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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMeterElement.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 11 matching lines...) Expand all
22 22
23 #include "core/html/HTMLMeterElement.h" 23 #include "core/html/HTMLMeterElement.h"
24 24
25 #include "bindings/core/v8/ExceptionMessages.h" 25 #include "bindings/core/v8/ExceptionMessages.h"
26 #include "bindings/core/v8/ExceptionState.h" 26 #include "bindings/core/v8/ExceptionState.h"
27 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 27 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
28 #include "core/HTMLNames.h" 28 #include "core/HTMLNames.h"
29 #include "core/dom/ExceptionCode.h" 29 #include "core/dom/ExceptionCode.h"
30 #include "core/dom/shadow/ShadowRoot.h" 30 #include "core/dom/shadow/ShadowRoot.h"
31 #include "core/frame/UseCounter.h" 31 #include "core/frame/UseCounter.h"
32 #include "core/html/HTMLContentElement.h"
32 #include "core/html/parser/HTMLParserIdioms.h" 33 #include "core/html/parser/HTMLParserIdioms.h"
33 #include "core/html/shadow/MeterShadowElement.h" 34 #include "core/html/shadow/MeterShadowElement.h"
34 #include "core/layout/LayoutMeter.h" 35 #include "core/layout/LayoutMeter.h"
35 #include "core/layout/LayoutTheme.h" 36 #include "core/layout/LayoutTheme.h"
36 37
37 namespace blink { 38 namespace blink {
38 39
39 using namespace HTMLNames; 40 using namespace HTMLNames;
40 41
41 HTMLMeterElement::HTMLMeterElement(Document& document) 42 HTMLMeterElement::HTMLMeterElement(Document& document)
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 RefPtrWillBeRawPtr<MeterInnerElement> inner = MeterInnerElement::create(docu ment()); 203 RefPtrWillBeRawPtr<MeterInnerElement> inner = MeterInnerElement::create(docu ment());
203 root.appendChild(inner); 204 root.appendChild(inner);
204 205
205 RefPtrWillBeRawPtr<MeterBarElement> bar = MeterBarElement::create(document() ); 206 RefPtrWillBeRawPtr<MeterBarElement> bar = MeterBarElement::create(document() );
206 m_value = MeterValueElement::create(document()); 207 m_value = MeterValueElement::create(document());
207 m_value->setWidthPercentage(0); 208 m_value->setWidthPercentage(0);
208 m_value->updatePseudo(); 209 m_value->updatePseudo();
209 bar->appendChild(m_value); 210 bar->appendChild(m_value);
210 211
211 inner->appendChild(bar); 212 inner->appendChild(bar);
213
214 RefPtrWillBeRawPtr<MeterFallbackElement> fallback = MeterFallbackElement::cr eate(document());
215 fallback->appendChild(HTMLContentElement::create(document()));
216 root.appendChild(fallback.release());
212 } 217 }
213 218
214 void HTMLMeterElement::willAddFirstAuthorShadowRoot() 219 void HTMLMeterElement::willAddFirstAuthorShadowRoot()
215 { 220 {
216 ASSERT(RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled()); 221 ASSERT(RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled());
217 lazyReattachIfAttached(); 222 lazyReattachIfAttached();
218 } 223 }
219 224
220 DEFINE_TRACE(HTMLMeterElement) 225 DEFINE_TRACE(HTMLMeterElement)
221 { 226 {
222 visitor->trace(m_value); 227 visitor->trace(m_value);
223 LabelableElement::trace(visitor); 228 LabelableElement::trace(visitor);
224 } 229 }
225 230
226 } // namespace 231 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698