Index: third_party/WebKit/Source/core/html/shadow/MeterShadowElement.cpp |
diff --git a/third_party/WebKit/Source/core/html/shadow/MeterShadowElement.cpp b/third_party/WebKit/Source/core/html/shadow/MeterShadowElement.cpp |
index b6f78cc587bcd96da5b77ca94e36995b8dae0274..a5e6e7cb8b1d6ad8234a0d18ddb5bdd8e3ac18ef 100644 |
--- a/third_party/WebKit/Source/core/html/shadow/MeterShadowElement.cpp |
+++ b/third_party/WebKit/Source/core/html/shadow/MeterShadowElement.cpp |
@@ -42,6 +42,25 @@ namespace blink { |
using namespace HTMLNames; |
+inline MeterFallbackElement::MeterFallbackElement(Document& document) |
+ : HTMLDivElement(document) |
+{ |
+ setHasCustomStyleCallbacks(); |
+} |
+ |
+DEFINE_NODE_FACTORY(MeterFallbackElement) |
+ |
+PassRefPtr<ComputedStyle> MeterFallbackElement::customStyleForLayoutObject() |
+{ |
+ Element* host = shadowHost(); |
+ RefPtr<ComputedStyle> style = originalStyleForLayoutObject(); |
+ if (!host || !host->computedStyle() || host->computedStyle()->appearance() != MeterPart) |
+ return style.release; |
+ RefPtr<ComputedStyle> newStyle = ComputedStyle::clone(*style); |
+ newStyle->setDisplay(NONE); |
+ return newStyle.release(); |
+} |
+ |
inline MeterShadowElement::MeterShadowElement(Document& document) |
: HTMLDivElement(document) |
{ |
@@ -61,6 +80,7 @@ bool MeterShadowElement::layoutObjectIsNeeded(const ComputedStyle& style) |
inline MeterInnerElement::MeterInnerElement(Document& document) |
: MeterShadowElement(document) |
{ |
+ setHasCustomStyleCallbacks(); |
} |
PassRefPtrWillBeRawPtr<MeterInnerElement> MeterInnerElement::create(Document& document) |
@@ -84,6 +104,17 @@ LayoutObject* MeterInnerElement::createLayoutObject(const ComputedStyle&) |
return new LayoutMeter(this); |
} |
+PassRefPtr<ComputedStyle> MeterInnerElement::customStyleForLayoutObject() |
+{ |
+ Element* host = shadowHost(); |
+ RefPtr<ComputedStyle> style = originalStyleForLayoutObject(); |
+ if (!host || !host->computedStyle() || host->computedStyle()->appearance() == MeterPart) |
+ return style.release; |
+ RefPtr<ComputedStyle> newStyle = ComputedStyle::clone(*style); |
+ newStyle->setDisplay(NONE); |
+ return newStyle.release(); |
+} |
+ |
inline MeterBarElement::MeterBarElement(Document& document) |
: MeterShadowElement(document) |
{ |