Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Unified Diff: third_party/WebKit/Source/core/html/shadow/MeterShadowElement.cpp

Issue 1428703004: Make <meter> transparent if -webkit-appearance:none or background CSS property is specified. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
{
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/MeterShadowElement.h ('k') | third_party/WebKit/Source/core/layout/LayoutTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698