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

Unified Diff: Source/core/html/HTMLFormControlElement.cpp

Issue 547823002: Track reasons for |Node::SetNeedsStyleRecalc| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use AtomicString Created 6 years, 3 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 | « Source/core/html/HTMLElement.cpp ('k') | Source/core/html/HTMLFrameSetElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFormControlElement.cpp
diff --git a/Source/core/html/HTMLFormControlElement.cpp b/Source/core/html/HTMLFormControlElement.cpp
index 4972a38a1bd7908f3be7cff35fbaaf736b078e9a..6029f3fe1e814339a8d896db5eb0e1bf69de265b 100644
--- a/Source/core/html/HTMLFormControlElement.cpp
+++ b/Source/core/html/HTMLFormControlElement.cpp
@@ -151,7 +151,7 @@ void HTMLFormControlElement::parseAttribute(const QualifiedName& name, const Ato
m_isReadOnly = !value.isNull();
if (wasReadOnly != m_isReadOnly) {
setNeedsWillValidateCheck();
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::fromAttribute(name));
if (renderer() && renderer()->style()->hasAppearance())
RenderTheme::theme().stateChanged(renderer(), ReadOnlyControlState);
}
@@ -187,7 +187,7 @@ void HTMLFormControlElement::requiredAttributeChanged()
setNeedsValidityCheck();
// Style recalculation is needed because style selectors may include
// :required and :optional pseudo-classes.
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::fromAttribute(requiredAttr));
}
bool HTMLFormControlElement::supportsAutofocus() const
@@ -206,7 +206,7 @@ void HTMLFormControlElement::setAutofilled(bool autofilled)
return;
m_isAutofilled = autofilled;
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::ControlValue));
}
static bool shouldAutofocusOnAttach(const HTMLFormControlElement* element)
@@ -402,7 +402,7 @@ void HTMLFormControlElement::setNeedsWillValidateCheck()
m_willValidateInitialized = true;
m_willValidate = newWillValidate;
setNeedsValidityCheck();
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::Validate));
if (!m_willValidate)
hideVisibleValidationMessage();
}
@@ -493,7 +493,7 @@ void HTMLFormControlElement::setNeedsValidityCheck()
bool newIsValid = valid();
if (willValidate() && newIsValid != m_isValid) {
// Update style for pseudo classes such as :valid :invalid.
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Invalid));
}
m_isValid = newIsValid;
« no previous file with comments | « Source/core/html/HTMLElement.cpp ('k') | Source/core/html/HTMLFrameSetElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698