| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 FirstPositionInOrBeforeNode(first_node), | 202 FirstPositionInOrBeforeNode(first_node), |
| 203 IsMailHTMLBlockquoteElement, kCanCrossEditingBoundary))) | 203 IsMailHTMLBlockquoteElement, kCanCrossEditingBoundary))) |
| 204 special_common_ancestor = highest_mail_blockquote; | 204 special_common_ancestor = highest_mail_blockquote; |
| 205 } | 205 } |
| 206 | 206 |
| 207 Node* check_ancestor = | 207 Node* check_ancestor = |
| 208 special_common_ancestor ? special_common_ancestor : common_ancestor; | 208 special_common_ancestor ? special_common_ancestor : common_ancestor; |
| 209 if (check_ancestor->GetLayoutObject()) { | 209 if (check_ancestor->GetLayoutObject()) { |
| 210 HTMLElement* new_special_common_ancestor = | 210 HTMLElement* new_special_common_ancestor = |
| 211 ToHTMLElement(HighestEnclosingNodeOfType( | 211 ToHTMLElement(HighestEnclosingNodeOfType( |
| 212 Position::FirstPositionInNode(check_ancestor), | 212 Position::FirstPositionInNode(*check_ancestor), |
| 213 &IsPresentationalHTMLElement, kCanCrossEditingBoundary, | 213 &IsPresentationalHTMLElement, kCanCrossEditingBoundary, |
| 214 constraining_ancestor)); | 214 constraining_ancestor)); |
| 215 if (new_special_common_ancestor) | 215 if (new_special_common_ancestor) |
| 216 special_common_ancestor = new_special_common_ancestor; | 216 special_common_ancestor = new_special_common_ancestor; |
| 217 } | 217 } |
| 218 | 218 |
| 219 // If a single tab is selected, commonAncestor will be a text node inside a | 219 // If a single tab is selected, commonAncestor will be a text node inside a |
| 220 // tab span. If two or more tabs are selected, commonAncestor will be the tab | 220 // tab span. If two or more tabs are selected, commonAncestor will be the tab |
| 221 // span. In either case, if there is a specialCommonAncestor already, it will | 221 // span. In either case, if there is a specialCommonAncestor already, it will |
| 222 // necessarily be above any tab span that needs to be included. | 222 // necessarily be above any tab span that needs to be included. |
| 223 if (!special_common_ancestor && IsTabHTMLSpanElementTextNode(common_ancestor)) | 223 if (!special_common_ancestor && IsTabHTMLSpanElementTextNode(common_ancestor)) |
| 224 special_common_ancestor = | 224 special_common_ancestor = |
| 225 toHTMLSpanElement(Strategy::Parent(*common_ancestor)); | 225 toHTMLSpanElement(Strategy::Parent(*common_ancestor)); |
| 226 if (!special_common_ancestor && IsTabHTMLSpanElement(common_ancestor)) | 226 if (!special_common_ancestor && IsTabHTMLSpanElement(common_ancestor)) |
| 227 special_common_ancestor = toHTMLSpanElement(common_ancestor); | 227 special_common_ancestor = toHTMLSpanElement(common_ancestor); |
| 228 | 228 |
| 229 if (HTMLAnchorElement* enclosing_anchor = | 229 if (HTMLAnchorElement* enclosing_anchor = |
| 230 toHTMLAnchorElement(EnclosingElementWithTag( | 230 toHTMLAnchorElement(EnclosingElementWithTag( |
| 231 Position::FirstPositionInNode(special_common_ancestor | 231 Position::FirstPositionInNode(special_common_ancestor |
| 232 ? special_common_ancestor | 232 ? *special_common_ancestor |
| 233 : common_ancestor), | 233 : *common_ancestor), |
| 234 aTag))) | 234 aTag))) |
| 235 special_common_ancestor = enclosing_anchor; | 235 special_common_ancestor = enclosing_anchor; |
| 236 | 236 |
| 237 return special_common_ancestor; | 237 return special_common_ancestor; |
| 238 } | 238 } |
| 239 | 239 |
| 240 template <typename Strategy> | 240 template <typename Strategy> |
| 241 class CreateMarkupAlgorithm { | 241 class CreateMarkupAlgorithm { |
| 242 public: | 242 public: |
| 243 static String CreateMarkup( | 243 static String CreateMarkup( |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 text_node->appendData(text_next->data()); | 757 text_node->appendData(text_next->data()); |
| 758 if (text_next->parentNode()) // Might have been removed by mutation event. | 758 if (text_next->parentNode()) // Might have been removed by mutation event. |
| 759 text_next->remove(exception_state); | 759 text_next->remove(exception_state); |
| 760 } | 760 } |
| 761 | 761 |
| 762 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; | 762 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; |
| 763 template class CORE_TEMPLATE_EXPORT | 763 template class CORE_TEMPLATE_EXPORT |
| 764 CreateMarkupAlgorithm<EditingInFlatTreeStrategy>; | 764 CreateMarkupAlgorithm<EditingInFlatTreeStrategy>; |
| 765 | 765 |
| 766 } // namespace blink | 766 } // namespace blink |
| OLD | NEW |