OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 if (root) | 174 if (root) |
175 m_rootDefaultStyle = styleForElement(root, 0, DisallowStyleSharing, Matc
hOnlyUserAgentRules); | 175 m_rootDefaultStyle = styleForElement(root, 0, DisallowStyleSharing, Matc
hOnlyUserAgentRules); |
176 | 176 |
177 if (m_rootDefaultStyle && view) | 177 if (m_rootDefaultStyle && view) |
178 m_medium = adoptPtr(new MediaQueryEvaluator(view->mediaType(), view->fra
me(), m_rootDefaultStyle.get())); | 178 m_medium = adoptPtr(new MediaQueryEvaluator(view->mediaType(), view->fra
me(), m_rootDefaultStyle.get())); |
179 | 179 |
180 m_styleTree.clear(); | 180 m_styleTree.clear(); |
181 | 181 |
182 DocumentStyleSheetCollection* styleSheetCollection = document->styleSheetCol
lection(); | 182 DocumentStyleSheetCollection* styleSheetCollection = document->styleSheetCol
lection(); |
183 m_ruleSets.initUserStyle(styleSheetCollection, *m_medium, *this); | 183 m_ruleSets.initUserStyle(styleSheetCollection, document->watchedCallbackSele
ctors(), *m_medium, *this); |
184 | 184 |
185 #if ENABLE(SVG_FONTS) | 185 #if ENABLE(SVG_FONTS) |
186 if (document->svgExtensions()) { | 186 if (document->svgExtensions()) { |
187 const HashSet<SVGFontFaceElement*>& svgFontFaceElements = document->svgE
xtensions()->svgFontFaceElements(); | 187 const HashSet<SVGFontFaceElement*>& svgFontFaceElements = document->svgE
xtensions()->svgFontFaceElements(); |
188 HashSet<SVGFontFaceElement*>::const_iterator end = svgFontFaceElements.e
nd(); | 188 HashSet<SVGFontFaceElement*>::const_iterator end = svgFontFaceElements.e
nd(); |
189 for (HashSet<SVGFontFaceElement*>::const_iterator it = svgFontFaceElemen
ts.begin(); it != end; ++it) | 189 for (HashSet<SVGFontFaceElement*>::const_iterator it = svgFontFaceElemen
ts.begin(); it != end; ++it) |
190 fontSelector()->addFontFaceRule((*it)->fontFaceRule()); | 190 fontSelector()->addFontFaceRule((*it)->fontFaceRule()); |
191 } | 191 } |
192 #endif | 192 #endif |
193 | 193 |
(...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1867 } | 1867 } |
1868 ASSERT_NOT_REACHED(); | 1868 ASSERT_NOT_REACHED(); |
1869 return false; | 1869 return false; |
1870 } | 1870 } |
1871 | 1871 |
1872 template <StyleResolver::StyleApplicationPass pass> | 1872 template <StyleResolver::StyleApplicationPass pass> |
1873 void StyleResolver::applyProperties(const StylePropertySet* properties, StyleRul
e* rule, bool isImportant, bool inheritedOnly, PropertyWhitelistType propertyWhi
telistType) | 1873 void StyleResolver::applyProperties(const StylePropertySet* properties, StyleRul
e* rule, bool isImportant, bool inheritedOnly, PropertyWhitelistType propertyWhi
telistType) |
1874 { | 1874 { |
1875 ASSERT((propertyWhitelistType != PropertyWhitelistRegion) || m_state.regionF
orStyling()); | 1875 ASSERT((propertyWhitelistType != PropertyWhitelistRegion) || m_state.regionF
orStyling()); |
1876 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willProces
sRule(document(), rule, this); | 1876 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willProces
sRule(document(), rule, this); |
| 1877 #if ENABLE(CSS_CALLBACKS) |
| 1878 m_state.setRule(rule); |
| 1879 #endif |
1877 | 1880 |
1878 unsigned propertyCount = properties->propertyCount(); | 1881 unsigned propertyCount = properties->propertyCount(); |
1879 for (unsigned i = 0; i < propertyCount; ++i) { | 1882 for (unsigned i = 0; i < propertyCount; ++i) { |
1880 StylePropertySet::PropertyReference current = properties->propertyAt(i); | 1883 StylePropertySet::PropertyReference current = properties->propertyAt(i); |
1881 if (isImportant != current.isImportant()) | 1884 if (isImportant != current.isImportant()) |
1882 continue; | 1885 continue; |
1883 if (inheritedOnly && !current.isInherited()) { | 1886 if (inheritedOnly && !current.isInherited()) { |
1884 // If the property value is explicitly inherited, we need to apply f
urther non-inherited properties | 1887 // If the property value is explicitly inherited, we need to apply f
urther non-inherited properties |
1885 // as they might override the value inherited here. For this reason
we don't allow declarations with | 1888 // as they might override the value inherited here. For this reason
we don't allow declarations with |
1886 // explicitly inherited properties to be cached. | 1889 // explicitly inherited properties to be cached. |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2273 info.addMember(m_state, "state"); | 2276 info.addMember(m_state, "state"); |
2274 | 2277 |
2275 // FIXME: move this to a place where it would be called only once? | 2278 // FIXME: move this to a place where it would be called only once? |
2276 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); | 2279 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); |
2277 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl
e"); | 2280 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl
e"); |
2278 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle"
); | 2281 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle"
); |
2279 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo
urceStyle"); | 2282 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo
urceStyle"); |
2280 } | 2283 } |
2281 | 2284 |
2282 } // namespace WebCore | 2285 } // namespace WebCore |
OLD | NEW |