Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: Source/core/editing/markup.cpp

Issue 1195743002: Have StyledMarkupSerializer work on the Composed tree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: reviews Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/editing/markup.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 return CreateMarkupAlgorithm<EditingStrategy>::createMarkup(range->startPosi tion(), range->endPosition(), shouldAnnotate, convertBlocksToInlines, shouldReso lveURLs, constrainingAncestor); 281 return CreateMarkupAlgorithm<EditingStrategy>::createMarkup(range->startPosi tion(), range->endPosition(), shouldAnnotate, convertBlocksToInlines, shouldReso lveURLs, constrainingAncestor);
282 } 282 }
283 283
284 String createMarkup(const Position& startPosition, const Position& endPosition, EAnnotateForInterchange shouldAnnotate, ConvertBlocksToInlines convertBlocksToIn lines, EAbsoluteURLs shouldResolveURLs, Node* constrainingAncestor) 284 String createMarkup(const Position& startPosition, const Position& endPosition, EAnnotateForInterchange shouldAnnotate, ConvertBlocksToInlines convertBlocksToIn lines, EAbsoluteURLs shouldResolveURLs, Node* constrainingAncestor)
285 { 285 {
286 ASSERT(startPosition.compareTo(endPosition) <= 0); 286 ASSERT(startPosition.compareTo(endPosition) <= 0);
287 return CreateMarkupAlgorithm<EditingStrategy>::createMarkup(startPosition, e ndPosition, shouldAnnotate, convertBlocksToInlines, shouldResolveURLs, constrain ingAncestor); 287 return CreateMarkupAlgorithm<EditingStrategy>::createMarkup(startPosition, e ndPosition, shouldAnnotate, convertBlocksToInlines, shouldResolveURLs, constrain ingAncestor);
288 } 288 }
289 289
290 String createMarkup(const PositionInComposedTree& startPosition, const PositionI nComposedTree& endPosition, EAnnotateForInterchange shouldAnnotate, ConvertBlock sToInlines convertBlocksToInlines, EAbsoluteURLs shouldResolveURLs, Node* constr ainingAncestor)
291 {
292 ASSERT(startPosition.compareTo(endPosition) <= 0);
293 return CreateMarkupAlgorithm<EditingInComposedTreeStrategy>::createMarkup(st artPosition, endPosition, shouldAnnotate, convertBlocksToInlines, shouldResolveU RLs, constrainingAncestor);
294 }
295
290 PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentFromMarkup(Document& docu ment, const String& markup, const String& baseURL, ParserContentPolicy parserCon tentPolicy) 296 PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentFromMarkup(Document& docu ment, const String& markup, const String& baseURL, ParserContentPolicy parserCon tentPolicy)
291 { 297 {
292 // We use a fake body element here to trick the HTML parser to using the InB ody insertion mode. 298 // We use a fake body element here to trick the HTML parser to using the InB ody insertion mode.
293 RefPtrWillBeRawPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(docum ent); 299 RefPtrWillBeRawPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(docum ent);
294 RefPtrWillBeRawPtr<DocumentFragment> fragment = DocumentFragment::create(doc ument); 300 RefPtrWillBeRawPtr<DocumentFragment> fragment = DocumentFragment::create(doc ument);
295 301
296 fragment->parseHTML(markup, fakeBody.get(), parserContentPolicy); 302 fragment->parseHTML(markup, fakeBody.get(), parserContentPolicy);
297 303
298 if (!baseURL.isEmpty() && baseURL != blankURL() && baseURL != document.baseU RL()) 304 if (!baseURL.isEmpty() && baseURL != blankURL() && baseURL != document.baseU RL())
299 completeURLs(*fragment, baseURL); 305 completeURLs(*fragment, baseURL);
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 if (!next || !next->isTextNode()) 716 if (!next || !next->isTextNode())
711 return; 717 return;
712 718
713 RefPtrWillBeRawPtr<Text> textNext = toText(next); 719 RefPtrWillBeRawPtr<Text> textNext = toText(next);
714 textNode->appendData(textNext->data()); 720 textNode->appendData(textNext->data());
715 if (textNext->parentNode()) // Might have been removed by mutation event. 721 if (textNext->parentNode()) // Might have been removed by mutation event.
716 textNext->remove(exceptionState); 722 textNext->remove(exceptionState);
717 } 723 }
718 724
719 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; 725 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>;
726 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingInComposedTreeS trategy>;
720 727
721 } 728 }
OLDNEW
« no previous file with comments | « Source/core/editing/markup.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698