Changeset 212522 in webkit
- Timestamp:
- Feb 16, 2017 8:30:45 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r212470 r212522 1 2017-02-16 Chris Dumez <cdumez@apple.com> 2 3 <input>.labels is empty if type changes from text->hidden->checkbox 4 https://bugs.webkit.org/show_bug.cgi?id=168358 5 6 Reviewed by Ryosuke Niwa. 7 8 Re-sync web-platform-test from: 9 https://github.com/w3c/web-platform-tests/pull/4804 10 11 * web-platform-tests/html/semantics/forms/the-label-element/labelable-elements-expected.txt: 12 * web-platform-tests/html/semantics/forms/the-label-element/labelable-elements.html: 13 1 14 2017-02-16 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-label-element/labelable-elements-expected.txt
r210823 r212522 11 11 PASS Check if the button element can access 'labels' 12 12 PASS Check if the hidden input element is not a labelable element. 13 FAIL Check if the hidden input element can access 'labels' null is not an object (evaluating 'elem.labels.length') 13 PASS Check if the hidden input element has null 'labels' 14 14 PASS Check if the input element in radio state is a labelable element 15 15 PASS Check if the input element in radio state can access 'labels' -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-label-element/labelable-elements.html
r210823 r212522 37 37 38 38 <script> 39 function testLabelsAttr(formElementId, labelElementId , hasLabels) {39 function testLabelsAttr(formElementId, labelElementId) { 40 40 var elem = document.getElementById(formElementId); 41 41 if (labelElementId) { … … 92 92 93 93 test(function() { 94 testLabelsAttr("testHidden", null); 95 }, "Check if the hidden input element can access 'labels'"); 94 var hiddenInput = document.getElementById("testHidden"); 95 assert_equals(hiddenInput.labels, null, "input[type=hidden] must have null .labels"); 96 97 this.add_cleanup(function () { 98 hiddenInput.type = "hidden"; 99 }); 100 101 hiddenInput.type = "text"; 102 testLabelsAttr("testHidden", "lbl5"); 103 var labels = hiddenInput.labels; 104 105 hiddenInput.type = "hidden"; 106 assert_equals(labels.length, 0, "Retained .labels NodeList should be empty after input type changed to hidden"); 107 108 hiddenInput.type = "checkbox"; 109 assert_true(labels === hiddenInput.labels, ".labels property must return the [SameObject] after input type is toggled back from 'hidden'"); 110 assert_equals(hiddenInput.labels.length, 1, ".labels NodeList should contain the input after the input type is changed from 'hidden' to 'checkbox'"); 111 }, "Check if the hidden input element has null 'labels'"); 96 112 97 113 test(function() { -
trunk/Source/WebCore/ChangeLog
r212521 r212522 1 2017-02-16 Chris Dumez <cdumez@apple.com> 2 3 <input>.labels is empty if type changes from text->hidden->checkbox 4 https://bugs.webkit.org/show_bug.cgi?id=168358 5 6 Reviewed by Ryosuke Niwa. 7 8 We were invalidating LabelsNodeLists on 'for' attribute change. 9 We now also invalidate them of 'type' attribute change since 10 HTMLInputElements whose type is 'hidden' do not support labels. 11 12 No new tests, updated existing test. 13 14 * dom/Document.h: 15 * dom/LiveNodeList.h: 16 (WebCore::shouldInvalidateTypeOnAttributeChange): 17 * html/LabelsNodeList.cpp: 18 (WebCore::LabelsNodeList::LabelsNodeList): 19 1 20 2017-02-16 Michael Catanzaro <mcatanzaro@igalia.com> 2 21 -
trunk/Source/WebCore/dom/Document.h
r212463 r212522 231 231 InvalidateOnIdNameAttrChange, 232 232 InvalidateOnNameAttrChange, 233 InvalidateOnFor AttrChange,233 InvalidateOnForTypeAttrChange, 234 234 InvalidateForFormControls, 235 235 InvalidateOnHRefAttrChange, -
trunk/Source/WebCore/dom/LiveNodeList.h
r211591 r212522 114 114 case InvalidateOnIdNameAttrChange: 115 115 return attrName == HTMLNames::idAttr || attrName == HTMLNames::nameAttr; 116 case InvalidateOnFor AttrChange:117 return attrName == HTMLNames::forAttr ;116 case InvalidateOnForTypeAttrChange: 117 return attrName == HTMLNames::forAttr || attrName == HTMLNames::typeAttr; 118 118 case InvalidateForFormControls: 119 119 return attrName == HTMLNames::nameAttr || attrName == HTMLNames::idAttr || attrName == HTMLNames::forAttr -
trunk/Source/WebCore/html/LabelsNodeList.cpp
r173980 r212522 35 35 36 36 LabelsNodeList::LabelsNodeList(LabelableElement& forNode) 37 : CachedLiveNodeList(forNode, InvalidateOnFor AttrChange)37 : CachedLiveNodeList(forNode, InvalidateOnForTypeAttrChange) 38 38 { 39 39 }
Note: See TracChangeset
for help on using the changeset viewer.