Changeset 250708 in webkit
- Timestamp:
- Oct 4, 2019 12:34:32 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r250701 r250708 1 2019-10-04 Ryosuke Niwa <rniwa@webkit.org> 2 3 Radio button groups are not scoped by shadow boundaries 4 https://bugs.webkit.org/show_bug.cgi?id=199568 5 6 Reviewed by Antti Koivisto. 7 8 Rebaselined a test now that it passes. 9 10 * web-platform-tests/shadow-dom/input-type-radio-expected.txt: 11 1 12 2019-10-03 Antti Koivisto <antti@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/input-type-radio-expected.txt
r238692 r250708 1 1 2 2 3 FAIL input type=radio elements should form a group inside shadow DOM. assert_true: expected true got false 3 PASS input type=radio elements should form a group inside shadow DOM. 4 4 -
trunk/Source/WebCore/ChangeLog
r250701 r250708 1 2019-10-04 Ryosuke Niwa <rniwa@webkit.org> 2 3 Radio button groups are not scoped by shadow boundaries 4 https://bugs.webkit.org/show_bug.cgi?id=199568 5 6 Reviewed by Antti Koivisto. 7 8 Fixed the bug that radio button groups are not scoped to each shadow tree by moving 9 RadioButtonGroups from FormController, which is a per-document object, to TreeScope. 10 11 Test: imported/w3c/web-platform-tests/shadow-dom/input-type-radio.html 12 13 * dom/RadioButtonGroups.h: 14 (WebCore::RadioButtonGroups): Made this bmalloc'ed now that it's allocated standalone. 15 * dom/TreeScope.cpp: 16 (WebCore::TreeScope::radioButtonGroups): Added. 17 * dom/TreeScope.h: 18 * html/FormController.h: 19 (WebCore::FormController::radioButtonGroups): Deleted. 20 * html/HTMLInputElement.cpp: 21 (WebCore::HTMLInputElement::~HTMLInputElement): 22 (WebCore::HTMLInputElement::removedFromAncestor): Update the radio button group here. 23 (WebCore::HTMLInputElement::didMoveToNewDocument): Removed the code to update radio 24 button group here since it's done in removedFromAncestor now. Note that insertion case 25 is alrady taken care of by HTMLInputElement::didFinishInsertingNode. 26 (WebCore::HTMLInputElement::radioButtonGroups const): Ditto. 27 1 28 2019-10-03 Antti Koivisto <antti@apple.com> 2 29 -
trunk/Source/WebCore/dom/RadioButtonGroups.h
r246490 r250708 32 32 33 33 class RadioButtonGroups { 34 WTF_MAKE_FAST_ALLOCATED; 34 35 public: 35 36 RadioButtonGroups(); -
trunk/Source/WebCore/dom/TreeScope.cpp
r248846 r250708 45 45 #include "PointerLockController.h" 46 46 #include "PseudoElement.h" 47 #include "RadioButtonGroups.h" 47 48 #include "RenderView.h" 48 49 #include "RuntimeEnabledFeatures.h" … … 54 55 55 56 struct SameSizeAsTreeScope { 56 void* pointers[ 9];57 void* pointers[10]; 57 58 }; 58 59 … … 540 541 } 541 542 543 RadioButtonGroups& TreeScope::radioButtonGroups() 544 { 545 if (!m_radioButtonGroups) 546 m_radioButtonGroups = makeUnique<RadioButtonGroups>(); 547 return *m_radioButtonGroups; 548 } 549 542 550 } // namespace WebCore -
trunk/Source/WebCore/dom/TreeScope.h
r246490 r250708 45 45 class IdTargetObserverRegistry; 46 46 class Node; 47 class RadioButtonGroups; 47 48 class ShadowRoot; 48 49 … … 110 111 IdTargetObserverRegistry& idTargetObserverRegistry() const { return *m_idTargetObserverRegistry.get(); } 111 112 113 RadioButtonGroups& radioButtonGroups(); 114 112 115 protected: 113 116 TreeScope(ShadowRoot&, Document&); … … 136 139 137 140 std::unique_ptr<IdTargetObserverRegistry> m_idTargetObserverRegistry; 141 142 std::unique_ptr<RadioButtonGroups> m_radioButtonGroups; 138 143 }; 139 144 -
trunk/Source/WebCore/html/FormController.h
r246490 r250708 22 22 #pragma once 23 23 24 #include "RadioButtonGroups.h"25 24 #include <wtf/Forward.h> 25 #include <wtf/HashMap.h> 26 26 #include <wtf/ListHashSet.h> 27 27 #include <wtf/Vector.h> … … 42 42 FormController(); 43 43 ~FormController(); 44 45 RadioButtonGroups& radioButtonGroups() { return m_radioButtonGroups; }46 44 47 45 void registerFormElementWithState(HTMLFormControlElementWithState&); … … 68 66 static void formStatesFromStateVector(const Vector<String>&, SavedFormStateMap&); 69 67 70 RadioButtonGroups m_radioButtonGroups;71 68 FormElementListHashSet m_formElementsWithState; 72 69 SavedFormStateMap m_savedFormStateMap; -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r249194 r250708 174 174 // That is inelegant, but harmless since we remove it here. 175 175 if (isRadioButton()) 176 document().formController().radioButtonGroups().removeButton(*this);176 treeScope().radioButtonGroups().removeButton(*this); 177 177 178 178 #if ENABLE(TOUCH_EVENTS) … … 1557 1557 void HTMLInputElement::removedFromAncestor(RemovalType removalType, ContainerNode& oldParentOfRemovedTree) 1558 1558 { 1559 if (removalType.treeScopeChanged && isRadioButton()) 1560 oldParentOfRemovedTree.treeScope().radioButtonGroups().removeButton(*this); 1559 1561 if (removalType.disconnectedFromDocument && !form()) 1560 1562 removeFromRadioButtonGroup(); … … 1576 1578 newDocument.registerForDocumentSuspensionCallbacks(*this); 1577 1579 } 1578 1579 // We call this even for radio buttons in forms; it's harmless because the1580 // removeButton function is written to be safe for buttons not in any group.1581 if (isRadioButton())1582 oldDocument.formController().radioButtonGroups().removeButton(*this);1583 1580 1584 1581 #if ENABLE(TOUCH_EVENTS) … … 1923 1920 if (auto* formElement = form()) 1924 1921 return &formElement->radioButtonGroups(); 1925 if (is Connected())1926 return & document().formController().radioButtonGroups();1922 if (isInTreeScope()) 1923 return &treeScope().radioButtonGroups(); 1927 1924 return nullptr; 1928 1925 }
Note: See TracChangeset
for help on using the changeset viewer.