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

Unified Diff: third_party/WebKit/Source/core/paint/ThemePainter.cpp

Issue 2182413005: Merge "Add more UseCounters for -webkit-appearance:button and -webkit-appearance:textfield." to M53. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/ThemePainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/ThemePainter.cpp b/third_party/WebKit/Source/core/paint/ThemePainter.cpp
index 432bb4ea33f5af0dd35e3ba9760a02e877720705..89fd9dd692f8b009c2c98835f656118fb3e612e7 100644
--- a/third_party/WebKit/Source/core/paint/ThemePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/ThemePainter.cpp
@@ -23,6 +23,7 @@
#include "core/InputTypeNames.h"
#include "core/frame/FrameView.h"
+#include "core/frame/UseCounter.h"
#include "core/html/HTMLDataListElement.h"
#include "core/html/HTMLDataListOptionsCollection.h"
#include "core/html/HTMLInputElement.h"
@@ -67,6 +68,19 @@ bool ThemePainter::paint(const LayoutObject& o, const PaintInfo& paintInfo, cons
if (LayoutTheme::theme().shouldUseFallbackTheme(o.styleRef()))
return paintUsingFallbackTheme(o, paintInfo, r);
+ if (part == ButtonPart && o.node()) {
+ UseCounter::count(o.document(), UseCounter::CSSValueAppearanceButtonRendered);
+ if (isHTMLAnchorElement(o.node())) {
+ UseCounter::count(o.document(), UseCounter::CSSValueAppearanceButtonForAnchor);
+ } else if (isHTMLButtonElement(o.node())) {
+ UseCounter::count(o.document(), UseCounter::CSSValueAppearanceButtonForButton);
+ } else if (isHTMLInputElement(o.node()) && toHTMLInputElement(o.node())->isTextButton()) {
+ // Text buttons (type=button, reset, submit) has
+ // -webkit-appearance:push-button by default.
+ UseCounter::count(o.node()->document(), UseCounter::CSSValueAppearanceButtonForOtherButtons);
+ }
+ }
+
if (m_platformTheme) {
switch (part) {
case CheckboxPart:
@@ -162,6 +176,14 @@ bool ThemePainter::paintBorderOnly(const LayoutObject& o, const PaintInfo& paint
// Call the appropriate paint method based off the appearance value.
switch (o.styleRef().appearance()) {
case TextFieldPart:
+ UseCounter::count(o.document(), UseCounter::CSSValueAppearanceTextFieldRendered);
+ if (isHTMLInputElement(o.node())) {
+ HTMLInputElement* input = toHTMLInputElement(o.node());
+ if (input->type() == InputTypeNames::search)
+ UseCounter::count(o.document(), UseCounter::CSSValueAppearanceTextFieldForSearch);
+ else if (input->isTextField())
+ UseCounter::count(o.document(), UseCounter::CSSValueAppearanceTextFieldForTextField);
+ }
return paintTextField(o, paintInfo, r);
case TextAreaPart:
return paintTextArea(o, paintInfo, r);
« 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