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

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

Issue 867963006: Add the <t> element and ignore whitespace outside it. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Do it for a whole subtree. Created 5 years, 11 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
« no previous file with comments | « sky/engine/core/dom/Node.h ('k') | sky/engine/core/dom/Text.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, 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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 if (inActiveChain()) 704 if (inActiveChain())
705 doc.activeChainNodeDetached(this); 705 doc.activeChainNodeDetached(this);
706 doc.userActionElements().didDetach(this); 706 doc.userActionElements().didDetach(this);
707 } 707 }
708 } 708 }
709 709
710 setStyleChange(NeedsReattachStyleChange); 710 setStyleChange(NeedsReattachStyleChange);
711 setChildNeedsStyleRecalc(); 711 setChildNeedsStyleRecalc();
712 } 712 }
713 713
714 void Node::reattachWhitespaceSiblings(Text* start)
715 {
716 for (Node* sibling = start; sibling; sibling = sibling->nextSibling()) {
717 if (sibling->isTextNode() && toText(sibling)->containsOnlyWhitespace()) {
718 bool hadRenderer = !!sibling->renderer();
719 sibling->reattach();
720 // If the reattach didn't toggle the visibility of the whitespace we don't
721 // need to continue reattaching siblings since they won't toggle vis ibility
722 // either.
723 if (hadRenderer == !!sibling->renderer())
724 return;
725 } else if (sibling->renderer()) {
726 return;
727 }
728 }
729 }
730
731 // FIXME: This code is used by editing. Seems like it could move over there and not pollute Node. 714 // FIXME: This code is used by editing. Seems like it could move over there and not pollute Node.
732 Node *Node::previousNodeConsideringAtomicNodes() const 715 Node *Node::previousNodeConsideringAtomicNodes() const
733 { 716 {
734 if (previousSibling()) { 717 if (previousSibling()) {
735 Node *n = previousSibling(); 718 Node *n = previousSibling();
736 while (!isAtomicNode(n) && n->lastChild()) 719 while (!isAtomicNode(n) && n->lastChild())
737 n = n->lastChild(); 720 n = n->lastChild();
738 return n; 721 return n;
739 } 722 }
740 else if (parentNode()) { 723 else if (parentNode()) {
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1680 node->showTreeForThis(); 1663 node->showTreeForThis();
1681 } 1664 }
1682 1665
1683 void showNodePath(const blink::Node* node) 1666 void showNodePath(const blink::Node* node)
1684 { 1667 {
1685 if (node) 1668 if (node)
1686 node->showNodePathForThis(); 1669 node->showNodePathForThis();
1687 } 1670 }
1688 1671
1689 #endif 1672 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Node.h ('k') | sky/engine/core/dom/Text.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698