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

Side by Side Diff: sky/engine/core/dom/Node.h

Issue 758623002: Remove didNotifySubtreeInsertionsToDocument. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « sky/engine/core/dom/Element.cpp ('k') | sky/engine/core/dom/shadow/InsertionPoint.h » ('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-2011, 2014 Apple Inc. All rights reserved. 5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved.
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 435
436 // Returns true if recalcStyle should be called on the object, if there is s uch a method (on Document and Element). 436 // Returns true if recalcStyle should be called on the object, if there is s uch a method (on Document and Element).
437 bool shouldCallRecalcStyle(StyleRecalcChange); 437 bool shouldCallRecalcStyle(StyleRecalcChange);
438 438
439 // Wrapper for nodes that don't have a renderer, but still cache the style ( like HTMLOptionElement). 439 // Wrapper for nodes that don't have a renderer, but still cache the style ( like HTMLOptionElement).
440 RenderStyle* renderStyle() const; 440 RenderStyle* renderStyle() const;
441 RenderStyle* parentRenderStyle() const; 441 RenderStyle* parentRenderStyle() const;
442 442
443 RenderStyle* computedStyle(PseudoId pseudoElementSpecifier = NOPSEUDO) { ret urn virtualComputedStyle(pseudoElementSpecifier); } 443 RenderStyle* computedStyle(PseudoId pseudoElementSpecifier = NOPSEUDO) { ret urn virtualComputedStyle(pseudoElementSpecifier); }
444 444
445 // ------------------------------------------------------------------------- ---- 445 virtual void insertedInto(ContainerNode* insertionPoint);
446 // Notification of document structure changes (see ContainerNode.h for more notification methods)
447 //
448 // At first, WebKit notifies the node that it has been inserted into the doc ument. This is called during document parsing, and also
449 // when a node is added through the DOM methods insertBefore(), appendChild( ) or replaceChild(). The call happens _after_ the node has been added to the tre e.
450 // This is similar to the DOMNodeInsertedIntoDocument DOM event, but does no t require the overhead of event
451 // dispatching.
452 //
453 // WebKit notifies this callback regardless if the subtree of the node is a document tree or a floating subtree.
454 // Implementation can determine the type of subtree by seeing insertionPoint ->inDocument().
455 // For a performance reason, notifications are delivered only to ContainerNo de subclasses if the insertionPoint is out of document.
456 //
457 // There are another callback named didNotifySubtreeInsertionsToDocument(), which is called after all the descendant is notified,
458 // if this node was inserted into the document tree. Only a few subclasses a ctually need this. To utilize this, the node should
459 // return InsertionShouldCallDidNotifySubtreeInsertions from insertedInto().
460 //
461 enum InsertionNotificationRequest {
462 InsertionDone,
463 InsertionShouldCallDidNotifySubtreeInsertions
464 };
465
466 virtual InsertionNotificationRequest insertedInto(ContainerNode* insertionPo int);
467 virtual void didNotifySubtreeInsertionsToDocument() { }
468
469 // Notifies the node that it is no longer part of the tree.
470 //
471 // This is a dual of insertedInto(), and is similar to the DOMNodeRemovedFro mDocument DOM event, but does not require the overhead of event
472 // dispatching, and is called _after_ the node is removed from the tree.
473 //
474 virtual void removedFrom(ContainerNode* insertionPoint); 446 virtual void removedFrom(ContainerNode* insertionPoint);
475 447
476 String debugName() const; 448 String debugName() const;
477 449
478 #ifndef NDEBUG 450 #ifndef NDEBUG
479 virtual void formatForDebugger(char* buffer, unsigned length) const; 451 virtual void formatForDebugger(char* buffer, unsigned length) const;
480 452
481 void showNode(const char* prefix = "") const; 453 void showNode(const char* prefix = "") const;
482 void showTreeForThis() const; 454 void showTreeForThis() const;
483 void showNodePathForThis() const; 455 void showNodePathForThis() const;
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 } // namespace blink 724 } // namespace blink
753 725
754 #ifndef NDEBUG 726 #ifndef NDEBUG
755 // Outside the WebCore namespace for ease of invocation from gdb. 727 // Outside the WebCore namespace for ease of invocation from gdb.
756 void showNode(const blink::Node*); 728 void showNode(const blink::Node*);
757 void showTree(const blink::Node*); 729 void showTree(const blink::Node*);
758 void showNodePath(const blink::Node*); 730 void showNodePath(const blink::Node*);
759 #endif 731 #endif
760 732
761 #endif // SKY_ENGINE_CORE_DOM_NODE_H_ 733 #endif // SKY_ENGINE_CORE_DOM_NODE_H_
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Element.cpp ('k') | sky/engine/core/dom/shadow/InsertionPoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698