OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. | 4 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. |
5 * Copyright (C) 2011 Igalia S.L. | 5 * Copyright (C) 2011 Igalia S.L. |
6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 const VisiblePositionTemplate<Strategy>& v) { | 153 const VisiblePositionTemplate<Strategy>& v) { |
154 return needInterchangeNewlineAfter(previousPositionOf(v)); | 154 return needInterchangeNewlineAfter(previousPositionOf(v)); |
155 } | 155 } |
156 | 156 |
157 template <typename Strategy> | 157 template <typename Strategy> |
158 static bool areSameRanges(Node* node, | 158 static bool areSameRanges(Node* node, |
159 const PositionTemplate<Strategy>& startPosition, | 159 const PositionTemplate<Strategy>& startPosition, |
160 const PositionTemplate<Strategy>& endPosition) { | 160 const PositionTemplate<Strategy>& endPosition) { |
161 DCHECK(node); | 161 DCHECK(node); |
162 const EphemeralRange range = | 162 const EphemeralRange range = |
163 VisibleSelection::selectionFromContentsOfNode(node) | 163 createVisibleSelection( |
| 164 SelectionInDOMTree::Builder().selectAllChildren(*node).build()) |
164 .toNormalizedEphemeralRange(); | 165 .toNormalizedEphemeralRange(); |
165 return toPositionInDOMTree(startPosition) == range.startPosition() && | 166 return toPositionInDOMTree(startPosition) == range.startPosition() && |
166 toPositionInDOMTree(endPosition) == range.endPosition(); | 167 toPositionInDOMTree(endPosition) == range.endPosition(); |
167 } | 168 } |
168 | 169 |
169 static EditingStyle* styleFromMatchedRulesAndInlineDecl( | 170 static EditingStyle* styleFromMatchedRulesAndInlineDecl( |
170 const HTMLElement* element) { | 171 const HTMLElement* element) { |
171 EditingStyle* style = EditingStyle::create(element->inlineStyle()); | 172 EditingStyle* style = EditingStyle::create(element->inlineStyle()); |
172 // FIXME: Having to const_cast here is ugly, but it is quite a bit of work to | 173 // FIXME: Having to const_cast here is ugly, but it is quite a bit of work to |
173 // untangle the non-const-ness of styleFromMatchedRulesForElement. | 174 // untangle the non-const-ness of styleFromMatchedRulesForElement. |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 if (element.isHTMLElement() && shouldAnnotate()) | 538 if (element.isHTMLElement() && shouldAnnotate()) |
538 inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element)); | 539 inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element)); |
539 | 540 |
540 return inlineStyle; | 541 return inlineStyle; |
541 } | 542 } |
542 | 543 |
543 template class StyledMarkupSerializer<EditingStrategy>; | 544 template class StyledMarkupSerializer<EditingStrategy>; |
544 template class StyledMarkupSerializer<EditingInFlatTreeStrategy>; | 545 template class StyledMarkupSerializer<EditingInFlatTreeStrategy>; |
545 | 546 |
546 } // namespace blink | 547 } // namespace blink |
OLD | NEW |