Ignore:
Timestamp:
Oct 2, 2013, 6:07:34 AM (12 years ago)
Author:
[email protected]
Message:

[CSS Regions] Activate all regions to have layers, as CSS Regions create a new stacking context
https://bugs.webkit.org/show_bug.cgi?id=121828

Patch by Mihai Maerean <Mihai Maerean> on 2013-10-02
Reviewed by Darin Adler.

Source/WebCore:

The CSS Regions specification says "CSS Regions create a new stacking context." (http://dev.w3.org/csswg/css-regions/).

Divs that create stacking contexts are painted after the divs that don't create stacking contexts.

Test: fast/regions/layers/stacking-context-paint-order.html: While the existing region-sibling-paint-order.html
test verifies that regions paint correctly when the next sibling also creates a stacking context, this new test
verifies that regions paint correctly when the next sibling doesn't create a stacking context.

  • rendering/RenderBlock.cpp: Remove code that is not needed now that all regions have layers.
  • rendering/RenderBlock.h: Remove code that is not needed now that all regions have layers.
  • rendering/RenderBox.cpp: Remove code that is not needed now that all regions have layers.
  • rendering/RenderBox.h: Remove code that is not needed now that all regions have layers.
  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::updateLayerToRegionMappings): Remove code that is not needed now that all regions have layers.

  • rendering/RenderRegion.cpp:

(WebCore::RenderRegion::RenderRegion):

  • rendering/RenderRegion.h:

(WebCore::RenderRegion::requiresLayer): Always. CSS Regions create Stacking Contexts. RenderMultiColumnSet
implements its own behaviour so the behaviour of each class is contained within its own files.

  • rendering/RenderMultiColumnSet.h:

(WebCore::RenderMultiColumnSet::requiresLayer): RenderMultiColumnSet derives from RenderRegion, but unlike the
CSS Regions specification, the Multi-Columns CSS specification states that the column boxes do not establish new
Stacking Contexts.

  • rendering/RenderTreeAsText.cpp:

(WebCore::writeRenderRegionList): There's no need to output " hasLayer" since all regions now have layers.

LayoutTests:

For the ref tests, the divs in the expected results coresponding to the regions now have a CSS style causing
them to also create Stacking Contexts.

Most of the tests in fast/regions/layers/ have been deleted because they aren't relevant anymore.

The change in most of the *-expected.txt files is that the " hasLayer" part has been removed (since all regions
now have layers).

Platform (efl, efl-wk2, gtk, mac-lion, mac-wk2, qt, qt-wk2) specific expectated results need to be generated again.

  • fast/regions/autoheight-regions-mark-expected.txt:
  • fast/regions/flow-content-basic-expected.html: Added. The test is now a ref test.
  • fast/regions/flow-content-basic-vertical-expected.html: Added. The test is now a ref test.
  • fast/regions/flow-content-basic-vertical-rl-expected.html: Added.The test is now a ref test.
  • fast/regions/flow-content-basic-vertical-rl.html:
  • fast/regions/flow-content-basic-vertical.html:
  • fast/regions/flow-content-basic.html:
  • fast/regions/flows-dependency-dynamic-remove-expected.txt:
  • fast/regions/flows-dependency-same-flow-expected.txt:
  • fast/regions/layers/dynamic-layer-added-with-no-layout-expected.png: Removed.
  • fast/regions/layers/dynamic-layer-added-with-no-layout-expected.txt: Removed.
  • fast/regions/layers/dynamic-layer-added-with-no-layout.html: Removed.
  • fast/regions/layers/dynamic-layer-removed-with-no-layout-expected.png: Removed.
  • fast/regions/layers/dynamic-layer-removed-with-no-layout-expected.txt: Removed.
  • fast/regions/layers/dynamic-layer-removed-with-no-layout.html: Removed.
  • fast/regions/layers/regions-promoted-to-layers-expected.png: Removed.
  • fast/regions/layers/regions-promoted-to-layers-expected.txt: Removed.
  • fast/regions/layers/regions-promoted-to-layers-horizontal-bt-expected.png: Removed.
  • fast/regions/layers/regions-promoted-to-layers-horizontal-bt-expected.txt: Removed.
  • fast/regions/layers/regions-promoted-to-layers-horizontal-bt.html: Removed.
  • fast/regions/layers/regions-promoted-to-layers-vertical-lr-expected.png: Removed.
  • fast/regions/layers/regions-promoted-to-layers-vertical-lr-expected.txt: Removed.
  • fast/regions/layers/regions-promoted-to-layers-vertical-lr.html: Removed.
  • fast/regions/layers/regions-promoted-to-layers-vertical-rl-expected.png: Removed.
  • fast/regions/layers/regions-promoted-to-layers-vertical-rl-expected.txt: Removed.
  • fast/regions/layers/regions-promoted-to-layers-vertical-rl.html: Removed.
  • fast/regions/layers/regions-promoted-to-layers.html: Removed.
  • fast/regions/layers/stacking-context-paint-order-expected.html: Added.
  • fast/regions/layers/stacking-context-paint-order.html: Added. While the existing region-sibling-paint-order.html

