Index: Source/core/css/resolver/StyleResolver.cpp |
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp |
index fd039ac38b58e3e29613f0e80ec0f852397b575c..8e249cc224d27d0b99962ea3cc107395b0f8b36d 100644 |
--- a/Source/core/css/resolver/StyleResolver.cpp |
+++ b/Source/core/css/resolver/StyleResolver.cpp |
@@ -80,7 +80,9 @@ |
#include "core/html/HTMLIFrameElement.h" |
#include "core/inspector/InspectorInstrumentation.h" |
#include "core/rendering/RenderView.h" |
+#include "core/rendering/style/CachedUAStyle.h" |
#include "core/rendering/style/KeyframeList.h" |
+#include "core/rendering/style/UAStyleChange.h" |
#include "core/svg/SVGDocumentExtensions.h" |
#include "core/svg/SVGElement.h" |
#include "platform/RuntimeEnabledFeatures.h" |
@@ -526,10 +528,34 @@ PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document& document) |
return documentStyle.release(); |
} |
+static UAStyleChange uaStyleChange(StyleResolverState& state) |
+{ |
+ const CachedUAStyle* cachedUAStyle = state.cachedUAStyle(); |
+ |
+ if (!cachedUAStyle) |
+ return UAStyleChange(false); |
+ |
+ UAStyleChange uaStyle(true); |
+ |
+ // Exclude background-repeat from comparison by resetting it. |
+ FillLayer backgroundCopy = cachedUAStyle->backgroundLayers; |
+ FillLayer backgroundLayersCopy = state.style()->backgroundLayers(); |
+ backgroundCopy.setRepeatX(NoRepeatFill); |
+ backgroundCopy.setRepeatY(NoRepeatFill); |
+ backgroundLayersCopy.setRepeatX(NoRepeatFill); |
+ backgroundLayersCopy.setRepeatY(NoRepeatFill); |
+ |
+ uaStyle.backgroundChanged = backgroundLayersCopy != backgroundCopy |
+ || state.style()->visitedDependentColor(CSSPropertyBackgroundColor) != cachedUAStyle->backgroundColor; |
+ uaStyle.borderChanged = state.style()->border() != cachedUAStyle->border; |
+ |
+ return uaStyle; |
+} |
+ |
void StyleResolver::adjustRenderStyle(StyleResolverState& state, Element* element) |
{ |
StyleAdjuster adjuster(document().inQuirksMode()); |
- adjuster.adjustRenderStyle(state.style(), state.parentStyle(), element, state.cachedUAStyle()); |
+ adjuster.adjustRenderStyle(state.style(), state.parentStyle(), element, uaStyleChange(state)); |
} |
// Start loading resources referenced by this style. |