mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
script: Implement Element::GetHTML
and ShadowRoot::GetHTML
(#36106)
* Serialize html fragments without going through html5ever Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement ShadowRoot::GetHtml / Element::GetHtml Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Propagate CanGc annotations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
1c9f486f88
commit
19d5f5f06f
12 changed files with 286 additions and 15941 deletions
|
@ -190,7 +190,7 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
'Element': {
|
||||
'canGc': ['SetHTMLUnsafe', 'SetInnerHTML', 'SetOuterHTML', 'InsertAdjacentHTML', 'GetClientRects', 'GetBoundingClientRect', 'InsertAdjacentText', 'ToggleAttribute', 'SetAttribute', 'SetAttributeNS', 'SetId','SetClassName','Prepend','Append','ReplaceChildren','Before','After','ReplaceWith', 'SetRole', 'SetAriaAtomic', 'SetAriaAutoComplete', 'SetAriaBrailleLabel', 'SetAriaBrailleRoleDescription', 'SetAriaBusy', 'SetAriaChecked', 'SetAriaColCount', 'SetAriaColIndex', 'SetAriaColIndexText', 'SetAriaColSpan', 'SetAriaCurrent', 'SetAriaDescription', 'SetAriaDisabled', 'SetAriaExpanded', 'SetAriaHasPopup', 'SetAriaHidden', 'SetAriaInvalid', 'SetAriaKeyShortcuts', 'SetAriaLabel', 'SetAriaLevel', 'SetAriaLive', 'SetAriaModal', 'SetAriaMultiLine', 'SetAriaMultiSelectable', 'SetAriaOrientation', 'SetAriaPlaceholder', 'SetAriaPosInSet', 'SetAriaPressed','SetAriaReadOnly', 'SetAriaRelevant', 'SetAriaRequired', 'SetAriaRoleDescription', 'SetAriaRowCount', 'SetAriaRowIndex', 'SetAriaRowIndexText', 'SetAriaRowSpan', 'SetAriaSelected', 'SetAriaSetSize','SetAriaSort', 'SetAriaValueMax', 'SetAriaValueMin', 'SetAriaValueNow', 'SetAriaValueText', 'SetScrollTop', 'SetScrollLeft', 'Scroll', 'Scroll_', 'ScrollBy', 'ScrollBy_', 'ScrollWidth', 'ScrollHeight', 'ScrollTop', 'ScrollLeft', 'ClientTop', 'ClientLeft', 'ClientWidth', 'ClientHeight', 'RequestFullscreen'],
|
||||
'canGc': ['SetHTMLUnsafe', 'SetInnerHTML', 'SetOuterHTML', 'InsertAdjacentHTML', 'GetClientRects', 'GetBoundingClientRect', 'InsertAdjacentText', 'ToggleAttribute', 'SetAttribute', 'SetAttributeNS', 'SetId','SetClassName','Prepend','Append','ReplaceChildren','Before','After','ReplaceWith', 'SetRole', 'SetAriaAtomic', 'SetAriaAutoComplete', 'SetAriaBrailleLabel', 'SetAriaBrailleRoleDescription', 'SetAriaBusy', 'SetAriaChecked', 'SetAriaColCount', 'SetAriaColIndex', 'SetAriaColIndexText', 'SetAriaColSpan', 'SetAriaCurrent', 'SetAriaDescription', 'SetAriaDisabled', 'SetAriaExpanded', 'SetAriaHasPopup', 'SetAriaHidden', 'SetAriaInvalid', 'SetAriaKeyShortcuts', 'SetAriaLabel', 'SetAriaLevel', 'SetAriaLive', 'SetAriaModal', 'SetAriaMultiLine', 'SetAriaMultiSelectable', 'SetAriaOrientation', 'SetAriaPlaceholder', 'SetAriaPosInSet', 'SetAriaPressed','SetAriaReadOnly', 'SetAriaRelevant', 'SetAriaRequired', 'SetAriaRoleDescription', 'SetAriaRowCount', 'SetAriaRowIndex', 'SetAriaRowIndexText', 'SetAriaRowSpan', 'SetAriaSelected', 'SetAriaSetSize','SetAriaSort', 'SetAriaValueMax', 'SetAriaValueMin', 'SetAriaValueNow', 'SetAriaValueText', 'SetScrollTop', 'SetScrollLeft', 'Scroll', 'Scroll_', 'ScrollBy', 'ScrollBy_', 'ScrollWidth', 'ScrollHeight', 'ScrollTop', 'ScrollLeft', 'ClientTop', 'ClientLeft', 'ClientWidth', 'ClientHeight', 'RequestFullscreen', 'GetHTML', 'GetInnerHTML', 'GetOuterHTML'],
|
||||
},
|
||||
|
||||
'ElementInternals': {
|
||||
|
@ -530,7 +530,7 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
'ShadowRoot': {
|
||||
'canGc': ['ElementFromPoint', 'ElementsFromPoint', 'SetInnerHTML'],
|
||||
'canGc': ['ElementFromPoint', 'ElementsFromPoint', 'SetInnerHTML', 'GetHTML', 'InnerHTML'],
|
||||
},
|
||||
|
||||
'StaticRange': {
|
||||
|
|
|
@ -120,14 +120,20 @@ partial interface Element {
|
|||
readonly attribute long clientHeight;
|
||||
};
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#extensions-to-the-element-interface
|
||||
// https://html.spec.whatwg.org/multipage/#dom-parsing-and-serialization
|
||||
partial interface Element {
|
||||
[CEReactions] undefined setHTMLUnsafe(DOMString html);
|
||||
DOMString getHTML(optional GetHTMLOptions options = {});
|
||||
|
||||
[CEReactions, Throws] attribute [LegacyNullToEmptyString] DOMString innerHTML;
|
||||
[CEReactions, Throws] attribute [LegacyNullToEmptyString] DOMString outerHTML;
|
||||
};
|
||||
|
||||
dictionary GetHTMLOptions {
|
||||
boolean serializableShadowRoots = false;
|
||||
sequence<ShadowRoot> shadowRoots = [];
|
||||
};
|
||||
|
||||
// https://fullscreen.spec.whatwg.org/#api
|
||||
partial interface Element {
|
||||
Promise<undefined> requestFullscreen();
|
||||
|
|
|
@ -26,7 +26,7 @@ ShadowRoot includes DocumentOrShadowRoot;
|
|||
// https://html.spec.whatwg.org/multipage/#dom-parsing-and-serialization
|
||||
partial interface ShadowRoot {
|
||||
// [CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html);
|
||||
// DOMString getHTML(optional GetHTMLOptions options = {});
|
||||
DOMString getHTML(optional GetHTMLOptions options = {});
|
||||
|
||||
// [CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
|
||||
[CEReactions] attribute [LegacyNullToEmptyString] DOMString innerHTML;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue