- Revision
- 122653
- Author
- [email protected]
- Date
- 2012-07-13 18:08:07 -0700 (Fri, 13 Jul 2012)
Log Message
REGRESSION: RenderInline boundingBox ignores relative position offset
https://bugs.webkit.org/show_bug.cgi?id=91168
Patch by Kiran Muppala <[email protected]> on 2012-07-13
Reviewed by Simon Fraser.
Source/WebCore:
RenderGeometryMap, used for caching the transform to the view,
expects the first mapping pushed, to be that of the view itself.
RenderInline was instead pushing it's own offset first. Besides
the offset of the view itself was not being pushed.
Relaxed the RenderGeometryMap restriction that the first pushed
step should be of the view. It is sufficient that the view's mapping
is pushed in the first call to pushMappingsToAncestor. Modified
RenderInline to push the offset of the view also to the geometry map.
Test: fast/inline/inline-relative-offset-boundingbox.html
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::pushMappingsToAncestor): Add assertion to
check if mapping to view was pushed in first invocation.
(WebCore::RenderGeometryMap::pushView): Correct assertion that checks
if the view's mapping is the first one to be applied.
(WebCore::RenderGeometryMap::stepInserted): Use isRenderView to check if
a mapping step belongs to a view instead of using mapping size.
(WebCore::RenderGeometryMap::stepRemoved): Ditto.
* rendering/RenderInline.cpp:
(WebCore::(anonymous namespace)::AbsoluteQuadsGeneratorContext::AbsoluteQuadsGeneratorContext):
Push mappings all the way up to and including the view.
LayoutTests:
Add a regression test for boundingBox of an inline element with relative position offsets.
* fast/inline/inline-relative-offset-boundingbox-expected.txt: Added.
* fast/inline/inline-relative-offset-boundingbox.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (122652 => 122653)
--- trunk/LayoutTests/ChangeLog 2012-07-14 01:03:14 UTC (rev 122652)
+++ trunk/LayoutTests/ChangeLog 2012-07-14 01:08:07 UTC (rev 122653)
@@ -1,3 +1,15 @@
+2012-07-13 Kiran Muppala <[email protected]>
+
+ REGRESSION: RenderInline boundingBox ignores relative position offset
+ https://bugs.webkit.org/show_bug.cgi?id=91168
+
+ Reviewed by Simon Fraser.
+
+ Add a regression test for boundingBox of an inline element with relative position offsets.
+
+ * fast/inline/inline-relative-offset-boundingbox-expected.txt: Added.
+ * fast/inline/inline-relative-offset-boundingbox.html: Added.
+
2012-07-13 Xianzhu Wang <[email protected]>
[Chromium] Sometimes bottom of text is truncated when page has a fractional scale
Added: trunk/LayoutTests/fast/inline/inline-relative-offset-boundingbox-expected.txt (0 => 122653)
--- trunk/LayoutTests/fast/inline/inline-relative-offset-boundingbox-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/inline/inline-relative-offset-boundingbox-expected.txt 2012-07-14 01:08:07 UTC (rev 122653)
@@ -0,0 +1,10 @@
+Bug 91168: REGRESSION: RenderInline boundingBox ignores relative position offset
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+PASS inlineRect.left is parentRect.left + inlineLeftOffset
+
Added: trunk/LayoutTests/fast/inline/inline-relative-offset-boundingbox.html (0 => 122653)
--- trunk/LayoutTests/fast/inline/inline-relative-offset-boundingbox.html (rev 0)
+++ trunk/LayoutTests/fast/inline/inline-relative-offset-boundingbox.html 2012-07-14 01:08:07 UTC (rev 122653)
@@ -0,0 +1,24 @@
+<html>
+<head>
+ <script src=""
+ <script>
+ description('<a href="" 91168</a>: REGRESSION: RenderInline boundingBox ignores relative position offset');
+
+ function runTest()
+ {
+ inline = document.getElementById("inlineElement");
+ inlineRect = inline.getBoundingClientRect();
+ inlineLeftOffset = parseInt(inline.style.left);
+ parent = inline.parentNode;
+ parentRect = parent.getBoundingClientRect();
+ shouldBe("inlineRect.left", "parentRect.left + inlineLeftOffset");
+ }
+
+ window._onload_ = runTest;
+ </script>
+</head>
+<body>
+ <span id="inlineElement" style="position:relative; left:10px;"></span>
+ <script src=""
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (122652 => 122653)
--- trunk/Source/WebCore/ChangeLog 2012-07-14 01:03:14 UTC (rev 122652)
+++ trunk/Source/WebCore/ChangeLog 2012-07-14 01:08:07 UTC (rev 122653)
@@ -1,3 +1,34 @@
+2012-07-13 Kiran Muppala <[email protected]>
+
+ REGRESSION: RenderInline boundingBox ignores relative position offset
+ https://bugs.webkit.org/show_bug.cgi?id=91168
+
+ Reviewed by Simon Fraser.
+
+ RenderGeometryMap, used for caching the transform to the view,
+ expects the first mapping pushed, to be that of the view itself.
+ RenderInline was instead pushing it's own offset first. Besides
+ the offset of the view itself was not being pushed.
+
+ Relaxed the RenderGeometryMap restriction that the first pushed
+ step should be of the view. It is sufficient that the view's mapping
+ is pushed in the first call to pushMappingsToAncestor. Modified
+ RenderInline to push the offset of the view also to the geometry map.
+
+ Test: fast/inline/inline-relative-offset-boundingbox.html
+
+ * rendering/RenderGeometryMap.cpp:
+ (WebCore::RenderGeometryMap::pushMappingsToAncestor): Add assertion to
+ check if mapping to view was pushed in first invocation.
+ (WebCore::RenderGeometryMap::pushView): Correct assertion that checks
+ if the view's mapping is the first one to be applied.
+ (WebCore::RenderGeometryMap::stepInserted): Use isRenderView to check if
+ a mapping step belongs to a view instead of using mapping size.
+ (WebCore::RenderGeometryMap::stepRemoved): Ditto.
+ * rendering/RenderInline.cpp:
+ (WebCore::(anonymous namespace)::AbsoluteQuadsGeneratorContext::AbsoluteQuadsGeneratorContext):
+ Push mappings all the way up to and including the view.
+
2012-07-13 Xianzhu Wang <[email protected]>
Move WebCore/platform/text/Base64 to WTF/wtf/text
Modified: trunk/Source/WebCore/rendering/RenderGeometryMap.cpp (122652 => 122653)
--- trunk/Source/WebCore/rendering/RenderGeometryMap.cpp 2012-07-14 01:03:14 UTC (rev 122652)
+++ trunk/Source/WebCore/rendering/RenderGeometryMap.cpp 2012-07-14 01:08:07 UTC (rev 122653)
@@ -136,6 +136,8 @@
do {
renderer = renderer->pushMappingToContainer(ancestorRenderer, *this);
} while (renderer && renderer != ancestorRenderer);
+
+ ASSERT(m_mapping.isEmpty() || m_mapping[0].m_renderer->isRenderView());
}
static bool canMapViaLayer(const RenderLayer* layer)
@@ -205,7 +207,7 @@
void RenderGeometryMap::pushView(const RenderView* view, const LayoutSize& scrollOffset, const TransformationMatrix* t)
{
ASSERT(m_insertionPosition != notFound);
- ASSERT(!m_mapping.size()); // The view should always be the first thing pushed.
+ ASSERT(!m_insertionPosition); // The view should always be the first step.
m_mapping.insert(m_insertionPosition, RenderGeometryMapStep(view, false, false, false, t));
@@ -235,8 +237,8 @@
void RenderGeometryMap::stepInserted(const RenderGeometryMapStep& step)
{
- // Offset on the first step is the RenderView's offset, which is only applied when we have fixed-position.s
- if (m_mapping.size() > 1)
+ // RenderView's offset, is only applied when we have fixed-positions.
+ if (!step.m_renderer->isRenderView())
m_accumulatedOffset += step.m_offset;
if (step.m_isNonUniform)
@@ -251,8 +253,8 @@
void RenderGeometryMap::stepRemoved(const RenderGeometryMapStep& step)
{
- // Offset on the first step is the RenderView's offset, which is only applied when we have fixed-position.s
- if (m_mapping.size() > 1)
+ // RenderView's offset, is only applied when we have fixed-positions.
+ if (!step.m_renderer->isRenderView())
m_accumulatedOffset -= step.m_offset;
if (step.m_isNonUniform) {
Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (122652 => 122653)
--- trunk/Source/WebCore/rendering/RenderInline.cpp 2012-07-14 01:03:14 UTC (rev 122652)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp 2012-07-14 01:08:07 UTC (rev 122653)
@@ -652,12 +652,7 @@
, m_wasFixed(wasFixed)
, m_geometryMap()
{
- RenderObject* root = renderer->parent();
- while (root && root->parent())
- root = root->parent();
-
- if (root)
- m_geometryMap.pushMappingsToAncestor(renderer, toRenderBoxModelObject(root));
+ m_geometryMap.pushMappingsToAncestor(renderer, 0);
}
void operator()(const FloatRect& rect)