Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLOptionElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/HTMLOptionElement.cpp b/third_party/WebKit/Source/core/html/HTMLOptionElement.cpp |
| index 07ba7a7af1bbffe62c550678cbb6e14b3b149caa..c95d5883273a61184f6a0442bef61f1ab6af46ea 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLOptionElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLOptionElement.cpp |
| @@ -267,7 +267,17 @@ bool HTMLOptionElement::selectedForBinding() const |
| void HTMLOptionElement::setSelectedForBinding(bool selected) |
| { |
| + bool wasSelected = m_isSelected; |
| setSelected(selected); |
| + |
| + // As of December 2015, the HTML specification says the dirtiness becomes |
|
tfarina
2015/12/23 23:04:36
is it worth pointing to the link for that specific
|
| + // true by |selected| setter unconditionally. However it caused a real bug, |
| + // crbug.com/570367, and is not compatible with other browsers. |
| + // Firefox seems not to set dirtiness if an option is owned by a select |
| + // element and selectedness is not changed. |
| + if (ownerSelectElement() && wasSelected == m_isSelected) |
| + return; |
| + |
| m_isDirty = true; |
| } |