Changeset 154982 in webkit


Ignore:
Timestamp:
Sep 3, 2013 7:43:20 AM (11 years ago)
Author:
mihnea@adobe.com
Message:

[CSSRegions] Pseudo-elements as regions should not be exposed to JS
https://bugs.webkit.org/show_bug.cgi?id=120633

Reviewed by Andreas Kling.

Source/WebCore:

Until we properly implement the Region interface (http://dev.w3.org/csswg/css-regions/#the-region-interface)
for pseudo-elements, we should not return these as regions in JS.

Tests: fast/regions/get-regions-by-content-pseudo.html

fast/regions/webkit-named-flow-get-regions-pseudo.html

  • dom/WebKitNamedFlow.cpp:

(WebCore::WebKitNamedFlow::firstEmptyRegionIndex): Skip pseudo-elements as regions here too,
otherwise we may get an index that cannot be used with getRegions().
(WebCore::WebKitNamedFlow::getRegionsByContent):
(WebCore::WebKitNamedFlow::getRegions):

LayoutTests:

Add tests with pseudo-elements as regions checking the following API:
WebKitNamedFlow::getRegions(), WebKitNamedFlow::getRegionsByContent()
Because we do not return the pseudo-elements as regions in the region list,
i modified WebKitNamedFlow::firstEmptyRegionIndex to skip these regions too.

  • fast/regions/get-regions-by-content-pseudo-expected.txt: Added.
  • fast/regions/get-regions-by-content-pseudo.html: Added.
  • fast/regions/webkit-named-flow-get-regions-pseudo-expected.txt: Added.
  • fast/regions/webkit-named-flow-get-regions-pseudo.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r154980 r154982  
     12013-09-03  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSSRegions] Pseudo-elements as regions should not be exposed to JS
     4        https://bugs.webkit.org/show_bug.cgi?id=120633
     5
     6        Reviewed by Andreas Kling.
     7
     8        Add tests with pseudo-elements as regions checking the following API:
     9        WebKitNamedFlow::getRegions(), WebKitNamedFlow::getRegionsByContent()
     10        Because we do not return the pseudo-elements as regions in the region list,
     11        i modified WebKitNamedFlow::firstEmptyRegionIndex to skip these regions too.
     12
     13        * fast/regions/get-regions-by-content-pseudo-expected.txt: Added.
     14        * fast/regions/get-regions-by-content-pseudo.html: Added.
     15        * fast/regions/webkit-named-flow-get-regions-pseudo-expected.txt: Added.
     16        * fast/regions/webkit-named-flow-get-regions-pseudo.html: Added.
     17
    1182013-09-03  Ádám Kallai  <kadam@inf.u-szeged.hu>
    219
  • trunk/Source/WebCore/ChangeLog

    r154981 r154982  
     12013-09-03  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSSRegions] Pseudo-elements as regions should not be exposed to JS
     4        https://bugs.webkit.org/show_bug.cgi?id=120633
     5
     6        Reviewed by Andreas Kling.
     7
     8        Until we properly implement the Region interface (http://dev.w3.org/csswg/css-regions/#the-region-interface)
     9        for pseudo-elements, we should not return these as regions in JS.
     10
     11        Tests: fast/regions/get-regions-by-content-pseudo.html
     12               fast/regions/webkit-named-flow-get-regions-pseudo.html
     13
     14        * dom/WebKitNamedFlow.cpp:
     15        (WebCore::WebKitNamedFlow::firstEmptyRegionIndex): Skip pseudo-elements as regions here too,
     16        otherwise we may get an index that cannot be used with getRegions().
     17        (WebCore::WebKitNamedFlow::getRegionsByContent):
     18        (WebCore::WebKitNamedFlow::getRegions):
     19
    1202013-09-03  Zan Dobersek  <zdobersek@igalia.com>
    221
  • trunk/Source/WebCore/dom/WebKitNamedFlow.cpp

    r153926 r154982  
    9999    if (regionList.isEmpty())
    100100        return -1;
     101
     102    int countNonPseudoRegions = -1;
    101103    RenderRegionList::const_iterator iter = regionList.begin();
    102104    for (int index = 0; iter != regionList.end(); ++index, ++iter) {
    103105        const RenderRegion* renderRegion = *iter;
     106        // FIXME: Pseudo-elements are not included in the list.
     107        // They will be included when we will properly support the Region interface
     108        // http://dev.w3.org/csswg/css-regions/#the-region-interface
     109        if (renderRegion->isPseudoElement())
     110            continue;
     111        countNonPseudoRegions++;
    104112        if (renderRegion->regionOversetState() == RegionEmpty)
    105             return index;
     113            return countNonPseudoRegions;
    106114    }
    107115    return -1;
     
    128136            const RenderRegion* renderRegion = *iter;
    129137            // FIXME: Pseudo-elements are not included in the list.
    130             if (!renderRegion->node())
     138            // They will be included when we will properly support the Region interface
     139            // http://dev.w3.org/csswg/css-regions/#the-region-interface
     140            if (renderRegion->isPseudoElement())
    131141                continue;
    132142            if (m_parentFlowThread->objectInFlowRegion(contentNode->renderer(), renderRegion))
     
    154164        const RenderRegion* renderRegion = *iter;
    155165        // FIXME: Pseudo-elements are not included in the list.
    156         if (!renderRegion->node())
     166        // They will be included when we will properly support the Region interface
     167        // http://dev.w3.org/csswg/css-regions/#the-region-interface
     168        if (renderRegion->isPseudoElement())
    157169            continue;
    158170        regionNodes.append(renderRegion->node());
Note: See TracChangeset for help on using the changeset viewer.