Changeset 207319 in webkit
- Timestamp:
- Oct 13, 2016 7:50:07 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 36 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207314 r207319 1 2016-10-13 Chris Dumez <cdumez@apple.com> 2 3 [Web IDL] Add support for [SameObject] extended attribute 4 https://bugs.webkit.org/show_bug.cgi?id=163414 5 6 Reviewed by Darin Adler. 7 8 Add layout test coverage. 9 10 * js/dom/SameObject-support-expected.txt: Added. 11 * js/dom/SameObject-support.html: Added. 12 1 13 2016-10-13 Nan Wang <n_wang@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r207318 r207319 1 2016-10-13 Chris Dumez <cdumez@apple.com> 2 3 [Web IDL] Add support for [SameObject] extended attribute 4 https://bugs.webkit.org/show_bug.cgi?id=163414 5 6 Reviewed by Darin Adler. 7 8 Add support for [SameObject] Web IDL extended attribute: 9 - https://heycam.github.io/webidl/#SameObject 10 11 Start using it on DOM / HTML attributes where the specification 12 mandates it. 13 14 Test: js/dom/SameObject-support.html 15 16 * bindings/scripts/CodeGeneratorJS.pm: 17 (ShouldCacheAttribute): 18 (GenerateHeader): 19 (GenerateImplementation): 20 * bindings/scripts/IDLAttributes.txt: 21 * dom/DataTransfer.idl: 22 * dom/Document.idl: 23 * dom/Element.idl: 24 * dom/MutationRecord.idl: 25 * dom/Node.idl: 26 * dom/NodeIterator.idl: 27 * dom/ParentNode.idl: 28 * dom/TreeWalker.idl: 29 * html/HTMLAnchorElement.idl: 30 * html/HTMLAreaElement.idl: 31 * html/HTMLButtonElement.idl: 32 * html/HTMLDataListElement.idl: 33 * html/HTMLDocument.idl: 34 * html/HTMLElement.idl: 35 * html/HTMLFieldSetElement.idl: 36 * html/HTMLFormElement.idl: 37 * html/HTMLIFrameElement.idl: 38 * html/HTMLInputElement.idl: 39 * html/HTMLKeygenElement.idl: 40 * html/HTMLLinkElement.idl: 41 * html/HTMLMapElement.idl: 42 * html/HTMLMediaElement.idl: 43 * html/HTMLMeterElement.idl: 44 * html/HTMLOutputElement.idl: 45 * html/HTMLProgressElement.idl: 46 * html/HTMLSelectElement.idl: 47 * html/HTMLTableElement.idl: 48 * html/HTMLTableRowElement.idl: 49 * html/HTMLTableSectionElement.idl: 50 * html/HTMLTextAreaElement.idl: 51 * page/Location.idl: 52 * page/Navigator.idl: 53 1 54 2016-10-13 Andy Estes <aestes@apple.com> 2 55 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r207302 r207319 351 351 352 352 return IsDOMGlobalObject($interface); 353 } 354 355 sub ShouldCacheAttribute 356 { 357 my $attribute = shift; 358 359 return 1 if $attribute->signature->extendedAttributes->{CachedAttribute}; 360 return 1 if $attribute->signature->extendedAttributes->{SameObject}; 361 return 0; 353 362 } 354 363 … … 1482 1491 $numCustomAttributes++ if HasCustomGetter($attribute->signature->extendedAttributes); 1483 1492 $numCustomAttributes++ if HasCustomSetter($attribute->signature->extendedAttributes); 1484 if ( $attribute->signature->extendedAttributes->{CachedAttribute}) {1493 if (ShouldCacheAttribute($attribute)) { 1485 1494 my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); 1486 1495 push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; … … 3065 3074 } 3066 3075 3067 $needsVisitChildren = 1 if $attribute->signature->extendedAttributes->{CachedAttribute};3076 $needsVisitChildren = 1 if ShouldCacheAttribute($attribute); 3068 3077 3069 3078 if ($interface->extendedAttributes->{CheckSecurity} && … … 3140 3149 } elsif (!$attribute->signature->extendedAttributes->{GetterMayThrowLegacyException}) { 3141 3150 my $cacheIndex = 0; 3142 if ( $attribute->signature->extendedAttributes->{CachedAttribute}) {3151 if (ShouldCacheAttribute($attribute)) { 3143 3152 $cacheIndex = $currentCachedAttribute; 3144 3153 $currentCachedAttribute++; … … 3183 3192 } 3184 3193 3185 push(@implContent, " thisObject.m_" . $attribute->signature->name . ".set(state.vm(), &thisObject, result);\n") if $attribute->signature->extendedAttributes->{CachedAttribute};3194 push(@implContent, " thisObject.m_" . $attribute->signature->name . ".set(state.vm(), &thisObject, result);\n") if ShouldCacheAttribute($attribute); 3186 3195 push(@implContent, " return result;\n"); 3187 3196 … … 3763 3772 foreach (@{$interface->attributes}) { 3764 3773 my $attribute = $_; 3765 if ( $attribute->signature->extendedAttributes->{CachedAttribute}) {3774 if (ShouldCacheAttribute($attribute)) { 3766 3775 push(@implContent, " visitor.append(&thisObject->m_" . $attribute->signature->name . ");\n"); 3767 3776 } -
trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt
r207302 r207319 115 115 ReportExternalMemoryCost 116 116 RequiresExistingAtomicString 117 SameObject 117 118 SetterCallWith=ScriptExecutionContext|ScriptState|ScriptArguments|CallStack|ActiveWindow|FirstWindow 118 119 SetterMayThrowException -
trunk/Source/WebCore/dom/DataTransfer.idl
r199500 r207319 34 34 35 35 [CustomGetter] readonly attribute Array types; 36 readonly attribute FileList files;36 [SameObject] readonly attribute FileList files; 37 37 38 38 void clearData(optional DOMString type); … … 41 41 void setDragImage(Element? image, long x, long y); // FIXME: Element argument is not nullable in the HTML standard. 42 42 43 // FIXME: Should be [SameObject]. 43 44 [Conditional=DATA_TRANSFER_ITEMS] readonly attribute DataTransferItemList items; 44 45 }; -
trunk/Source/WebCore/dom/Document.idl
r207170 r207319 29 29 ] interface Document : Node { 30 30 readonly attribute DocumentType? doctype; 31 readonly attribute DOMImplementation implementation;31 [SameObject] readonly attribute DOMImplementation implementation; 32 32 readonly attribute Element? documentElement; 33 33 … … 106 106 107 107 readonly attribute HTMLHeadElement? head; 108 readonly attribute HTMLCollection images;109 readonly attribute HTMLCollection applets;110 readonly attribute HTMLCollection links;111 readonly attribute HTMLCollection forms;112 readonly attribute HTMLCollection anchors;113 readonly attribute HTMLCollection embeds;114 readonly attribute HTMLCollection plugins;115 readonly attribute HTMLCollection scripts;108 [SameObject] readonly attribute HTMLCollection images; 109 [SameObject] readonly attribute HTMLCollection applets; 110 [SameObject] readonly attribute HTMLCollection links; 111 [SameObject] readonly attribute HTMLCollection forms; 112 [SameObject] readonly attribute HTMLCollection anchors; 113 [SameObject] readonly attribute HTMLCollection embeds; 114 [SameObject] readonly attribute HTMLCollection plugins; 115 [SameObject] readonly attribute HTMLCollection scripts; 116 116 readonly attribute DOMString lastModified; 117 117 -
trunk/Source/WebCore/dom/Element.idl
r207170 r207319 39 39 HTMLCollection getElementsByTagName(DOMString name); 40 40 41 readonly attribute NamedNodeMap attributes;41 [SameObject] readonly attribute NamedNodeMap attributes; 42 42 boolean hasAttributes(); 43 43 … … 102 102 103 103 [CEReactions, Reflect=class] attribute DOMString className; 104 [ PutForwards=value] readonly attribute DOMTokenList classList;104 [SameObject, PutForwards=value] readonly attribute DOMTokenList classList; 105 105 106 106 [MayThrowLegacyException] boolean matches(DOMString selectors); -
trunk/Source/WebCore/dom/MutationRecord.idl
r197060 r207319 33 33 ] interface MutationRecord { 34 34 readonly attribute DOMString type; 35 readonly attribute Node target;35 [SameObject] readonly attribute Node target; 36 36 37 readonly attribute NodeList addedNodes;38 readonly attribute NodeList removedNodes;37 [SameObject] readonly attribute NodeList addedNodes; 38 [SameObject] readonly attribute NodeList removedNodes; 39 39 readonly attribute Node previousSibling; 40 40 readonly attribute Node nextSibling; -
trunk/Source/WebCore/dom/Node.idl
r207239 r207319 49 49 [DOMJIT, CustomGetter] readonly attribute unsigned short nodeType; 50 50 [DOMJIT] readonly attribute Node? parentNode; 51 readonly attribute NodeList childNodes;51 [SameObject] readonly attribute NodeList childNodes; 52 52 [DOMJIT] readonly attribute Node? firstChild; 53 53 [DOMJIT] readonly attribute Node? lastChild; -
trunk/Source/WebCore/dom/NodeIterator.idl
r204717 r207319 24 24 JSCustomMarkFunction, 25 25 ] interface NodeIterator { 26 readonly attribute Node root;26 [SameObject] readonly attribute Node root; 27 27 readonly attribute unsigned long whatToShow; 28 28 readonly attribute NodeFilter filter; -
trunk/Source/WebCore/dom/ParentNode.idl
r207170 r207319 29 29 NoInterfaceObject, 30 30 ] interface ParentNode { 31 readonly attribute HTMLCollection children;31 [SameObject] readonly attribute HTMLCollection children; 32 32 readonly attribute Element firstElementChild; 33 33 readonly attribute Element lastElementChild; -
trunk/Source/WebCore/dom/TreeWalker.idl
r204717 r207319 24 24 JSCustomMarkFunction, 25 25 ] interface TreeWalker { 26 readonly attribute Node root;26 [SameObject] readonly attribute Node root; 27 27 readonly attribute unsigned long whatToShow; 28 28 readonly attribute NodeFilter filter; -
trunk/Source/WebCore/html/HTMLAnchorElement.idl
r206561 r207319 34 34 attribute DOMString text; 35 35 36 [ PutForwards=value] readonly attribute DOMTokenList relList;36 [SameObject, PutForwards=value] readonly attribute DOMTokenList relList; 37 37 }; 38 38 -
trunk/Source/WebCore/html/HTMLAreaElement.idl
r206630 r207319 30 30 [Conditional=DOWNLOAD_ATTRIBUTE, EnabledAtRuntime=DownloadAttribute, Reflect] attribute DOMString download; 31 31 32 [ PutForwards=value] readonly attribute DOMTokenList relList;32 [SameObject, PutForwards=value] readonly attribute DOMTokenList relList; 33 33 }; 34 34 -
trunk/Source/WebCore/html/HTMLButtonElement.idl
r205839 r207319 40 40 void setCustomValidity(DOMString? error); 41 41 42 readonly attribute NodeList labels;42 [SameObject] readonly attribute NodeList labels; 43 43 }; -
trunk/Source/WebCore/html/HTMLDataListElement.idl
r131172 r207319 32 32 Conditional=DATALIST_ELEMENT, 33 33 ] interface HTMLDataListElement : HTMLElement { 34 readonly attribute HTMLCollection options;34 [SameObject] readonly attribute HTMLCollection options; 35 35 }; -
trunk/Source/WebCore/html/HTMLDocument.idl
r205280 r207319 31 31 [Custom] void writeln(optional DOMString text); 32 32 33 // FIXME: Should be [SameObject]. 33 34 [Custom, Replaceable, Deletable] readonly attribute HTMLAllCollection all; 34 35 -
trunk/Source/WebCore/html/HTMLElement.idl
r206723 r207319 37 37 [Reflect] attribute DOMString webkitdropzone; 38 38 // FIXME: Support the standard HTML equivalent. 39 // [ PutForwards=value] readonly attribute DOMTokenList dropzone;39 // [SameObject, PutForwards=value] readonly attribute DOMTokenList dropzone; 40 40 41 41 [Reflect] attribute boolean hidden; … … 55 55 void blur(); 56 56 57 readonly attribute DOMStringMap dataset;57 [SameObject] readonly attribute DOMStringMap dataset; 58 58 }; 59 59 -
trunk/Source/WebCore/html/HTMLFieldSetElement.idl
r205280 r207319 25 25 readonly attribute DOMString type; 26 26 27 readonly attribute HTMLFormControlsCollection elements;27 [SameObject] readonly attribute HTMLFormControlsCollection elements; 28 28 29 29 readonly attribute boolean willValidate; 30 readonly attribute ValidityStatevalidity;30 [SameObject] readonly attribute ValidityState validity; 31 31 readonly attribute DOMString validationMessage; 32 32 boolean checkValidity(); -
trunk/Source/WebCore/html/HTMLFormElement.idl
r205280 r207319 36 36 [Reflect] attribute DOMString target; 37 37 38 readonly attribute HTMLFormControlsCollection elements;38 [SameObject] readonly attribute HTMLFormControlsCollection elements; 39 39 readonly attribute long length; 40 40 -
trunk/Source/WebCore/html/HTMLIFrameElement.idl
r206723 r207319 28 28 [Reflect] attribute DOMString name; 29 29 30 [ PutForwards=value] readonly attribute DOMTokenList sandbox;30 [SameObject, PutForwards=value] readonly attribute DOMTokenList sandbox; 31 31 [Reflect] attribute boolean allowFullscreen; 32 32 -
trunk/Source/WebCore/html/HTMLInputElement.idl
r206723 r207319 74 74 void setCustomValidity(DOMString? error); 75 75 76 readonly attribute NodeList labels;76 [SameObject] readonly attribute NodeList labels; 77 77 78 78 void select(); -
trunk/Source/WebCore/html/HTMLKeygenElement.idl
r197864 r207319 45 45 void setCustomValidity(DOMString? error); 46 46 47 readonly attribute NodeList labels;47 [SameObject] readonly attribute NodeList labels; 48 48 }; 49 49 -
trunk/Source/WebCore/html/HTMLLinkElement.idl
r204259 r207319 31 31 [Reflect] attribute DOMString rel; 32 32 [Reflect] attribute DOMString rev; 33 [ PutForwards=value] readonly attribute DOMTokenList sizes;33 [SameObject, PutForwards=value] readonly attribute DOMTokenList sizes; 34 34 [Reflect] attribute DOMString target; 35 35 [Reflect] attribute DOMString type; … … 40 40 readonly attribute StyleSheet sheet; 41 41 42 [ PutForwards=value] readonly attribute DOMTokenList relList;42 [SameObject, PutForwards=value] readonly attribute DOMTokenList relList; 43 43 }; 44 44 -
trunk/Source/WebCore/html/HTMLMapElement.idl
r131172 r207319 20 20 21 21 interface HTMLMapElement : HTMLElement { 22 readonly attribute HTMLCollection areas;22 [SameObject] readonly attribute HTMLCollection areas; 23 23 [Reflect] attribute DOMString name; 24 24 }; -
trunk/Source/WebCore/html/HTMLMediaElement.idl
r206983 r207319 96 96 97 97 [Conditional=VIDEO_TRACK, MayThrowLegacyException] TextTrack addTextTrack(DOMString kind, optional DOMString label = "", optional DOMString language = ""); 98 [Conditional=VIDEO_TRACK ] readonly attribute AudioTrackList audioTracks;99 [Conditional=VIDEO_TRACK ] readonly attribute TextTrackList textTracks;100 [Conditional=VIDEO_TRACK ] readonly attribute VideoTrackList videoTracks;98 [Conditional=VIDEO_TRACK, SameObject] readonly attribute AudioTrackList audioTracks; 99 [Conditional=VIDEO_TRACK, SameObject] readonly attribute TextTrackList textTracks; 100 [Conditional=VIDEO_TRACK, SameObject] readonly attribute VideoTrackList videoTracks; 101 101 102 102 [Reflect] attribute DOMString mediaGroup; -
trunk/Source/WebCore/html/HTMLMeterElement.idl
r206243 r207319 27 27 attribute double high; 28 28 attribute double optimum; 29 readonly attribute NodeList labels;29 [SameObject] readonly attribute NodeList labels; 30 30 }; -
trunk/Source/WebCore/html/HTMLOutputElement.idl
r197353 r207319 24 24 25 25 interface HTMLOutputElement : HTMLElement { 26 [ PutForwards=value] readonly attribute DOMTokenList htmlFor;26 [SameObject, PutForwards=value] readonly attribute DOMTokenList htmlFor; 27 27 28 28 readonly attribute HTMLFormElement form; … … 39 39 void setCustomValidity(DOMString? error); 40 40 41 readonly attribute NodeList labels;41 [SameObject] readonly attribute NodeList labels; 42 42 }; -
trunk/Source/WebCore/html/HTMLProgressElement.idl
r206723 r207319 19 19 20 20 interface HTMLProgressElement : HTMLElement { 21 [SetterMayThrowLegacyException] attribute 22 [SetterMayThrowLegacyException] attribute 23 readonly attribute unrestricted double 24 readonly attribute NodeListlabels;21 [SetterMayThrowLegacyException] attribute unrestricted double value; 22 [SetterMayThrowLegacyException] attribute unrestricted double max; 23 readonly attribute unrestricted double position; 24 [SameObject] readonly attribute NodeList labels; 25 25 }; 26 26 -
trunk/Source/WebCore/html/HTMLSelectElement.idl
r206723 r207319 35 35 readonly attribute DOMString type; 36 36 37 readonly attribute HTMLOptionsCollection options;37 [SameObject] readonly attribute HTMLOptionsCollection options; 38 38 [SetterMayThrowLegacyException] attribute unsigned long length; 39 39 … … 51 51 [ImplementedAs=removeByIndex] void remove(long index); 52 52 53 readonly attribute HTMLCollection selectedOptions;53 [SameObject] readonly attribute HTMLCollection selectedOptions; 54 54 attribute long selectedIndex; 55 55 … … 62 62 void setCustomValidity(DOMString? error); // FIXME: Argument should not be nullable. 63 63 64 readonly attribute NodeList labels;64 [SameObject] readonly attribute NodeList labels; 65 65 66 66 attribute DOMString autocomplete; -
trunk/Source/WebCore/html/HTMLTableElement.idl
r206723 r207319 24 24 [SetterMayThrowLegacyException] attribute HTMLTableSectionElement? tFoot; 25 25 26 readonly attribute HTMLCollection rows;27 readonly attribute HTMLCollection tBodies;26 [SameObject] readonly attribute HTMLCollection rows; 27 [SameObject] readonly attribute HTMLCollection tBodies; 28 28 [Reflect] attribute DOMString align; 29 29 [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor; -
trunk/Source/WebCore/html/HTMLTableRowElement.idl
r206723 r207319 22 22 readonly attribute long rowIndex; 23 23 readonly attribute long sectionRowIndex; 24 readonly attribute HTMLCollection cells;24 [SameObject] readonly attribute HTMLCollection cells; 25 25 [Reflect] attribute DOMString align; 26 26 [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor; -
trunk/Source/WebCore/html/HTMLTableSectionElement.idl
r206723 r207319 26 26 [Reflect=charoff] attribute DOMString chOff; 27 27 [Reflect] attribute DOMString vAlign; 28 readonly attribute HTMLCollection rows;28 [SameObject] readonly attribute HTMLCollection rows; 29 29 [MayThrowLegacyException] HTMLElement insertRow(optional long index = -1); 30 30 [MayThrowLegacyException] void deleteRow(long index); -
trunk/Source/WebCore/html/HTMLTextAreaElement.idl
r206723 r207319 46 46 void setCustomValidity(DOMString? error); 47 47 48 readonly attribute NodeList labels;48 [SameObject] readonly attribute NodeList labels; 49 49 50 50 void select(); -
trunk/Source/WebCore/page/Location.idl
r206723 r207319 59 59 readonly attribute USVString origin; 60 60 61 // FIXME: Add support for SameObject 62 [Unforgeable, CachedAttribute] readonly attribute FrozenArray<USVString> ancestorOrigins; 61 [Unforgeable, SameObject] readonly attribute FrozenArray<USVString> ancestorOrigins; 63 62 }; -
trunk/Source/WebCore/page/Navigator.idl
r201970 r207319 21 21 GenerateIsReachable=ImplFrame, 22 22 ] interface Navigator { 23 readonly attribute DOMPluginArray plugins;24 readonly attribute DOMMimeTypeArray mimeTypes;23 [SameObject] readonly attribute DOMPluginArray plugins; 24 [SameObject] readonly attribute DOMMimeTypeArray mimeTypes; 25 25 [Nondeterministic] readonly attribute boolean cookieEnabled; 26 26 [Nondeterministic] boolean javaEnabled();
Note: See TracChangeset
for help on using the changeset viewer.