| OLD | NEW |
| 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 13 matching lines...) Expand all Loading... |
| 24 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #include "core/editing/serializers/Serialization.h" | 29 #include "core/editing/serializers/Serialization.h" |
| 30 | 30 |
| 31 #include "bindings/core/v8/ExceptionState.h" | 31 #include "bindings/core/v8/ExceptionState.h" |
| 32 #include "core/CSSValueKeywords.h" | 32 #include "core/CSSValueKeywords.h" |
| 33 #include "core/HTMLNames.h" | 33 #include "core/HTMLNames.h" |
| 34 #include "core/css/CSSPrimitiveValue.h" | 34 #include "core/css/CSSIdentifierValue.h" |
| 35 #include "core/css/CSSValue.h" | 35 #include "core/css/CSSValue.h" |
| 36 #include "core/css/StylePropertySet.h" | 36 #include "core/css/StylePropertySet.h" |
| 37 #include "core/dom/CDATASection.h" | 37 #include "core/dom/CDATASection.h" |
| 38 #include "core/dom/ChildListMutationScope.h" | 38 #include "core/dom/ChildListMutationScope.h" |
| 39 #include "core/dom/Comment.h" | 39 #include "core/dom/Comment.h" |
| 40 #include "core/dom/ContextFeatures.h" | 40 #include "core/dom/ContextFeatures.h" |
| 41 #include "core/dom/DocumentFragment.h" | 41 #include "core/dom/DocumentFragment.h" |
| 42 #include "core/dom/ElementTraversal.h" | 42 #include "core/dom/ElementTraversal.h" |
| 43 #include "core/dom/ExceptionCode.h" | 43 #include "core/dom/ExceptionCode.h" |
| 44 #include "core/dom/NodeTraversal.h" | 44 #include "core/dom/NodeTraversal.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return ancestorToRetainStructureAndAppearanceForBlock(commonAncestorBlock); | 156 return ancestorToRetainStructureAndAppearanceForBlock(commonAncestorBlock); |
| 157 } | 157 } |
| 158 | 158 |
| 159 bool propertyMissingOrEqualToNone(StylePropertySet* style, CSSPropertyID propert
yID) | 159 bool propertyMissingOrEqualToNone(StylePropertySet* style, CSSPropertyID propert
yID) |
| 160 { | 160 { |
| 161 if (!style) | 161 if (!style) |
| 162 return false; | 162 return false; |
| 163 const CSSValue* value = style->getPropertyCSSValue(propertyID); | 163 const CSSValue* value = style->getPropertyCSSValue(propertyID); |
| 164 if (!value) | 164 if (!value) |
| 165 return true; | 165 return true; |
| 166 if (!value->isPrimitiveValue()) | 166 if (!value->isIdentifierValue()) |
| 167 return false; | 167 return false; |
| 168 return toCSSPrimitiveValue(value)->getValueID() == CSSValueNone; | 168 return toCSSIdentifierValue(value)->getValueID() == CSSValueNone; |
| 169 } | 169 } |
| 170 | 170 |
| 171 template<typename Strategy> | 171 template<typename Strategy> |
| 172 static HTMLElement* highestAncestorToWrapMarkup(const PositionTemplate<Strategy>
& startPosition, const PositionTemplate<Strategy>& endPosition, EAnnotateForInte
rchange shouldAnnotate, Node* constrainingAncestor) | 172 static HTMLElement* highestAncestorToWrapMarkup(const PositionTemplate<Strategy>
& startPosition, const PositionTemplate<Strategy>& endPosition, EAnnotateForInte
rchange shouldAnnotate, Node* constrainingAncestor) |
| 173 { | 173 { |
| 174 Node* firstNode = startPosition.nodeAsRangeFirstNode(); | 174 Node* firstNode = startPosition.nodeAsRangeFirstNode(); |
| 175 // For compatibility reason, we use container node of start and end | 175 // For compatibility reason, we use container node of start and end |
| 176 // positions rather than first node and last node in selection. | 176 // positions rather than first node and last node in selection. |
| 177 Node* commonAncestor = Strategy::commonAncestor(*startPosition.computeContai
nerNode(), *endPosition.computeContainerNode()); | 177 Node* commonAncestor = Strategy::commonAncestor(*startPosition.computeContai
nerNode(), *endPosition.computeContainerNode()); |
| 178 DCHECK(commonAncestor); | 178 DCHECK(commonAncestor); |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 Text* textNext = toText(next); | 674 Text* textNext = toText(next); |
| 675 textNode->appendData(textNext->data()); | 675 textNode->appendData(textNext->data()); |
| 676 if (textNext->parentNode()) // Might have been removed by mutation event. | 676 if (textNext->parentNode()) // Might have been removed by mutation event. |
| 677 textNext->remove(exceptionState); | 677 textNext->remove(exceptionState); |
| 678 } | 678 } |
| 679 | 679 |
| 680 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; | 680 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; |
| 681 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingInFlatTreeStrat
egy>; | 681 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingInFlatTreeStrat
egy>; |
| 682 | 682 |
| 683 } // namespace blink | 683 } // namespace blink |
| OLD | NEW |