#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.
// 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