test verifies that regions paint correctly when the next sibling also creates a stacking context, this new test
verifies that regions paint correctly when the next sibling doesn't create a stacking context.

  • fast/regions/region-sibling-paint-order-expected.html:
  • fast/regions/region-sibling-paint-order.html:
  • fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.txt:
  • fast/repaint/region-painting-composited-element-expected.html:
  • fast/repaint/region-painting-in-composited-view-expected.html:
  • fast/repaint/region-painting-in-composited-view.html:
  • fast/repaint/region-painting-via-layout-expected.txt:
  • platform/efl-wk2/TestExpectations:
  • platform/efl-wk2/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png: Removed.
  • platform/efl-wk2/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt: Removed.
  • platform/efl/TestExpectations:
  • platform/efl/fast/regions/autoheight-regions-mark-expected.png: Removed.
  • platform/efl/fast/regions/autoheight-regions-mark-expected.txt: Removed.
  • platform/efl/fast/regions/flow-content-basic-expected.png: Removed. The test is now a ref test.
  • platform/efl/fast/regions/flow-content-basic-expected.txt: Removed.
  • platform/efl/fast/regions/flow-content-basic-vertical-expected.png: Removed.
  • platform/efl/fast/regions/flow-content-basic-vertical-expected.txt: Removed.
  • platform/efl/fast/regions/flow-content-basic-vertical-rl-expected.png: Removed.
  • platform/efl/fast/regions/flow-content-basic-vertical-rl-expected.txt: Removed.
  • platform/efl/fast/regions/flows-dependency-dynamic-remove-expected.png: Removed.
  • platform/efl/fast/regions/flows-dependency-dynamic-remove-expected.txt: Removed.
  • platform/efl/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.png: Removed.
  • platform/efl/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.txt: Removed.
  • platform/efl/fast/regions/region-dynamic-after-before-expected.txt:
  • platform/efl/fast/regions/region-generated-content-before-after-expected.txt:
  • platform/efl/fast/regions/text-region-split-small-pagination-expected.png: Removed.
  • platform/efl/fast/regions/text-region-split-small-pagination-expected.txt: Removed.
  • platform/efl/fast/regions/top-overflow-out-of-second-region-expected.png: Removed.
  • platform/efl/fast/regions/top-overflow-out-of-second-region-expected.txt: Removed.
  • platform/efl/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png: Removed.
  • platform/efl/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt: Removed.
  • platform/efl/fast/repaint/region-painting-invalidation-expected.png: Removed.
  • platform/efl/fast/repaint/region-painting-invalidation-expected.txt: Removed.
  • platform/efl/fast/repaint/region-painting-via-layout-expected.png: Removed.
  • platform/efl/fast/repaint/region-painting-via-layout-expected.txt: Removed.
  • platform/gtk/TestExpectations:
  • platform/gtk/fast/regions/autoheight-regions-mark-expected.png: Removed.
  • platform/gtk/fast/regions/autoheight-regions-mark-expected.txt: Removed.
  • platform/gtk/fast/regions/flow-content-basic-expected.png: Removed.
  • platform/gtk/fast/regions/flow-content-basic-expected.txt: Removed.
  • platform/gtk/fast/regions/flow-content-basic-vertical-expected.png: Removed.
  • platform/gtk/fast/regions/flow-content-basic-vertical-expected.txt: Removed.
  • platform/gtk/fast/regions/flow-content-basic-vertical-rl-expected.png: Removed.
  • platform/gtk/fast/regions/flow-content-basic-vertical-rl-expected.txt: Removed.
  • platform/gtk/fast/regions/flows-dependency-dynamic-remove-expected.png: Removed.
  • platform/gtk/fast/regions/flows-dependency-dynamic-remove-expected.txt: Removed.
  • platform/gtk/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.png: Removed.
  • platform/gtk/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.txt: Removed.
  • platform/gtk/fast/regions/region-dynamic-after-before-expected.txt:
  • platform/gtk/fast/regions/region-generated-content-before-after-expected.txt:
  • platform/gtk/fast/regions/text-region-split-small-pagination-expected.png: Removed.
  • platform/gtk/fast/regions/text-region-split-small-pagination-expected.txt: Removed.
  • platform/gtk/fast/regions/top-overflow-out-of-second-region-expected.png: Removed.
  • platform/gtk/fast/regions/top-overflow-out-of-second-region-expected.txt: Removed.
  • platform/gtk/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png: Removed.
  • platform/gtk/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt: Removed.
  • platform/gtk/fast/repaint/line-flow-with-floats-in-regions-expected.txt:
  • platform/gtk/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.txt:
  • platform/gtk/fast/repaint/region-painting-invalidation-expected.png: Removed.
  • platform/gtk/fast/repaint/region-painting-invalidation-expected.txt: Removed.
  • platform/gtk/fast/repaint/region-painting-via-layout-expected.png: Removed.
  • platform/gtk/fast/repaint/region-painting-via-layout-expected.txt: Removed.
  • platform/mac-lion/TestExpectations:
  • platform/mac-lion/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png: Removed.
  • platform/mac-lion/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt: Removed.
  • platform/mac-wk2/TestExpectations:
  • platform/mac/fast/regions/flow-content-basic-expected.png: Removed.
  • platform/mac/fast/regions/flow-content-basic-expected.txt: Removed.
  • platform/mac/fast/regions/flow-content-basic-vertical-expected.png: Removed.
  • platform/mac/fast/regions/flow-content-basic-vertical-expected.txt: Removed.
  • platform/mac/fast/regions/flow-content-basic-vertical-rl-expected.png: Removed.
  • platform/mac/fast/regions/flow-content-basic-vertical-rl-expected.txt: Removed.
  • platform/mac/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.txt:
  • platform/mac/fast/regions/region-dynamic-after-before-expected.txt:
  • platform/mac/fast/regions/region-generated-content-before-after-expected.txt:
  • platform/mac/fast/regions/text-region-split-small-pagination-expected.txt:
  • platform/mac/fast/regions/top-overflow-out-of-second-region-expected.txt:
  • platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png: Removed.
  • platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt:
  • platform/mac/fast/repaint/line-flow-with-floats-in-regions-expected.txt:
  • platform/mac/fast/repaint/region-painting-invalidation-expected.txt:
  • platform/qt-wk2/TestExpectations:
  • platform/qt-wk2/fast/regions/flow-content-basic-expected.png: Removed.
  • platform/qt-wk2/fast/regions/flow-content-basic-vertical-expected.png: Removed.
  • platform/qt-wk2/fast/regions/flow-content-basic-vertical-rl-expected.png: Removed.
  • platform/qt-wk2/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.png: Removed.
  • platform/qt-wk2/fast/regions/text-region-split-small-pagination-expected.png: Removed.
  • platform/qt-wk2/fast/regions/top-overflow-out-of-second-region-expected.png: Removed.
  • platform/qt-wk2/fast/repaint/region-painting-invalidation-expected.png: Removed.
  • platform/qt-wk2/fast/repaint/region-painting-invalidation-expected.txt: Removed.
  • platform/qt-wk2/fast/repaint/region-painting-via-layout-expected.png: Removed.
  • platform/qt/TestExpectations:
  • platform/qt/fast/regions/autoheight-regions-mark-expected.png: Removed.
  • platform/qt/fast/regions/autoheight-regions-mark-expected.txt: Removed.
  • platform/qt/fast/regions/flow-content-basic-expected.png: Removed.
  • platform/qt/fast/regions/flow-content-basic-expected.txt: Removed.
  • platform/qt/fast/regions/flow-content-basic-vertical-expected.png: Removed.
  • platform/qt/fast/regions/flow-content-basic-vertical-expected.txt: Removed.
  • platform/qt/fast/regions/flow-content-basic-vertical-rl-expected.png: Removed.
  • platform/qt/fast/regions/flow-content-basic-vertical-rl-expected.txt: Removed.
  • platform/qt/fast/regions/flows-dependency-dynamic-remove-expected.png: Removed.
  • platform/qt/fast/regions/flows-dependency-dynamic-remove-expected.txt: Removed.
  • platform/qt/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.png: Removed.
  • platform/qt/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.txt: Removed.
  • platform/qt/fast/regions/text-region-split-small-pagination-expected.png: Removed.
  • platform/qt/fast/regions/text-region-split-small-pagination-expected.txt: Removed.
  • platform/qt/fast/regions/top-overflow-out-of-second-region-expected.png: Removed.
  • platform/qt/fast/regions/top-overflow-out-of-second-region-expected.txt: Removed.
  • platform/qt/fast/repaint/line-flow-with-floats-in-regions-expected.txt:
  • platform/qt/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.txt:
  • platform/qt/fast/repaint/region-painting-invalidation-expected.png: Removed.
  • platform/qt/fast/repaint/region-painting-invalidation-expected.txt: Removed.
  • platform/qt/fast/repaint/region-painting-via-layout-expected.png: Removed.
  • platform/qt/fast/repaint/region-painting-via-layout-expected.txt: Removed.
  • platform/win/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png: Removed.
  • platform/win/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt: Removed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r156742 r156767  
    39723972}
    39733973
    3974 void RenderBlock::updateFloatingObjectsPaintingContainer(RenderBox* floatToUpdate)
    3975 {
    3976     bool didFindPaintContainer = false;
    3977     updateFloatingObjectsPaintingContainer(floatToUpdate, didFindPaintContainer);
    3978     ASSERT(didFindPaintContainer || floatToUpdate->hasSelfPaintingLayer());
    3979 }
    3980 
    3981 void RenderBlock::updateFloatingObjectsPaintingContainer(RenderBox* floatToUpdate, bool& didFindPaintContainer)
    3982 {
    3983     if (needsLayout()) {
    3984         // The floating object update should only be required after the layout is already complete.
    3985         ASSERT_NOT_REACHED();
    3986         return;
    3987     }
    3988     if (!m_floatingObjects)
    3989         return;
    3990     updateAllDescendantsFloatingObjectsPaintingContainer(floatToUpdate, didFindPaintContainer);
    3991     for (RenderObject* next = nextSibling(); next; next = next->nextSibling()) {
    3992         if (!next->isRenderBlock() || next->isFloatingOrOutOfFlowPositioned() || toRenderBlock(next)->avoidsFloats())
    3993             continue;
    3994         RenderBlock* nextBlock = toRenderBlock(next);
    3995         if (nextBlock->containsFloat(floatToUpdate))
    3996             nextBlock->updateAllDescendantsFloatingObjectsPaintingContainer(floatToUpdate, didFindPaintContainer);
    3997     }
    3998 }
    3999 
    4000 void RenderBlock::updateLocalFloatingObjectsForPaintingContainer(RenderBox* floatToUpdate, bool& foundPaintContainer)
    4001 {
    4002     ASSERT(!needsLayout());
    4003     if (!m_floatingObjects)
    4004         return;
    4005     auto iterator = m_floatingObjects->set().find<RenderBox&, FloatingObjectHashTranslator>(*floatToUpdate);
    4006     if (iterator != m_floatingObjects->set().end()) {
    4007         bool shouldPaint = !foundPaintContainer && !floatToUpdate->hasSelfPaintingLayer() && floatToUpdate->enclosingFloatPaintingLayer() == enclosingFloatPaintingLayer();
    4008         foundPaintContainer |= shouldPaint;
    4009         (*iterator)->setShouldPaint(shouldPaint);
    4010     }
    4011 }
    4012 
    4013 void RenderBlock::updateAllDescendantsFloatingObjectsPaintingContainer(RenderBox* floatToUpdate, bool& didFindPaintContainer)
    4014 {
    4015     if (needsLayout()) {
    4016         // The floating object update should only be required after the layout is already complete.
    4017         ASSERT_NOT_REACHED();
    4018         return;
    4019     }
    4020     updateLocalFloatingObjectsForPaintingContainer(floatToUpdate, didFindPaintContainer);
    4021     if (childrenInline())
    4022         return;
    4023     for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
    4024         if (!child->isRenderBlock())
    4025             continue;
    4026         RenderBlock* childBlock = toRenderBlock(child);
    4027         if (childBlock->containsFloat(floatToUpdate))
    4028             childBlock->updateAllDescendantsFloatingObjectsPaintingContainer(floatToUpdate, didFindPaintContainer);
    4029     }
    4030 }
    4031 
    40323974LayoutUnit RenderBlock::getClearDelta(RenderBox* child, LayoutUnit logicalTop)
    40333975{
Note: See TracChangeset for help on using the changeset viewer.