Changeset 249079 in webkit
- Timestamp:
- Aug 23, 2019, 7:22:28 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/dom/ranges/StaticRange-constructor-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/dom/ranges/StaticRange-constructor.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/StaticRange.cpp (modified) (2 diffs)
-
Source/WebCore/dom/StaticRange.h (modified) (1 diff)
-
Source/WebCore/dom/StaticRange.idl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r248960 r249079 1 2019-08-22 Ryosuke Niwa <rniwa@webkit.org> 2 3 Implement StaticRange constructor 4 https://bugs.webkit.org/show_bug.cgi?id=201055 5 6 Reviewed by Wenson Hsieh. 7 8 Added a test from https://github.com/web-platform-tests/wpt/pull/18619 9 with my review comment addressed. 10 11 * web-platform-tests/dom/interfaces-expected.txt: Rebaselined. 12 * web-platform-tests/dom/ranges/StaticRange-constructor-expected.txt: Added. 13 * web-platform-tests/dom/ranges/StaticRange-constructor.html: Added. 14 1 15 2019-08-21 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt
r235889 r249079 1438 1438 FAIL AbstractRange interface: attribute collapsed assert_own_property: self does not have own property "AbstractRange" expected property "AbstractRange" missing 1439 1439 FAIL StaticRange interface: existence and properties of interface object assert_own_property: should inherit from AbstractRange, but self has no such property expected property "AbstractRange" missing 1440 PASS StaticRange interface object length 1440 FAIL StaticRange interface object length assert_equals: wrong value for StaticRange.length expected 0 but got 1 1441 1441 PASS StaticRange interface object name 1442 1442 FAIL StaticRange interface: existence and properties of interface prototype object assert_own_property: should inherit from AbstractRange, but self has no such property expected property "AbstractRange" missing -
trunk/Source/WebCore/ChangeLog
r249078 r249079 1 2019-08-22 Ryosuke Niwa <rniwa@webkit.org> 2 3 Implement StaticRange constructor 4 https://bugs.webkit.org/show_bug.cgi?id=201055 5 6 Reviewed by Wenson Hsieh. 7 8 Added the constructor to StaticRange per https://github.com/whatwg/dom/pull/778. 9 10 Test: imported/w3c/web-platform-tests/dom/ranges/StaticRange-constructor.html 11 12 * dom/StaticRange.cpp: 13 (WebCore::isDocumentTypeOrAttr): 14 (WebCore::StaticRange::create): 15 * dom/StaticRange.h: 16 * dom/StaticRange.idl: 17 1 18 2019-08-23 Devin Rousso <drousso@apple.com> 2 19 -
trunk/Source/WebCore/dom/StaticRange.cpp
r223728 r249079 27 27 #include "StaticRange.h" 28 28 29 #include "DOMException.h" 29 30 #include "Node.h" 30 31 #include "Range.h" … … 52 53 } 53 54 55 static inline bool isDocumentTypeOrAttr(Node& node) 56 { 57 return node.isDocumentTypeNode() || node.isAttributeNode(); 58 } 59 60 ExceptionOr<Ref<StaticRange>> StaticRange::create(Init&& init) 61 { 62 ASSERT(init.startContainer); 63 ASSERT(init.endContainer); 64 if (isDocumentTypeOrAttr(*init.startContainer) || isDocumentTypeOrAttr(*init.endContainer)) 65 return Exception { InvalidNodeTypeError }; 66 return StaticRange::create(init.startContainer.releaseNonNull(), init.startOffset, init.endContainer.releaseNonNull(), init.endOffset); 67 } 68 54 69 Node* StaticRange::startContainer() const 55 70 { -
trunk/Source/WebCore/dom/StaticRange.h
r218593 r249079 41 41 static Ref<StaticRange> create(Ref<Node>&& startContainer, unsigned startOffset, Ref<Node>&& endContainer, unsigned endOffset); 42 42 43 struct Init { 44 RefPtr<Node> startContainer; 45 unsigned long startOffset { 0 }; 46 RefPtr<Node> endContainer; 47 unsigned long endOffset { 0 }; 48 }; 49 50 static ExceptionOr<Ref<StaticRange>> create(Init&&); 51 43 52 unsigned startOffset() const { return m_startOffset; } 44 53 unsigned endOffset() const { return m_endOffset; } -
trunk/Source/WebCore/dom/StaticRange.idl
r207670 r249079 27 27 EnabledAtRuntime=InputEvents, 28 28 ImplementationLacksVTable, 29 Exposed=Window, 30 ConstructorMayThrowException, 31 Constructor(StaticRangeInit staticRangeInitDict), 29 32 ] interface StaticRange { 30 33 readonly attribute unsigned long startOffset; … … 34 37 readonly attribute boolean collapsed; 35 38 }; 39 40 dictionary StaticRangeInit { 41 required Node startContainer; 42 required unsigned long startOffset; 43 required Node endContainer; 44 required unsigned long endOffset; 45 };
Note:
See TracChangeset
for help on using the changeset viewer.