summaryrefslogtreecommitdiffstats
path: root/WebCore/css/CSSStyleSelector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/css/CSSStyleSelector.cpp')
-rw-r--r--WebCore/css/CSSStyleSelector.cpp34
1 files changed, 26 insertions, 8 deletions
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index a534247..0e49314 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -389,6 +389,9 @@ static CSSStyleSheet* simpleDefaultStyleSheet;
RenderStyle* CSSStyleSelector::s_styleNotYetAvailable;
static void loadFullDefaultStyle();
+#if ENABLE(FULLSCREEN_API)
+static void loadFullScreenRulesIfNeeded(Document*);
+#endif
static void loadSimpleDefaultStyle();
// FIXME: It would be nice to use some mechanism that guarantees this is in sync with the real UA stylesheet.
static const char* simpleUserAgentStyleSheet = "html,body,div{display:block}body{margin:8px}div:focus,span:focus{outline:auto 5px -webkit-focus-ring-color}a:-webkit-any-link{color:-webkit-link;text-decoration:underline}a:-webkit-any-link:active{color:-webkit-activelink}";
@@ -427,8 +430,12 @@ CSSStyleSelector::CSSStyleSelector(Document* document, StyleSheetList* styleShee
if (!defaultStyle) {
if (!root || elementCanUseSimpleDefaultStyle(root))
loadSimpleDefaultStyle();
- else
+ else {
loadFullDefaultStyle();
+#if ENABLE(FULLSCREEN_API)
+ loadFullScreenRulesIfNeeded(document);
+#endif
+ }
}
// construct document root element default style. this is needed
@@ -534,15 +541,20 @@ static void loadFullDefaultStyle()
String quirksRules = String(quirksUserAgentStyleSheet, sizeof(quirksUserAgentStyleSheet)) + RenderTheme::defaultTheme()->extraQuirksStyleSheet();
CSSStyleSheet* quirksSheet = parseUASheet(quirksRules);
defaultQuirksStyle->addRulesFromSheet(quirksSheet, screenEval());
-
+}
+
#if ENABLE(FULLSCREEN_API)
+static void loadFullScreenRulesIfNeeded(Document* document)
+{
+ if (!document->webkitFullScreen())
+ return;
// Full-screen rules.
String fullscreenRules = String(fullscreenUserAgentStyleSheet, sizeof(fullscreenUserAgentStyleSheet)) + RenderTheme::defaultTheme()->extraDefaultStyleSheet();
CSSStyleSheet* fullscreenSheet = parseUASheet(fullscreenRules);
defaultStyle->addRulesFromSheet(fullscreenSheet, screenEval());
defaultQuirksStyle->addRulesFromSheet(fullscreenSheet, screenEval());
-#endif
}
+#endif
static void loadSimpleDefaultStyle()
{
@@ -1141,8 +1153,12 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyl
m_style->setInsideLink(m_elementLinkState);
}
- if (simpleDefaultStyleSheet && !elementCanUseSimpleDefaultStyle(e))
+ if (simpleDefaultStyleSheet && !elementCanUseSimpleDefaultStyle(e)) {
loadFullDefaultStyle();
+#if ENABLE(FULLSCREEN_API)
+ loadFullScreenRulesIfNeeded(e->document());
+#endif
+ }
#if ENABLE(SVG)
static bool loadedSVGUserAgentSheet;
@@ -7003,10 +7019,12 @@ void CSSStyleSelector::loadPendingImages()
}
case CSSPropertyWebkitBoxReflect: {
- const NinePieceImage& maskImage = m_style->boxReflect()->mask();
- if (maskImage.image() && maskImage.image()->isPendingImage()) {
- CSSImageValue* imageValue = static_cast<StylePendingImage*>(maskImage.image())->cssImageValue();
- m_style->boxReflect()->setMask(NinePieceImage(imageValue->cachedImage(cachedResourceLoader), maskImage.slices(), maskImage.horizontalRule(), maskImage.verticalRule()));
+ if (StyleReflection* reflection = m_style->boxReflect()) {
+ const NinePieceImage& maskImage = reflection->mask();
+ if (maskImage.image() && maskImage.image()->isPendingImage()) {
+ CSSImageValue* imageValue = static_cast<StylePendingImage*>(maskImage.image())->cssImageValue();
+ reflection->setMask(NinePieceImage(imageValue->cachedImage(cachedResourceLoader), maskImage.slices(), maskImage.horizontalRule(), maskImage.verticalRule()));
+ }
}
break;
}