3 styleForElement() should use enums instead of bools so we can all understand what it's doing
4 https://bugs.webkit.org/show_bug.cgi?id=82807
5
6 Reviewed by NOBODY (OOPS!).
7
8 No change in behavior, thus no tests.
9
10 Mostly this is just replacing true/false with the correct new enum value
11 or removing true/false from the callsites when they would have been default anyway.
12 I think this makes the code *way* more clear.
13
14 The old code was extra confusing because the defaults were "true, false". :)
15 The new defaults are AllowStyleSharing, MatchAllRules.
16 It's very uncommon for callers to want to override either of these behaviors.
17 I think most callers which specify DisallowStyleSharing likely don't actually need to
18 (our style-sharing code should be smart enough to only share when safe anyway).
19
20 * css/CSSStyleSelector.cpp:
21 (WebCore::CSSStyleSelector::CSSStyleSelector):
22 - Use enums and remove bogus comment (m_rootDefaultStyle is a RefPtr!)
23 (WebCore::CSSStyleSelector::collectMatchingRulesForList):
24 * css/CSSStyleSelector.h:
25 (CSSStyleSelector):
26 * css/MediaQueryMatcher.cpp:
27 (WebCore::MediaQueryMatcher::prepareEvaluator):
28 * css/StyleMedia.cpp:
29 (WebCore::StyleMedia::matchMedium):
30 * dom/Element.cpp:
31 (WebCore::Element::styleForRenderer):
32 * rendering/RenderObject.cpp:
33 (WebCore::RenderObject::getUncachedPseudoStyle):
34 - Updated to use enums
35 - Also fixed this to use toElement and modern early-return styles.
36 * rendering/RenderRegion.cpp:
37 (WebCore::RenderRegion::computeStyleInRegion):
38 * svg/SVGElement.cpp:
39 (WebCore::SVGElement::customStyleForRenderer):
40
412012-03-30 Eric Seidel <eric@webkit.org>
42