⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 178490 in webkit


Ignore:
Timestamp:
Jan 14, 2015, 11:59:09 PM (12 years ago)
Author:
Simon Fraser
Message:

Graphics corruption after Find on some pages
https://bugs.webkit.org/show_bug.cgi?id=140489

Reviewed by Zalan Bujtas.

Source/WebCore:

After doing a Find on http://shop.outlier.cc/shop/retail/chino.html,
garbage could appear on some parts of the page. This is caused by creating
a compositing layer which is marked as opaque, yet failing to paint the entire
layer contents.

This was caused by a bug in RenderBox::computeBackgroundIsKnownToBeObscured()
logic. On the page in question, doing a Find could cause overflow:hidden sections
to get scrolled (since Find can reveal the selection by scrolling overflow).
However, the render tree walking under RenderBox::foregroundIsKnownToBeOpaqueInRect()
fails to take overflow scrolling into account, so gives the wrong answer
in some content configurations. As a result, we'd think that the background
is obscured, and never paint it.

Conservative fix is to have isCandidateForOpaquenessTest() return false
when the content has any non-zero scroll offset.

Tests: compositing/contents-opaque/opaque-with-scrolled.html

fast/backgrounds/opaque-scrolled-paint-background.html

  • rendering/RenderBox.cpp:

(WebCore::isCandidateForOpaquenessTest):

LayoutTests:

Two new tests. The first one just reports that we have an opaque compositing
layer. The second one tests the the user-visible symptom of the missing
background.

  • compositing/contents-opaque/opaque-with-scrolled-expected.txt: Added.
  • compositing/contents-opaque/opaque-with-scrolled.html: Added.
  • fast/backgrounds/opaque-scrolled-paint-background-expected.html: Added.
  • fast/backgrounds/opaque-scrolled-paint-background.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r178488 r178490  
     12015-01-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Graphics corruption after Find on some pages
     4        https://bugs.webkit.org/show_bug.cgi?id=140489
     5
     6        Reviewed by Zalan Bujtas.
     7       
     8        Two new tests. The first one just reports that we have an opaque compositing
     9        layer. The second one tests the the user-visible symptom of the missing
     10        background.
     11
     12        * compositing/contents-opaque/opaque-with-scrolled-expected.txt: Added.
     13        * compositing/contents-opaque/opaque-with-scrolled.html: Added.
     14        * fast/backgrounds/opaque-scrolled-paint-background-expected.html: Added.
     15        * fast/backgrounds/opaque-scrolled-paint-background.html: Added.
     16
    1172015-01-14  Alexey Proskuryakov  <ap@apple.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r178486 r178490  
     12015-01-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Graphics corruption after Find on some pages
     4        https://bugs.webkit.org/show_bug.cgi?id=140489
     5
     6        Reviewed by Zalan Bujtas.
     7       
     8        After doing a Find on http://shop.outlier.cc/shop/retail/chino.html,
     9        garbage could appear on some parts of the page. This is caused by creating
     10        a compositing layer which is marked as opaque, yet failing to paint the entire
     11        layer contents.
     12       
     13        This was caused by a bug in RenderBox::computeBackgroundIsKnownToBeObscured()
     14        logic. On the page in question, doing a Find could cause overflow:hidden sections
     15        to get scrolled (since Find can reveal the selection by scrolling overflow).
     16        However, the render tree walking under RenderBox::foregroundIsKnownToBeOpaqueInRect()
     17        fails to take overflow scrolling into account, so gives the wrong answer
     18        in some content configurations. As a result, we'd think that the background
     19        is obscured, and never paint it.
     20       
     21        Conservative fix is to have isCandidateForOpaquenessTest() return false
     22        when the content has any non-zero scroll offset.
     23
     24        Tests: compositing/contents-opaque/opaque-with-scrolled.html
     25               fast/backgrounds/opaque-scrolled-paint-background.html
     26
     27        * rendering/RenderBox.cpp:
     28        (WebCore::isCandidateForOpaquenessTest):
     29
    1302015-01-14  Jer Noble  <jer.noble@apple.com>
    231
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r178231 r178490  
    14001400            return false;
    14011401        if (childLayer->hasTransform() || childLayer->isTransparent() || childLayer->hasFilter())
     1402            return false;
     1403        if (!childBox.scrolledContentOffset().isZero())
    14021404            return false;
    14031405    }
Note: See TracChangeset for help on using the changeset viewer.