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

Side by Side Diff: sky/engine/core/html/parser/HTMLConstructionSite.cpp

Issue 788113002: Simplify HTMLStyleElement. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « sky/engine/core/html/HTMLTagNames.in ('k') | sky/engine/core/html/parser/HTMLElementStack.h » ('j') | 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) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 static inline void insert(HTMLConstructionSiteTask& task) 70 static inline void insert(HTMLConstructionSiteTask& task)
71 { 71 {
72 if (isHTMLTemplateElement(*task.parent)) 72 if (isHTMLTemplateElement(*task.parent))
73 task.parent = toHTMLTemplateElement(task.parent.get())->content(); 73 task.parent = toHTMLTemplateElement(task.parent.get())->content();
74 task.parent->parserAppendChild(task.child.get()); 74 task.parent->parserAppendChild(task.child.get());
75 } 75 }
76 76
77 static inline void executeInsertTask(HTMLConstructionSiteTask& task) 77 static inline void executeInsertTask(HTMLConstructionSiteTask& task)
78 { 78 {
79 ASSERT(task.operation == HTMLConstructionSiteTask::Insert); 79 ASSERT(task.operation == HTMLConstructionSiteTask::Insert);
80
81 insert(task); 80 insert(task);
82
83 if (task.child->isElementNode()) {
84 Element& child = toElement(*task.child);
85 if (task.selfClosing)
86 child.finishParsingChildren();
87 }
88 } 81 }
89 82
90 static inline void executeInsertTextTask(HTMLConstructionSiteTask& task) 83 static inline void executeInsertTextTask(HTMLConstructionSiteTask& task)
91 { 84 {
92 ASSERT(task.operation == HTMLConstructionSiteTask::InsertText); 85 ASSERT(task.operation == HTMLConstructionSiteTask::InsertText);
93 ASSERT(task.child->isTextNode()); 86 ASSERT(task.child->isTextNode());
94 87
95 // Merge text nodes into previous ones if possible: 88 // Merge text nodes into previous ones if possible:
96 // http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construc tion.html#insert-a-character 89 // http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construc tion.html#insert-a-character
97 Text* newText = toText(task.child.get()); 90 Text* newText = toText(task.child.get());
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 331
339 PassRefPtr<HTMLElement> HTMLConstructionSite::createHTMLElement(AtomicHTMLToken* token) 332 PassRefPtr<HTMLElement> HTMLConstructionSite::createHTMLElement(AtomicHTMLToken* token)
340 { 333 {
341 Document& document = ownerDocumentForCurrentNode(); 334 Document& document = ownerDocumentForCurrentNode();
342 RefPtr<HTMLElement> element = HTMLElementFactory::createHTMLElement(token->n ame(), document, true); 335 RefPtr<HTMLElement> element = HTMLElementFactory::createHTMLElement(token->n ame(), document, true);
343 setAttributes(element.get(), token); 336 setAttributes(element.get(), token);
344 return element.release(); 337 return element.release();
345 } 338 }
346 339
347 } 340 }
OLDNEW
« no previous file with comments | « sky/engine/core/html/HTMLTagNames.in ('k') | sky/engine/core/html/parser/HTMLElementStack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698