| 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 // Close up the ancestors. | 379 // Close up the ancestors. |
| 380 while (!ancestorsToClose.isEmpty()) { | 380 while (!ancestorsToClose.isEmpty()) { |
| 381 ContainerNode* ancestor = ancestorsToClose.last(); | 381 ContainerNode* ancestor = ancestorsToClose.last(); |
| 382 DCHECK(ancestor); | 382 DCHECK(ancestor); |
| 383 if (next && next != pastEnd && Strategy::isDescendantOf(*next, *ancestor)) | 383 if (next && next != pastEnd && Strategy::isDescendantOf(*next, *ancestor)) |
| 384 break; | 384 break; |
| 385 // Not at the end of the range, close ancestors up to sibling of next | 385 // Not at the end of the range, close ancestors up to sibling of next |
| 386 // node. | 386 // node. |
| 387 appendEndMarkup(*ancestor); | 387 appendEndMarkup(*ancestor); |
| 388 lastClosed = ancestor; | 388 lastClosed = ancestor; |
| 389 ancestorsToClose.removeLast(); | 389 ancestorsToClose.pop_back(); |
| 390 } | 390 } |
| 391 | 391 |
| 392 // Surround the currently accumulated markup with markup for ancestors we | 392 // Surround the currently accumulated markup with markup for ancestors we |
| 393 // never opened as we leave the subtree(s) rooted at those ancestors. | 393 // never opened as we leave the subtree(s) rooted at those ancestors. |
| 394 ContainerNode* nextParent = next ? Strategy::parent(*next) : nullptr; | 394 ContainerNode* nextParent = next ? Strategy::parent(*next) : nullptr; |
| 395 if (next == pastEnd || n == nextParent) | 395 if (next == pastEnd || n == nextParent) |
| 396 continue; | 396 continue; |
| 397 | 397 |
| 398 DCHECK(n); | 398 DCHECK(n); |
| 399 Node* lastAncestorClosedOrSelf = | 399 Node* lastAncestorClosedOrSelf = |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 if (element.isHTMLElement() && shouldAnnotate()) | 538 if (element.isHTMLElement() && shouldAnnotate()) |
| 539 inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element)); | 539 inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element)); |
| 540 | 540 |
| 541 return inlineStyle; | 541 return inlineStyle; |
| 542 } | 542 } |
| 543 | 543 |
| 544 template class StyledMarkupSerializer<EditingStrategy>; | 544 template class StyledMarkupSerializer<EditingStrategy>; |
| 545 template class StyledMarkupSerializer<EditingInFlatTreeStrategy>; | 545 template class StyledMarkupSerializer<EditingInFlatTreeStrategy>; |
| 546 | 546 |
| 547 } // namespace blink | 547 } // namespace blink |
| OLD | NEW |