Changeset 85267 in webkit
- Timestamp:
- Apr 28, 2011 5:10:34 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r85264 r85267 1 2011-04-28 Chang Shu <cshu@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 isContentEditable is not working properly with document.designMode 6 https://bugs.webkit.org/show_bug.cgi?id=53031 7 8 1. Added test cases for checking isContentEditable with designMode. 9 2. Added a new test case for setting contenteditable attribute to "inherit" as the 10 original code will cause a crash. 11 3. Ryosuke Niwa also helped to fix test cases under editing/style that cause infinite loop. 12 13 * editing/style/iframe-onload-crash-mac.html: 14 * editing/style/iframe-onload-crash-unix.html: 15 * editing/style/iframe-onload-crash-win.html: 16 * fast/dom/HTMLElement/attr-invalid-string-expected.txt: 17 * fast/dom/HTMLElement/attr-invalid-string.html: 18 * fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit-expected.txt: Added. 19 * fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit-subframe-expected.txt: Added. 20 * fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit-subframe.html: Added. 21 * fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit.html: Added. 22 * fast/dom/HTMLElement/iscontenteditable-designmodeon-ancestor-expected.txt: Added. 23 * fast/dom/HTMLElement/iscontenteditable-designmodeon-ancestor.html: Added. 24 * fast/dom/HTMLElement/iscontenteditable-designmodeon-expected.txt: Added. 25 * fast/dom/HTMLElement/iscontenteditable-designmodeon.html: Added. 26 1 27 2011-04-28 Mike Reed <reed@google.com> 2 28 -
trunk/LayoutTests/editing/style/iframe-onload-crash-mac.html
r81266 r85267 5 5 } 6 6 7 document.designMode='on'; 8 document.execCommand('selectall'); 9 document.execCommand('italic'); 10 document.execCommand('RemoveFormat'); 11 document.execCommand('inserthtml', false); 12 document.body.innerHTML='PASS';">x 7 if (document.counter) 8 document.counter++; 9 else 10 document.counter = 1; 11 12 if (document.counter <= 16) { 13 document.designMode='on'; 14 document.execCommand('selectall'); 15 document.execCommand('italic'); 16 document.execCommand('RemoveFormat'); 17 document.execCommand('inserthtml', false); 18 document.body.innerHTML='PASS'; 19 } ">x -
trunk/LayoutTests/editing/style/iframe-onload-crash-unix.html
r81266 r85267 5 5 } 6 6 7 document.designMode='on'; 8 document.execCommand('selectall'); 9 document.execCommand('italic'); 10 document.execCommand('RemoveFormat'); 11 document.execCommand('inserthtml', false); 12 document.body.innerHTML='PASS';">x 7 if (document.counter) 8 document.counter++; 9 else 10 document.counter = 1; 11 12 if (document.counter <= 16) { 13 document.designMode='on'; 14 document.execCommand('selectall'); 15 document.execCommand('italic'); 16 document.execCommand('RemoveFormat'); 17 document.execCommand('inserthtml', false); 18 document.body.innerHTML='PASS'; 19 } ">x -
trunk/LayoutTests/editing/style/iframe-onload-crash-win.html
r81266 r85267 5 5 } 6 6 7 document.designMode='on'; 8 document.execCommand('selectall'); 9 document.execCommand('italic'); 10 document.execCommand('RemoveFormat'); 11 document.execCommand('inserthtml', false); 12 document.body.innerHTML='PASS';">x 7 if (document.counter) 8 document.counter++; 9 else 10 document.counter = 1; 11 12 if (document.counter <= 16) { 13 document.designMode='on'; 14 document.execCommand('selectall'); 15 document.execCommand('italic'); 16 document.execCommand('RemoveFormat'); 17 document.execCommand('inserthtml', false); 18 document.body.innerHTML='PASS'; 19 } ">x -
trunk/LayoutTests/fast/dom/HTMLElement/attr-invalid-string-expected.txt
r76528 r85267 7 7 8 8 9 PASS document.getElementById("div").getAttribute("contentEditable") is "abc" 10 PASS document.getElementById("div").contentEditable is "inherit" 11 PASS document.getElementById("div").isContentEditable is false 12 PASS window.getComputedStyle(div, "").getPropertyValue("-webkit-user-modify") is "read-only" 9 10 PASS document.getElementById("d").getAttribute("contentEditable") is "abc" 11 PASS document.getElementById("d").contentEditable is "inherit" 12 PASS document.getElementById("d").isContentEditable is false 13 PASS window.getComputedStyle(d, "").getPropertyValue("-webkit-user-modify") is "read-only" 14 PASS document.getElementById("d2").getAttribute("contentEditable") is "inherit" 15 PASS document.getElementById("d2").contentEditable is "inherit" 16 PASS document.getElementById("d2").isContentEditable is false 17 PASS window.getComputedStyle(d2, "").getPropertyValue("-webkit-user-modify") is "read-only" 13 18 14 19 PASS successfullyParsed is true -
trunk/LayoutTests/fast/dom/HTMLElement/attr-invalid-string.html
r76528 r85267 9 9 <div id="console"></p> 10 10 <div id="result"></div> 11 <div id="div" contentEditable="abc"></div> 11 <div id="d" contentEditable="abc"></div> 12 <div id="d2" contentEditable="inherit"></div> 12 13 <script> 13 14 description('When contentEditable attribute is invalid string, element.contentEditable returns "inherit".') 14 15 15 shouldBe('document.getElementById("d iv").getAttribute("contentEditable")','"abc"');16 shouldBe('document.getElementById("d iv").contentEditable', '"inherit"');17 shouldBe('document.getElementById("d iv").isContentEditable', 'false');18 shouldBe('window.getComputedStyle(d iv, "").getPropertyValue("-webkit-user-modify")', '"read-only"');16 shouldBe('document.getElementById("d").getAttribute("contentEditable")','"abc"'); 17 shouldBe('document.getElementById("d").contentEditable', '"inherit"'); 18 shouldBe('document.getElementById("d").isContentEditable', 'false'); 19 shouldBe('window.getComputedStyle(d, "").getPropertyValue("-webkit-user-modify")', '"read-only"'); 19 20 20 document.getElementById("div").style.display= 'none'; 21 shouldBe('document.getElementById("d2").getAttribute("contentEditable")','"inherit"'); 22 shouldBe('document.getElementById("d2").contentEditable', '"inherit"'); 23 shouldBe('document.getElementById("d2").isContentEditable', 'false'); 24 shouldBe('window.getComputedStyle(d2, "").getPropertyValue("-webkit-user-modify")', '"read-only"'); 25 26 document.getElementById("d").style.display= 'none'; 27 document.getElementById("d2").style.display= 'none'; 21 28 22 29 window.successfullyParsed = true; -
trunk/Source/WebCore/ChangeLog
r85266 r85267 1 2011-04-28 Chang Shu <cshu@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 isContentEditable is not working properly with document.designMode 6 https://bugs.webkit.org/show_bug.cgi?id=53031 7 8 The specification (http://dev.w3.org/html5/spec/Overview.html#attr-contenteditable) 9 indicates that the element.isContentEditable relies on document.designMode if its 10 and its ancestors' contenteditable attributes are set to inherit. 11 12 1. Sync document render style after document.designMode is changed. 13 2. Removed the code that does unnecessary and incorrect handling for contenteditable 14 attribute with "inherit" value. 15 3. Ryosuke Niwa also helped to fix the code in ApplyStyleCommand that causes an assertion. 16 17 Tests: fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit-subframe.html 18 fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit.html 19 fast/dom/HTMLElement/iscontenteditable-designmodeon-ancestor.html 20 fast/dom/HTMLElement/iscontenteditable-designmodeon.html 21 22 * css/CSSStyleSelector.cpp: 23 (WebCore::CSSStyleSelector::styleForDocument): 24 * dom/Document.cpp: 25 (WebCore::Document::setDesignMode): 26 * dom/Node.cpp: 27 (WebCore::Node::rendererIsEditable): 28 * editing/ApplyStyleCommand.cpp: 29 (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): 30 * html/HTMLElement.cpp: 31 (WebCore::HTMLElement::setContentEditable): 32 1 33 2011-04-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 34 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r85256 r85267 1220 1220 documentStyle->setZoom(frame ? frame->pageZoomFactor() : 1); 1221 1221 documentStyle->setPageScaleTransform(frame ? frame->pageScaleFactor() : 1); 1222 1222 documentStyle->setUserModify(document->inDesignMode() ? READ_WRITE : READ_ONLY); 1223 1223 1224 Element* docElement = document->documentElement(); 1224 1225 RenderObject* docElementRenderer = docElement ? docElement->renderer() : 0; -
trunk/Source/WebCore/dom/Document.cpp
r85256 r85267 4038 4038 { 4039 4039 m_designMode = value; 4040 for (Frame* frame = m_frame; frame && frame->document(); frame = frame->tree()->traverseNext(m_frame)) 4041 frame->document()->scheduleForcedStyleRecalc(); 4040 4042 } 4041 4043 -
trunk/Source/WebCore/dom/Node.cpp
r85256 r85267 764 764 bool Node::rendererIsEditable(EditableLevel editableLevel) const 765 765 { 766 if (document()-> inDesignMode() || (document()->frame() && document()->frame()->page() && document()->frame()->page()->isEditable()))766 if (document()->frame() && document()->frame()->page() && document()->frame()->page()->isEditable()) 767 767 return true; 768 768 -
trunk/Source/WebCore/editing/ApplyStyleCommand.cpp
r83618 r85267 1317 1317 while (node) { 1318 1318 RefPtr<Node> next = node->nextSibling(); 1319 removeNode(node); 1320 appendNode(node, element); 1319 if (node->isContentEditable()) { 1320 removeNode(node); 1321 appendNode(node, element); 1322 } 1321 1323 if (node == endNode) 1322 1324 break; -
trunk/Source/WebCore/html/HTMLElement.cpp
r84991 r85267 679 679 attr->decl()->removeProperty(CSSPropertyWebkitNbspMode, false); 680 680 attr->decl()->removeProperty(CSSPropertyWebkitLineBreak, false); 681 } else if (equalIgnoringCase(enabled, "inherit")) {682 addCSSProperty(attr, CSSPropertyWebkitUserModify, CSSValueInherit);683 attr->decl()->removeProperty(CSSPropertyWordWrap, false);684 attr->decl()->removeProperty(CSSPropertyWebkitNbspMode, false);685 attr->decl()->removeProperty(CSSPropertyWebkitLineBreak, false);686 681 } else if (equalIgnoringCase(enabled, "plaintext-only")) { 687 682 addCSSProperty(attr, CSSPropertyWebkitUserModify, CSSValueReadWritePlaintextOnly);
Note: See TracChangeset
for help on using the changeset viewer.