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

Side by Side Diff: third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp

Issue 1413583002: Make ElementShadow::youngestShadowRoot() return a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use m_shadowRoots.isEmpty() Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2011 Igalia S.L. 4 * Copyright (C) 2011 Igalia S.L.
5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 5 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 template<> 72 template<>
73 bool handleSelectionBoundary<EditingInComposedTreeStrategy>(const Node& node) 73 bool handleSelectionBoundary<EditingInComposedTreeStrategy>(const Node& node)
74 { 74 {
75 if (!node.isElementNode()) 75 if (!node.isElementNode())
76 return false; 76 return false;
77 ElementShadow* shadow = toElement(node).shadow(); 77 ElementShadow* shadow = toElement(node).shadow();
78 if (!shadow) 78 if (!shadow)
79 return false; 79 return false;
80 return shadow->youngestShadowRoot()->type() == ShadowRootType::UserAgent; 80 return shadow->youngestShadowRoot().type() == ShadowRootType::UserAgent;
81 } 81 }
82 82
83 } // namespace 83 } // namespace
84 84
85 using namespace HTMLNames; 85 using namespace HTMLNames;
86 86
87 template<typename Strategy> 87 template<typename Strategy>
88 class StyledMarkupTraverser { 88 class StyledMarkupTraverser {
89 WTF_MAKE_NONCOPYABLE(StyledMarkupTraverser); 89 WTF_MAKE_NONCOPYABLE(StyledMarkupTraverser);
90 STACK_ALLOCATED(); 90 STACK_ALLOCATED();
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 if (element.isHTMLElement() && shouldAnnotate()) 475 if (element.isHTMLElement() && shouldAnnotate())
476 inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element) ); 476 inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element) );
477 477
478 return inlineStyle; 478 return inlineStyle;
479 } 479 }
480 480
481 template class StyledMarkupSerializer<EditingStrategy>; 481 template class StyledMarkupSerializer<EditingStrategy>;
482 template class StyledMarkupSerializer<EditingInComposedTreeStrategy>; 482 template class StyledMarkupSerializer<EditingInComposedTreeStrategy>;
483 483
484 } // namespace blink 484 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698