Ignore:
Timestamp:
Feb 23, 2013, 12:41:26 PM (12 years ago)
Author:
Dimitri Glazkov
Message:

Scrollbar style resolution arguments should not passed via statics.
https://bugs.webkit.org/show_bug.cgi?id=110690

Use PseudoStyleRequest to pass scrollbar params for style resolve.

Reviewed by Eric Seidel.

No change in functionality, covered by existing tests.

  • css/SelectorChecker.cpp:

(WebCore::SelectorChecker::match): Changed to use context params, rather than statics.
(WebCore::SelectorChecker::checkOne): Changed to pass context to checkScrollbarPseudoClass.
(WebCore::SelectorChecker::checkScrollbarPseudoClass): Changed to use context params, rather than statics.

  • css/SelectorChecker.h:

(WebCore::SelectorChecker::SelectorCheckingContext::SelectorCheckingContext): Added scrollbar style args.
(SelectorCheckingContext): Ditto.

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::collectMatchingRulesForList): Changed to use PseudoStyleRequest.
(WebCore::StyleResolver::State::initForStyleResolve): Ditto.
(WebCore::StyleResolver::pseudoStyleForElement): Ditto.
(WebCore::StyleResolver::ruleMatches): Ditto and added stuffing scrollbar style resolve args into SelectorCheckingContext.

  • css/StyleResolver.h:

(PseudoStyleRequest): Added.
(State): Changed to hold and use PseudoStyleRequest instead of just PseudoId

  • dom/Element.cpp:

(WebCore::Element::pseudoStyleCacheIsInvalid): Changed to use PseudoStyleRequest.

  • page/FrameView.cpp: Ditto.

(WebCore::FrameView::updateScrollCorner): Ditto.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::updateScrollCornerStyle): Ditto.
(WebCore::RenderLayer::updateResizerStyle): Ditto.

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::selectionBackgroundColor): Ditto.
(WebCore::RenderObject::selectionColor): Ditto.
(WebCore::firstLineStyleForCachedUncachedType): Ditto.
(WebCore::RenderObject::getCachedPseudoStyle): Ditto.
(WebCore::RenderObject::getUncachedPseudoStyle): Ditto.

  • rendering/RenderObject.h:

(RenderObject): Ditto.

  • rendering/RenderScrollbar.cpp:

(WebCore::RenderScrollbar::getScrollbarPseudoStyle): Ditto.

  • rendering/RenderScrollbar.h:

(RenderScrollbar): Removed static members that are now obsolete.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderScrollbar.cpp

    r140244 r143848  
    3333#include "RenderScrollbarTheme.h"
    3434#include "StyleInheritedData.h"
     35#include "StyleResolver.h"
    3536
    3637namespace WebCore {
     
    146147}
    147148
    148 static ScrollbarPart s_styleResolvePart;
    149 static RenderScrollbar* s_styleResolveScrollbar;
    150 
    151 RenderScrollbar* RenderScrollbar::scrollbarForStyleResolve()
    152 {
    153     return s_styleResolveScrollbar;
    154 }
    155 
    156 ScrollbarPart RenderScrollbar::partForStyleResolve()
    157 {
    158     return s_styleResolvePart;
    159 }
    160 
    161149PassRefPtr<RenderStyle> RenderScrollbar::getScrollbarPseudoStyle(ScrollbarPart partType, PseudoId pseudoId)
    162150{
     
    164152        return 0;
    165153
    166     s_styleResolvePart = partType;
    167     s_styleResolveScrollbar = this;
    168     RefPtr<RenderStyle> result = owningRenderer()->getUncachedPseudoStyle(pseudoId, owningRenderer()->style());
    169     s_styleResolvePart = NoPart;
    170     s_styleResolveScrollbar = 0;
    171 
     154    RefPtr<RenderStyle> result = owningRenderer()->getUncachedPseudoStyle(PseudoStyleRequest(pseudoId, this, partType), owningRenderer()->style());
    172155    // Scrollbars for root frames should always have background color
    173156    // unless explicitly specified as transparent. So we force it.
Note: See TracChangeset for help on using the changeset viewer.