| Differences between
and this patch
- a/LayoutTests/fast/dom/NodeList/script-tests/nodelist-item-call-as-function.js -1 / +1 lines
Lines 1-5 a/LayoutTests/fast/dom/NodeList/script-tests/nodelist-item-call-as-function.js_sec1
1
description('This tests that items in a NodeList cannot be called indexed using [[Call]].');
1
description('This tests that items in a NodeList cannot be called indexed using [[Call]].');
2
2
3
var nodeList = document.getElementsByTagName('div');
3
var nodeList = document.childNodes;
4
shouldThrow("nodeList(0)");
4
shouldThrow("nodeList(0)");
5
5
- a/LayoutTests/fast/dom/domListEnumeration-expected.txt -1 / +1 lines
Lines 5-11 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE a/LayoutTests/fast/dom/domListEnumeration-expected.txt_sec1
5
5
6
6
7
[object NodeList]
7
[object NodeList]
8
PASS resultArray.length is 5
8
PASS resultArray.length is 11
9
PASS resultArray[0].i is '0'
9
PASS resultArray[0].i is '0'
10
PASS resultArray[0].item is nodeList.item(0)
10
PASS resultArray[0].item is nodeList.item(0)
11
PASS resultArray[1].i is '1'
11
PASS resultArray[1].i is '1'
- a/LayoutTests/fast/dom/named-items-with-symbol-name-expected.txt -1 / +1 lines
Lines 9-15 PASS querySelectorAllList[Symbol()] === undefined is true a/LayoutTests/fast/dom/named-items-with-symbol-name-expected.txt_sec1
9
PASS querySelectorAllList[Symbol('div')] === undefined is true
9
PASS querySelectorAllList[Symbol('div')] === undefined is true
10
PASS querySelectorAllList['Symbol(div)'] instanceof HTMLDivElement is true
10
PASS querySelectorAllList['Symbol(div)'] instanceof HTMLDivElement is true
11
11
12
[object NodeList]
12
[object HTMLCollection]
13
PASS getElementsByTagNameList.length === 4 is true
13
PASS getElementsByTagNameList.length === 4 is true
14
PASS getElementsByTagNameList[Symbol()] === undefined is true
14
PASS getElementsByTagNameList[Symbol()] === undefined is true
15
PASS getElementsByTagNameList[Symbol('div')] === undefined is true
15
PASS getElementsByTagNameList[Symbol('div')] === undefined is true
- a/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt -1 / +1 lines
Lines 50-56 PASS nonNumericPolicy('document.createEvent("MouseEvent").initMouseEvent("a", fa a/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt_sec1
50
PASS nonNumericPolicy('document.createEvent("MouseEvent").initMouseEvent("a", false, false, null, 0, 0, 0, 0, 0, false, false, false, false, x, null)') is 'any type allowed'
50
PASS nonNumericPolicy('document.createEvent("MouseEvent").initMouseEvent("a", false, false, null, 0, 0, 0, 0, 0, false, false, false, false, x, null)') is 'any type allowed'
51
PASS nonNumericPolicy('document.body.attributes.item(x)') is 'any type allowed'
51
PASS nonNumericPolicy('document.body.attributes.item(x)') is 'any type allowed'
52
PASS nonNumericPolicy('document.createNodeIterator(document, x, null, false)') is 'any type allowed'
52
PASS nonNumericPolicy('document.createNodeIterator(document, x, null, false)') is 'any type allowed'
53
PASS nonNumericPolicy('document.getElementsByTagName("div").item(x)') is 'any type allowed (but not omitted)'
53
FAIL nonNumericPolicy('document.getElementsByTagName("div").item(x)') should be any type allowed (but not omitted). Was any type allowed.
54
PASS nonNumericPolicy('document.createRange().setStart(document, x)') is 'any type allowed'
54
PASS nonNumericPolicy('document.createRange().setStart(document, x)') is 'any type allowed'
55
PASS nonNumericPolicy('document.createRange().setEnd(document, x)') is 'any type allowed'
55
PASS nonNumericPolicy('document.createRange().setEnd(document, x)') is 'any type allowed'
56
PASS nonNumericPolicy('document.createRange().comparePoint(document, x)') is 'any type allowed'
56
PASS nonNumericPolicy('document.createRange().comparePoint(document, x)') is 'any type allowed'
- a/LayoutTests/fast/dom/script-tests/domListEnumeration.js -2 / +2 lines
Lines 94-103 setup(); a/LayoutTests/fast/dom/script-tests/domListEnumeration.js_sec1
94
var resultArray = new Array();
94
var resultArray = new Array();
95
95
96
// NodeList
96
// NodeList
97
var nodeList = document.getElementsByTagName('ol');
97
var nodeList = testingGround.childNodes;
98
resultArray = iterateList(nodeList);
98
resultArray = iterateList(nodeList);
99
99
100
shouldBe("resultArray.length", "5");
100
shouldBe("resultArray.length", "11");
101
shouldBe("resultArray[0].i", "'0'");
101
shouldBe("resultArray[0].i", "'0'");
102
shouldBe("resultArray[0].item", "nodeList.item(0)");
102
shouldBe("resultArray[0].item", "nodeList.item(0)");
103
shouldBe("resultArray[1].i", "'1'");
103
shouldBe("resultArray[1].i", "'1'");
- a/LayoutTests/fast/dom/wrapper-classes-expected.txt -3 / +3 lines
Lines 23-31 PASS jsWrapperClass(root.attributes.constructor) is 'NamedNodeMapConstructor' a/LayoutTests/fast/dom/wrapper-classes-expected.txt_sec1
23
PASS jsWrapperClass(document.createNodeIterator(root, 0, null, false)) is 'NodeIterator'
23
PASS jsWrapperClass(document.createNodeIterator(root, 0, null, false)) is 'NodeIterator'
24
PASS jsWrapperClass(document.createNodeIterator(root, 0, null, false).__proto__) is 'NodeIteratorPrototype'
24
PASS jsWrapperClass(document.createNodeIterator(root, 0, null, false).__proto__) is 'NodeIteratorPrototype'
25
PASS jsWrapperClass(document.createNodeIterator(root, 0, null, false).constructor) is 'NodeIteratorConstructor'
25
PASS jsWrapperClass(document.createNodeIterator(root, 0, null, false).constructor) is 'NodeIteratorConstructor'
26
PASS jsWrapperClass(document.getElementsByTagName('div')) is 'NodeList'
26
PASS jsWrapperClass(document.getElementsByTagName('div')) is 'HTMLCollection'
27
PASS jsWrapperClass(document.getElementsByTagName('div').__proto__) is 'NodeListPrototype'
27
PASS jsWrapperClass(document.getElementsByTagName('div').__proto__) is 'HTMLCollectionPrototype'
28
PASS jsWrapperClass(document.getElementsByTagName('div').constructor) is 'NodeListConstructor'
28
PASS jsWrapperClass(document.getElementsByTagName('div').constructor) is 'HTMLCollectionConstructor'
29
PASS jsWrapperClass(document.createRange()) is 'Range'
29
PASS jsWrapperClass(document.createRange()) is 'Range'
30
PASS jsWrapperClass(document.createRange().__proto__) is 'RangePrototype'
30
PASS jsWrapperClass(document.createRange().__proto__) is 'RangePrototype'
31
PASS jsWrapperClass(document.createRange().constructor) is 'RangeConstructor'
31
PASS jsWrapperClass(document.createRange().constructor) is 'RangeConstructor'
- a/LayoutTests/fast/dom/wrapper-classes.html -1 / +1 lines
Lines 78-84 function runTest() a/LayoutTests/fast/dom/wrapper-classes.html_sec1
78
    test("document.implementation", "DOMImplementation");
78
    test("document.implementation", "DOMImplementation");
79
    test("root.attributes", "NamedNodeMap");
79
    test("root.attributes", "NamedNodeMap");
80
    test("document.createNodeIterator(root, 0, null, false)", "NodeIterator");
80
    test("document.createNodeIterator(root, 0, null, false)", "NodeIterator");
81
    test("document.getElementsByTagName('div')", "NodeList");
81
    test("document.getElementsByTagName('div')", "HTMLCollection");
82
    test("document.createRange()", "Range");
82
    test("document.createRange()", "Range");
83
    test("document.createTextNode()", "Text");
83
    test("document.createTextNode()", "Text");
84
    test("document.createTreeWalker(root, 0, null, false)", "TreeWalker");
84
    test("document.createTreeWalker(root, 0, null, false)", "TreeWalker");
- a/Source/WebCore/CMakeLists.txt -1 / +1 lines
Lines 1464-1470 set(WebCore_SOURCES a/Source/WebCore/CMakeLists.txt_sec1
1464
    dom/StaticNodeList.cpp
1464
    dom/StaticNodeList.cpp
1465
    dom/StringCallback.cpp
1465
    dom/StringCallback.cpp
1466
    dom/StyledElement.cpp
1466
    dom/StyledElement.cpp
1467
    dom/TagNodeList.cpp
1467
    dom/TagCollection.cpp
1468
    dom/Text.cpp
1468
    dom/Text.cpp
1469
    dom/TextEvent.cpp
1469
    dom/TextEvent.cpp
1470
    dom/TextNodeTraversal.cpp
1470
    dom/TextNodeTraversal.cpp
- a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj -2 / +2 lines
Lines 15020-15026 a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj_sec1
15020
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
15020
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
15021
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
15021
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
15022
    </ClCompile>
15022
    </ClCompile>
15023
    <ClCompile Include="..\dom\TagNodeList.cpp">
15023
    <ClCompile Include="..\dom\TagCollection.cpp">
15024
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
15024
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
15025
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
15025
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
15026
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
15026
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
Lines 22145-22151 a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj_sec2
22145
    <ClInclude Include="..\dom\StaticNodeList.h" />
22145
    <ClInclude Include="..\dom\StaticNodeList.h" />
22146
    <ClInclude Include="..\dom\StringCallback.h" />
22146
    <ClInclude Include="..\dom\StringCallback.h" />
22147
    <ClInclude Include="..\dom\StyledElement.h" />
22147
    <ClInclude Include="..\dom\StyledElement.h" />
22148
    <ClInclude Include="..\dom\TagNodeList.h" />
22148
    <ClInclude Include="..\dom\TagCollection.h" />
22149
    <ClInclude Include="..\dom\TemplateContentDocumentFragment.h" />
22149
    <ClInclude Include="..\dom\TemplateContentDocumentFragment.h" />
22150
    <ClInclude Include="..\dom\Text.h" />
22150
    <ClInclude Include="..\dom\Text.h" />
22151
    <ClInclude Include="..\dom\TextEvent.h" />
22151
    <ClInclude Include="..\dom\TextEvent.h" />
- a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters -2 / +2 lines
Lines 3333-3339 a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters_sec1
3333
    <ClCompile Include="..\dom\StyledElement.cpp">
3333
    <ClCompile Include="..\dom\StyledElement.cpp">
3334
      <Filter>dom</Filter>
3334
      <Filter>dom</Filter>
3335
    </ClCompile>
3335
    </ClCompile>
3336
    <ClCompile Include="..\dom\TagNodeList.cpp">
3336
    <ClCompile Include="..\dom\TagCollection.cpp">
3337
      <Filter>dom</Filter>
3337
      <Filter>dom</Filter>
3338
    </ClCompile>
3338
    </ClCompile>
3339
    <ClCompile Include="..\dom\Text.cpp">
3339
    <ClCompile Include="..\dom\Text.cpp">
Lines 10460-10466 a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters_sec2
10460
    <ClInclude Include="..\dom\StyledElement.h">
10460
    <ClInclude Include="..\dom\StyledElement.h">
10461
      <Filter>dom</Filter>
10461
      <Filter>dom</Filter>
10462
    </ClInclude>
10462
    </ClInclude>
10463
    <ClInclude Include="..\dom\TagNodeList.h">
10463
    <ClInclude Include="..\dom\TagCollection.h">
10464
      <Filter>dom</Filter>
10464
      <Filter>dom</Filter>
10465
    </ClInclude>
10465
    </ClInclude>
10466
    <ClInclude Include="..\dom\TemplateContentDocumentFragment.h">
10466
    <ClInclude Include="..\dom\TemplateContentDocumentFragment.h">
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj -8 / +8 lines
Lines 1683-1688 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
1683
		45FEA5D0156DDE8C00654101 /* Decimal.h in Headers */ = {isa = PBXBuildFile; fileRef = 45FEA5CE156DDE8C00654101 /* Decimal.h */; settings = {ATTRIBUTES = (Private, ); }; };
1683
		45FEA5D0156DDE8C00654101 /* Decimal.h in Headers */ = {isa = PBXBuildFile; fileRef = 45FEA5CE156DDE8C00654101 /* Decimal.h */; settings = {ATTRIBUTES = (Private, ); }; };
1684
		4634592C1AC2271000ECB71C /* PowerObserverMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */; };
1684
		4634592C1AC2271000ECB71C /* PowerObserverMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */; };
