Changeset 107242 in webkit
- Timestamp:
- Feb 9, 2012 7:26:58 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r107241 r107242 1 2012-02-09 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: fix setOuterHTML for the case that adds / removes duplicate. 4 https://bugs.webkit.org/show_bug.cgi?id=78235 5 6 Reviewed by Yury Semikhatsky. 7 8 * inspector/elements/set-outer-html-2-expected.txt: 9 * inspector/elements/set-outer-html-2.html: 10 * inspector/elements/set-outer-html-expected.txt: 11 * inspector/elements/set-outer-html.html: 12 1 13 2012-02-09 Pavel Podivilov <podivilov@chromium.org> 2 14 -
trunk/LayoutTests/inspector/elements/set-outer-html-2-expected.txt
r104920 r107242 13 13 ==========8<========== 14 14 <div id="container" style="display:none"> 15 <h2 foo="bar" bar="baz">Welcome to the website for the WebKit Open Source Project!</h2> 16 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 17 18 <h2>Getting involved</h2> 19 <a href="http://nightly.webkit.org/"></a> 15 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 16 <h2 foo="bar" bar="baz">Getting involved</h2> 20 17 <p id="identity">There are many ways to get involved. You can:</p> 21 18 <ul> … … 36 33 ==========8<========== 37 34 <div id="container" style="display:none"> 38 <h2>Welcome to the website for the WebKit Open Source Project!</h2> 39 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 40 41 <h2>Getting involved</h2> 42 <a href="http://nightly.webkit.org/"></a> 35 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 36 <h2>Getting involved</h2> 43 37 <p id="identity">There are many ways to get involved. You can:</p> 44 38 <ul> … … 61 55 ==========8<========== 62 56 <div id="container" style="display:none"> 63 <h2>Welcome to the website for the WebKit Open Source Project!</h2> 64 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 65 66 <h2>Getting involved</h2> 67 <a href="http://nightly.webkit.org/"></a> 57 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 58 <h2>Getting involved</h2> 68 59 <p id="identity">There are many ways to get involved. You can:</p> 69 60 <div><ul> … … 83 74 ==========8<========== 84 75 <div id="container" style="display:none"> 85 <h2>Welcome to the website for the WebKit Open Source Project!</h2> 86 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 87 88 <h2>Getting involved</h2> 89 <a href="http://nightly.webkit.org/"></a> 76 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 77 <h2>Getting involved</h2> 90 78 <p id="identity">There are many ways to get involved. You can:</p> 91 79 <ul> … … 108 96 ==========8<========== 109 97 <div id="container" style="display:none"> 110 <h2>Welcome to the website for the WebKit Open Source Project!</h2> 111 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 112 113 114 <a href="http://nightly.webkit.org/"></a> 98 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 99 115 100 <p id="identity">There are many ways to get involved. You can:</p> 116 101 <ul> … … 126 111 127 112 Wrapper identity: identity 128 Event NodeInserted: A129 113 Event NodeInserted: H2 130 Event Node Removed: A114 Event NodeInserted: P 131 115 Event NodeRemoved: H2 132 ==========8<========== 133 <div id="container" style="display:none"> 134 <h2>Welcome to the website for the WebKit Open Source Project!</h2> 135 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 136 137 <h2>Getting involved</h2> 138 <a href="http://nightly.webkit.org/"></a> 116 Event NodeRemoved: P 117 ==========8<========== 118 <div id="container" style="display:none"> 119 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 120 <h2>Getting involved</h2> 139 121 <p id="identity">There are many ways to get involved. You can:</p> 140 122 <ul> … … 156 138 ==========8<========== 157 139 <div id="container" style="display:none"> 158 <h2>Welcome to the website for the WebKit Open Source Project!</h2> 159 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 160 161 <h2>Getting involved</h2> 162 <a href="http://nightly.webkit.org/"></a> 163 <p id="identity">There are many ways to get involved. You can:</p> 164 <ul> 165 <li></li> 166 </ul> 167 <ul> 168 <li></li> 169 </ul> 170 </div> 171 ==========>8========== 172 173 Bringing things back 174 175 Wrapper identity: identity 176 ==========8<========== 177 <div id="container" style="display:none"> 178 <h2>Welcome to the website for the WebKit Open Source Project!</h2> 179 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 180 181 <h2>Getting involved</h2> 182 <a href="http://nightly.webkit.org/"></a> 183 <p id="identity">There are many ways to get involved. You can:</p> 184 <ul> 185 <li></li> 186 </ul> 187 <ul> 188 <li></li> 189 </ul> 190 </div> 191 ==========>8========== 192 193 194 195 196 140 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 141 <h2>Getting involved</h2> 142 <p id="identity">There are many ways to get involved. You can:</p> 143 <ul> 144 <li></li> 145 </ul> 146 <ul> 147 <li></li> 148 </ul> 149 </div> 150 ==========>8========== 151 152 Bringing things back 153 154 Wrapper identity: identity 155 ==========8<========== 156 <div id="container" style="display:none"> 157 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 158 <h2>Getting involved</h2> 159 <p id="identity">There are many ways to get involved. You can:</p> 160 <ul> 161 <li></li> 162 </ul> 163 <ul> 164 <li></li> 165 </ul> 166 </div> 167 ==========>8========== 168 169 170 171 172 173 Running: testDupeNode 174 Replacing '<h2>Getting involved</h2>' with '<h2>Getting involved</h2><h2>Getting involved</h2>' 175 176 Wrapper identity: identity 177 Event NodeInserted: H2 178 ==========8<========== 179 <div id="container" style="display:none"> 180 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 181 <h2>Getting involved</h2><h2>Getting involved</h2> 182 <p id="identity">There are many ways to get involved. You can:</p> 183 <ul> 184 <li></li> 185 </ul> 186 <ul> 187 <li></li> 188 </ul> 189 </div> 190 ==========>8========== 191 192 Bringing things back 193 194 Wrapper identity: identity 195 Event NodeRemoved: H2 196 ==========8<========== 197 <div id="container" style="display:none"> 198 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 199 <h2>Getting involved</h2> 200 <p id="identity">There are many ways to get involved. You can:</p> 201 <ul> 202 <li></li> 203 </ul> 204 <ul> 205 <li></li> 206 </ul> 207 </div> 208 ==========>8========== 209 210 211 212 213 -
trunk/LayoutTests/inspector/elements/set-outer-html-2.html
r104920 r107242 46 46 var text = InspectorTest.containerText + "<div>Additional node</div>"; 47 47 InspectorTest.setOuterHTML(text, next); 48 }, 49 50 function testDupeNode(next) 51 { 52 InspectorTest.patchOuterHTML("<h2>Getting involved</h2>", "<h2>Getting involved</h2><h2>Getting involved</h2>", next); 48 53 } 49 54 ]); … … 58 63 59 64 <div id="container" style="display:none"> 60 <h2>Welcome to the website for the WebKit Open Source Project!</h2> 61 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</a>.</p> 62 65 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 63 66 <h2>Getting involved</h2> 64 <a href="http://nightly.webkit.org/"></a>65 67 <p id="identity">There are many ways to get involved. You can:</p> 66 68 <ul> -
trunk/LayoutTests/inspector/elements/set-outer-html-expected.txt
r104920 r107242 11 11 ==========8<========== 12 12 <div id="container" style="display:none"> 13 <h2>Welcome to the website for the WebKit Open Source Project!</h2>14 13 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 15 16 14 <h2>Getting not involved</h2> 17 <a href="http://nightly.webkit.org/"></a>18 15 <p id="identity">There are many ways to get involved. You can:</p> 19 <ul>20 <li></li>21 </ul>22 <ul>23 <li></li>24 </ul>25 16 </div> 26 17 ==========>8========== … … 32 23 ==========8<========== 33 24 <div id="container" style="display:none"> 34 <h2>Welcome to the website for the WebKit Open Source Project!</h2>35 25 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 36 37 26 <h2>Getting involved</h2> 38 <a href="http://nightly.webkit.org/"></a>39 27 <p id="identity">There are many ways to get involved. You can:</p> 40 <ul>41 <li></li>42 </ul>43 <ul>44 <li></li>45 </ul>46 28 </div> 47 29 ==========>8========== … … 60 42 ==========8<========== 61 43 <div id="container" style="display:none"> 62 <h2>Welcome to the website for the WebKit Open Source Project!</h2>63 44 <p>WebKit is used by <a foo="bar" href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 64 65 45 <h2>Getting involved</h2> 66 <a href="http://nightly.webkit.org/"></a>67 46 <p id="identity">There are many ways to get involved. You can:</p> 68 <ul>69 <li></li>70 </ul>71 <ul>72 <li></li>73 </ul>74 47 </div> 75 48 ==========>8========== … … 83 56 ==========8<========== 84 57 <div id="container" style="display:none"> 85 <h2>Welcome to the website for the WebKit Open Source Project!</h2>86 58 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 87 88 59 <h2>Getting involved</h2> 89 <a href="http://nightly.webkit.org/"></a>90 60 <p id="identity">There are many ways to get involved. You can:</p> 91 <ul>92 <li></li>93 </ul>94 <ul>95 <li></li>96 </ul>97 61 </div> 98 62 ==========>8========== … … 109 73 ==========8<========== 110 74 <div id="container" style="display:none"> 111 <h2>Welcome to the website for the WebKit Open Source Project!</h2>112 75 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 113 114 76 <h2></h2> 115 <a href="http://nightly.webkit.org/"></a>116 77 <p id="identity">There are many ways to get involved. You can:</p> 117 <ul>118 <li></li>119 </ul>120 <ul>121 <li></li>122 </ul>123 78 </div> 124 79 ==========>8========== … … 130 85 ==========8<========== 131 86 <div id="container" style="display:none"> 132 <h2>Welcome to the website for the WebKit Open Source Project!</h2>133 87 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 134 135 88 <h2>Getting involved</h2> 136 <a href="http://nightly.webkit.org/"></a>137 89 <p id="identity">There are many ways to get involved. You can:</p> 138 <ul>139 <li></li>140 </ul>141 <ul>142 <li></li>143 </ul>144 90 </div> 145 91 ==========>8========== … … 158 104 ==========8<========== 159 105 <div id="container" style="display:none"> 160 <h2>Welcome to the website for the WebKit Open Source Project!</h2>161 106 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 162 163 107 <h2>Getting</h2><h2>involved</h2> 164 <a href="http://nightly.webkit.org/"></a>165 108 <p id="identity">There are many ways to get involved. You can:</p> 166 <ul>167 <li></li>168 </ul>169 <ul>170 <li></li>171 </ul>172 109 </div> 173 110 ==========>8========== … … 181 118 ==========8<========== 182 119 <div id="container" style="display:none"> 183 <h2>Welcome to the website for the WebKit Open Source Project!</h2>184 120 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 185 186 121 <h2>Getting involved</h2> 187 <a href="http://nightly.webkit.org/"></a>188 122 <p id="identity">There are many ways to get involved. You can:</p> 189 <ul>190 <li></li>191 </ul>192 <ul>193 <li></li>194 </ul>195 123 </div> 196 124 ==========>8========== … … 208 136 ==========8<========== 209 137 <div id="container" style="display:none"> 210 <h2>Welcome to the website for the WebKit Open Source Project!</h2>211 138 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 212 213 139 <h3>Getting involved</h3> 214 <a href="http://nightly.webkit.org/"></a>215 140 <p id="identity">There are many ways to get involved. You can:</p> 216 <ul>217 <li></li>218 </ul>219 <ul>220 <li></li>221 </ul>222 141 </div> 223 142 ==========>8========== … … 230 149 ==========8<========== 231 150 <div id="container" style="display:none"> 232 <h2>Welcome to the website for the WebKit Open Source Project!</h2>233 151 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p> 234 235 152 <h2>Getting involved</h2> 236 <a href="http://nightly.webkit.org/"></a>237 153 <p id="identity">There are many ways to get involved. You can:</p> 238 <ul>239 <li></li>240 </ul>241 <ul>242 <li></li>243 </ul>244 154 </div> 245 155 ==========>8========== -
trunk/LayoutTests/inspector/elements/set-outer-html.html
r104920 r107242 56 56 57 57 <div id="container" style="display:none"> 58 <h2>Welcome to the website for the WebKit Open Source Project!</h2>59 58 <p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</a>.</p> 60 61 59 <h2>Getting involved</h2> 62 <a href="http://nightly.webkit.org/"></a>63 60 <p id="identity">There are many ways to get involved. You can:</p> 64 <ul>65 <li></li>66 </ul>67 <ul>68 <li></li>69 </ul>70 61 </div> 71 62 -
trunk/Source/WebCore/ChangeLog
r107239 r107242 1 2012-02-09 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: fix setOuterHTML for the case that adds / removes duplicate. 4 https://bugs.webkit.org/show_bug.cgi?id=78235 5 6 Reviewed by Yury Semikhatsky. 7 8 * inspector/DOMEditor.cpp: 9 (WebCore::DOMEditor::diff): 10 (WebCore::DOMEditor::innerPatchChildren): 11 (WebCore): 12 (WebCore::nodeName): 13 (WebCore::DOMEditor::dumpMap): 14 * inspector/DOMEditor.h: 15 (DOMEditor): 16 1 17 2012-02-09 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 18 -
trunk/Source/WebCore/inspector/DOMEditor.cpp
r106833 r107242 261 261 } 262 262 263 #ifdef DEBUG_DOM_EDITOR 264 dumpMap(oldMap, "OLD"); 265 dumpMap(newMap, "NEW"); 266 #endif 267 263 268 return make_pair(oldMap, newMap); 264 269 } … … 275 280 // 1. First strip everything except for the nodes that retain. Collect pending merges. 276 281 HashMap<Digest*, Digest*> merges; 282 HashSet<size_t> usedNewOrdinals; 277 283 for (size_t i = 0; i < oldList.size(); ++i) { 278 if (oldMap[i].first) 279 continue; 284 if (oldMap[i].first) { 285 if (!usedNewOrdinals.contains(oldMap[i].second)) { 286 usedNewOrdinals.add(oldMap[i].second); 287 continue; 288 } 289 oldMap[i].first = 0; 290 oldMap[i].second = 0; 291 } 280 292 281 293 // Always match <head> and <body> tags with each other - we can't remove them from the DOM … … 308 320 } 309 321 310 // Mark retained nodes as used. 322 // Mark retained nodes as used, do not reuse node more than once. 323 HashSet<size_t> usedOldOrdinals; 311 324 for (size_t i = 0; i < newList.size(); ++i) { 312 if (newMap[i].first) 313 markNodeAsUsed(newMap[i].first); 325 if (!newMap[i].first) 326 continue; 327 size_t oldOrdinal = newMap[i].second; 328 if (usedOldOrdinals.contains(oldOrdinal)) { 329 // Do not map node more than once 330 newMap[i].first = 0; 331 newMap[i].second = 0; 332 continue; 333 } 334 usedOldOrdinals.add(oldOrdinal); 335 markNodeAsUsed(newMap[i].first); 314 336 } 315 337 … … 452 474 } 453 475 476 #ifdef DEBUG_DOM_EDITOR 477 static String nodeName(Node* node) 478 { 479 if (node->document()->isXHTMLDocument()) 480 return node->nodeName(); 481 return node->nodeName().lower(); 482 } 483 484 void DOMEditor::dumpMap(const ResultMap& map, const String& name) 485 { 486 fprintf(stderr, "\n\n"); 487 for (size_t i = 0; i < map.size(); ++i) 488 fprintf(stderr, "%s[%lu]: %s (%p) - [%lu]\n", name.utf8().data(), i, map[i].first ? nodeName(map[i].first->m_node).utf8().data() : "", map[i].first, map[i].second); 489 } 490 #endif 491 454 492 } // namespace WebCore 455 493 -
trunk/Source/WebCore/inspector/DOMEditor.h
r105067 r107242 69 69 void removeChild(Digest*, ExceptionCode&); 70 70 void markNodeAsUsed(Digest*); 71 #ifdef DEBUG_DOM_EDITOR 72 void dumpMap(const ResultMap&, const String& name); 73 #endif 71 74 72 75 Document* m_document;
Note: See TracChangeset
for help on using the changeset viewer.