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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp

Issue 2122613002: Add a use counter for author rules setting display: block on summary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bring patch to head. Update counter value in test. 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
Index: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
index 7cb4edda2987be15d54fa106b4b56ec55a94ce70..71c83cd1b920886c8a47005344ceee9a4472fde1 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -80,6 +80,7 @@
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
+#include "core/frame/UseCounter.h"
#include "core/html/HTMLIFrameElement.h"
#include "core/html/HTMLSlotElement.h"
#include "core/inspector/InspectorInstrumentation.h"
@@ -791,6 +792,16 @@ PassRefPtr<ComputedStyle> StyleResolver::styleForElement(Element* element, const
matchAllRules(state, collector, matchingBehavior != MatchAllRulesExcludingSMIL);
+ // TODO(dominicc): Remove this counter when Issue 590014 is fixed.
+ if (element->hasTagName(HTMLNames::summaryTag)) {
+ MatchedPropertiesRange properties = collector.matchedResult().authorRules();
+ for (auto it = properties.begin(); it != properties.end(); ++it) {
+ CSSValue* value = it->properties->getPropertyCSSValue(CSSPropertyDisplay);
+ if (value && value->isPrimitiveValue() && toCSSPrimitiveValue(*value).getValueID() == CSSValueBlock)
+ UseCounter::count(element->document(), UseCounter::SummaryElementWithDisplayBlockAuthorRule);
+ }
+ }
+
if (element->computedStyle() && element->computedStyle()->textAutosizingMultiplier() != state.style()->textAutosizingMultiplier()) {
// Preserve the text autosizing multiplier on style recalc. Autosizer will update it during layout if needed.
// NOTE: this must occur before applyMatchedProperties for correct computation of font-relative lengths.

Powered by Google App Engine
This is Rietveld 408576698