| 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 } | 371 } |
| 372 | 372 |
| 373 // If we didn't insert open tag and there's no more siblings or we're at the | 373 // If we didn't insert open tag and there's no more siblings or we're at the |
| 374 // end of the traversal, take care of ancestors. | 374 // end of the traversal, take care of ancestors. |
| 375 // FIXME: What happens if we just inserted open tag and reached the end? | 375 // FIXME: What happens if we just inserted open tag and reached the end? |
| 376 if (Strategy::nextSibling(*n) && next != pastEnd) | 376 if (Strategy::nextSibling(*n) && next != pastEnd) |
| 377 continue; | 377 continue; |
| 378 | 378 |
| 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.back(); |
| 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.pop_back(); | 389 ancestorsToClose.pop_back(); |
| 390 } | 390 } |
| 391 | 391 |
| (...skipping 146 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 |