1685
		4634592E1AC2273C00ECB71C /* SharedTimerCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4634592D1AC2273C00ECB71C /* SharedTimerCF.cpp */; };
1685
		4634592E1AC2273C00ECB71C /* SharedTimerCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4634592D1AC2273C00ECB71C /* SharedTimerCF.cpp */; };
1686
		463EB6221B8789E00096ED51 /* TagCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 463EB6201B8789CB0096ED51 /* TagCollection.cpp */; };
1687
		463EB6231B8789E00096ED51 /* TagCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 463EB6211B8789CB0096ED51 /* TagCollection.h */; };
1686
		4669B2871B852A0B000F905F /* JSDOMNamedFlowCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F2768E1B85297F005C2556 /* JSDOMNamedFlowCollectionCustom.cpp */; };
1688
		4669B2871B852A0B000F905F /* JSDOMNamedFlowCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F2768E1B85297F005C2556 /* JSDOMNamedFlowCollectionCustom.cpp */; };
1687
		4689F1AF1267BAE100E8D380 /* FileMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 4689F1AE1267BAE100E8D380 /* FileMetadata.h */; };
1689
		4689F1AF1267BAE100E8D380 /* FileMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 4689F1AE1267BAE100E8D380 /* FileMetadata.h */; };
1688
		46C83EFD1A9BBE2900A79A41 /* GeoNotifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46C83EFB1A9BBE2900A79A41 /* GeoNotifier.cpp */; };
1690
		46C83EFD1A9BBE2900A79A41 /* GeoNotifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46C83EFB1A9BBE2900A79A41 /* GeoNotifier.cpp */; };
Lines 5545-5552 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
5545
		BCE1C4400D9830F4003B02F2 /* JSLocationCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */; };
5547
		BCE1C4400D9830F4003B02F2 /* JSLocationCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */; };
5546
		BCE32B9C1517C0B200F542EC /* RenderMultiColumnSet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE32B9B1517C0B100F542EC /* RenderMultiColumnSet.h */; };
5548
		BCE32B9C1517C0B200F542EC /* RenderMultiColumnSet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE32B9B1517C0B100F542EC /* RenderMultiColumnSet.h */; };
5547
		BCE32B9E1517C22700F542EC /* RenderMultiColumnSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE32B9D1517C22700F542EC /* RenderMultiColumnSet.cpp */; };
5549
		BCE32B9E1517C22700F542EC /* RenderMultiColumnSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE32B9D1517C22700F542EC /* RenderMultiColumnSet.cpp */; };
5548
		BCE3BEC20D222B1D007E06E4 /* TagNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE3BEC00D222B1D007E06E4 /* TagNodeList.cpp */; };
5549
		BCE3BEC30D222B1D007E06E4 /* TagNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE3BEC10D222B1D007E06E4 /* TagNodeList.h */; };
5550
		BCE4389C140B1BA8005E437E /* JSDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE4389B140B1BA7005E437E /* JSDictionary.h */; settings = {ATTRIBUTES = (Private, ); }; };
5550
		BCE4389C140B1BA8005E437E /* JSDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE4389B140B1BA7005E437E /* JSDictionary.h */; settings = {ATTRIBUTES = (Private, ); }; };
5551
		BCE438A2140C0DC0005E437E /* JSDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE438A1140C0DBF005E437E /* JSDictionary.cpp */; };
5551
		BCE438A2140C0DC0005E437E /* JSDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE438A1140C0DBF005E437E /* JSDictionary.cpp */; };
5552
		BCE4413312F748E2009B84B8 /* RenderCombineText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE4413112F748E2009B84B8 /* RenderCombineText.cpp */; };
5552
		BCE4413312F748E2009B84B8 /* RenderCombineText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE4413112F748E2009B84B8 /* RenderCombineText.cpp */; };
Lines 8928-8933 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
8928
		45FEA5CE156DDE8C00654101 /* Decimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Decimal.h; sourceTree = "<group>"; };
8928
		45FEA5CE156DDE8C00654101 /* Decimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Decimal.h; sourceTree = "<group>"; };
8929
		4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PowerObserverMac.cpp; sourceTree = "<group>"; };
8929
		4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PowerObserverMac.cpp; sourceTree = "<group>"; };
8930
		4634592D1AC2273C00ECB71C /* SharedTimerCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedTimerCF.cpp; sourceTree = "<group>"; };
8930
		4634592D1AC2273C00ECB71C /* SharedTimerCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedTimerCF.cpp; sourceTree = "<group>"; };
8931
		463EB6201B8789CB0096ED51 /* TagCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagCollection.cpp; sourceTree = "<group>"; };
8932
		463EB6211B8789CB0096ED51 /* TagCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagCollection.h; sourceTree = "<group>"; };
8931
		4689F1AE1267BAE100E8D380 /* FileMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMetadata.h; sourceTree = "<group>"; };
8933
		4689F1AE1267BAE100E8D380 /* FileMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMetadata.h; sourceTree = "<group>"; };
8932
		46C83EFB1A9BBE2900A79A41 /* GeoNotifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeoNotifier.cpp; sourceTree = "<group>"; };
8934
		46C83EFB1A9BBE2900A79A41 /* GeoNotifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeoNotifier.cpp; sourceTree = "<group>"; };
8933
		46C83EFC1A9BBE2900A79A41 /* GeoNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeoNotifier.h; sourceTree = "<group>"; };
8935
		46C83EFC1A9BBE2900A79A41 /* GeoNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeoNotifier.h; sourceTree = "<group>"; };
Lines 13149-13156 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
13149
		BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSLocationCustom.cpp; sourceTree = "<group>"; };
13151
		BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSLocationCustom.cpp; sourceTree = "<group>"; };
13150
		BCE32B9B1517C0B100F542EC /* RenderMultiColumnSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMultiColumnSet.h; sourceTree = "<group>"; };
13152
		BCE32B9B1517C0B100F542EC /* RenderMultiColumnSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMultiColumnSet.h; sourceTree = "<group>"; };
13151
		BCE32B9D1517C22700F542EC /* RenderMultiColumnSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMultiColumnSet.cpp; sourceTree = "<group>"; };
13153
		BCE32B9D1517C22700F542EC /* RenderMultiColumnSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMultiColumnSet.cpp; sourceTree = "<group>"; };
13152
		BCE3BEC00D222B1D007E06E4 /* TagNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagNodeList.cpp; sourceTree = "<group>"; };
13153
		BCE3BEC10D222B1D007E06E4 /* TagNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagNodeList.h; sourceTree = "<group>"; };
13154
		BCE4389B140B1BA7005E437E /* JSDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDictionary.h; sourceTree = "<group>"; };
13154
		BCE4389B140B1BA7005E437E /* JSDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDictionary.h; sourceTree = "<group>"; };
13155
		BCE438A1140C0DBF005E437E /* JSDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDictionary.cpp; sourceTree = "<group>"; };
13155
		BCE438A1140C0DBF005E437E /* JSDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDictionary.cpp; sourceTree = "<group>"; };
13156
		BCE4413112F748E2009B84B8 /* RenderCombineText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderCombineText.cpp; sourceTree = "<group>"; };
13156
		BCE4413112F748E2009B84B8 /* RenderCombineText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderCombineText.cpp; sourceTree = "<group>"; };
Lines 23487-23494 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
23487
				81AC6C34131C57C20009A7E0 /* StringCallback.idl */,
23487
				81AC6C34131C57C20009A7E0 /* StringCallback.idl */,
23488
				A8C4A7EC09D563270003AC8D /* StyledElement.cpp */,
23488
				A8C4A7EC09D563270003AC8D /* StyledElement.cpp */,
23489
				A8C4A7EB09D563270003AC8D /* StyledElement.h */,
23489
				A8C4A7EB09D563270003AC8D /* StyledElement.h */,
23490
				BCE3BEC00D222B1D007E06E4 /* TagNodeList.cpp */,
23490
				463EB6201B8789CB0096ED51 /* TagCollection.cpp */,
23491
				BCE3BEC10D222B1D007E06E4 /* TagNodeList.h */,
23491
				463EB6211B8789CB0096ED51 /* TagCollection.h */,
23492
				C65046A8167BFB5500CC2A4D /* TemplateContentDocumentFragment.h */,
23492
				C65046A8167BFB5500CC2A4D /* TemplateContentDocumentFragment.h */,
23493
				6550B69B099DF0270090D781 /* Text.cpp */,
23493
				6550B69B099DF0270090D781 /* Text.cpp */,
23494
				6550B69C099DF0270090D781 /* Text.h */,
23494
				6550B69C099DF0270090D781 /* Text.h */,
Lines 24259-24264 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec6
24259
				9746AF2114F4DDE6003E7A71 /* Coordinates.h in Headers */,
24259
				9746AF2114F4DDE6003E7A71 /* Coordinates.h in Headers */,
