Changeset 122653 in webkit


Ignore:
Timestamp:
Jul 13, 2012 6:08:07 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION: RenderInline boundingBox ignores relative position offset
https://bugs.webkit.org/show_bug.cgi?id=91168

Patch by Kiran Muppala <cmuppala@apple.com> 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.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r122651 r122653  
     12012-07-13  Kiran Muppala  <cmuppala@apple.com>
     2
     3        REGRESSION: RenderInline boundingBox ignores relative position offset
     4        https://bugs.webkit.org/show_bug.cgi?id=91168
     5
     6        Reviewed by Simon Fraser.
     7
     8        Add a regression test for boundingBox of an inline element with relative position offsets.
     9
     10        * fast/inline/inline-relative-offset-boundingbox-expected.txt: Added.
     11        * fast/inline/inline-relative-offset-boundingbox.html: Added.
     12
    1132012-07-13  Xianzhu Wang  <wangxianzhu@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r122652 r122653  
     12012-07-13  Kiran Muppala  <cmuppala@apple.com>
     2
     3        REGRESSION: RenderInline boundingBox ignores relative position offset
     4        https://bugs.webkit.org/show_bug.cgi?id=91168
     5
     6        Reviewed by Simon Fraser.
     7
     8        RenderGeometryMap, used for caching the transform to the view,
     9        expects the first mapping pushed, to be that of the view itself.
     10        RenderInline was instead pushing it's own offset first.  Besides
     11        the offset of the view itself was not being pushed.
     12
     13        Relaxed the RenderGeometryMap restriction that the first pushed
     14        step should be of the view.  It is sufficient that the view's mapping
     15        is pushed in the first call to pushMappingsToAncestor.  Modified
     16        RenderInline to push the offset of the view also to the geometry map.
     17
     18        Test: fast/inline/inline-relative-offset-boundingbox.html
     19
     20        * rendering/RenderGeometryMap.cpp:
     21        (WebCore::RenderGeometryMap::pushMappingsToAncestor): Add assertion to
     22        check if mapping to view was pushed in first invocation.
     23        (WebCore::RenderGeometryMap::pushView): Correct assertion that checks
     24        if the view's mapping is the first one to be applied.
     25        (WebCore::RenderGeometryMap::stepInserted): Use isRenderView to check if
     26        a mapping step belongs to a view instead of using mapping size.
     27        (WebCore::RenderGeometryMap::stepRemoved): Ditto.
     28        * rendering/RenderInline.cpp:
     29        (WebCore::(anonymous namespace)::AbsoluteQuadsGeneratorContext::AbsoluteQuadsGeneratorContext):
     30        Push mappings all the way up to and including the view.
     31
    1322012-07-13  Xianzhu Wang  <wangxianzhu@chromium.org>
    233
  • trunk/Source/WebCore/rendering/RenderGeometryMap.cpp

    r122376 r122653  
    137137        renderer = renderer->pushMappingToContainer(ancestorRenderer, *this);
    138138    } while (renderer && renderer != ancestorRenderer);
     139
     140    ASSERT(m_mapping.isEmpty() || m_mapping[0].m_renderer->isRenderView());
    139141}
    140142
     
    206208{
    207209    ASSERT(m_insertionPosition != notFound);
    208     ASSERT(!m_mapping.size()); // The view should always be the first thing pushed.
     210    ASSERT(!m_insertionPosition); // The view should always be the first step.
    209211
    210212    m_mapping.insert(m_insertionPosition, RenderGeometryMapStep(view, false, false, false, t));
     
    236238void RenderGeometryMap::stepInserted(const RenderGeometryMapStep& step)
    237239{
    238     // Offset on the first step is the RenderView's offset, which is only applied when we have fixed-position.s
    239     if (m_mapping.size() > 1)
     240    // RenderView's offset, is only applied when we have fixed-positions.
     241    if (!step.m_renderer->isRenderView())
    240242        m_accumulatedOffset += step.m_offset;
    241243
     
    252254void RenderGeometryMap::stepRemoved(const RenderGeometryMapStep& step)
    253255{
    254     // Offset on the first step is the RenderView's offset, which is only applied when we have fixed-position.s
    255     if (m_mapping.size() > 1)
     256    // RenderView's offset, is only applied when we have fixed-positions.
     257    if (!step.m_renderer->isRenderView())
    256258        m_accumulatedOffset -= step.m_offset;
    257259
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r122191 r122653  
    653653        , m_geometryMap()
    654654    {
    655         RenderObject* root = renderer->parent();
    656         while (root && root->parent())
    657             root = root->parent();
    658 
    659         if (root)
    660             m_geometryMap.pushMappingsToAncestor(renderer, toRenderBoxModelObject(root));
     655        m_geometryMap.pushMappingsToAncestor(renderer, 0);
    661656    }
    662657
Note: See TracChangeset for help on using the changeset viewer.