Changeset 150318 in webkit


Ignore:
Timestamp:
May 17, 2013 7:56:20 PM (11 years ago)
Author:
akling@apple.com
Message:

Ads on theverge.com cause repaints when hovered, even though content doesn't visibly change.
<http://webkit.org/b/116344>

Reviewed by Darin Adler.

Teach RenderStyle::diff() to ignore differences in the outline value if both styles have non-visible outlines.

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::diff):

  • rendering/style/StyleBackgroundData.cpp:

(WebCore::StyleBackgroundData::isEquivalentForPainting):

  • rendering/style/StyleBackgroundData.h:

(StyleBackgroundData):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r150316 r150318  
     12013-05-17  Andreas Kling  <akling@apple.com>
     2
     3        Ads on theverge.com cause repaints when hovered, even though content doesn't visibly change.
     4        <http://webkit.org/b/116344>
     5
     6        Reviewed by Darin Adler.
     7
     8        Teach RenderStyle::diff() to ignore differences in the outline value if both styles have non-visible outlines.
     9
     10        * rendering/style/RenderStyle.cpp:
     11        (WebCore::RenderStyle::diff):
     12        * rendering/style/StyleBackgroundData.cpp:
     13        (WebCore::StyleBackgroundData::isEquivalentForPainting):
     14        * rendering/style/StyleBackgroundData.h:
     15        (StyleBackgroundData):
     16
    1172013-05-17  Andreas Kling  <akling@apple.com>
    218
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r150259 r150318  
    680680        || inherited_flags._insideLink != other->inherited_flags._insideLink
    681681        || surround->border != other->surround->border
    682         || *m_background.get() != *other->m_background.get()
     682        || !m_background->isEquivalentForPainting(*other->m_background)
    683683        || rareInheritedData->userModify != other->rareInheritedData->userModify
    684684        || rareInheritedData->userSelect != other->rareInheritedData->userSelect
  • trunk/Source/WebCore/rendering/style/StyleBackgroundData.cpp

    r134242 r150318  
    4747}
    4848
     49bool StyleBackgroundData::isEquivalentForPainting(const StyleBackgroundData& other) const
     50{
     51    if (m_background != other.m_background || m_color != other.m_color)
     52        return false;
     53    if (!m_outline.isVisible() && !other.m_outline.isVisible())
     54        return true;
     55    return m_outline == other.m_outline;
     56}
     57
    4958} // namespace WebCore
  • trunk/Source/WebCore/rendering/style/StyleBackgroundData.h

    r134242 r150318  
    4646    }
    4747
     48    bool isEquivalentForPainting(const StyleBackgroundData&) const;
     49
    4850    const FillLayer& background() const { return m_background; }
    4951    const Color& color() const { return m_color; }
Note: See TracChangeset for help on using the changeset viewer.