WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch v7
issue54623-patch7.txt (text/plain), 15.56 KB, created by
Hironori Bono
on 2011-11-08 02:24:36 PST
(
hide
)
Description:
Patch v7
Filename:
MIME Type:
Creator:
Hironori Bono
Created:
2011-11-08 02:24:36 PST
Size:
15.56 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 99540) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,29 @@ >+2011-11-08 Hironori Bono <hbono@chromium.org> >+ >+ Render overflow controls of an RTL element to its left-side. >+ https://bugs.webkit.org/show_bug.cgi?id=54623 >+ >+ This change adds a new flag WTF_USE_RTL_SCROLLBAR and render the >+ vertical scrollbars and resizers of RTL elements to their left side if >+ this new flag is enabled. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: platform/chromium/fast/events/rtl-scrollbar.html >+ >+ * rendering/RenderBlock.cpp: >+ (WebCore::RenderBlock::addOverflowFromPositionedObjects): Move child elements right. >+ (WebCore::RenderBlock::determineLogicalLeftPositionForChild): ditto >+ * rendering/RenderBox.cpp: >+ (WebCore::RenderBox::overflowClipRect): Move the content rectange right. >+ * rendering/RenderLayer.cpp: >+ (WebCore::cornerRect): Render a resizer to the bottom-left corner. >+ (WebCore::RenderLayer::scrollbarOffset): Render a vertical scrollbar to the left side >+ and move a horizontal scrollbar right by the width of the vertical scrollbar. >+ (WebCore::RenderLayer::invalidateScrollbarRect): ditto. >+ (WebCore::RenderLayer::positionOverflowControls): ditto. >+ (WebCore::RenderLayer::hitTestOverflowControls): ditto. >+ > 2011-11-08 Nikolas Zimmermann <nzimmermann@rim.com> > > Switch SVGImage cache to store ImageBuffers instead of whole SVGImages, including a DOM/Render tree >Index: Source/WebCore/rendering/RenderBlock.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBlock.cpp (revision 99514) >+++ Source/WebCore/rendering/RenderBlock.cpp (working copy) >@@ -1472,8 +1472,17 @@ void RenderBlock::addOverflowFromPositio > positionedObject = *it; > > // Fixed positioned elements don't contribute to layout overflow, since they don't scroll with the content. >+#if USE(RTL_SCROLLBAR) >+ if (positionedObject->style()->position() != FixedPosition) { >+ int x = positionedObject->x(); >+ if (!style()->isLeftToRightDirection()) >+ x -= verticalScrollbarWidth(); >+ addOverflowFromChild(positionedObject, IntSize(x, positionedObject->y())); >+ } >+#else > if (positionedObject->style()->position() != FixedPosition) > addOverflowFromChild(positionedObject); >+#endif > } > } > >@@ -1851,6 +1860,10 @@ LayoutUnit RenderBlock::computeStartPosi > void RenderBlock::determineLogicalLeftPositionForChild(RenderBox* child) > { > LayoutUnit startPosition = borderStart() + paddingStart(); >+#if USE(RTL_SCROLLBAR) >+ if (!style()->isLeftToRightDirection()) >+ startPosition -= verticalScrollbarWidth(); >+#endif > LayoutUnit totalAvailableLogicalWidth = borderAndPaddingLogicalWidth() + availableLogicalWidth(); > > // Add in our start margin. >Index: Source/WebCore/rendering/RenderBox.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBox.cpp (revision 99514) >+++ Source/WebCore/rendering/RenderBox.cpp (working copy) >@@ -1241,8 +1241,16 @@ LayoutRect RenderBox::overflowClipRect(c > clipRect.setSize(clipRect.size() - LayoutSize(borderLeft() + borderRight(), borderTop() + borderBottom())); > > // Subtract out scrollbars if we have them. >+#if USE(RTL_SCROLLBAR) >+ if (layer()) { >+ if (!style()->isLeftToRightDirection()) >+ clipRect.move(layer()->verticalScrollbarWidth(relevancy), 0); >+ clipRect.contract(layer()->verticalScrollbarWidth(relevancy), layer()->horizontalScrollbarHeight(relevancy)); >+ } >+#else > if (layer()) > clipRect.contract(layer()->verticalScrollbarWidth(relevancy), layer()->horizontalScrollbarHeight(relevancy)); >+#endif > > return clipRect; > } >Index: Source/WebCore/rendering/RenderLayer.cpp >=================================================================== >--- Source/WebCore/rendering/RenderLayer.cpp (revision 99514) >+++ Source/WebCore/rendering/RenderLayer.cpp (working copy) >@@ -1771,9 +1771,15 @@ static IntRect cornerRect(const RenderLa > horizontalThickness = layer->verticalScrollbar()->width(); > verticalThickness = layer->horizontalScrollbar()->height(); > } >+#if USE(RTL_SCROLLBAR) >+ const RenderStyle* style = layer->renderer()->style(); >+ int x = !style->isLeftToRightDirection() ? bounds.x() + style->borderLeftWidth() : bounds.maxX() - horizontalThickness - style->borderRightWidth(); >+ return IntRect(x, bounds.maxY() - verticalThickness - style->borderBottomWidth(), horizontalThickness, verticalThickness); >+#else > return IntRect(bounds.maxX() - horizontalThickness - layer->renderer()->style()->borderRightWidth(), > bounds.maxY() - verticalThickness - layer->renderer()->style()->borderBottomWidth(), > horizontalThickness, verticalThickness); >+#endif > } > > IntRect RenderLayer::scrollCornerRect() const >@@ -1898,11 +1904,25 @@ IntSize RenderLayer::scrollbarOffset(con > { > RenderBox* box = renderBox(); > >+#if USE(RTL_SCROLLBAR) >+ if (scrollbar == m_vBar.get()) { >+ int x = !renderer()->style()->isLeftToRightDirection() ? box->borderLeft() : box->width() - box->borderRight() - scrollbar->width(); >+ return LayoutSize(x, box->borderTop()); >+ } >+ >+ if (scrollbar == m_hBar.get()) { >+ int x = box->borderLeft(); >+ if (!renderer()->style()->isLeftToRightDirection()) >+ x += m_vBar ? m_vBar->width() : resizerCornerRect(this, box->borderBoxRect()).width(); >+ return LayoutSize(x, box->height() - box->borderBottom() - scrollbar->height()); >+ } >+#else > if (scrollbar == m_vBar.get()) > return IntSize(box->width() - box->borderRight() - scrollbar->width(), box->borderTop()); > > if (scrollbar == m_hBar.get()) > return IntSize(box->borderLeft(), box->height() - box->borderBottom() - scrollbar->height()); >+#endif > > ASSERT_NOT_REACHED(); > return IntSize(); >@@ -1926,10 +1946,22 @@ void RenderLayer::invalidateScrollbarRec > IntRect scrollRect = rect; > RenderBox* box = renderBox(); > ASSERT(box); >+#if USE(RTL_SCROLLBAR) >+ if (scrollbar == m_vBar.get()) { >+ int x = !renderer()->style()->isLeftToRightDirection() ? box->borderLeft() : box->width() - box->borderRight() - scrollbar->width(); >+ scrollRect.move(x, box->borderTop()); >+ } else { >+ int x = box->borderLeft(); >+ if (!renderer()->style()->isLeftToRightDirection()) >+ x += m_vBar ? m_vBar->width() : resizerCornerRect(this, box->borderBoxRect()).width(); >+ scrollRect.move(x, box->height() - box->borderBottom() - scrollbar->height()); >+ } >+#else > if (scrollbar == m_vBar.get()) > scrollRect.move(box->width() - box->borderRight() - scrollbar->width(), box->borderTop()); > else > scrollRect.move(box->borderLeft(), box->height() - box->borderBottom() - scrollbar->height()); >+#endif > renderer()->repaintRectangle(scrollRect); > } > >@@ -2106,6 +2138,25 @@ void RenderLayer::positionOverflowContro > const IntRect borderBox = box->borderBoxRect(); > const IntRect& scrollCorner = scrollCornerRect(); > IntRect absBounds(borderBox.location() + offsetFromLayer, borderBox.size()); >+#if USE(RTL_SCROLLBAR) >+ if (m_vBar) { >+ int x = !renderer()->style()->isLeftToRightDirection() ? absBounds.x() + box->borderLeft() : absBounds.maxX() - box->borderRight() - m_vBar->width(); >+ m_vBar->setFrameRect(LayoutRect(x, >+ absBounds.y() + box->borderTop(), >+ m_vBar->width(), >+ absBounds.height() - (box->borderTop() + box->borderBottom()) - scrollCorner.height())); >+ } >+ >+ if (m_hBar) { >+ int x = absBounds.x() + box->borderLeft(); >+ if (!renderer()->style()->isLeftToRightDirection()) >+ x += scrollCorner.width(); >+ m_hBar->setFrameRect(LayoutRect(x, >+ absBounds.maxY() - box->borderBottom() - m_hBar->height(), >+ absBounds.width() - (box->borderLeft() + box->borderRight()) - scrollCorner.width(), >+ m_hBar->height())); >+ } >+#else > if (m_vBar) > m_vBar->setFrameRect(IntRect(absBounds.maxX() - box->borderRight() - m_vBar->width(), > absBounds.y() + box->borderTop(), >@@ -2117,6 +2168,7 @@ void RenderLayer::positionOverflowContro > absBounds.maxY() - box->borderBottom() - m_hBar->height(), > absBounds.width() - (box->borderLeft() + box->borderRight()) - scrollCorner.width(), > m_hBar->height())); >+#endif > > #if USE(ACCELERATED_COMPOSITING) > if (GraphicsLayer* layer = layerForHorizontalScrollbar()) { >@@ -2512,10 +2564,18 @@ bool RenderLayer::hitTestOverflowControl > int resizeControlSize = max(resizeControlRect.height(), 0); > > if (m_vBar) { >+#if USE(RTL_SCROLLBAR) >+ int x = !renderer()->style()->isLeftToRightDirection() ? box->borderLeft() : box->width() - box->borderRight() - m_vBar->width(); >+ LayoutRect vBarRect(x, >+ box->borderTop(), >+ m_vBar->width(), >+ box->height() - (box->borderTop() + box->borderBottom()) - (m_hBar ? m_hBar->height() : resizeControlSize)); >+#else > LayoutRect vBarRect(box->width() - box->borderRight() - m_vBar->width(), > box->borderTop(), > m_vBar->width(), > box->height() - (box->borderTop() + box->borderBottom()) - (m_hBar ? m_hBar->height() : resizeControlSize)); >+#endif > if (vBarRect.contains(localPoint)) { > result.setScrollbar(m_vBar.get()); > return true; >@@ -2524,10 +2584,20 @@ bool RenderLayer::hitTestOverflowControl > > resizeControlSize = max(resizeControlRect.width(), 0); > if (m_hBar) { >+#if USE(RTL_SCROLLBAR) >+ int x = box->borderLeft(); >+ if (!renderer()->style()->isLeftToRightDirection()) >+ x += m_vBar ? m_vBar->width() : resizeControlSize; >+ LayoutRect hBarRect(x, >+ box->height() - box->borderBottom() - m_hBar->height(), >+ box->width() - (box->borderLeft() + box->borderRight()) - (m_vBar ? m_vBar->width() : resizeControlSize), >+ m_hBar->height()); >+#else > LayoutRect hBarRect(box->borderLeft(), > box->height() - box->borderBottom() - m_hBar->height(), > box->width() - (box->borderLeft() + box->borderRight()) - (m_vBar ? m_vBar->width() : resizeControlSize), > m_hBar->height()); >+#endif > if (hBarRect.contains(localPoint)) { > result.setScrollbar(m_hBar.get()); > return true; >Index: Source/WebKit/chromium/ChangeLog >=================================================================== >--- Source/WebKit/chromium/ChangeLog (revision 99540) >+++ Source/WebKit/chromium/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2011-11-08 Hironori Bono <hbono@chromium.org> >+ >+ Render overflow controls of an RTL element to its left-side. >+ https://bugs.webkit.org/show_bug.cgi?id=54623 >+ >+ This change sets a new flag WTF_USE_RTL_SCROLLBAR on Chromium so we can >+ render the vertical scrollbars and resizers of RTL elements to their >+ left side. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * features.gypi: Set WTF_USE_RTL_SCROLLBAR to 1. >+ > 2011-11-07 Emil A Eklund <eae@chromium.org> > > Revert platform and scrolling to ints >Index: Source/WebKit/chromium/features.gypi >=================================================================== >--- Source/WebKit/chromium/features.gypi (revision 99514) >+++ Source/WebKit/chromium/features.gypi (working copy) >@@ -101,6 +101,7 @@ > # We can't define it here because it should be present only > # in Debug or release_valgrind_build=1 builds. > 'WTF_USE_OPENTYPE_SANITIZER=1', >+ 'WTF_USE_RTL_SCROLLBAR=1', > 'WTF_USE_SKIA_TEXT=<(enable_skia_text)', > 'WTF_USE_WEBP=1', > 'WTF_USE_WEBKIT_IMAGE_DECODERS=1', >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 99540) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,17 @@ >+2011-11-08 Hironori Bono <hbono@chromium.org> >+ >+ Render overflow controls of an RTL element to its left-side. >+ https://bugs.webkit.org/show_bug.cgi?id=54623 >+ >+ This change adds a new flag WTF_USE_RTL_SCROLLBAR and render the >+ vertical scrollbars and resizers of RTL elements to their left side if >+ this new flag is enabled. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/chromium/fast/events/rtl-scrollbar-expected.txt: Added. >+ * platform/chromium/fast/events/rtl-scrollbar.html: Added. >+ > 2011-11-08 Nikolas Zimmermann <nzimmermann@rim.com> > > Switch SVGImage cache to store ImageBuffers instead of whole SVGImages, including a DOM/Render tree >Index: LayoutTests/platform/chromium/fast/events/rtl-scrollbar-expected.txt >=================================================================== >--- LayoutTests/platform/chromium/fast/events/rtl-scrollbar-expected.txt (revision 0) >+++ LayoutTests/platform/chromium/fast/events/rtl-scrollbar-expected.txt (revision 0) >@@ -0,0 +1,10 @@ >+Test that we can scroll down an RTL element with its left-side scrollbar. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+PASS document.getElementById('overflow').scrollTop > scrollTop is true >+ >Index: LayoutTests/platform/chromium/fast/events/rtl-scrollbar.html >=================================================================== >--- LayoutTests/platform/chromium/fast/events/rtl-scrollbar.html (revision 0) >+++ LayoutTests/platform/chromium/fast/events/rtl-scrollbar.html (revision 0) >@@ -0,0 +1,43 @@ >+<html> >+<head> >+<script src="../../../../fast/js/resources/js-test-pre.js"></script> >+</head> >+<body style="margin:0"> >+<div id="overflow" dir="rtl" style="border:2px solid black;overflow:auto;height:400px;width:400px; position:absolute;"> >+<div style="background-color:red;height:720px"></div> >+<div style="background-color:green;height:1600px"></div> >+</div> >+ >+<script> >+description('Test that we can scroll down an RTL element with its left-side scrollbar.'); >+ >+// Save the vertical-scroll offset of the above <div> element before sending a >+// click event. If we successfully scroll down the element, this offset should >+// become greather than this value. >+var scrollTop = document.getElementById('overflow').scrollTop; >+ >+if (window.layoutTestController) >+ layoutTestController.waitUntilDone(); >+ >+if (window.eventSender) { >+ // Send a click event to the scrollbar track of the above <div> element. >+ eventSender.mouseMoveTo(10, 300); >+ eventSender.mouseDown(); >+ eventSender.mouseUp(); >+ >+ // Wait until we finish rendering the element. >+ setTimeout(finished, 1000); >+} >+ >+function finished() >+{ >+ // Verify the vertical-scroll offset becomes greater than the saved one. >+ shouldBeTrue('document.getElementById(\'overflow\').scrollTop > scrollTop'); >+ window.layoutTestController.notifyDone(); >+} >+ >+var successfullyParsed = true; >+</script> >+<script src="../../../../fast/js/resources/js-test-post.js"></script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
eric
:
review-
webkit.review.bot
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 54623
:
87158
|
87748
|
88796
|
89186
|
90162
|
107460
|
114018
|
121427
|
122368
|
125303
|
127350
|
129623
|
137316