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

Side by Side Diff: Source/core/html/HTMLElement.cpp

Issue 23717008: Remove useless null checks from Node::document() call sites (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/editing/markup.cpp ('k') | Source/core/html/LabelableElement.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 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 { 922 {
923 Node* strongDirectionalityTextNode; 923 Node* strongDirectionalityTextNode;
924 TextDirection textDirection = directionality(&strongDirectionalityTextNode); 924 TextDirection textDirection = directionality(&strongDirectionalityTextNode);
925 setHasDirAutoFlagRecursively(this, true, strongDirectionalityTextNode); 925 setHasDirAutoFlagRecursively(this, true, strongDirectionalityTextNode);
926 if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection) 926 if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection)
927 setNeedsStyleRecalc(); 927 setNeedsStyleRecalc();
928 } 928 }
929 929
930 void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Node* beforeC hange, int childCountDelta) 930 void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Node* beforeC hange, int childCountDelta)
931 { 931 {
932 if ((!document() || document()->renderer()) && childCountDelta < 0) { 932 if (document()->renderer() && childCountDelta < 0) {
933 Node* node = beforeChange ? NodeTraversal::nextSkippingChildren(beforeCh ange) : 0; 933 Node* node = beforeChange ? NodeTraversal::nextSkippingChildren(beforeCh ange) : 0;
934 for (int counter = 0; node && counter < childCountDelta; counter++, node = NodeTraversal::nextSkippingChildren(node)) { 934 for (int counter = 0; node && counter < childCountDelta; counter++, node = NodeTraversal::nextSkippingChildren(node)) {
935 if (elementAffectsDirectionality(node)) 935 if (elementAffectsDirectionality(node))
936 continue; 936 continue;
937 937
938 setHasDirAutoFlagRecursively(node, false); 938 setHasDirAutoFlagRecursively(node, false);
939 } 939 }
940 } 940 }
941 941
942 if (!selfOrAncestorHasDirAutoAttribute()) 942 if (!selfOrAncestorHasDirAutoAttribute())
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 #ifndef NDEBUG 1099 #ifndef NDEBUG
1100 1100
1101 // For use in the debugger 1101 // For use in the debugger
1102 void dumpInnerHTML(WebCore::HTMLElement*); 1102 void dumpInnerHTML(WebCore::HTMLElement*);
1103 1103
1104 void dumpInnerHTML(WebCore::HTMLElement* element) 1104 void dumpInnerHTML(WebCore::HTMLElement* element)
1105 { 1105 {
1106 printf("%s\n", element->innerHTML().ascii().data()); 1106 printf("%s\n", element->innerHTML().ascii().data());
1107 } 1107 }
1108 #endif 1108 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/markup.cpp ('k') | Source/core/html/LabelableElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698