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

Side by Side Diff: Source/core/editing/EditingStyle.cpp

Issue 667403002: Rename nodes/elements traversal function names. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename to startsAt (and startsAfter) Created 6 years, 2 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/CompositeEditCommand.cpp ('k') | Source/core/editing/FrameSelection.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) 2007, 2008, 2009 Apple Computer, Inc. 2 * Copyright (C) 2007, 2008, 2009 Apple Computer, Inc.
3 * Copyright (C) 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2010, 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 TriState EditingStyle::triStateOfStyle(const VisibleSelection& selection) const 705 TriState EditingStyle::triStateOfStyle(const VisibleSelection& selection) const
706 { 706 {
707 if (!selection.isCaretOrRange()) 707 if (!selection.isCaretOrRange())
708 return FalseTriState; 708 return FalseTriState;
709 709
710 if (selection.isCaret()) 710 if (selection.isCaret())
711 return triStateOfStyle(EditingStyle::styleAtSelectionStart(selection).ge t()); 711 return triStateOfStyle(EditingStyle::styleAtSelectionStart(selection).ge t());
712 712
713 TriState state = FalseTriState; 713 TriState state = FalseTriState;
714 bool nodeIsStart = true; 714 bool nodeIsStart = true;
715 for (Node& node : NodeTraversal::from(selection.start().deprecatedNode())) { 715 for (Node& node : NodeTraversal::startsAt(selection.start().deprecatedNode() )) {
716 if (node.renderer() && node.hasEditableStyle()) { 716 if (node.renderer() && node.hasEditableStyle()) {
717 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> nodeStyle = CSSCompu tedStyleDeclaration::create(&node); 717 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> nodeStyle = CSSCompu tedStyleDeclaration::create(&node);
718 if (nodeStyle) { 718 if (nodeStyle) {
719 TriState nodeState = triStateOfStyle(nodeStyle.get(), node.isTex tNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreText OnlyProperties); 719 TriState nodeState = triStateOfStyle(nodeStyle.get(), node.isTex tNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreText OnlyProperties);
720 if (nodeIsStart) { 720 if (nodeIsStart) {
721 state = nodeState; 721 state = nodeState;
722 nodeIsStart = false; 722 nodeIsStart = false;
723 } else if (state != nodeState && node.isTextNode()) { 723 } else if (state != nodeState && node.isTextNode()) {
724 state = MixedTriState; 724 state = MixedTriState;
725 break; 725 break;
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
1678 { 1678 {
1679 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { 1679 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
1680 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu tedStyleDeclaration::create(ancestor); 1680 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu tedStyleDeclaration::create(ancestor);
1681 if (!hasTransparentBackgroundColor(ancestorStyle.get())) 1681 if (!hasTransparentBackgroundColor(ancestorStyle.get()))
1682 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor ); 1682 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor );
1683 } 1683 }
1684 return nullptr; 1684 return nullptr;
1685 } 1685 }
1686 1686
1687 } 1687 }
OLDNEW
« no previous file with comments | « Source/core/editing/CompositeEditCommand.cpp ('k') | Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698