OLD | NEW |
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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 { | 737 { |
738 Document& document = ownerDocumentForCurrentNode(); | 738 Document& document = ownerDocumentForCurrentNode(); |
739 // Only associate the element with the current form if we're creating the ne
w element | 739 // Only associate the element with the current form if we're creating the ne
w element |
740 // in a document with a browsing context (rather than in <template> contents
). | 740 // in a document with a browsing context (rather than in <template> contents
). |
741 HTMLFormElement* form = document.frame() ? m_form.get() : 0; | 741 HTMLFormElement* form = document.frame() ? m_form.get() : 0; |
742 // FIXME: This can't use HTMLConstructionSite::createElement because we | 742 // FIXME: This can't use HTMLConstructionSite::createElement because we |
743 // have to pass the current form element. We should rework form association | 743 // have to pass the current form element. We should rework form association |
744 // to occur after construction to allow better code sharing here. | 744 // to occur after construction to allow better code sharing here. |
745 RefPtr<Element> element = HTMLElementFactory::createHTMLElement(token->name(
), document, form, true); | 745 RefPtr<Element> element = HTMLElementFactory::createHTMLElement(token->name(
), document, form, true); |
746 setAttributes(element.get(), token, m_parserContentPolicy); | 746 setAttributes(element.get(), token, m_parserContentPolicy); |
| 747 element->finishParsingAttributes(); |
747 ASSERT(element->isHTMLElement()); | 748 ASSERT(element->isHTMLElement()); |
748 return element.release(); | 749 return element.release(); |
749 } | 750 } |
750 | 751 |
751 PassRefPtr<HTMLStackItem> HTMLConstructionSite::createElementFromSavedToken(HTML
StackItem* item) | 752 PassRefPtr<HTMLStackItem> HTMLConstructionSite::createElementFromSavedToken(HTML
StackItem* item) |
752 { | 753 { |
753 RefPtr<Element> element; | 754 RefPtr<Element> element; |
754 // NOTE: Moving from item -> token -> item copies the Attribute vector twice
! | 755 // NOTE: Moving from item -> token -> item copies the Attribute vector twice
! |
755 AtomicHTMLToken fakeToken(HTMLToken::StartTag, item->localName(), item->attr
ibutes()); | 756 AtomicHTMLToken fakeToken(HTMLToken::StartTag, item->localName(), item->attr
ibutes()); |
756 if (item->namespaceURI() == HTMLNames::xhtmlNamespaceURI) | 757 if (item->namespaceURI() == HTMLNames::xhtmlNamespaceURI) |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 void HTMLConstructionSite::fosterParent(PassRefPtr<Node> node) | 854 void HTMLConstructionSite::fosterParent(PassRefPtr<Node> node) |
854 { | 855 { |
855 HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert); | 856 HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert); |
856 findFosterSite(task); | 857 findFosterSite(task); |
857 task.child = node; | 858 task.child = node; |
858 ASSERT(task.parent); | 859 ASSERT(task.parent); |
859 queueTask(task); | 860 queueTask(task); |
860 } | 861 } |
861 | 862 |
862 } | 863 } |
OLD | NEW |