Changeset 215507 in webkit


Ignore:
Timestamp:
Apr 19, 2017 5:15:37 AM (7 years ago)
Author:
Antti Koivisto
Message:

Avoid repaints for invisible animations on tumblr.com/search/aww
https://bugs.webkit.org/show_bug.cgi?id=170986
<rdar://problem/28644580>

Reviewed by Andreas Kling.

Source/WebCore:

Test: fast/repaint/mutate-non-visible.html

  • rendering/style/RenderStyle.cpp:

(WebCore::requiresPainting):
(WebCore::RenderStyle::changeRequiresRepaint):

If an element is invisible it does not require repaint even if something else changes.

LayoutTests:

  • fast/repaint/mutate-non-visible-expected.txt: Added.
  • fast/repaint/mutate-non-visible.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r215491 r215507  
     12017-04-19  Antti Koivisto  <antti@apple.com>
     2
     3        Avoid repaints for invisible animations on tumblr.com/search/aww
     4        https://bugs.webkit.org/show_bug.cgi?id=170986
     5        <rdar://problem/28644580>
     6
     7        Reviewed by Andreas Kling.
     8
     9        * fast/repaint/mutate-non-visible-expected.txt: Added.
     10        * fast/repaint/mutate-non-visible.html: Added.
     11
    1122017-04-18  John Wilander  <wilander@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r215506 r215507  
     12017-04-19  Antti Koivisto  <antti@apple.com>
     2
     3        Avoid repaints for invisible animations on tumblr.com/search/aww
     4        https://bugs.webkit.org/show_bug.cgi?id=170986
     5        <rdar://problem/28644580>
     6
     7        Reviewed by Andreas Kling.
     8
     9        Test: fast/repaint/mutate-non-visible.html
     10
     11        * rendering/style/RenderStyle.cpp:
     12        (WebCore::requiresPainting):
     13        (WebCore::RenderStyle::changeRequiresRepaint):
     14
     15            If an element is invisible it does not require repaint even if something else changes.
     16
    1172017-04-19  Dean Jackson  <dino@apple.com>
    218
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r215261 r215507  
    844844}
    845845
     846static bool requiresPainting(const RenderStyle& style)
     847{
     848    if (style.visibility() == HIDDEN)
     849        return false;
     850    if (!style.opacity())
     851        return false;
     852    return true;
     853}
     854
    846855bool RenderStyle::changeRequiresRepaint(const RenderStyle& other, unsigned& changedContextSensitiveProperties) const
    847856{
     857    if (!requiresPainting(*this) && !requiresPainting(other))
     858        return false;
     859
    848860    if (m_inheritedFlags.visibility != other.m_inheritedFlags.visibility
    849861        || m_inheritedFlags.printColorAdjust != other.m_inheritedFlags.printColorAdjust
Note: See TracChangeset for help on using the changeset viewer.