RESOLVED FIXED Bug 62464
[Qt] QWebElement::encloseWith doesn't work at all
https://bugs.webkit.org/show_bug.cgi?id=62464
Summary [Qt] QWebElement::encloseWith doesn't work at all
Bernhard Rosenkraenzer
Reported 2011-06-10 10:31:03 PDT
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>
Attachments
Test case (10.00 KB, application/octet-stream)
2011-06-10 10:31 PDT, Bernhard Rosenkraenzer
no flags
patch for review. (6.01 KB, patch)
2011-09-09 04:06 PDT, Zeno Albisser
kling: review-
kling: commit-queue-
patch for review - fixed coding style issues (6.12 KB, patch)
2011-09-09 05:13 PDT, Zeno Albisser
no flags
Bernhard Rosenkraenzer
Comment 1 2011-06-14 02:02:34 PDT
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.
Steven Chu
Comment 2 2011-06-26 19:51:14 PDT
(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()
Zeno Albisser
Comment 3 2011-09-09 04:06:54 PDT
Created attachment 106858 [details] patch for review.
Andreas Kling
Comment 4 2011-09-09 04:21:50 PDT
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.
Zeno Albisser
Comment 5 2011-09-09 05:13:04 PDT
Created attachment 106863 [details] patch for review - fixed coding style issues
Andreas Kling
Comment 6 2011-09-09 05:15:19 PDT
Comment on attachment 106863 [details] patch for review - fixed coding style issues Delightful, r=me
WebKit Review Bot
Comment 7 2011-09-09 07:31:20 PDT
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>
WebKit Review Bot
Comment 8 2011-09-09 07:31:25 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.