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

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

Issue 547823002: Track reasons for |Node::SetNeedsStyleRecalc| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: reasons as tuple 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
Index: Source/core/html/HTMLInputElement.cpp
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index a58c934315e1f94fc9aa80715d0cf97c9c29e04f..0af0ff538fcc4b4b038a2b948e4d71a6ed75f9bb 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -655,7 +655,7 @@ void HTMLInputElement::parseAttribute(const QualifiedName& name, const AtomicStr
// We only need to setChanged if the form is looking at the default value right now.
if (!hasDirtyValue()) {
updatePlaceholderVisibility(false);
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(StyleChangeReasonForTracing::fromAttribute(valueAttr), SubtreeStyleChange);
}
m_needsToUpdateViewValue = true;
setNeedsValidityCheck();
@@ -695,10 +695,10 @@ void HTMLInputElement::parseAttribute(const QualifiedName& name, const AtomicStr
// time to relayout for this change.
if (m_maxResults != oldResults && (m_maxResults <= 0 || oldResults <= 0))
lazyReattachIfAttached();
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(StyleChangeReasonForTracing::fromAttribute(resultsAttr), SubtreeStyleChange);
UseCounter::count(document(), UseCounter::ResultsAttribute);
} else if (name == incrementalAttr) {
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(StyleChangeReasonForTracing::fromAttribute(incrementalAttr), SubtreeStyleChange);
UseCounter::count(document(), UseCounter::IncrementalAttribute);
} else if (name == minAttr) {
m_inputTypeView->minOrMaxAttributeChanged();
@@ -843,10 +843,11 @@ void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
if (checked() == nowChecked)
return;
+ const StyleChangeReasonForTracing styleChangeReason = StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Checked);
RefPtrWillBeRawPtr<HTMLInputElement> protector(this);
m_reflectsCheckedAttribute = false;
m_isChecked = nowChecked;
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(styleChangeReason, SubtreeStyleChange);
if (RadioButtonGroupScope* scope = radioButtonGroupScope())
scope->updateCheckedState(this);
@@ -875,7 +876,7 @@ void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
dispatchFormControlChangeEvent();
}
- didAffectSelector(AffectedSelectorChecked);
+ didAffectSelector(styleChangeReason, AffectedSelectorChecked);
}
void HTMLInputElement::setIndeterminate(bool newValue)
@@ -885,7 +886,7 @@ void HTMLInputElement::setIndeterminate(bool newValue)
m_isIndeterminate = newValue;
- didAffectSelector(AffectedSelectorIndeterminate);
+ didAffectSelector(StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Indeterminate), AffectedSelectorIndeterminate);
if (renderer() && renderer()->style()->hasAppearance())
RenderTheme::theme().stateChanged(renderer(), CheckedControlState);
@@ -960,7 +961,7 @@ void HTMLInputElement::setSuggestedValue(const String& value)
return;
m_needsToUpdateViewValue = true;
m_suggestedValue = sanitizeValue(value);
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(StyleChangeReasonForTracing::create(StyleChangeReason::ControlValue), SubtreeStyleChange);
m_inputTypeView->updateView();
}
@@ -1590,7 +1591,7 @@ void HTMLInputElement::parseMaxLengthAttribute(const AtomicString& value)
m_maxLength = maxLength;
if (oldMaxLength != maxLength)
updateValueIfNeeded();
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(StyleChangeReasonForTracing::fromAttribute(maxlengthAttr), SubtreeStyleChange);
setNeedsValidityCheck();
}

Powered by Google App Engine
This is Rietveld 408576698