Changeset 210767 in webkit
- Timestamp:
- Jan 14, 2017 9:35:56 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r210754 r210767 1 2017-01-14 Chris Dumez <cdumez@apple.com> 2 3 Align the innerText setter with the HTML spec and Gecko 4 https://bugs.webkit.org/show_bug.cgi?id=160971 5 6 Reviewed by Alex Christensen. 7 8 Add test coverage for outerText, which is non-standard. 9 10 * fast/dom/br-set-outerText-expected.txt: Added. 11 * fast/dom/br-set-outerText.html: Added. 12 1 13 2017-01-13 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/ChangeLog
r210751 r210767 1 2017-01-14 Chris Dumez <cdumez@apple.com> 2 3 Align the innerText setter with the HTML spec and Gecko 4 https://bugs.webkit.org/show_bug.cgi?id=160971 5 6 Reviewed by Alex Christensen. 7 8 Rebaseline several W3C tests now that more checks are passing. 9 10 * web-platform-tests/domparsing/createContextualFragment-expected.txt: 11 * web-platform-tests/innerText/setter-expected.txt: 12 1 13 2017-01-13 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/domparsing/createContextualFragment-expected.txt
r210749 r210767 5 5 PASS Don't auto-create <body> when applied to <html> 6 6 PASS <script>s should be run when appended to the document (but not before) 7 FAIL createContextualFragment should work even when the context is <area> The operation is not supported. 8 FAIL createContextualFragment should work even when the context is <base> The operation is not supported. 9 FAIL createContextualFragment should work even when the context is <basefont> The operation is not supported. 7 PASS createContextualFragment should work even when the context is <area> 8 PASS createContextualFragment should work even when the context is <base> 9 PASS createContextualFragment should work even when the context is <basefont> 10 10 PASS createContextualFragment should work even when the context is <bgsound> 11 FAIL createContextualFragment should work even when the context is <br> The operation is not supported. 12 FAIL createContextualFragment should work even when the context is <col> The operation is not supported. 13 FAIL createContextualFragment should work even when the context is <embed> The operation is not supported. 14 FAIL createContextualFragment should work even when the context is <frame> The operation is not supported. 15 FAIL createContextualFragment should work even when the context is <hr> The operation is not supported. 16 FAIL createContextualFragment should work even when the context is <img> The operation is not supported. 17 FAIL createContextualFragment should work even when the context is <input> The operation is not supported. 11 PASS createContextualFragment should work even when the context is <br> 12 PASS createContextualFragment should work even when the context is <col> 13 PASS createContextualFragment should work even when the context is <embed> 14 PASS createContextualFragment should work even when the context is <frame> 15 PASS createContextualFragment should work even when the context is <hr> 16 PASS createContextualFragment should work even when the context is <img> 17 PASS createContextualFragment should work even when the context is <input> 18 18 PASS createContextualFragment should work even when the context is <keygen> 19 FAIL createContextualFragment should work even when the context is <link> The operation is not supported. 20 FAIL createContextualFragment should work even when the context is <meta> The operation is not supported. 21 FAIL createContextualFragment should work even when the context is <param> The operation is not supported. 22 FAIL createContextualFragment should work even when the context is <source> The operation is not supported. 19 PASS createContextualFragment should work even when the context is <link> 20 PASS createContextualFragment should work even when the context is <meta> 21 PASS createContextualFragment should work even when the context is <param> 22 PASS createContextualFragment should work even when the context is <source> 23 23 PASS createContextualFragment should work even when the context is <track> 24 FAIL createContextualFragment should work even when the context is <wbr> The operation is not supported. 24 PASS createContextualFragment should work even when the context is <wbr> 25 25 PASS createContextualFragment should work even when the context is <menuitem> 26 FAIL createContextualFragment should work even when the context is <image> The operation is not supported. 26 PASS createContextualFragment should work even when the context is <image> 27 27 PASS <html> and <body> must work the same, 1 28 28 PASS <html> and <body> must work the same, 2 -
trunk/LayoutTests/imported/w3c/web-platform-tests/innerText/setter-expected.txt
r210751 r210767 1 abc 1 2 2 3 PASS Simplest possible test … … 27 28 PASS Assigning null 28 29 PASS Assigning undefined 29 FAIL innerText on <area> element The object can not be modified. 30 FAIL innerText on <base> element The object can not be modified. 31 FAIL innerText on <basefont> element The object can not be modified. 30 PASS innerText on <area> element 31 PASS innerText on <base> element 32 PASS innerText on <basefont> element 32 33 PASS innerText on <bgsound> element 33 FAIL innerText on <br> element The object can not be modified. 34 FAIL innerText on <col> element The object can not be modified. 35 FAIL innerText on <embed> element The object can not be modified. 36 FAIL innerText on <frame> element The object can not be modified. 37 FAIL innerText on <hr> element The object can not be modified. 38 FAIL innerText on <image> element The object can not be modified. 39 FAIL innerText on <img> element The object can not be modified. 40 FAIL innerText on <input> element The object can not be modified. 34 PASS innerText on <br> element 35 PASS innerText on <col> element 36 PASS innerText on <embed> element 37 PASS innerText on <frame> element 38 PASS innerText on <hr> element 39 PASS innerText on <image> element 40 PASS innerText on <img> element 41 PASS innerText on <input> element 41 42 PASS innerText on <keygen> element 42 FAIL innerText on <link> element The object can not be modified. 43 PASS innerText on <link> element 43 44 PASS innerText on <menuitem> element 44 FAIL innerText on <meta> element The object can not be modified. 45 FAIL innerText on <param> element The object can not be modified. 46 FAIL innerText on <source> element The object can not be modified. 45 PASS innerText on <meta> element 46 PASS innerText on <param> element 47 PASS innerText on <source> element 47 48 PASS innerText on <track> element 48 FAIL innerText on <wbr> element The object can not be modified. 49 FAIL innerText on <colgroup> element The object can not be modified. 50 FAIL innerText on <frameset> element The object can not be modified. 51 FAIL innerText on <head> element The object can not be modified. 52 FAIL innerText on <html> element The object can not be modified. 53 FAIL innerText on <table> element The object can not be modified. 54 FAIL innerText on <tbody> element The object can not be modified. 55 FAIL innerText on <tfoot> element The object can not be modified. 56 FAIL innerText on <thead> element The object can not be modified. 57 FAIL innerText on <tr> element The object can not be modified. 49 PASS innerText on <wbr> element 50 PASS innerText on <colgroup> element 51 PASS innerText on <frameset> element 52 PASS innerText on <head> element 53 PASS innerText on <html> element 54 PASS innerText on <table> element 55 PASS innerText on <tbody> element 56 PASS innerText on <tfoot> element 57 PASS innerText on <thead> element 58 PASS innerText on <tr> element 58 59 -
trunk/Source/WebCore/ChangeLog
r210763 r210767 1 2017-01-14 Chris Dumez <cdumez@apple.com> 2 3 Align the innerText setter with the HTML spec and Gecko 4 https://bugs.webkit.org/show_bug.cgi?id=160971 5 6 Reviewed by Alex Christensen. 7 8 Align the innerText setter and createContextualFragment() with the 9 HTML specification and Gecko. In particular, they no longer throw 10 when the context element is a void element. This behavior was there 11 to match an old IE behavior but Edge dropped this behavior. 12 13 Test: fast/dom/br-set-outerText.html 14 15 * dom/Element.cpp: 16 * dom/Element.h: 17 * editing/markup.cpp: 18 (WebCore::createContextualFragment): 19 * html/HTMLElement.cpp: 20 (WebCore::HTMLElement::setInnerText): 21 (WebCore::HTMLElement::setOuterText): 22 1 23 2017-01-13 Joseph Pecoraro <pecoraro@apple.com> 2 24 -
trunk/Source/WebCore/dom/Element.cpp
r210284 r210767 3579 3579 } 3580 3580 3581 bool Element::ieForbidsInsertHTML() const3582 {3583 // FIXME: Supposedly IE disallows setting innerHTML, outerHTML3584 // and createContextualFragment on these tags. We have no tests to3585 // verify this however, so this list could be totally wrong.3586 // This list was moved from the previous endTagRequirement() implementation.3587 // This is also called from editing and assumed to be the list of tags3588 // for which no end tag should be serialized. It's unclear if the list for3589 // IE compat and the list for serialization sanity are the same.3590 if (hasTagName(areaTag)3591 || hasTagName(baseTag)3592 || hasTagName(basefontTag)3593 || hasTagName(brTag)3594 || hasTagName(colTag)3595 || hasTagName(embedTag)3596 || hasTagName(frameTag)3597 || hasTagName(hrTag)3598 || hasTagName(imageTag)3599 || hasTagName(imgTag)3600 || hasTagName(inputTag)3601 || hasTagName(linkTag)3602 || hasTagName(metaTag)3603 || hasTagName(paramTag)3604 || hasTagName(sourceTag)3605 || hasTagName(wbrTag))3606 return true;3607 // FIXME: I'm not sure why dashboard mode would want to change the3608 // serialization of <canvas>, that seems like a bad idea.3609 #if ENABLE(DASHBOARD_SUPPORT)3610 if (hasTagName(canvasTag)) {3611 Settings* settings = document().settings();3612 if (settings && settings->usesDashboardBackwardCompatibilityMode())3613 return true;3614 }3615 #endif3616 return false;3617 }3618 3619 3581 ExceptionOr<Node*> Element::insertAdjacent(const String& where, Ref<Node>&& newChild) 3620 3582 { -
trunk/Source/WebCore/dom/Element.h
r210029 r210767 314 314 WEBCORE_EXPORT ExceptionOr<void> insertAdjacentText(const String& where, const String& text); 315 315 316 bool ieForbidsInsertHTML() const;317 318 316 const RenderStyle* computedStyle(PseudoId = NOPSEUDO) override; 319 317 -
trunk/Source/WebCore/editing/markup.cpp
r208839 r210767 950 950 ExceptionOr<Ref<DocumentFragment>> createContextualFragment(Element& element, const String& markup, ParserContentPolicy parserContentPolicy) 951 951 { 952 if (element.ieForbidsInsertHTML())953 return Exception { NOT_SUPPORTED_ERR };954 955 if (element.hasTagName(colTag) || element.hasTagName(colgroupTag) || element.hasTagName(framesetTag)956 || element.hasTagName(headTag) || element.hasTagName(styleTag) || element.hasTagName(titleTag))957 return Exception { NOT_SUPPORTED_ERR };958 959 952 auto result = createFragmentForInnerOuterHTML(element, markup, parserContentPolicy); 960 953 if (result.hasException()) -
trunk/Source/WebCore/html/HTMLElement.cpp
r210319 r210767 471 471 } 472 472 473 static inline bool shouldProhibitSetInnerOuterText(const HTMLElement& element)474 {475 return element.hasTagName(colTag)476 || element.hasTagName(colgroupTag)477 || element.hasTagName(framesetTag)478 || element.hasTagName(headTag)479 || element.hasTagName(htmlTag)480 || element.hasTagName(tableTag)481 || element.hasTagName(tbodyTag)482 || element.hasTagName(tfootTag)483 || element.hasTagName(theadTag)484 || element.hasTagName(trTag);485 }486 487 473 // Returns the conforming 'dir' value associated with the state the attribute is in (in its canonical case), if any, 488 474 // or the empty string if the attribute is in a state that has no associated keyword value or if the attribute is … … 515 501 ExceptionOr<void> HTMLElement::setInnerText(const String& text) 516 502 { 517 if (ieForbidsInsertHTML())518 return Exception { NO_MODIFICATION_ALLOWED_ERR };519 if (shouldProhibitSetInnerOuterText(*this))520 return Exception { NO_MODIFICATION_ALLOWED_ERR };521 522 503 // FIXME: This doesn't take whitespace collapsing into account at all. 523 504 … … 552 533 ExceptionOr<void> HTMLElement::setOuterText(const String& text) 553 534 { 554 if (ieForbidsInsertHTML())555 return Exception { NO_MODIFICATION_ALLOWED_ERR };556 if (shouldProhibitSetInnerOuterText(*this))557 return Exception { NO_MODIFICATION_ALLOWED_ERR };558 559 535 RefPtr<ContainerNode> parent = parentNode(); 560 536 if (!parent)
Note: See TracChangeset
for help on using the changeset viewer.