24260
				CE1252371A15BDBE00864480 /* CoreGraphicsSPI.h in Headers */,
24260
				CE1252371A15BDBE00864480 /* CoreGraphicsSPI.h in Headers */,
24261
				443818001A91B2F8006E04F2 /* CoreMediaSoftLink.h in Headers */,
24261
				443818001A91B2F8006E04F2 /* CoreMediaSoftLink.h in Headers */,
24262
				463EB6231B8789E00096ED51 /* TagCollection.h in Headers */,
24262
				4449A4051A964B0000B64AD5 /* CoreMediaSPI.h in Headers */,
24263
				4449A4051A964B0000B64AD5 /* CoreMediaSPI.h in Headers */,
24263
				1C6466251A12C38E0094603C /* CoreTextSPI.h in Headers */,
24264
				1C6466251A12C38E0094603C /* CoreTextSPI.h in Headers */,
24264
				CE1252431A16C01A00864480 /* CoreUISPI.h in Headers */,
24265
				CE1252431A16C01A00864480 /* CoreUISPI.h in Headers */,
Lines 27118-27124 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec7
27118
				CDA07FC218E0A22B004699FA /* SystemSleepListenerMac.h in Headers */,
27119
				CDA07FC218E0A22B004699FA /* SystemSleepListenerMac.h in Headers */,
27119
				5D5975B319635F1100D00878 /* SystemVersion.h in Headers */,
27120
				5D5975B319635F1100D00878 /* SystemVersion.h in Headers */,
27120
				A8CFF0510A154F09000A4234 /* TableLayout.h in Headers */,
27121
				A8CFF0510A154F09000A4234 /* TableLayout.h in Headers */,
27121
				BCE3BEC30D222B1D007E06E4 /* TagNodeList.h in Headers */,
27122
				F55B3DD61251F12D003EF269 /* TelephoneInputType.h in Headers */,
27122
				F55B3DD61251F12D003EF269 /* TelephoneInputType.h in Headers */,
27123
				7CC564B818BABEA6001B9652 /* TelephoneNumberDetector.h in Headers */,
27123
				7CC564B818BABEA6001B9652 /* TelephoneNumberDetector.h in Headers */,
27124
				C65046A9167BFB5500CC2A4D /* TemplateContentDocumentFragment.h in Headers */,
27124
				C65046A9167BFB5500CC2A4D /* TemplateContentDocumentFragment.h in Headers */,
Lines 29561-29566 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec8
29561
				E1C36D340EB0A094007410BC /* JSWorkerGlobalScopeBase.cpp in Sources */,
29561
				E1C36D340EB0A094007410BC /* JSWorkerGlobalScopeBase.cpp in Sources */,
29562
				E18258AC0EF3CD7000933242 /* JSWorkerGlobalScopeCustom.cpp in Sources */,
29562
				E18258AC0EF3CD7000933242 /* JSWorkerGlobalScopeCustom.cpp in Sources */,
29563
				E1C362F00EAF2AA9007410BC /* JSWorkerLocation.cpp in Sources */,
29563
				E1C362F00EAF2AA9007410BC /* JSWorkerLocation.cpp in Sources */,
29564
				463EB6221B8789E00096ED51 /* TagCollection.cpp in Sources */,
29564
				E1271A590EEECDE400F61213 /* JSWorkerNavigator.cpp in Sources */,
29565
				E1271A590EEECDE400F61213 /* JSWorkerNavigator.cpp in Sources */,
29565
				BC348BD30DB7F804004ABAB9 /* JSXMLHttpRequest.cpp in Sources */,
29566
				BC348BD30DB7F804004ABAB9 /* JSXMLHttpRequest.cpp in Sources */,
29566
				BC348BBE0DB7F531004ABAB9 /* JSXMLHttpRequestCustom.cpp in Sources */,
29567
				BC348BBE0DB7F531004ABAB9 /* JSXMLHttpRequestCustom.cpp in Sources */,
Lines 30503-30509 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec9
30503
				CDA07FBD18E0A16A004699FA /* SystemSleepListener.cpp in Sources */,
30504
				CDA07FBD18E0A16A004699FA /* SystemSleepListener.cpp in Sources */,
30504
				CDA07FC118E0A22B004699FA /* SystemSleepListenerMac.mm in Sources */,
30505
				CDA07FC118E0A22B004699FA /* SystemSleepListenerMac.mm in Sources */,
30505
				5D5975B419635F1100D00878 /* SystemVersion.mm in Sources */,
30506
				5D5975B419635F1100D00878 /* SystemVersion.mm in Sources */,
30506
				BCE3BEC20D222B1D007E06E4 /* TagNodeList.cpp in Sources */,
30507
				F55B3DD51251F12D003EF269 /* TelephoneInputType.cpp in Sources */,
30507
				F55B3DD51251F12D003EF269 /* TelephoneInputType.cpp in Sources */,
30508
				7CC564BA18BAC720001B9652 /* TelephoneNumberDetectorCocoa.cpp in Sources */,
30508
				7CC564BA18BAC720001B9652 /* TelephoneNumberDetectorCocoa.cpp in Sources */,
30509
				7A29BA6A187B7C1D00F29CEB /* TemporaryOpenGLSetting.cpp in Sources */,
30509
				7A29BA6A187B7C1D00F29CEB /* TemporaryOpenGLSetting.cpp in Sources */,
- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp -10 / +4 lines
Lines 956-971 void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildren a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp_sec1
956
                linkedUIElements.append(object);        
956
                linkedUIElements.append(object);        
957
        } 
957
        } 
958
    } else {
958
    } else {
959
        RefPtr<NodeList> list = node->document().getElementsByTagName(inputTag.localName());
959
        for (auto& associateElement : descendantsOfType<HTMLInputElement>(node->document())) {
960
        unsigned length = list->length();
960
            if (associateElement.isRadioButton() && associateElement.name() == input.name()) {
961
        for (unsigned i = 0; i < length; ++i) {
961
                if (AccessibilityObject* object = axObjectCache()->getOrCreate(&associateElement))
962
            Node* item = list->item(i);
962
                    linkedUIElements.append(object);
963
            if (is<HTMLInputElement>(*item)) {
964
                HTMLInputElement& associateElement = downcast<HTMLInputElement>(*item);
965
                if (associateElement.isRadioButton() && associateElement.name() == input.name()) {
966
                    if (AccessibilityObject* object = axObjectCache()->getOrCreate(&associateElement))
967
                        linkedUIElements.append(object);
968
                }
969
            }
963
            }
970
        }
964
        }
971
    }
965
    }
- a/Source/WebCore/bindings/objc/DOMHTML.mm -1 / +1 lines
Lines 146-152 using namespace WebCore; a/Source/WebCore/bindings/objc/DOMHTML.mm_sec1
146
146
147
- (DOMDocumentFragment *)createDocumentFragmentWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL
147
- (DOMDocumentFragment *)createDocumentFragmentWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL
148
{
148
{
149
    return kit(createFragmentFromMarkup(*core(self), markupString, [baseURL absoluteString]).get());
149
    return kit(WTF::getPtr(createFragmentFromMarkup(*core(self), markupString, [baseURL absoluteString])));
150
}
150
}
151
151
152
- (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text
152
- (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text
- a/Source/WebCore/dom/ContainerNode.cpp -7 / +21 lines
Lines 864-888 RefPtr<NodeList> ContainerNode::querySelectorAll(const String& selectors, Except a/Source/WebCore/dom/ContainerNode.cpp_sec1
864
    return nullptr;
864
    return nullptr;
865
}
865
}
866
866
867
RefPtr<NodeList> ContainerNode::getElementsByTagName(const AtomicString& localName)
867
Ref<HTMLCollection> ContainerNode::getElementsByTagName(const AtomicString& localName)
868
{
868
{
869
    if (localName.isNull())
869
    ASSERT(!localName.isNull());
870
        return nullptr;
871
870
872
    if (document().isHTMLDocument())
871
    if (document().isHTMLDocument())
873
        return ensureRareData().ensureNodeLists().addCacheWithAtomicName<HTMLTagNodeList>(*this, localName);
872
        return ensureRareData().ensureNodeLists().addCachedCollection<HTMLTagCollection>(*this, ByHTMLTag, localName);
874
    return ensureRareData().ensureNodeLists().addCacheWithAtomicName<TagNodeList>(*this, localName);
873
    return ensureRareData().ensureNodeLists().addCachedCollection<TagCollection>(*this, ByTag, localName);
875
}
874
}
876
875
877
RefPtr<NodeList> ContainerNode::getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName)
876
RefPtr<NodeList> ContainerNode::getElementsByTagNameForObjC(const AtomicString& localName)
878
{
877
{
879
    if (localName.isNull())
878
    if (localName.isNull())
880
        return nullptr;
879
        return nullptr;
881
880
881
    return getElementsByTagName(localName);
882
}
883
884
Ref<HTMLCollection> ContainerNode::getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName)
885
{
886
    ASSERT(!localName.isNull());
887
882
    if (namespaceURI == starAtom)
888
    if (namespaceURI == starAtom)
883
        return getElementsByTagName(localName);
889
        return getElementsByTagName(localName);
884
890
885
    return ensureRareData().ensureNodeLists().addCacheWithQualifiedName(*this, namespaceURI.isEmpty() ? nullAtom : namespaceURI, localName);
891
    return ensureRareData().ensureNodeLists().addCachedCollectionWithQualifiedName(*this, namespaceURI.isEmpty() ? nullAtom : namespaceURI, localName);
892
}
893
894
RefPtr<NodeList> ContainerNode::getElementsByTagNameNSForObjC(const AtomicString& namespaceURI, const AtomicString& localName)
895
{
896
    if (localName.isNull())
897
        return nullptr;
898
899
    return getElementsByTagNameNS(namespaceURI, localName);
886
}
900
}
887
901
888
Ref<NodeList> ContainerNode::getElementsByName(const String& elementName)
902
Ref<NodeList> ContainerNode::getElementsByName(const String& elementName)
- a/Source/WebCore/dom/ContainerNode.h -2 / +4 lines
Lines 143-150 public: a/Source/WebCore/dom/ContainerNode.h_sec1
143
    Element* querySelector(const String& selectors, ExceptionCode&);
143
    Element* querySelector(const String& selectors, ExceptionCode&);
144
    RefPtr<NodeList> querySelectorAll(const String& selectors, ExceptionCode&);
144
    RefPtr<NodeList> querySelectorAll(const String& selectors, ExceptionCode&);
145
145
146
    RefPtr<NodeList> getElementsByTagName(const AtomicString&);
146
    Ref<HTMLCollection> getElementsByTagName(const AtomicString&);
147
    RefPtr<NodeList> getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName);
147
    RefPtr<NodeList> getElementsByTagNameForObjC(const AtomicString&);
148
    Ref<HTMLCollection> getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName);
149
    RefPtr<NodeList> getElementsByTagNameNSForObjC(const AtomicString& namespaceURI, const AtomicString& localName);
