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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLProgressElement.cpp

Issue 1956293002: Count usage of PROGRESS element with -webkit-appearance:none. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 HTMLProgressElement* HTMLProgressElement::create(Document& document) 52 HTMLProgressElement* HTMLProgressElement::create(Document& document)
53 { 53 {
54 HTMLProgressElement* progress = new HTMLProgressElement(document); 54 HTMLProgressElement* progress = new HTMLProgressElement(document);
55 progress->ensureUserAgentShadowRoot(); 55 progress->ensureUserAgentShadowRoot();
56 return progress; 56 return progress;
57 } 57 }
58 58
59 LayoutObject* HTMLProgressElement::createLayoutObject(const ComputedStyle& style ) 59 LayoutObject* HTMLProgressElement::createLayoutObject(const ComputedStyle& style )
60 { 60 {
61 if (!style.hasAppearance() || openShadowRoot()) 61 if (!style.hasAppearance()) {
62 UseCounter::count(document(), UseCounter::ProgressElementWithNoneAppeara nce);
62 return LayoutObject::createObject(this, style); 63 return LayoutObject::createObject(this, style);
64 }
65 UseCounter::count(document(), UseCounter::ProgressElementWithProgressBarAppe arance);
63 return new LayoutProgress(this); 66 return new LayoutProgress(this);
64 } 67 }
65 68
66 LayoutProgress* HTMLProgressElement::layoutProgress() const 69 LayoutProgress* HTMLProgressElement::layoutProgress() const
67 { 70 {
68 if (layoutObject() && layoutObject()->isProgress()) 71 if (layoutObject() && layoutObject()->isProgress())
69 return toLayoutProgress(layoutObject()); 72 return toLayoutProgress(layoutObject());
70 return nullptr; 73 return nullptr;
71 } 74 }
72 75
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 visitor->trace(m_value); 171 visitor->trace(m_value);
169 LabelableElement::trace(visitor); 172 LabelableElement::trace(visitor);
170 } 173 }
171 174
172 void HTMLProgressElement::setValueWidthPercentage(double width) const 175 void HTMLProgressElement::setValueWidthPercentage(double width) const
173 { 176 {
174 m_value->setInlineStyleProperty(CSSPropertyWidth, width, CSSPrimitiveValue:: UnitType::Percentage); 177 m_value->setInlineStyleProperty(CSSPropertyWidth, width, CSSPrimitiveValue:: UnitType::Percentage);
175 } 178 }
176 179
177 } // namespace blink 180 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698