Created attachment 96756 [details] Test case QWebElement::encloseWith fails to do anything - see attached test case. Expected output after the encloseWith call: <html><head><title>test</title></head><body><p id="p1"><img src="test.png"/></p></body></html>
The same is true for QWebElement::prependOutside and QWebElement::appendOutside. To test, simply insert e.prependOutside("<p id=\"p2\">Test</p>"); e.appendOutside("<p id=\"p3\">Another test</p>"); after e.encloseWith("<p id=\"p1\"></p>"); in TestApp.cpp The result remains the same -- none of the calls has any effect.
(In reply to comment #1) > The same is true for QWebElement::prependOutside and QWebElement::appendOutside. > > To test, simply insert > > e.prependOutside("<p id=\"p2\">Test</p>"); > e.appendOutside("<p id=\"p3\">Another test</p>"); > > after > > e.encloseWith("<p id=\"p1\"></p>"); > > in TestApp.cpp > The result remains the same -- none of the calls has any effect. <img> is one of the tags not allowed. For the list of other tags ignored, HTMLElement.cpp - Line 76: HTMLElement::ieForbidsInsertHTML()
Created attachment 106858 [details] patch for review.
Comment on attachment 106858 [details] patch for review. View in context: https://bugs.webkit.org/attachment.cgi?id=106858&action=review Looks generally great, apart from some minor coding style problems. Please refer to http://www.webkit.org/coding/coding-style.html for the inside scoop :) You can use the Tools/Scripts/check-webkit-style script to verify correct style before uploading patches. > Source/WebKit/qt/Api/qwebelement.cpp:1122 > + RefPtr<DocumentFragment> fragment = Range::createDocumentFragmentForElement(markup, toHTMLElement(parent)); Coding style, two spaces after =. > Source/WebKit/qt/Api/qwebelement.cpp:1172 > + RefPtr<DocumentFragment> fragment = Range::createDocumentFragmentForElement(markup, toHTMLElement(parent)); Ditto. > Source/WebKit/qt/Api/qwebelement.cpp:1393 > + RefPtr<DocumentFragment> fragment = Range::createDocumentFragmentForElement(markup, toHTMLElement(parent)); Ditto. > Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp:650 > + // check behavior for a tag that IE forbids inserting HTML Coding style, comments should be written like normal sentences (capitalized and ending with a period.) > Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp:655 > + QWebElement img = body.findFirst("img"); > + img.appendInside("<p id=\"fail1\"></p>"); QVERIFY(!img.isNull()); wouldn't hurt here. > Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp:904 > + // check behavior for a tag that IE forbids inserting HTML Coding style, comments should be written like normal sentences (capitalized and ending with a period.) > Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp:909 > + QWebElement img = body.findFirst("img"); > + img.encloseWith("<p id=\"success\"></p>"); QVERIFY(!img.isNull()); wouldn't hurt here.
Created attachment 106863 [details] patch for review - fixed coding style issues
Comment on attachment 106863 [details] patch for review - fixed coding style issues Delightful, r=me
Comment on attachment 106863 [details] patch for review - fixed coding style issues Clearing flags on attachment: 106863 Committed r94852: <http://trac.webkit.org/changeset/94852>
All reviewed patches have been landed. Closing bug.