148
    Ref<NodeList> getElementsByName(const String& elementName);
150
    Ref<NodeList> getElementsByName(const String& elementName);
149
    Ref<HTMLCollection> getElementsByClassName(const AtomicString& classNames);
151
    Ref<HTMLCollection> getElementsByClassName(const AtomicString& classNames);
150
    Ref<NodeList> getElementsByClassNameForObjC(const AtomicString& classNames);
152
    Ref<NodeList> getElementsByClassNameForObjC(const AtomicString& classNames);
- a/Source/WebCore/dom/DOMAllInOne.cpp -1 / +1 lines
Lines 144-150 a/Source/WebCore/dom/DOMAllInOne.cpp_sec1
144
#include "StaticNodeList.cpp"
144
#include "StaticNodeList.cpp"
145
#include "StringCallback.cpp"
145
#include "StringCallback.cpp"
146
#include "StyledElement.cpp"
146
#include "StyledElement.cpp"
147
#include "TagNodeList.cpp"
147
#include "TagCollection.cpp"
148
#include "Text.cpp"
148
#include "Text.cpp"
149
#include "TextEvent.cpp"
149
#include "TextEvent.cpp"
150
#include "TextNodeTraversal.cpp"
150
#include "TextNodeTraversal.cpp"
- a/Source/WebCore/dom/Document.idl -3 / +12 lines
Lines 40-46 a/Source/WebCore/dom/Document.idl_sec1
40
                                                                                 [Default=Undefined] optional DOMString data);
40
                                                                                 [Default=Undefined] optional DOMString data);
41
    [ReturnNewObject, RaisesException] Attr createAttribute([Default=Undefined] optional DOMString name);
41
    [ReturnNewObject, RaisesException] Attr createAttribute([Default=Undefined] optional DOMString name);
42
    [ReturnNewObject, RaisesException] EntityReference createEntityReference([Default=Undefined] optional DOMString name);
42
    [ReturnNewObject, RaisesException] EntityReference createEntityReference([Default=Undefined] optional DOMString name);
43
    NodeList getElementsByTagName([Default=Undefined] optional DOMString tagname);
43
44
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
45
    [ImplementedAs=getElementsByTagNameForObjC] NodeList getElementsByTagName([Default=Undefined] optional DOMString tagname);
46
#else
47
    HTMLCollection getElementsByTagName([Default=Undefined] optional DOMString tagname);
48
#endif
44
49
45
    // Introduced in DOM Level 2:
50
    // Introduced in DOM Level 2:
46
51
Lines 50-57 a/Source/WebCore/dom/Document.idl_sec2
50
                            [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
55
                            [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
51
    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] Attr createAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
56
    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] Attr createAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
52
                                                                          [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
57
                                                                          [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
53
    [ObjCLegacyUnnamedParameters] NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
58
54
                                                   [Default=Undefined] optional DOMString localName);
59
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
60
    [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, [Default=Undefined] optional DOMString localName);
61
#else
62
    HTMLCollection getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, [Default=Undefined] optional DOMString localName);
63
#endif
55
64
56
    // DOM Level 3 Core
65
    // DOM Level 3 Core
57
66
- a/Source/WebCore/dom/Element.idl -3 / +12 lines
Lines 34-40 a/Source/WebCore/dom/Element.idl_sec1
34
    Attr getAttributeNode([Default=Undefined] optional DOMString name);
34
    Attr getAttributeNode([Default=Undefined] optional DOMString name);
35
    [RaisesException] Attr setAttributeNode([Default=Undefined] optional Attr newAttr);
35
    [RaisesException] Attr setAttributeNode([Default=Undefined] optional Attr newAttr);
36
    [RaisesException] Attr removeAttributeNode([Default=Undefined] optional Attr oldAttr);
36
    [RaisesException] Attr removeAttributeNode([Default=Undefined] optional Attr oldAttr);
37
    NodeList getElementsByTagName([Default=Undefined] optional DOMString name);
37
38
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
39
    [ImplementedAs=getElementsByTagNameForObjC] NodeList getElementsByTagName([Default=Undefined] optional DOMString name);
40
#else
41
    HTMLCollection getElementsByTagName([Default=Undefined] optional DOMString name);
42
#endif
38
43
39
#if !defined(LANGUAGE_OBJECTIVE_C)
44
#if !defined(LANGUAGE_OBJECTIVE_C)
40
    // For ObjC this is defined on Node for legacy support.
45
    // For ObjC this is defined on Node for legacy support.
Lines 51-58 a/Source/WebCore/dom/Element.idl_sec2
51
                                       [Default=Undefined] optional DOMString value);
56
                                       [Default=Undefined] optional DOMString value);
52
    [ObjCLegacyUnnamedParameters] void removeAttributeNS([TreatNullAs=NullString] DOMString namespaceURI,
57
    [ObjCLegacyUnnamedParameters] void removeAttributeNS([TreatNullAs=NullString] DOMString namespaceURI,
53
                                          DOMString localName);
58
                                          DOMString localName);
54
    [ObjCLegacyUnnamedParameters] NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
59
55
                                                   [Default=Undefined] optional DOMString localName);
60
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
61
    [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, [Default=Undefined] optional DOMString localName);
62
#else
63
    HTMLCollection getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, [Default=Undefined] optional DOMString localName);
64
#endif
56
    [ObjCLegacyUnnamedParameters] Attr getAttributeNodeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
65
    [ObjCLegacyUnnamedParameters] Attr getAttributeNodeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
57
                                           [Default=Undefined] optional DOMString localName);
66
                                           [Default=Undefined] optional DOMString localName);
58
    [RaisesException] Attr setAttributeNodeNS([Default=Undefined] optional Attr newAttr);
67
    [RaisesException] Attr setAttributeNodeNS([Default=Undefined] optional Attr newAttr);
- a/Source/WebCore/dom/LiveNodeList.cpp -1 / +1 lines
Lines 27-33 a/Source/WebCore/dom/LiveNodeList.cpp_sec1
27
#include "Element.h"
27
#include "Element.h"
28
#include "ElementTraversal.h"
28
#include "ElementTraversal.h"
29
#include "HTMLCollection.h"
29
#include "HTMLCollection.h"
30
#include "TagNodeList.h"
30
#include "TagCollection.h"
31
31
32
namespace WebCore {
32
namespace WebCore {
33
33
- a/Source/WebCore/dom/Node.cpp -4 / +4 lines
Lines 818-824 void Document::invalidateNodeListAndCollectionCaches(const QualifiedName* attrNa a/Source/WebCore/dom/Node.cpp_sec1
818
        list->invalidateCacheForAttribute(attrName);
818
        list->invalidateCacheForAttribute(attrName);
819
    HashSet<HTMLCollection*> collections = WTF::move(m_collectionsInvalidatedAtDocument);
819
    HashSet<HTMLCollection*> collections = WTF::move(m_collectionsInvalidatedAtDocument);
820
    for (auto* collection : collections)
820
    for (auto* collection : collections)
821
        collection->invalidateCache(attrName);
821
        collection->invalidateCacheForAttribute(attrName);
822
#if !ASSERT_DISABLED
822
#if !ASSERT_DISABLED
823
    m_inInvalidateNodeListAndCollectionCaches = false;
823
    m_inInvalidateNodeListAndCollectionCaches = false;
824
#endif
824
#endif
Lines 1768-1780 void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName) a/Source/WebCore/dom/Node.cpp_sec2
1768
        atomicName.value->invalidateCacheForAttribute(attrName);
1768
        atomicName.value->invalidateCacheForAttribute(attrName);
1769
1769
1770
    for (auto& collection : m_cachedCollections)
1770
    for (auto& collection : m_cachedCollections)
1771
        collection.value->invalidateCache(attrName);
1771
        collection.value->invalidateCacheForAttribute(attrName);
1772
1772
1773
    if (attrName)
1773
    if (attrName)
1774
        return;
1774
        return;
1775
1775
1776
    for (auto& tagNodeList : m_tagNodeListCacheNS)
1776
    for (auto& tagCollection : m_tagCollectionCacheNS)
1777
        tagNodeList.value->invalidateCacheForAttribute(nullptr);
1777
        tagCollection.value->invalidateCacheForAttribute(nullptr);
1778
}
1778
}
1779
1779
1780
void Node::getSubresourceURLs(ListHashSet<URL>& urls) const
1780
void Node::getSubresourceURLs(ListHashSet<URL>& urls) const
- a/Source/WebCore/dom/Node.h -1 / +1 lines
Lines 73-79 class RenderObject; a/Source/WebCore/dom/Node.h_sec1
73
class RenderStyle;
73
class RenderStyle;
74
class SVGQualifiedName;
74
class SVGQualifiedName;
75
class ShadowRoot;
75
class ShadowRoot;
76
class TagNodeList;
76
class TagCollection;
77
77
78
#if ENABLE(INDIE_UI)
78
#if ENABLE(INDIE_UI)
79
class UIRequestEvent;
79
class UIRequestEvent;
- a/Source/WebCore/dom/NodeRareData.h -17 / +15 lines
Lines 32-38 a/Source/WebCore/dom/NodeRareData.h_sec1
32
#include "MutationObserverRegistration.h"
32
#include "MutationObserverRegistration.h"
33
#include "Page.h"
33
#include "Page.h"
34
#include "QualifiedName.h"
34
#include "QualifiedName.h"
35
#include "TagNodeList.h"
35
#include "TagCollection.h"
36
#include <wtf/HashSet.h>
36
#include <wtf/HashSet.h>
37
#include <wtf/text/AtomicString.h>
37
#include <wtf/text/AtomicString.h>
38
38
Lines 48-57 class TreeScope; a/Source/WebCore/dom/NodeRareData.h_sec2
48
48
49
template <class ListType> struct NodeListTypeIdentifier;
49
template <class ListType> struct NodeListTypeIdentifier;
50
template <> struct NodeListTypeIdentifier<NameNodeList> { static int value() { return 0; } };
50
template <> struct NodeListTypeIdentifier<NameNodeList> { static int value() { return 0; } };
51
template <> struct NodeListTypeIdentifier<TagNodeList> { static int value() { return 1; } };
51
template <> struct NodeListTypeIdentifier<RadioNodeList> { static int value() { return 1; } };
52
template <> struct NodeListTypeIdentifier<HTMLTagNodeList> { static int value() { return 2; } };
52
template <> struct NodeListTypeIdentifier<LabelsNodeList> { static int value() { return 2; } };
53
template <> struct NodeListTypeIdentifier<RadioNodeList> { static int value() { return 3; } };
54
template <> struct NodeListTypeIdentifier<LabelsNodeList> { static int value() { return 4; } };
55
53
56
class NodeListsNodeData {
54
class NodeListsNodeData {
57
    WTF_MAKE_NONCOPYABLE(NodeListsNodeData); WTF_MAKE_FAST_ALLOCATED;
55
    WTF_MAKE_NONCOPYABLE(NodeListsNodeData); WTF_MAKE_FAST_ALLOCATED;
Lines 115-121 public: a/Source/WebCore/dom/NodeRareData.h_sec3
115
113
116
    typedef HashMap<std::pair<unsigned char, AtomicString>, LiveNodeList*, NodeListCacheMapEntryHash> NodeListAtomicNameCacheMap;
114
    typedef HashMap<std::pair<unsigned char, AtomicString>, LiveNodeList*, NodeListCacheMapEntryHash> NodeListAtomicNameCacheMap;
117
    typedef HashMap<std::pair<unsigned char, AtomicString>, HTMLCollection*, NodeListCacheMapEntryHash> CollectionCacheMap;
115
    typedef HashMap<std::pair<unsigned char, AtomicString>, HTMLCollection*, NodeListCacheMapEntryHash> CollectionCacheMap;
118
    typedef HashMap<QualifiedName, TagNodeList*> TagNodeListCacheNS;
116
    typedef HashMap<QualifiedName, TagCollection*> TagCollectionCacheNS;
119
117
120
    template<typename T, typename ContainerType>
118
    template<typename T, typename ContainerType>
121
    ALWAYS_INLINE Ref<T> addCacheWithAtomicName(ContainerType& container, const AtomicString& name)
119
    ALWAYS_INLINE Ref<T> addCacheWithAtomicName(ContainerType& container, const AtomicString& name)
Lines 129-142 public: a/Source/WebCore/dom/NodeRareData.h_sec4
129
        return list;
127
        return list;
130
    }
128
    }
