Changeset 213440 in webkit


Ignore:
Timestamp:
Mar 5, 2017, 6:48:20 PM (8 years ago)
Author:
Simon Fraser
Message:

Avoid backing store for layers with empty text nodes in a few more cases
https://bugs.webkit.org/show_bug.cgi?id=169185

Reviewed by Dan Bernstein.

Source/WebCore:

In hasPaintingNonLayerDescendants() we can check whether the RenderText's linesBoundingBox()
is empty to avoid backing store in a few more cases. Also use containsOnlyWhitespace() rather
than isAllCollapsibleWhitespace(), because there's no need for backing store for non-selectable
whitespace text.

Covered by existing tests.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::calculateClipRects):

LayoutTests:

inline-block-no-backing.html enhanced to have a layer with non-collapsible whitespace (an  ).

Rebaselined other tests.

  • compositing/backing/inline-block-no-backing-expected.txt:
  • compositing/backing/inline-block-no-backing.html:
  • compositing/iframes/page-cache-layer-tree-expected.txt:
  • css3/blending/blend-mode-clip-accelerated-blending-canvas-expected.txt:
  • platform/ios-simulator-wk2/compositing/backing/inline-block-no-backing-expected.txt:
  • platform/ios-simulator-wk2/compositing/iframes/page-cache-layer-tree-expected.txt:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/LayoutTests/ChangeLog

    r213438 r213440  
     12017-03-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Avoid backing store for layers with empty text nodes in a few more cases
     4        https://bugs.webkit.org/show_bug.cgi?id=169185
     5
     6        Reviewed by Dan Bernstein.
     7
     8        inline-block-no-backing.html enhanced to have a layer with non-collapsible whitespace (an &nbsp;).
     9
     10        Rebaselined other tests.
     11
     12        * compositing/backing/inline-block-no-backing-expected.txt:
     13        * compositing/backing/inline-block-no-backing.html:
     14        * compositing/iframes/page-cache-layer-tree-expected.txt:
     15        * css3/blending/blend-mode-clip-accelerated-blending-canvas-expected.txt:
     16        * platform/ios-simulator-wk2/compositing/backing/inline-block-no-backing-expected.txt:
     17        * platform/ios-simulator-wk2/compositing/iframes/page-cache-layer-tree-expected.txt:
     18
    1192017-03-05  Chris Dumez  <cdumez@apple.com>
    220
  • TabularUnified trunk/LayoutTests/compositing/backing/inline-block-no-backing-expected.txt

    r173293 r213440  
    1      
     1           
    22
    33 (GraphicsLayer
     
    88      (bounds 800.00 600.00)
    99      (contentsOpaque 1)
    10       (children 3
     10      (children 4
    1111        (GraphicsLayer
    1212          (position 18.00 18.00)
     
    1515          (children 2
    1616            (GraphicsLayer
    17               (position 10.00 10.00)
     17              (position 18.00 10.00)
    1818              (bounds 120.00 120.00)
    1919            )
     
    5252          )
    5353        )
     54        (GraphicsLayer
     55          (position 570.00 18.00)
     56          (bounds 160.00 320.00)
     57          (children 2
     58            (GraphicsLayer
     59              (position 10.00 10.00)
     60              (bounds 120.00 120.00)
     61            )
     62            (GraphicsLayer
     63              (position 10.00 154.00)
     64              (bounds 120.00 120.00)
     65            )
     66          )
     67        )
    5468      )
    5569    )
  • TabularUnified trunk/LayoutTests/compositing/backing/inline-block-no-backing.html

    r173293 r213440  
    4343</head>
    4444<body>
     45    <div class="composited container">&nbsp;
     46        <img class="composited child" src="../resources/apple.jpg">
     47        <img class="composited child" src="../resources/apple.jpg">
     48    </div>
    4549    <div class="composited container">
    4650        <img class="composited child" src="../resources/apple.jpg">
  • TabularUnified trunk/LayoutTests/compositing/iframes/page-cache-layer-tree-expected.txt

    r209932 r213440  
    6262          (position 8.00 274.00)
    6363          (bounds 784.00 224.00)
    64           (drawsContent 1)
    6564          (children 1
    6665            (GraphicsLayer
  • TabularUnified trunk/LayoutTests/css3/blending/blend-mode-clip-accelerated-blending-canvas-expected.txt

    r168356 r213440  
    1111          (bounds 100.00 100.00)
    1212          (contentsOpaque 1)
    13           (drawsContent 1)
    1413          (children 1
    1514            (GraphicsLayer
  • TabularUnified trunk/LayoutTests/platform/ios-simulator-wk2/compositing/backing/inline-block-no-backing-expected.txt

    r177052 r213440  
    1      
     1           
    22
    33 (GraphicsLayer
     
    88      (bounds 800.00 600.00)
    99      (contentsOpaque 1)
    10       (children 3
     10      (children 4
    1111        (GraphicsLayer
    1212          (position 18.00 18.00)
     
    1515          (children 2
    1616            (GraphicsLayer
    17               (position 10.00 10.00)
     17              (position 18.00 10.00)
    1818              (bounds 120.00 120.00)
    1919              (drawsContent 1)
     
    5858          )
    5959        )
     60        (GraphicsLayer
     61          (position 570.00 18.00)
     62          (bounds 160.00 320.00)
     63          (children 2
     64            (GraphicsLayer
     65              (position 10.00 10.00)
     66              (bounds 120.00 120.00)
     67              (drawsContent 1)
     68            )
     69            (GraphicsLayer
     70              (position 10.00 155.00)
     71              (bounds 120.00 120.00)
     72              (drawsContent 1)
     73            )
     74          )
     75        )
    6076      )
    6177    )
  • TabularUnified trunk/LayoutTests/platform/ios-simulator-wk2/compositing/iframes/page-cache-layer-tree-expected.txt

    r194063 r213440  
    6262          (position 8.00 277.00)
    6363          (bounds 784.00 225.00)
    64           (drawsContent 1)
    6564          (children 1
    6665            (GraphicsLayer
  • TabularUnified trunk/Source/WebCore/ChangeLog

    r213439 r213440  
     12017-03-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Avoid backing store for layers with empty text nodes in a few more cases
     4        https://bugs.webkit.org/show_bug.cgi?id=169185
     5
     6        Reviewed by Dan Bernstein.
     7
     8        In hasPaintingNonLayerDescendants() we can check whether the RenderText's linesBoundingBox()
     9        is empty to avoid backing store in a few more cases. Also use containsOnlyWhitespace() rather
     10        than isAllCollapsibleWhitespace(), because there's no need for backing store for non-selectable
     11        whitespace text.
     12
     13        Covered by existing tests.
     14
     15        * rendering/RenderLayer.cpp:
     16        (WebCore::RenderLayer::calculateClipRects):
     17
    1182017-03-05  Chris Dumez  <cdumez@apple.com>
    219
  • TabularUnified trunk/Source/WebCore/rendering/RenderLayer.cpp

    r213149 r213440  
    65936593        if (++siblingCount > maxSiblingCount)
    65946594            return true;
    6595        
     6595
    65966596        if (is<RenderText>(child)) {
    6597             bool isSelectable = renderer.style().userSelect() != SELECT_NONE;
    6598             if (isSelectable || !downcast<RenderText>(child).isAllCollapsibleWhitespace())
     6597            const auto& renderText = downcast<RenderText>(child);
     6598            if (renderText.linesBoundingBox().isEmpty())
     6599                continue;
     6600
     6601            if (renderer.style().userSelect() != SELECT_NONE)
     6602                return true;
     6603
     6604            if (!renderText.text()->containsOnlyWhitespace())
    65996605                return true;
    66006606        }
Note: See TracChangeset for help on using the changeset viewer.