Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / style / CachedUAStyle.h
index a3d7446..610e095 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "core/rendering/style/RenderStyle.h"
 
-namespace WebCore {
+namespace blink {
 
 // RenderTheme::adjustStyle wants the background and borders
 // as specified by the UA sheets, excluding any author rules.
@@ -32,30 +32,29 @@ namespace WebCore {
 // applyMatchedProperties for later use during adjustRenderStyle.
 class CachedUAStyle {
 public:
-    CachedUAStyle()
-        : hasAppearance(false)
-        , backgroundLayers(BackgroundFillLayer)
-        , backgroundColor(StyleColor::currentColor())
-    { }
-
-    explicit CachedUAStyle(const RenderStyle* style)
-        : hasAppearance(true)
-        , backgroundLayers(BackgroundFillLayer)
-        , backgroundColor(StyleColor::currentColor())
+    static PassOwnPtr<CachedUAStyle> create(const RenderStyle* style)
     {
-        ASSERT(style->hasAppearance());
-        border = style->border();
-        backgroundLayers = *style->backgroundLayers();
-        backgroundColor = style->backgroundColor();
+        return adoptPtr(new CachedUAStyle(style));
     }
 
     bool hasAppearance;
     BorderData border;
     FillLayer backgroundLayers;
     StyleColor backgroundColor;
+
+private:
+    explicit CachedUAStyle(const RenderStyle* style)
+        : hasAppearance(true)
+        , border(style->border())
+        , backgroundLayers(style->backgroundLayers())
+        , backgroundColor(style->backgroundColor())
+    {
+        ASSERT(style->hasAppearance());
+    }
 };
 
 
-} // namespace WebCore
+
+} // namespace blink
 
 #endif // CachedUAStyle_h