131
129
132
    ALWAYS_INLINE Ref<TagNodeList> addCacheWithQualifiedName(ContainerNode& node, const AtomicString& namespaceURI, const AtomicString& localName)
130
    ALWAYS_INLINE Ref<TagCollection> addCachedCollectionWithQualifiedName(ContainerNode& node, const AtomicString& namespaceURI, const AtomicString& localName)
133
    {
131
    {
134
        QualifiedName name(nullAtom, localName, namespaceURI);
132
        QualifiedName name(nullAtom, localName, namespaceURI);
135
        TagNodeListCacheNS::AddResult result = m_tagNodeListCacheNS.fastAdd(name, nullptr);
133
        TagCollectionCacheNS::AddResult result = m_tagCollectionCacheNS.fastAdd(name, nullptr);
136
        if (!result.isNewEntry)
134
        if (!result.isNewEntry)
137
            return *result.iterator->value;
135
            return *result.iterator->value;
138
136
139
        auto list = TagNodeList::create(node, namespaceURI, localName);
137
        auto list = TagCollection::create(node, namespaceURI, localName);
140
        result.iterator->value = list.ptr();
138
        result.iterator->value = list.ptr();
141
        return list;
139
        return list;
142
    }
140
    }
Lines 180-192 public: a/Source/WebCore/dom/NodeRareData.h_sec5
180
        m_atomicNameCaches.remove(namedNodeListKey<NodeListType>(name));
178
        m_atomicNameCaches.remove(namedNodeListKey<NodeListType>(name));
181
    }
179
    }
182
180
183
    void removeCacheWithQualifiedName(LiveNodeList* list, const AtomicString& namespaceURI, const AtomicString& localName)
181
    void removeCachedCollectionWithQualifiedName(HTMLCollection* collection, const AtomicString& namespaceURI, const AtomicString& localName)
184
    {
182
    {
185
        QualifiedName name(nullAtom, localName, namespaceURI);
183
        QualifiedName name(nullAtom, localName, namespaceURI);
186
        ASSERT(list == m_tagNodeListCacheNS.get(name));
184
        ASSERT(collection == m_tagCollectionCacheNS.get(name));
187
        if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(list->ownerNode()))
185
        if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(collection->ownerNode()))
188
            return;
186
            return;
189
        m_tagNodeListCacheNS.remove(name);
187
        m_tagCollectionCacheNS.remove(name);
190
    }
188
    }
191
189
192
    void removeCachedCollection(HTMLCollection* collection, const AtomicString& name = starAtom)
190
    void removeCachedCollection(HTMLCollection* collection, const AtomicString& name = starAtom)
Lines 200-206 public: a/Source/WebCore/dom/NodeRareData.h_sec6
200
    void invalidateCaches(const QualifiedName* attrName = 0);
198
    void invalidateCaches(const QualifiedName* attrName = 0);
201
    bool isEmpty() const
199
    bool isEmpty() const
202
    {
200
    {
203
        return m_atomicNameCaches.isEmpty() && m_cachedCollections.isEmpty() && m_tagNodeListCacheNS.isEmpty();
201
        return m_atomicNameCaches.isEmpty() && m_cachedCollections.isEmpty() && m_tagCollectionCacheNS.isEmpty();
204
    }
202
    }
205
203
206
    void adoptTreeScope()
204
    void adoptTreeScope()
Lines 219-225 public: a/Source/WebCore/dom/NodeRareData.h_sec7
219
        for (auto& cache : m_atomicNameCaches.values())
217
        for (auto& cache : m_atomicNameCaches.values())
220
            cache->invalidateCache(*oldDocument);
218
            cache->invalidateCache(*oldDocument);
221
219
222
        for (auto& list : m_tagNodeListCacheNS.values()) {
220
        for (auto& list : m_tagCollectionCacheNS.values()) {
223
            ASSERT(!list->isRootedAtDocument());
221
            ASSERT(!list->isRootedAtDocument());
224
            list->invalidateCache(*oldDocument);
222
            list->invalidateCache(*oldDocument);
225
        }
223
        }
Lines 247-253 private: a/Source/WebCore/dom/NodeRareData.h_sec8
247
    EmptyNodeList* m_emptyChildNodeList;
245
    EmptyNodeList* m_emptyChildNodeList;
248
246
249
    NodeListAtomicNameCacheMap m_atomicNameCaches;
247
    NodeListAtomicNameCacheMap m_atomicNameCaches;
250
    TagNodeListCacheNS m_tagNodeListCacheNS;
248
    TagCollectionCacheNS m_tagCollectionCacheNS;
251
    CollectionCacheMap m_cachedCollections;
249
    CollectionCacheMap m_cachedCollections;
