Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: Source/core/dom/Node.cpp

Issue 23549008: Have Node::diff() take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 printf(" Number of Attributes (non-Node and Node): %zu [%zu]\n", attributes , sizeof(Attribute)); 257 printf(" Number of Attributes (non-Node and Node): %zu [%zu]\n", attributes , sizeof(Attribute));
258 printf(" Number of Attributes with an Attr: %zu\n", attributesWithAttr); 258 printf(" Number of Attributes with an Attr: %zu\n", attributesWithAttr);
259 printf(" Number of Elements with attribute storage: %zu [%zu]\n", elementsW ithAttributeStorage, sizeof(ElementData)); 259 printf(" Number of Elements with attribute storage: %zu [%zu]\n", elementsW ithAttributeStorage, sizeof(ElementData));
260 printf(" Number of Elements with RareData: %zu\n", elementsWithRareData); 260 printf(" Number of Elements with RareData: %zu\n", elementsWithRareData);
261 printf(" Number of Elements with NamedNodeMap: %zu [%zu]\n", elementsWithNa medNodeMap, sizeof(NamedNodeMap)); 261 printf(" Number of Elements with NamedNodeMap: %zu [%zu]\n", elementsWithNa medNodeMap, sizeof(NamedNodeMap));
262 #endif 262 #endif
263 } 263 }
264 264
265 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, nodeCounter, ("WebCoreNode" )); 265 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, nodeCounter, ("WebCoreNode" ));
266 266
267 Node::StyleChange Node::diff(const RenderStyle* s1, const RenderStyle* s2, Docum ent* doc) 267 Node::StyleChange Node::diff(const RenderStyle* s1, const RenderStyle* s2, const Document& doc)
268 { 268 {
269 StyleChange ch = NoInherit; 269 StyleChange ch = NoInherit;
270 EDisplay display1 = s1 ? s1->display() : NONE; 270 EDisplay display1 = s1 ? s1->display() : NONE;
271 bool fl1 = s1 && s1->hasPseudoStyle(FIRST_LETTER); 271 bool fl1 = s1 && s1->hasPseudoStyle(FIRST_LETTER);
272 EDisplay display2 = s2 ? s2->display() : NONE; 272 EDisplay display2 = s2 ? s2->display() : NONE;
273 bool fl2 = s2 && s2->hasPseudoStyle(FIRST_LETTER); 273 bool fl2 = s2 && s2->hasPseudoStyle(FIRST_LETTER);
274 274
275 // We just detach if a renderer acquires or loses a column-span, since spann ing elements 275 // We just detach if a renderer acquires or loses a column-span, since spann ing elements
276 // typically won't contain much content. 276 // typically won't contain much content.
277 bool colSpan1 = s1 && s1->columnSpan(); 277 bool colSpan1 = s1 && s1->columnSpan();
278 bool colSpan2 = s2 && s2->columnSpan(); 278 bool colSpan2 = s2 && s2->columnSpan();
279 279
280 bool specifiesColumns1 = s1 && (!s1->hasAutoColumnCount() || !s1->hasAutoCol umnWidth()); 280 bool specifiesColumns1 = s1 && (!s1->hasAutoColumnCount() || !s1->hasAutoCol umnWidth());
281 bool specifiesColumns2 = s2 && (!s2->hasAutoColumnCount() || !s2->hasAutoCol umnWidth()); 281 bool specifiesColumns2 = s2 && (!s2->hasAutoColumnCount() || !s2->hasAutoCol umnWidth());
282 282
283 if (display1 != display2 || fl1 != fl2 || colSpan1 != colSpan2 283 if (display1 != display2 || fl1 != fl2 || colSpan1 != colSpan2
284 || (specifiesColumns1 != specifiesColumns2 && doc->settings()->regionBas edColumnsEnabled()) 284 || (specifiesColumns1 != specifiesColumns2 && doc.settings()->regionBase dColumnsEnabled())
285 || (s1 && s2 && !s1->contentDataEquivalent(s2))) 285 || (s1 && s2 && !s1->contentDataEquivalent(s2)))
286 ch = Reattach; 286 ch = Reattach;
287 else if (!s1 || !s2) 287 else if (!s1 || !s2)
288 ch = Inherit; 288 ch = Inherit;
289 else if (*s1 == *s2) 289 else if (*s1 == *s2)
290 ch = NoChange; 290 ch = NoChange;
291 else if (s1->inheritedNotEqual(s2)) 291 else if (s1->inheritedNotEqual(s2))
292 ch = Inherit; 292 ch = Inherit;
293 else if (s1->hasExplicitlyInheritedProperties() || s2->hasExplicitlyInherite dProperties()) 293 else if (s1->hasExplicitlyInheritedProperties() || s2->hasExplicitlyInherite dProperties())
294 ch = Inherit; 294 ch = Inherit;
(...skipping 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after
2765 node->showTreeForThis(); 2765 node->showTreeForThis();
2766 } 2766 }
2767 2767
2768 void showNodePath(const WebCore::Node* node) 2768 void showNodePath(const WebCore::Node* node)
2769 { 2769 {
2770 if (node) 2770 if (node)
2771 node->showNodePathForThis(); 2771 node->showNodePathForThis();
2772 } 2772 }
2773 2773
2774 #endif 2774 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698