15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/* 25c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright (C) 2000 Peter Kelly (pmk@post.com) 35c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright (C) 2006 Apple Inc. All rights reserved. 45c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * This library is free software; you can redistribute it and/or 65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * modify it under the terms of the GNU Library General Public 75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * License as published by the Free Software Foundation; either 85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * version 2 of the License, or (at your option) any later version. 95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * This library is distributed in the hope that it will be useful, 115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * but WITHOUT ANY WARRANTY; without even the implied warranty of 125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Library General Public License for more details. 145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * You should have received a copy of the GNU Library General Public License 165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * along with this library; see the file COPYING.LIB. If not, write to 175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Boston, MA 02110-1301, USA. 195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) */ 215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#ifndef ProcessingInstruction_h 235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#define ProcessingInstruction_h 245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 25e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)#include "core/dom/CharacterData.h" 26e08f70592b3fc0d5e68b9b914c9196e813720070Torne (Richard Coles)#include "core/fetch/ResourceOwner.h" 27e08f70592b3fc0d5e68b9b914c9196e813720070Torne (Richard Coles)#include "core/fetch/StyleSheetResource.h" 28e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)#include "core/fetch/StyleSheetResourceClient.h" 295c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 305c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)namespace WebCore { 315c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 325c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class StyleSheet; 335c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class CSSStyleSheet; 345c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 35e08f70592b3fc0d5e68b9b914c9196e813720070Torne (Richard Coles)class ProcessingInstruction FINAL : public CharacterData, private ResourceOwner<StyleSheetResource> { 365c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)public: 378abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles) static PassRefPtr<ProcessingInstruction> create(Document&, const String& target, const String& data); 385c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual ~ProcessingInstruction(); 395c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 405c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) const String& target() const { return m_target; } 415c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 425c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; } 435c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 445c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual void finishParsingChildren(); 455c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 465c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) const String& localHref() const { return m_localHref; } 475c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) StyleSheet* sheet() const { return m_sheet.get(); } 485c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void setCSSStyleSheet(PassRefPtr<CSSStyleSheet>); 495c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 505c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool isCSS() const { return m_isCSS; } 515c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool isXSL() const { return m_isXSL; } 525c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 53fff8884795cb540f87cf6e6d67b629519b00eb8bBen Murdoch bool isLoading() const; 54fff8884795cb540f87cf6e6d67b629519b00eb8bBen Murdoch 555c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)private: 56e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) friend class CharacterData; 578abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles) ProcessingInstruction(Document&, const String& target, const String& data); 585c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 595c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual String nodeName() const; 605c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual NodeType nodeType() const; 61e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch virtual PassRefPtr<Node> cloneNode(bool deep = true); 625c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 635c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 645c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual void removedFrom(ContainerNode*) OVERRIDE; 655c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 665c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void checkStyleSheet(); 673c9e4aeaee9f9b0a9a814da07bcb33319c7ea363Ben Murdoch virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource*); 685c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual void setXSLStyleSheet(const String& href, const KURL& baseURL, const String& sheet); 695c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 705c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual bool sheetLoaded(); 715c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 725c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; 735c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 745c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void parseStyleSheet(const String& sheet); 755c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 765c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) String m_target; 775c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) String m_localHref; 785c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) String m_title; 795c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) String m_media; 805c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) RefPtr<StyleSheet> m_sheet; 815c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_loading; 825c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_alternate; 835c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_createdByParser; 845c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_isCSS; 855c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_isXSL; 865c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)}; 875c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 881e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)DEFINE_NODE_TYPE_CASTS(ProcessingInstruction, nodeType() == Node::PROCESSING_INSTRUCTION_NODE); 898abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles) 908abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles)} // namespace WebCore 915c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 925c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#endif 93