| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "core/dom/StyleSheetCollections.h" | 29 #include "core/dom/StyleSheetCollections.h" |
| 30 #include "core/fetch/CSSStyleSheetResource.h" | 30 #include "core/fetch/CSSStyleSheetResource.h" |
| 31 #include "core/fetch/FetchRequest.h" | 31 #include "core/fetch/FetchRequest.h" |
| 32 #include "core/fetch/ResourceFetcher.h" | 32 #include "core/fetch/ResourceFetcher.h" |
| 33 #include "core/fetch/XSLStyleSheetResource.h" | 33 #include "core/fetch/XSLStyleSheetResource.h" |
| 34 #include "core/xml/XSLStyleSheet.h" | 34 #include "core/xml/XSLStyleSheet.h" |
| 35 #include "core/xml/parser/XMLDocumentParser.h" // for parseAttributes() | 35 #include "core/xml/parser/XMLDocumentParser.h" // for parseAttributes() |
| 36 | 36 |
| 37 namespace WebCore { | 37 namespace WebCore { |
| 38 | 38 |
| 39 inline ProcessingInstruction::ProcessingInstruction(Document* document, const St
ring& target, const String& data) | 39 inline ProcessingInstruction::ProcessingInstruction(Document& document, const St
ring& target, const String& data) |
| 40 : CharacterData(document, data, CreateOther) | 40 : CharacterData(document, data, CreateOther) |
| 41 , m_target(target) | 41 , m_target(target) |
| 42 , m_resource(0) | 42 , m_resource(0) |
| 43 , m_loading(false) | 43 , m_loading(false) |
| 44 , m_alternate(false) | 44 , m_alternate(false) |
| 45 , m_createdByParser(false) | 45 , m_createdByParser(false) |
| 46 , m_isCSS(false) | 46 , m_isCSS(false) |
| 47 , m_isXSL(false) | 47 , m_isXSL(false) |
| 48 { | 48 { |
| 49 ScriptWrappable::init(this); | 49 ScriptWrappable::init(this); |
| 50 } | 50 } |
| 51 | 51 |
| 52 PassRefPtr<ProcessingInstruction> ProcessingInstruction::create(Document* docume
nt, const String& target, const String& data) | 52 PassRefPtr<ProcessingInstruction> ProcessingInstruction::create(Document& docume
nt, const String& target, const String& data) |
| 53 { | 53 { |
| 54 return adoptRef(new ProcessingInstruction(document, target, data)); | 54 return adoptRef(new ProcessingInstruction(document, target, data)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 ProcessingInstruction::~ProcessingInstruction() | 57 ProcessingInstruction::~ProcessingInstruction() |
| 58 { | 58 { |
| 59 if (m_sheet) | 59 if (m_sheet) |
| 60 m_sheet->clearOwnerNode(); | 60 m_sheet->clearOwnerNode(); |
| 61 | 61 |
| 62 if (m_resource) | 62 if (m_resource) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 73 | 73 |
| 74 Node::NodeType ProcessingInstruction::nodeType() const | 74 Node::NodeType ProcessingInstruction::nodeType() const |
| 75 { | 75 { |
| 76 return PROCESSING_INSTRUCTION_NODE; | 76 return PROCESSING_INSTRUCTION_NODE; |
| 77 } | 77 } |
| 78 | 78 |
| 79 PassRefPtr<Node> ProcessingInstruction::cloneNode(bool /*deep*/) | 79 PassRefPtr<Node> ProcessingInstruction::cloneNode(bool /*deep*/) |
| 80 { | 80 { |
| 81 // FIXME: Is it a problem that this does not copy m_localHref? | 81 // FIXME: Is it a problem that this does not copy m_localHref? |
| 82 // What about other data members? | 82 // What about other data members? |
| 83 return create(&document(), m_target, m_data); | 83 return create(document(), m_target, m_data); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void ProcessingInstruction::checkStyleSheet() | 86 void ProcessingInstruction::checkStyleSheet() |
| 87 { | 87 { |
| 88 if (m_target == "xml-stylesheet" && document().frame() && parentNode() == &d
ocument()) { | 88 if (m_target == "xml-stylesheet" && document().frame() && parentNode() == &d
ocument()) { |
| 89 // see http://www.w3.org/TR/xml-stylesheet/ | 89 // see http://www.w3.org/TR/xml-stylesheet/ |
| 90 // ### support stylesheet included in a fragment of this (or another) do
cument | 90 // ### support stylesheet included in a fragment of this (or another) do
cument |
| 91 // ### make sure this gets called when adding from javascript | 91 // ### make sure this gets called when adding from javascript |
| 92 bool attrsOk; | 92 bool attrsOk; |
| 93 const HashMap<String, String> attrs = parseAttributes(m_data, attrsOk); | 93 const HashMap<String, String> attrs = parseAttributes(m_data, attrsOk); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 document().removedStyleSheet(removedSheet.get()); | 274 document().removedStyleSheet(removedSheet.get()); |
| 275 } | 275 } |
| 276 | 276 |
| 277 void ProcessingInstruction::finishParsingChildren() | 277 void ProcessingInstruction::finishParsingChildren() |
| 278 { | 278 { |
| 279 m_createdByParser = false; | 279 m_createdByParser = false; |
| 280 CharacterData::finishParsingChildren(); | 280 CharacterData::finishParsingChildren(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace | 283 } // namespace |
| OLD | NEW |