Changeset 160717 in webkit


Ignore:
Timestamp:
Dec 17, 2013 10:46:04 AM (10 years ago)
Author:
mihnea@adobe.com
Message:

[CSSRegions] Incorrect repaint of fixed element with transformed parent
https://bugs.webkit.org/show_bug.cgi?id=125756

Reviewed by Darin Adler.

Source/WebCore:

When collecting the layers for fixed positioned elements with named flow
as a containing block, use layers collection at named flow layer level
instead of relying on the positioned elements collection.

Modified also FlowThreadController::collectFixedPositionedLayers function
to always return the layers sorted by z-index, as this operation was always
done at the call sites.

Tests: fast/regions/repaint/fixed-in-named-flow-cb-changed.html

fast/regions/repaint/fixed-in-named-flow-cb-changed2.html

  • rendering/FlowThreadController.cpp:

(WebCore::compareZIndex):
(WebCore::FlowThreadController::collectFixedPositionedLayers):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::paintFixedLayersInNamedFlows):
(WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):

LayoutTests:

Add tests for a fixed positioned element with a parent that:

  1. dynamically gets a transform, in which case the fixed positioned element should be positioned

relative to its parent

  1. dynamically loses its transform, in which case the fixed positioned element should be positioned

relative to the view.

  • fast/regions/repaint/fixed-in-named-flow-cb-changed-expected.txt: Added.
  • fast/regions/repaint/fixed-in-named-flow-cb-changed.html: Added.
  • fast/regions/repaint/fixed-in-named-flow-cb-changed2-expected.txt: Added.
  • fast/regions/repaint/fixed-in-named-flow-cb-changed2.html: Added.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r160715 r160717  
     12013-12-17  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSSRegions] Incorrect repaint of fixed element with transformed parent
     4        https://bugs.webkit.org/show_bug.cgi?id=125756
     5
     6        Reviewed by Darin Adler.
     7
     8        Add tests for a fixed positioned element with a parent that:
     9        1. dynamically gets a transform, in which case the fixed positioned element should be positioned
     10        relative to its parent
     11        2. dynamically loses its transform, in which case the fixed positioned element should be positioned
     12        relative to the view.
     13
     14        * fast/regions/repaint/fixed-in-named-flow-cb-changed-expected.txt: Added.
     15        * fast/regions/repaint/fixed-in-named-flow-cb-changed.html: Added.
     16        * fast/regions/repaint/fixed-in-named-flow-cb-changed2-expected.txt: Added.
     17        * fast/regions/repaint/fixed-in-named-flow-cb-changed2.html: Added.
     18
    1192013-12-17  Bem Jones-Bey  <bjonesbe@adobe.com>
    220
  • trunk/Source/WebCore/ChangeLog

    r160715 r160717  
     12013-12-17  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSSRegions] Incorrect repaint of fixed element with transformed parent
     4        https://bugs.webkit.org/show_bug.cgi?id=125756
     5
     6        Reviewed by Darin Adler.
     7
     8        When collecting the layers for fixed positioned elements with named flow
     9        as a containing block, use layers collection at named flow layer level
     10        instead of relying on the positioned elements collection.
     11
     12        Modified also FlowThreadController::collectFixedPositionedLayers function
     13        to always return the layers sorted by z-index, as this operation was always
     14        done at the call sites.
     15
     16        Tests: fast/regions/repaint/fixed-in-named-flow-cb-changed.html
     17               fast/regions/repaint/fixed-in-named-flow-cb-changed2.html
     18
     19        * rendering/FlowThreadController.cpp:
     20        (WebCore::compareZIndex):
     21        (WebCore::FlowThreadController::collectFixedPositionedLayers):
     22        * rendering/RenderLayer.cpp:
     23        (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
     24        (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
     25
    1262013-12-17  Bem Jones-Bey  <bjonesbe@adobe.com>
    227
  • trunk/Source/WebCore/rendering/FlowThreadController.cpp

    r158559 r160717  
    2929
    3030#include "config.h"
    31 
    3231#include "FlowThreadController.h"
    3332
     
    281280}
    282281
    283 // Collect the fixed positioned layers that have the named flows as containing block
     282// Helper for the sorting of layers by z-index.
     283static inline bool compareZIndex(RenderLayer* first, RenderLayer* second)
     284{
     285    return first->zIndex() < second->zIndex();
     286}
     287
     288// Collect the fixed positioned layers that have the named flows as containing block.
    284289// These layers are painted and hit-tested starting from RenderView not from regions.
     290// The list of layers is returned sorted by z-index.
    285291void FlowThreadController::collectFixedPositionedLayers(Vector<RenderLayer*>& fixedPosLayers) const
    286292{
     
    293299            continue;
    294300
    295         // Iterate over the fixed positioned elements in the flow thread
    296         TrackedRendererListHashSet* positionedDescendants = flowRenderer->positionedObjects();
    297         if (positionedDescendants) {
    298             for (auto it = positionedDescendants->begin(), end = positionedDescendants->end(); it != end; ++it) {
    299                 RenderBox* box = *it;
    300                 if (!box->fixedPositionedWithNamedFlowContainingBlock())
     301        RenderLayer* flowThreadLayer = flowRenderer->layer();
     302        if (Vector<RenderLayer*>* negZOrderList = flowThreadLayer->negZOrderList()) {
     303            for (size_t i = 0, size = negZOrderList->size(); i < size; ++i) {
     304                RenderLayer* currLayer = negZOrderList->at(i);
     305                if (currLayer->renderer().style().position() != FixedPosition)
    301306                    continue;
    302                 fixedPosLayers.append(box->layer());
     307                fixedPosLayers.append(currLayer);
    303308            }
    304309        }
    305     }
     310
     311        if (Vector<RenderLayer*>* posZOrderList = flowThreadLayer->posZOrderList()) {
     312            for (size_t i = 0, size = posZOrderList->size(); i < size; ++i) {
     313                RenderLayer* currLayer = posZOrderList->at(i);
     314                if (currLayer->renderer().style().position() != FixedPosition)
     315                    continue;
     316                fixedPosLayers.append(currLayer);
     317            }
     318        }
     319    }
     320
     321    std::stable_sort(fixedPosLayers.begin(), fixedPosLayers.end(), compareZIndex);
    306322}
    307323
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r160699 r160717  
    40454045    renderer().view().flowThreadController().collectFixedPositionedLayers(fixedLayers);
    40464046
    4047     // Sort the fixed layers list
    4048     std::stable_sort(fixedLayers.begin(), fixedLayers.end(), compareZIndex);
    4049 
    40504047    // Paint the layers
    40514048    for (size_t i = 0; i < fixedLayers.size(); ++i) {
     
    47944791    Vector<RenderLayer*> fixedLayers;
    47954792    renderer().view().flowThreadController().collectFixedPositionedLayers(fixedLayers);
    4796 
    4797     // Sort the fixed layers list
    4798     std::stable_sort(fixedLayers.begin(), fixedLayers.end(), compareZIndex);
    47994793
    48004794    // Hit test the layers
Note: See TracChangeset for help on using the changeset viewer.