252
};
250
};
253
251
Lines 308-314 inline bool NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLas a/Source/WebCore/dom/NodeRareData.h_sec9
308
{
306
{
309
    ASSERT(ownerNode.nodeLists() == this);
307
    ASSERT(ownerNode.nodeLists() == this);
310
    if ((m_childNodeList ? 1 : 0) + (m_emptyChildNodeList ? 1 : 0) + m_atomicNameCaches.size()
308
    if ((m_childNodeList ? 1 : 0) + (m_emptyChildNodeList ? 1 : 0) + m_atomicNameCaches.size()
311
        + m_tagNodeListCacheNS.size() + m_cachedCollections.size() != 1)
309
        + m_tagCollectionCacheNS.size() + m_cachedCollections.size() != 1)
312
        return false;
310
        return false;
313
    ownerNode.clearNodeLists();
311
    ownerNode.clearNodeLists();
314
    return true;
312
    return true;
- a/Source/WebCore/dom/TagCollection.cpp +59 lines
Line 0 a/Source/WebCore/dom/TagCollection.cpp_sec1
1
/*
2
 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3
 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
4
 *           (C) 2001 Dirk Mueller (mueller@kde.org)
5
 * Copyright (C) 2004-2007, 2014, 2015 Apple Inc. All rights reserved.
6
 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7
 *
8
 * This library is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Library General Public
10
 * License as published by the Free Software Foundation; either
11
 * version 2 of the License, or (at your option) any later version.
12
 *
13
 * This library is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Library General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Library General Public License
19
 * along with this library; see the file COPYING.LIB.  If not, write to
20
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
 * Boston, MA 02110-1301, USA.
22
 */
23
24
#include "config.h"
25
#include "TagCollection.h"
26
27
#include "NodeRareData.h"
28
29
namespace WebCore {
30
31
TagCollection::TagCollection(ContainerNode& rootNode, const AtomicString& namespaceURI, const AtomicString& localName)
32
    : CachedHTMLCollection<TagCollection, CollectionTypeTraits<ByTag>::traversalType>(rootNode, ByTag)
33
    , m_namespaceURI(namespaceURI)
34
    , m_localName(localName)
35
{
36
    ASSERT(m_namespaceURI.isNull() || !m_namespaceURI.isEmpty());
37
}
38
39
TagCollection::~TagCollection()
40
{
41
    if (m_namespaceURI == starAtom)
42
        ownerNode().nodeLists()->removeCachedCollection(this, m_localName);
43
    else
44
        ownerNode().nodeLists()->removeCachedCollectionWithQualifiedName(this, m_namespaceURI, m_localName);
45
}
46
47
HTMLTagCollection::HTMLTagCollection(ContainerNode& rootNode, const AtomicString& localName)
48
    : CachedHTMLCollection<HTMLTagCollection, CollectionTypeTraits<ByHTMLTag>::traversalType>(rootNode, ByHTMLTag)
49
    , m_localName(localName)
50
    , m_loweredLocalName(localName.lower())
51
{
52
}
53
54
HTMLTagCollection::~HTMLTagCollection()
55
{
56
    ownerNode().nodeLists()->removeCachedCollection(this, m_localName);
57
}
58
59
} // namespace WebCore
- a/Source/WebCore/dom/TagCollection.h +97 lines
Line 0 a/Source/WebCore/dom/TagCollection.h_sec1
1
/*
2
 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3
 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
4
 *           (C) 2001 Dirk Mueller (mueller@kde.org)
5
 * Copyright (C) 2004-2008, 2014, 2015 Apple Inc. All rights reserved.
6
 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7
 *
8
 * This library is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Library General Public
10
 * License as published by the Free Software Foundation; either
11
 * version 2 of the License, or (at your option) any later version.
12
 *
13
 * This library is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Library General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Library General Public License
19
 * along with this library; see the file COPYING.LIB.  If not, write to
20
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
 * Boston, MA 02110-1301, USA.
22
 */
23
24
#ifndef TagCollection_h
25
#define TagCollection_h
26
27
#include "CachedHTMLCollection.h"
28
#include <wtf/text/AtomicString.h>
29
30
namespace WebCore {
31
32
// HTMLCollection that limits to a particular tag.
33
class TagCollection final : public CachedHTMLCollection<TagCollection, CollectionTypeTraits<ByTag>::traversalType> {
34
public:
35
    static Ref<TagCollection> create(ContainerNode& rootNode, const AtomicString& namespaceURI, const AtomicString& localName)
36
    {
37
        ASSERT(namespaceURI != starAtom);
38
        return adoptRef(*new TagCollection(rootNode, namespaceURI, localName));
39
    }
40
41
    static Ref<TagCollection> create(ContainerNode& rootNode, CollectionType type, const AtomicString& localName)
42
    {
43
        ASSERT(type == ByTag);
44
        return adoptRef(*new TagCollection(rootNode, starAtom, localName));
45
    }
46
47
    virtual ~TagCollection();
48
49
    bool elementMatches(Element&) const;
50
51
protected:
52
    TagCollection(ContainerNode& rootNode, const AtomicString& namespaceURI, const AtomicString& localName);
53
54
    AtomicString m_namespaceURI;
55
    AtomicString m_localName;
56
};
57
58
inline bool TagCollection::elementMatches(Element& element) const
59
{
60
    // Implements http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-getelementsbytagnamens
61
    if (m_localName != starAtom && m_localName != element.localName())
62
        return false;
63
64
    return m_namespaceURI == starAtom || m_namespaceURI == element.namespaceURI();
65
}
66
67
class HTMLTagCollection final : public CachedHTMLCollection<HTMLTagCollection, CollectionTypeTraits<ByHTMLTag>::traversalType> {
68
public:
69
    static Ref<HTMLTagCollection> create(ContainerNode& rootNode, CollectionType type, const AtomicString& localName)
70
    {
71
        ASSERT(type == ByHTMLTag);
72
        return adoptRef(*new HTMLTagCollection(rootNode, localName));
73
    }
74
75
    virtual ~HTMLTagCollection();
76
77
    bool elementMatches(Element&) const;
78
79
private:
80
    HTMLTagCollection(ContainerNode& rootNode, const AtomicString& localName);
81
82
    AtomicString m_localName;
83
    AtomicString m_loweredLocalName;
84
};
85
86
inline bool HTMLTagCollection::elementMatches(Element& element) const
87
{
88
    // Implements http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-getelementsbytagname
89
    if (m_localName == starAtom)
90
        return true;
91
    const AtomicString& localName = element.isHTMLElement() ? m_loweredLocalName : m_localName;
92
    return localName == element.localName();
93
}
94
95
} // namespace WebCore
96
97
#endif // TagCollection_h
- a/Source/WebCore/dom/TagNodeList.cpp -59 lines
Lines 1-59 a/Source/WebCore/dom/TagNodeList.cpp_sec1
1
/*
2
 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3
 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
4
 *           (C) 2001 Dirk Mueller (mueller@kde.org)
5
 * Copyright (C) 2004-2007, 2014 Apple Inc. All rights reserved.
6
 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7
 *
8
 * This library is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Library General Public
10
 * License as published by the Free Software Foundation; either
11
 * version 2 of the License, or (at your option) any later version.
12
 *
13
 * This library is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Library General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Library General Public License
19
 * along with this library; see the file COPYING.LIB.  If not, write to
20
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
 * Boston, MA 02110-1301, USA.
22
 */
23
24
#include "config.h"
25
#include "TagNodeList.h"
26
27
#include "NodeRareData.h"
28
29
namespace WebCore {
30
31
TagNodeList::TagNodeList(ContainerNode& rootNode, const AtomicString& namespaceURI, const AtomicString& localName)
32
    : CachedLiveNodeList(rootNode, DoNotInvalidateOnAttributeChanges)
33
    , m_namespaceURI(namespaceURI)
34
    , m_localName(localName)
35
{
36
    ASSERT(m_namespaceURI.isNull() || !m_namespaceURI.isEmpty());
37
}
38
39
TagNodeList::~TagNodeList()
40
{
41
    if (m_namespaceURI == starAtom)
42
        ownerNode().nodeLists()->removeCacheWithAtomicName(this, m_localName);
43
    else
44
        ownerNode().nodeLists()->removeCacheWithQualifiedName(this, m_namespaceURI, m_localName);
45
}
46
47
HTMLTagNodeList::HTMLTagNodeList(ContainerNode& rootNode, const AtomicString& localName)
48
    : CachedLiveNodeList(rootNode, DoNotInvalidateOnAttributeChanges)
49
    , m_localName(localName)
50
    , m_loweredLocalName(localName.lower())
51
{
52
}
53
54
HTMLTagNodeList::~HTMLTagNodeList()
55
{
56
    ownerNode().nodeLists()->removeCacheWithAtomicName(this, m_localName);
57
}
58
59
} // namespace WebCore
- a/Source/WebCore/dom/TagNodeList.h -98 lines
Lines 1-98 a/Source/WebCore/dom/TagNodeList.h_sec1
1
/*
2
 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3
 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
4
 *           (C) 2001 Dirk Mueller (mueller@kde.org)
5
 * Copyright (C) 2004-2008, 2014 Apple Inc. All rights reserved.
6
 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7
 *
8
 * This library is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Library General Public
10
 * License as published by the Free Software Foundation; either
11
 * version 2 of the License, or (at your option) any later version.
12
 *
13
 * This library is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Library General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Library General Public License
19
 * along with this library; see the file COPYING.LIB.  If not, write to
20
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
 * Boston, MA 02110-1301, USA.
22
 */
23
24
#ifndef TagNodeList_h
25
#define TagNodeList_h
26
27
#include "Element.h"
28
#include "LiveNodeList.h"
29
#include <wtf/text/AtomicString.h>
30
31
namespace WebCore {
32
33
// NodeList that limits to a particular tag.
34
class TagNodeList final : public CachedLiveNodeList<TagNodeList> {
35
public:
36
    static Ref<TagNodeList> create(ContainerNode& rootNode, const AtomicString& namespaceURI, const AtomicString& localName)
37
    {
38
        ASSERT(namespaceURI != starAtom);
39
        return adoptRef(*new TagNodeList(rootNode, namespaceURI, localName));
40
    }
41
42
    static Ref<TagNodeList> create(ContainerNode& rootNode, const AtomicString& localName)
43
    {
44
        return adoptRef(*new TagNodeList(rootNode, starAtom, localName));
45
    }
46
47
    virtual ~TagNodeList();
48
49
    virtual bool elementMatches(Element&) const override;
50
    virtual bool isRootedAtDocument() const override { return false; }
51
52
protected:
53
    TagNodeList(ContainerNode& rootNode, const AtomicString& namespaceURI, const AtomicString& localName);
54
55
    AtomicString m_namespaceURI;
56
    AtomicString m_localName;
57
};
58
59
inline bool TagNodeList::elementMatches(Element& element) const
60
{
61
    // Implements http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-getelementsbytagnamens
62
    if (m_localName != starAtom && m_localName != element.localName())
63
        return false;
64
65
    return m_namespaceURI == starAtom || m_namespaceURI == element.namespaceURI();
66
}
67
68
class HTMLTagNodeList final : public CachedLiveNodeList<HTMLTagNodeList> {
69
public:
70
    static Ref<HTMLTagNodeList> create(ContainerNode& rootNode, const AtomicString& localName)
71
    {
72
        return adoptRef(*new HTMLTagNodeList(rootNode, localName));
73
    }
74
75
    virtual ~HTMLTagNodeList();
76
77
    virtual bool elementMatches(Element&) const override;
78
    virtual bool isRootedAtDocument() const override { return false; }
79
80
private:
81
    HTMLTagNodeList(ContainerNode& rootNode, const AtomicString& localName);
82
83
    AtomicString m_localName;
84
    AtomicString m_loweredLocalName;
85
};
86
87
inline bool HTMLTagNodeList::elementMatches(Element& element) const
88
{
89
    // Implements http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-getelementsbytagname
90
    if (m_localName == starAtom)
91
        return true;
92
    const AtomicString& localName = element.isHTMLElement() ? m_loweredLocalName : m_localName;
93
    return localName == element.localName();
94
}
95
96
} // namespace WebCore
97
98
#endif // TagNodeList_h
- a/Source/WebCore/editing/Editor.cpp -4 / +5 lines
Lines 51-56 a/Source/WebCore/editing/Editor.cpp_sec1
51
#include "FrameTree.h"
51
#include "FrameTree.h"
52
#include "FrameView.h"
52
#include "FrameView.h"
53
#include "GraphicsContext.h"
53
#include "GraphicsContext.h"
54
#include "HTMLCollection.h"
54
#include "HTMLFormControlElement.h"
55
#include "HTMLFormControlElement.h"
55
#include "HTMLFrameOwnerElement.h"
56
#include "HTMLFrameOwnerElement.h"
56
#include "HTMLImageElement.h"
57
#include "HTMLImageElement.h"
Lines 3051-3060 void Editor::textDidChangeInTextArea(Element* e) a/Source/WebCore/editing/Editor.cpp_sec2
3051
3052
3052
void Editor::applyEditingStyleToBodyElement() const
3053
void Editor::applyEditingStyleToBodyElement() const
3053
{
3054
{
3054
    RefPtr<NodeList> list = document().getElementsByTagName("body");
3055
    auto collection = document().getElementsByTagName(HTMLNames::bodyTag.localName());
3055
    unsigned len = list->length();
3056
    unsigned length = collection->length();
3056
    for (unsigned i = 0; i < len; i++)
3057
    for (unsigned i = 0; i < length; ++i)
3057
        applyEditingStyleToElement(downcast<Element>(list->item(i)));
3058
        applyEditingStyleToElement(collection->item(i));
3058
}
3059
}
3059
3060
3060
void Editor::applyEditingStyleToElement(Element* element) const
3061
void Editor::applyEditingStyleToElement(Element* element) const
- a/Source/WebCore/editing/markup.cpp -13 / +10 lines
Lines 59-64 a/Source/WebCore/editing/markup.cpp_sec1
59
#include "Settings.h"
59
#include "Settings.h"
60
#include "StyleProperties.h"
60
#include "StyleProperties.h"
61
#include "TextIterator.h"
61
#include "TextIterator.h"
62
#include "TypedElementDescendantIterator.h"
62
#include "VisibleSelection.h"
63
#include "VisibleSelection.h"
63
#include "VisibleUnits.h"
64
#include "VisibleUnits.h"
64
#include "htmlediting.h"
65
#include "htmlediting.h"
Lines 672-700 String createMarkup(const Range& range, Vector<Node*>* nodes, EAnnotateForInterc a/Source/WebCore/editing/markup.cpp_sec2
672
    return createMarkupInternal(range.ownerDocument(), range, nodes, shouldAnnotate, convertBlocksToInlines, shouldResolveURLs);
673
    return createMarkupInternal(range.ownerDocument(), range, nodes, shouldAnnotate, convertBlocksToInlines, shouldResolveURLs);
673
}
674
}
674
675
675
PassRefPtr<DocumentFragment> createFragmentFromMarkup(Document& document, const String& markup, const String& baseURL, ParserContentPolicy parserContentPolicy)
676
Ref<DocumentFragment> createFragmentFromMarkup(Document& document, const String& markup, const String& baseURL, ParserContentPolicy parserContentPolicy)
676
{
677
{
677
    // We use a fake body element here to trick the HTML parser to using the InBody insertion mode.
678
    // We use a fake body element here to trick the HTML parser to using the InBody insertion mode.
678
    RefPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(document);
679
    Ref<HTMLBodyElement> fakeBody = HTMLBodyElement::create(document);
679
    RefPtr<DocumentFragment> fragment = DocumentFragment::create(document);
680
    Ref<DocumentFragment> fragment = DocumentFragment::create(document);
680
681
681
    fragment->parseHTML(markup, fakeBody.get(), parserContentPolicy);
682
    fragment->parseHTML(markup, fakeBody.ptr(), parserContentPolicy);
682
683
683
#if ENABLE(ATTACHMENT_ELEMENT)
684
#if ENABLE(ATTACHMENT_ELEMENT)
684
    // When creating a fragment we must strip the webkit-attachment-path attribute after restoring the File object.
685
    // When creating a fragment we must strip the webkit-attachment-path attribute after restoring the File object.
685
    RefPtr<NodeList> nodes = fragment->getElementsByTagName("attachment");
686
    for (auto& attachment : descendantsOfType<HTMLAttachmentElement>(fragment)) {
686
    for (size_t i = 0; i < nodes->length(); ++i) {
687
        attachment.setFile(File::create(attachment.fastGetAttribute(webkitattachmentpathAttr)).ptr());
687
        if (!is<HTMLAttachmentElement>(*nodes->item(i)))
688
        attachment.removeAttribute(webkitattachmentpathAttr);
688
            continue;
689
        HTMLAttachmentElement& element = downcast<HTMLAttachmentElement>(*nodes->item(i));
690
        element.setFile(File::create(element.fastGetAttribute(webkitattachmentpathAttr)).ptr());
691
        element.removeAttribute(webkitattachmentpathAttr);
692
    }
689
    }
693
#endif
690
#endif
694
    if (!baseURL.isEmpty() && baseURL != blankURL() && baseURL != document.baseURL())
691
    if (!baseURL.isEmpty() && baseURL != blankURL() && baseURL != document.baseURL())
695
        completeURLs(fragment.get(), baseURL);
692
        completeURLs(fragment.ptr(), baseURL);
696
693
697
    return fragment.release();
694
    return fragment;
698
}
695
}
699
696
700
String createMarkup(const Node& node, EChildrenOnly childrenOnly, Vector<Node*>* nodes, EAbsoluteURLs shouldResolveURLs, Vector<QualifiedName>* tagNamesToSkip, EFragmentSerialization fragmentSerialization)
697
String createMarkup(const Node& node, EChildrenOnly childrenOnly, Vector<Node*>* nodes, EAbsoluteURLs shouldResolveURLs, Vector<QualifiedName>* tagNamesToSkip, EFragmentSerialization fragmentSerialization)
- a/Source/WebCore/editing/markup.h -1 / +1 lines
Lines 50-56 enum EAbsoluteURLs { DoNotResolveURLs, ResolveAllURLs, ResolveNonLocalURLs }; a/Source/WebCore/editing/markup.h_sec1
50
enum EFragmentSerialization { HTMLFragmentSerialization, XMLFragmentSerialization };
50
enum EFragmentSerialization { HTMLFragmentSerialization, XMLFragmentSerialization };
51
51
52
WEBCORE_EXPORT PassRefPtr<DocumentFragment> createFragmentFromText(Range& context, const String& text);
52
WEBCORE_EXPORT PassRefPtr<DocumentFragment> createFragmentFromText(Range& context, const String& text);
53
WEBCORE_EXPORT PassRefPtr<DocumentFragment> createFragmentFromMarkup(Document&, const String& markup, const String& baseURL, ParserContentPolicy = AllowScriptingContent);
53
WEBCORE_EXPORT Ref<DocumentFragment> createFragmentFromMarkup(Document&, const String& markup, const String& baseURL, ParserContentPolicy = AllowScriptingContent);
54
PassRefPtr<DocumentFragment> createFragmentForInnerOuterHTML(const String&, Element*, ParserContentPolicy, ExceptionCode&);
54
PassRefPtr<DocumentFragment> createFragmentForInnerOuterHTML(const String&, Element*, ParserContentPolicy, ExceptionCode&);
55
PassRefPtr<DocumentFragment> createFragmentForTransformToFragment(const String&, const String& sourceMIMEType, Document* outputDoc);
55
PassRefPtr<DocumentFragment> createFragmentForTransformToFragment(const String&, const String& sourceMIMEType, Document* outputDoc);
56
PassRefPtr<DocumentFragment> createContextualFragment(const String&, HTMLElement*, ParserContentPolicy, ExceptionCode&);
56
PassRefPtr<DocumentFragment> createContextualFragment(const String&, HTMLElement*, ParserContentPolicy, ExceptionCode&);
- a/Source/WebCore/html/CollectionType.h +2 lines
Lines 52-57 enum CollectionType { a/Source/WebCore/html/CollectionType.h_sec1
52
    MapAreas,
52
    MapAreas,
53
    FormControls,
53
    FormControls,
54
    ByClass,
54
    ByClass,
55
    ByTag,
56
    ByHTMLTag,
55
};
57
};
56
58
57
enum class CollectionTraversalType { Descendants, ChildrenOnly, CustomForwardOnly };
59
enum class CollectionTraversalType { Descendants, ChildrenOnly, CustomForwardOnly };
- a/Source/WebCore/html/GenericCachedHTMLCollection.cpp +2 lines
Lines 72-77 bool GenericCachedHTMLCollection<traversalType>::elementMatches(Element& element a/Source/WebCore/html/GenericCachedHTMLCollection.cpp_sec1
72
    case DocAnchors:
72
    case DocAnchors:
73
        return element.hasTagName(aTag) && element.fastHasAttribute(nameAttr);
73
        return element.hasTagName(aTag) && element.fastHasAttribute(nameAttr);
74
    case ByClass:
74
    case ByClass:
75
    case ByTag:
76
    case ByHTMLTag:
75
    case DocAll:
77
    case DocAll:
76
    case DocumentNamedItems:
78
    case DocumentNamedItems:
77
    case FormControls:
79
    case FormControls:
- a/Source/WebCore/html/HTMLCollection.cpp -1 / +10 lines
Lines 47-52 inline auto HTMLCollection::rootTypeFromCollectionType(CollectionType type) -> R a/Source/WebCore/html/HTMLCollection.cpp_sec1
47
    case FormControls:
47
    case FormControls:
48
        return HTMLCollection::IsRootedAtDocument;
48
        return HTMLCollection::IsRootedAtDocument;
49
    case ByClass:
49
    case ByClass:
50
    case ByTag:
51
    case ByHTMLTag:
50
    case NodeChildren:
52
    case NodeChildren:
51
    case TableTBodies:
53
    case TableTBodies:
52
    case TSectionRows:
54
    case TSectionRows:
Lines 65-70 inline auto HTMLCollection::rootTypeFromCollectionType(CollectionType type) -> R a/Source/WebCore/html/HTMLCollection.cpp_sec2
65
static NodeListInvalidationType invalidationTypeExcludingIdAndNameAttributes(CollectionType type)
67
static NodeListInvalidationType invalidationTypeExcludingIdAndNameAttributes(CollectionType type)
66
{
68
{
67
    switch (type) {
69
    switch (type) {
70
    case ByTag:
71
    case ByHTMLTag:
68
    case DocImages:
72
    case DocImages:
69
    case DocEmbeds:
73
    case DocEmbeds:
70
    case DocForms:
74
    case DocForms:
Lines 120-125 HTMLCollection::~HTMLCollection() a/Source/WebCore/html/HTMLCollection.cpp_sec3
120
    // FIXME: We need a cleaner way to handle this.
124
    // FIXME: We need a cleaner way to handle this.
121
    switch (type()) {
125
    switch (type()) {
122
    case ByClass:
126
    case ByClass:
127
    case ByTag:
128
    case ByHTMLTag:
123
    case WindowNamedItems:
129
    case WindowNamedItems:
124
    case DocumentNamedItems:
130
    case DocumentNamedItems:
125
        break;
131
        break;
Lines 213-220 Vector<Ref<Element>> HTMLCollection::namedItems(const AtomicString& name) const a/Source/WebCore/html/HTMLCollection.cpp_sec4
213
    return elements;
219
    return elements;
214
}
220
}
215
221
216
PassRefPtr<NodeList> HTMLCollection::tags(const String& name)
222
RefPtr<NodeList> HTMLCollection::tags(const String& name)
217
{
223
{
224
    if (name.isNull())
225
        return nullptr;
226
218
    return ownerNode().getElementsByTagName(name);
227
    return ownerNode().getElementsByTagName(name);
219
}
228
}
220
229
- a/Source/WebCore/html/HTMLCollection.h -3 / +3 lines
Lines 66-72 public: a/Source/WebCore/html/HTMLCollection.h_sec1
66
    // DOM API
66
    // DOM API
67
    virtual Element* item(unsigned index) const override = 0; // Tighten return type from NodeList::item().
67
    virtual Element* item(unsigned index) const override = 0; // Tighten return type from NodeList::item().
68
    virtual Element* namedItem(const AtomicString& name) const override = 0; // Tighten return type from NodeList::namedItem().
68
    virtual Element* namedItem(const AtomicString& name) const override = 0; // Tighten return type from NodeList::namedItem().
69
    PassRefPtr<NodeList> tags(const String&);
69
    RefPtr<NodeList> tags(const String&);
70
70
71
    // Non-DOM API
71
    // Non-DOM API
72
    Vector<Ref<Element>> namedItems(const AtomicString& name) const;
72
    Vector<Ref<Element>> namedItems(const AtomicString& name) const;
Lines 77-83 public: a/Source/WebCore/html/HTMLCollection.h_sec2
77
    CollectionType type() const;
77
    CollectionType type() const;
78
    ContainerNode& ownerNode() const;
78
    ContainerNode& ownerNode() const;
79
    ContainerNode& rootNode() const;
79
    ContainerNode& rootNode() const;
80
    void invalidateCache(const QualifiedName* attributeName);
80
    void invalidateCacheForAttribute(const QualifiedName* attributeName);
81
    virtual void invalidateCache(Document&);
81
    virtual void invalidateCache(Document&);
82
82
83
    bool hasNamedElementCache() const;
83
    bool hasNamedElementCache() const;
Lines 191-197 inline Document& HTMLCollection::document() const a/Source/WebCore/html/HTMLCollection.h_sec3
191
    return m_ownerNode->document();
191
    return m_ownerNode->document();
192
}
192
}
193
193
194
inline void HTMLCollection::invalidateCache(const QualifiedName* attributeName)
194
inline void HTMLCollection::invalidateCacheForAttribute(const QualifiedName* attributeName)
195
{
195
{
196
    if (!attributeName || shouldInvalidateTypeOnAttributeChange(invalidationType(), *attributeName))
196
    if (!attributeName || shouldInvalidateTypeOnAttributeChange(invalidationType(), *attributeName))
197
        invalidateCache(document());
197
        invalidateCache(document());
- a/Source/WebCore/html/HTMLPlugInImageElement.cpp -25 / +10 lines
Lines 50-55 a/Source/WebCore/html/HTMLPlugInImageElement.cpp_sec1
50
#include "ShadowRoot.h"
50
#include "ShadowRoot.h"
51
#include "StyleResolver.h"
51
#include "StyleResolver.h"
52
#include "SubframeLoader.h"
52
#include "SubframeLoader.h"
53
#include "TypedElementDescendantIterator.h"
53
#include <JavaScriptCore/APICast.h>
54
#include <JavaScriptCore/APICast.h>
54
#include <JavaScriptCore/JSBase.h>
55
#include <JavaScriptCore/JSBase.h>
55
#include <wtf/HashMap.h>
56
#include <wtf/HashMap.h>
Lines 59-65 namespace WebCore { a/Source/WebCore/html/HTMLPlugInImageElement.cpp_sec2
59
60
60
using namespace HTMLNames;
61
using namespace HTMLNames;
61
62
62
typedef Vector<RefPtr<HTMLPlugInImageElement>> HTMLPlugInImageElementList;
63
typedef Vector<Ref<HTMLPlugInImageElement>> HTMLPlugInImageElementList;
63
typedef HashMap<String, String> MimeTypeToLocalizedStringMap;
64
typedef HashMap<String, String> MimeTypeToLocalizedStringMap;
64
65
65
static const int sizingTinyDimensionThreshold = 40;
66
static const int sizingTinyDimensionThreshold = 40;
Lines 424-443 void HTMLPlugInImageElement::removeSnapshotTimerFired() a/Source/WebCore/html/HTMLPlugInImageElement.cpp_sec3
424
        renderer()->repaint();
425
        renderer()->repaint();
425
}
426
}
426
427
427
static void addPlugInsFromNodeListMatchingPlugInOrigin(HTMLPlugInImageElementList& plugInList, PassRefPtr<NodeList> collection, const String& plugInOrigin, const String& mimeType)
428
{
429
    for (unsigned i = 0, length = collection->length(); i < length; i++) {
430
        Node* node = collection->item(i);
431
        if (is<HTMLPlugInImageElement>(*node)) {
432
            HTMLPlugInImageElement& plugInImageElement = downcast<HTMLPlugInImageElement>(*node);
433
            const URL& loadedURL = plugInImageElement.loadedUrl();
434
            String otherMimeType = plugInImageElement.loadedMimeType();
435
            if (plugInOrigin == loadedURL.host() && mimeType == otherMimeType)
436
                plugInList.append(&plugInImageElement);
437
        }
438
    }
439
}
440
441
void HTMLPlugInImageElement::restartSimilarPlugIns()
428
void HTMLPlugInImageElement::restartSimilarPlugIns()
442
{
429
{
443
    // Restart any other snapshotted plugins in the page with the same origin. Note that they
430
    // Restart any other snapshotted plugins in the page with the same origin. Note that they
Lines 457-475 void HTMLPlugInImageElement::restartSimilarPlugIns() a/Source/WebCore/html/HTMLPlugInImageElement.cpp_sec4
457
        if (!frame->document())
444
        if (!frame->document())
458
            continue;
445
            continue;
459
446
460
        RefPtr<NodeList> plugIns = frame->document()->getElementsByTagName(embedTag.localName());
447
        for (auto& plugInImageElement : descendantsOfType<HTMLPlugInImageElement>(*frame->document())) {
461
        if (plugIns)
448
            const URL& loadedURL = plugInImageElement.loadedUrl();
462
            addPlugInsFromNodeListMatchingPlugInOrigin(similarPlugins, plugIns, plugInOrigin, mimeType);
449
            String otherMimeType = plugInImageElement.loadedMimeType();
463
450
            if (plugInOrigin == loadedURL.host() && mimeType == otherMimeType)
464
        plugIns = frame->document()->getElementsByTagName(objectTag.localName());
451
                similarPlugins.append(plugInImageElement);
465
        if (plugIns)
452
        }
466
            addPlugInsFromNodeListMatchingPlugInOrigin(similarPlugins, plugIns, plugInOrigin, mimeType);
467
    }
453
    }
468
454
469
    for (size_t i = 0, length = similarPlugins.size(); i < length; ++i) {
455
    for (auto& plugInToRestart : similarPlugins) {
470
        HTMLPlugInImageElement* plugInToRestart = similarPlugins[i].get();
471
        if (plugInToRestart->displayState() <= HTMLPlugInElement::DisplayingSnapshot) {
456
        if (plugInToRestart->displayState() <= HTMLPlugInElement::DisplayingSnapshot) {
472
            LOG(Plugins, "%p Plug-in looks similar to a restarted plug-in. Restart.", plugInToRestart);
457
            LOG(Plugins, "%p Plug-in looks similar to a restarted plug-in. Restart.", plugInToRestart.ptr());
473
            plugInToRestart->restartSnapshottedPlugIn();
458
            plugInToRestart->restartSnapshottedPlugIn();
474
        }
459
        }
475
        plugInToRestart->m_snapshotDecision = NeverSnapshot;
460
        plugInToRestart->m_snapshotDecision = NeverSnapshot;
- a/Source/WebCore/html/MediaDocument.cpp -9 / +5 lines
Lines 46-51 a/Source/WebCore/html/MediaDocument.cpp_sec1
46
#include "RawDataDocumentParser.h"
46
#include "RawDataDocumentParser.h"
47
#include "ScriptController.h"
47
#include "ScriptController.h"
48
#include "ShadowRoot.h"
48
#include "ShadowRoot.h"
49
#include "TypedElementDescendantIterator.h"
49
50
50
namespace WebCore {
51
namespace WebCore {
51
52
Lines 160-176 Ref<DocumentParser> MediaDocument::createParser() a/Source/WebCore/html/MediaDocument.cpp_sec2
160
    return MediaDocumentParser::create(*this);
161
    return MediaDocumentParser::create(*this);
161
}
162
}
162
163
163
static inline HTMLVideoElement* descendentVideoElement(ContainerNode& node)
164
static inline HTMLVideoElement* descendantVideoElement(ContainerNode& node)
164
{
165
{
165
    if (is<HTMLVideoElement>(node))
166
    if (is<HTMLVideoElement>(node))
166
        return downcast<HTMLVideoElement>(&node);
167
        return downcast<HTMLVideoElement>(&node);
167
168
168
    RefPtr<NodeList> nodeList = node.getElementsByTagNameNS(videoTag.namespaceURI(), videoTag.localName());
169
    return descendantsOfType<HTMLVideoElement>(node).first();
169
   
170
    if (nodeList->length() > 0)
171
        return downcast<HTMLVideoElement>(nodeList->item(0));
172
173
    return nullptr;
174
}
170
}
175
171
176
static inline HTMLVideoElement* ancestorVideoElement(Node* node)
172
static inline HTMLVideoElement* ancestorVideoElement(Node* node)
Lines 207-213 void MediaDocument::defaultEventHandler(Event* event) a/Source/WebCore/html/MediaDocument.cpp_sec3
207
        return;
203
        return;
208
    ContainerNode& targetContainer = downcast<ContainerNode>(*targetNode);
204
    ContainerNode& targetContainer = downcast<ContainerNode>(*targetNode);
209
    if (event->type() == eventNames().keydownEvent && is<KeyboardEvent>(*event)) {
205
    if (event->type() == eventNames().keydownEvent && is<KeyboardEvent>(*event)) {
210
        HTMLVideoElement* video = descendentVideoElement(targetContainer);
206
        HTMLVideoElement* video = descendantVideoElement(targetContainer);
211
        if (!video)
207
        if (!video)
212
            return;
208
            return;
213
209
Lines 243-249 void MediaDocument::replaceMediaElementTimerFired() a/Source/WebCore/html/MediaDocument.cpp_sec4
243
    htmlBody->setAttribute(marginwidthAttr, "0");
239
    htmlBody->setAttribute(marginwidthAttr, "0");
244
    htmlBody->setAttribute(marginheightAttr, "0");
240
    htmlBody->setAttribute(marginheightAttr, "0");
245
241
246
    if (HTMLVideoElement* videoElement = descendentVideoElement(*htmlBody)) {
242
    if (HTMLVideoElement* videoElement = descendantVideoElement(*htmlBody)) {
247
        RefPtr<Element> element = Document::createElement(embedTag, false);
243
        RefPtr<Element> element = Document::createElement(embedTag, false);
248
        HTMLEmbedElement& embedElement = downcast<HTMLEmbedElement>(*element);
244
        HTMLEmbedElement& embedElement = downcast<HTMLEmbedElement>(*element);
249
245
- a/Source/WebKit/mac/WebView/WebFrame.mm -1 / +1 lines
Lines 868-874 static inline WebDataSource *dataSource(DocumentLoader* loader) a/Source/WebKit/mac/WebView/WebFrame.mm_sec1
868
    if (!document)
868
    if (!document)
869
        return nil;
869
        return nil;
870
870
871
    return kit(createFragmentFromMarkup(*document, markupString, baseURLString, DisallowScriptingContent).get());
871
    return kit(WTF::getPtr(createFragmentFromMarkup(*document, markupString, baseURLString, DisallowScriptingContent)));
872
}
872
}
873
873
874
- (DOMDocumentFragment *)_documentFragmentWithNodesAsParagraphs:(NSArray *)nodes
874
- (DOMDocumentFragment *)_documentFragmentWithNodesAsParagraphs:(NSArray *)nodes
- a/Source/WebKit/win/DOMCoreClasses.cpp -2 / +4 lines
Lines 708-714 HRESULT DOMDocument::getElementsByTagName(_In_ BSTR tagName, _COM_Outptr_opt_ ID a/Source/WebKit/win/DOMCoreClasses.cpp_sec1
708
        return E_FAIL;
708
        return E_FAIL;
709
709
710
    String tagNameString(tagName);
710
    String tagNameString(tagName);
711
    *result = DOMNodeList::createInstance(m_document->getElementsByTagName(tagNameString).get());
711
    RefPtr<WebCore::NodeList> elements = tagNameString.isNull() ? nullptr : m_document->getElementsByTagName(tagNameString);
712
    *result = DOMNodeList::createInstance(elements.get());
712
    return *result ? S_OK : E_FAIL;
713
    return *result ? S_OK : E_FAIL;
713
}
714
}
714
715
Lines 749-755 HRESULT DOMDocument::getElementsByTagNameNS(_In_ BSTR namespaceURI, _In_ BSTR lo a/Source/WebKit/win/DOMCoreClasses.cpp_sec2
749
750
750
    String namespaceURIString(namespaceURI);
751
    String namespaceURIString(namespaceURI);
751
    String localNameString(localName);
752
    String localNameString(localName);
752
    *result = DOMNodeList::createInstance(m_document->getElementsByTagNameNS(namespaceURIString, localNameString).get());
753
    RefPtr<WebCore::NodeList> elements = localNameString.isNull() ? nullptr : m_document->getElementsByTagNameNS(namespaceURIString, localNameString);
754
    *result = DOMNodeList::createInstance(elements.get());
753
    return *result ? S_OK : E_FAIL;
755
    return *result ? S_OK : E_FAIL;
754
}
756
}
755
757

Return to Bug 110611