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

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

Issue 977113003: Rename renderer() to layoutObject(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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/html/HTMLDetailsElement.cpp ('k') | Source/core/html/HTMLEmbedElement.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-2008, 2013, 2014 Apple Inc. All rights reserved. 4 * Copyright (C) 2004-2008, 2013, 2014 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 removeChildren(); 420 removeChildren();
421 return; 421 return;
422 } 422 }
423 replaceChildrenWithText(this, text, exceptionState); 423 replaceChildrenWithText(this, text, exceptionState);
424 return; 424 return;
425 } 425 }
426 426
427 // FIXME: Do we need to be able to detect preserveNewline style even when th ere's no renderer? 427 // FIXME: Do we need to be able to detect preserveNewline style even when th ere's no renderer?
428 // FIXME: Can the renderer be out of date here? Do we need to call updateSty leIfNeeded? 428 // FIXME: Can the renderer be out of date here? Do we need to call updateSty leIfNeeded?
429 // For example, for the contents of textarea elements that are display:none? 429 // For example, for the contents of textarea elements that are display:none?
430 LayoutObject* r = renderer(); 430 LayoutObject* r = layoutObject();
431 if (r && r->style()->preserveNewline()) { 431 if (r && r->style()->preserveNewline()) {
432 if (!text.contains('\r')) { 432 if (!text.contains('\r')) {
433 replaceChildrenWithText(this, text, exceptionState); 433 replaceChildrenWithText(this, text, exceptionState);
434 return; 434 return;
435 } 435 }
436 String textWithConsistentLineBreaks = text; 436 String textWithConsistentLineBreaks = text;
437 textWithConsistentLineBreaks.replace("\r\n", "\n"); 437 textWithConsistentLineBreaks.replace("\r\n", "\n");
438 textWithConsistentLineBreaks.replace('\r', '\n'); 438 textWithConsistentLineBreaks.replace('\r', '\n');
439 replaceChildrenWithText(this, textWithConsistentLineBreaks, exceptionSta te); 439 replaceChildrenWithText(this, textWithConsistentLineBreaks, exceptionSta te);
440 return; 440 return;
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 if (equalIgnoringCase(value, "auto")) 773 if (equalIgnoringCase(value, "auto"))
774 calculateAndAdjustDirectionality(); 774 calculateAndAdjustDirectionality();
775 } 775 }
776 776
777 void HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged(Element * child) 777 void HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged(Element * child)
778 { 778 {
779 ASSERT(selfOrAncestorHasDirAutoAttribute()); 779 ASSERT(selfOrAncestorHasDirAutoAttribute());
780 Node* strongDirectionalityTextNode; 780 Node* strongDirectionalityTextNode;
781 TextDirection textDirection = directionality(&strongDirectionalityTextNode); 781 TextDirection textDirection = directionality(&strongDirectionalityTextNode);
782 setHasDirAutoFlagRecursively(child, false); 782 setHasDirAutoFlagRecursively(child, false);
783 if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection) { 783 if (layoutObject() && layoutObject()->style() && layoutObject()->style()->di rection() != textDirection) {
784 Element* elementToAdjust = this; 784 Element* elementToAdjust = this;
785 for (; elementToAdjust; elementToAdjust = elementToAdjust->parentElement ()) { 785 for (; elementToAdjust; elementToAdjust = elementToAdjust->parentElement ()) {
786 if (elementAffectsDirectionality(elementToAdjust)) { 786 if (elementAffectsDirectionality(elementToAdjust)) {
787 elementToAdjust->setNeedsStyleRecalc(SubtreeStyleChange, StyleCh angeReasonForTracing::create(StyleChangeReason::WritingModeChange)); 787 elementToAdjust->setNeedsStyleRecalc(SubtreeStyleChange, StyleCh angeReasonForTracing::create(StyleChangeReason::WritingModeChange));
788 return; 788 return;
789 } 789 }
790 } 790 }
791 } 791 }
792 } 792 }
793 793
794 void HTMLElement::calculateAndAdjustDirectionality() 794 void HTMLElement::calculateAndAdjustDirectionality()
795 { 795 {
796 Node* strongDirectionalityTextNode; 796 Node* strongDirectionalityTextNode;
797 TextDirection textDirection = directionality(&strongDirectionalityTextNode); 797 TextDirection textDirection = directionality(&strongDirectionalityTextNode);
798 setHasDirAutoFlagRecursively(this, hasDirectionAuto(), strongDirectionalityT extNode); 798 setHasDirAutoFlagRecursively(this, hasDirectionAuto(), strongDirectionalityT extNode);
799 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root()) 799 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root())
800 setHasDirAutoFlagRecursively(root, hasDirectionAuto()); 800 setHasDirAutoFlagRecursively(root, hasDirectionAuto());
801 if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection) 801 if (layoutObject() && layoutObject()->style() && layoutObject()->style()->di rection() != textDirection)
802 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::cre ate(StyleChangeReason::WritingModeChange)); 802 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::cre ate(StyleChangeReason::WritingModeChange));
803 } 803 }
804 804
805 void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(const Childre nChange& change) 805 void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(const Childre nChange& change)
806 { 806 {
807 if (!selfOrAncestorHasDirAutoAttribute()) 807 if (!selfOrAncestorHasDirAutoAttribute())
808 return; 808 return;
809 809
810 Node* oldMarkedNode = change.siblingBeforeChange ? NodeTraversal::nextSkippi ngChildren(*change.siblingBeforeChange) : 0; 810 Node* oldMarkedNode = change.siblingBeforeChange ? NodeTraversal::nextSkippi ngChildren(*change.siblingBeforeChange) : 0;
811 while (oldMarkedNode && elementAffectsDirectionality(oldMarkedNode)) 811 while (oldMarkedNode && elementAffectsDirectionality(oldMarkedNode))
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 #ifndef NDEBUG 1036 #ifndef NDEBUG
1037 1037
1038 // For use in the debugger 1038 // For use in the debugger
1039 void dumpInnerHTML(blink::HTMLElement*); 1039 void dumpInnerHTML(blink::HTMLElement*);
1040 1040
1041 void dumpInnerHTML(blink::HTMLElement* element) 1041 void dumpInnerHTML(blink::HTMLElement* element)
1042 { 1042 {
1043 printf("%s\n", element->innerHTML().ascii().data()); 1043 printf("%s\n", element->innerHTML().ascii().data());
1044 } 1044 }
1045 #endif 1045 #endif
OLDNEW
« no previous file with comments | « Source/core/html/HTMLDetailsElement.cpp ('k') | Source/core/html/HTMLEmbedElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698