2008-11-12 Julien Chaffraix Reviewed by Darin Adler. Bug 22133: [XBL] Add shorter method to get the global XBLBindingManager Renamed XBBindingManager::sharedInstance() to bindingManager(). Suggested by Eric Seidel. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::CSSStyleSelector): (WebCore::CSSStyleSelector::applyProperty): (WebCore::CSSStyleSelector::removeBindings): * dom/Document.cpp: (WebCore::Document::~Document): (WebCore::Document::recalcStyleSelector): (WebCore::Document::addBindingSheet): (WebCore::Document::removeBindingSheet): * dom/Element.cpp: (WebCore::Element::~Element): (WebCore::Element::addBinding): (WebCore::Element::removeBinding): (WebCore::Element::hasBinding): * xbl/XBLBindingManager.cpp: (WebCore::bindingManager): * xbl/XBLBindingManager.h: 2008-10-15 Julien Chaffraix Reviewed by David Hyatt. Bug 20490: [XBL] XBLBinding should be split into several classes - Distribute XBLBinding's methods and attributes between 2 new classes: * XBLBindingPrototype: holds and manages the binding element. * XBLDocumentPrototype: loads and stores the binding document. - Make the 2 new classes RefCounted as they should be shared between multiple bindings. No functional changes, thus no test cases. * GNUmakefile.am: Add the 2 new files to compile. * WebCore.pro: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * xbl/XBLBinding.cpp: (WebCore::XBLBinding::XBLBinding): Take an XBLBindingPrototype. (WebCore::XBLBinding::~XBLBinding): Zero the XBLBindingPrototype. (WebCore::XBLBinding::uri): * xbl/XBLBinding.h: * xbl/XBLBindingManager.cpp: (WebCore::XBLBindingManager::addBinding): * xbl/XBLBindingPrototype.cpp: Copied from WebCore/xbl/XBLBinding.cpp. (WebCore::XBLBindingPrototype::XBLBindingPrototype): (WebCore::XBLBindingPrototype::~XBLBindingPrototype): (WebCore::XBLBindingPrototype::updateBindingElement): Renamed getBindingElement to updateBindingElement. * xbl/XBLBindingPrototype.h: Copied from WebCore/xbl/XBLBinding.h. (WebCore::XBLBindingPrototype::create): * xbl/XBLDocumentPrototype.cpp: Copied from WebCore/xbl/XBLBinding.cpp. (WebCore::XBLDocumentPrototype::XBLDocumentPrototype): (WebCore::XBLDocumentPrototype::~XBLDocumentPrototype): (WebCore::XBLDocumentPrototype::setXBLDocument): * xbl/XBLDocumentPrototype.h: Copied from WebCore/xbl/XBLBinding.h. (WebCore::XBLDocumentPrototype::create): (WebCore::XBLDocumentPrototype::bindingDocument): 2008-08-18 Julien Chaffraix Reviewed by Eric. Bug 20347: [XBL] Add support for DocumentXBL interface - Add a custom NamedNodeMap for document.bindingsDocument as it is a static map that throws NO_MODIFICATIN_ALLOWED_ERR on modification. Test: fast/xbl/xbl-bindingDocuments.html * GNUmakefile.am: Add NamedStaticDocumentMap.cpp. * WebCore.pro: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * dom/Document.cpp: (WebCore::Document::Document): Initialize m_bindingDocuments. (WebCore::Document::~Document): Zero m_bindingDocuments. (WebCore::Document::bindingDocuments): Getter method. (WebCore::Document::loadBindingDocument): Stub method as we need an helper class to load bindings. (WebCore::Document::createBindingDocumentsIfNeeded): * dom/Document.h: * dom/Document.idl: Add documentXBL interface. * dom/NamedStaticDocumentMap.cpp: Added. (WebCore::NamedStaticDocumentMap::NamedStaticDocumentMap): (WebCore::NamedStaticDocumentMap::~NamedStaticDocumentMap): (WebCore::NamedStaticDocumentMap::getNamedItem): (WebCore::NamedStaticDocumentMap::removeNamedItem): (WebCore::NamedStaticDocumentMap::getNamedItemNS): (WebCore::NamedStaticDocumentMap::removeNamedItemNS): (WebCore::NamedStaticDocumentMap::setNamedItem): (WebCore::NamedStaticDocumentMap::item): (WebCore::NamedStaticDocumentMap::addItem): * dom/NamedStaticDocumentMap.h: Added. (WebCore::NamedStaticDocumentMap::create): (WebCore::NamedStaticDocumentMap::length): (WebCore::NamedStaticDocumentMap::clear): Custom NamedNodeMap that match the specification. 2008-08-18 Julien Chaffraix Reviewed by Eric. Bug 20263: [XBL] Add loading code for XBLBinding Test: fast/xbl/xbl-empty-fragment-loadBinding.html * GNUmakefile.am: Add XBLBinding.cpp. * WebCore.pro: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * xbl/XBLBinding.cpp: Added. (WebCore::XBLBinding::XBLBinding): (WebCore::XBLBinding::~XBLBinding): (WebCore::XBLBinding::setXBLDocument): (WebCore::XBLBinding::getBindingElement): * xbl/XBLBinding.h: Inherit from CachedResourceClient to use the Cache management. Also added the bound element, the element as members. * xbl/XBLBindingManager.cpp: Changed Vector* to Vector* as we were taking a pointer to a local value. (WebCore::XBLBindingManager::addBinding): Ditto. (WebCore::XBLBindingManager::removeBinding): Ditto. (WebCore::XBLBindingManager::hasBinding): Ditto. (WebCore::XBLBindingManager::removeAllBindings): Ditto. * xbl/XBLBindingManager.h: Ditto. 2008-08-08 Julien Chaffraix Reviewed by Eric. Tests: fast/xbl/xbl-crash-inline.xhtml fast/xbl/xbl-document-sheets-modification.xhtml fast/xbl/xbl-element-binding.xhtml Bug 20212: [XBL] Add full support for element="" attachment - Add attributeChanged method to XBLBindingElement to catch "element" changes and update the bindings. - Translate "element" attribute to a stylesheet that is added to the bound document's sheets. * GNUmakefile.am: Add XBLBindingElement.cpp. * WebCore.pro: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::CSSStyleSelector): Add binding sheets. * dom/Document.cpp: (WebCore::Document::~Document): Remove binding sheet information. (WebCore::Document::recalcStyleSelector): When recalculating the style selector, remove all the bindings as the removed sheets would never remove theirs. (WebCore::Document::addBindingSheet): Update binding manager information. (WebCore::Document::removeBindingSheet): Ditto. * dom/Document.h: * xbl/XBLBindingElement.cpp: Added. (WebCore::XBLBindingElement::XBLBindingElement): (WebCore::XBLBindingElement::attributeChanged): Check for "element" changes and update the cached sheet and the bound element's bindings style sheets. (WebCore::XBLBindingElement::generateBindingSheet): Create the style sheet from the "element" attribute. * xbl/XBLBindingElement.h: * xbl/XBLBindingManager.cpp: (WebCore::XBLBindingManager::addBindingSheet): (WebCore::XBLBindingManager::removeBindingSheet): (WebCore::XBLBindingManager::clearBindingSheets): (WebCore::XBLBindingManager::getBindingSheets): All 4 previous methods are used to manage the binding sheets. * xbl/XBLBindingManager.h: 2008-08-08 Julien Chaffraix Reviewed by Eric. Re-enable last bits of XBLDocument loading legacy code. * loader/DocLoader.cpp: (WebCore::DocLoader::requestXBLDocument): (WebCore::DocLoader::requestResource): * loader/DocLoader.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::addLowBandwidthDisplayRequest): * xbl/XBLDocument.h: (WebCore::XBLDocument::create): Removed adoptRef to match other Document 'create' method as it would lead to refcount churn. Also added missing 'const' in isXBLDocument. 2008-07-28 Julien Chaffraix Reviewed by Eric. Bug 20196: [XBL] Re-enable CSS binding attachment - Re-enable legacy CSS attachment code. - Add XBLBindingManager bits so that it also creates / removes the required bindings. - Renamed '-webkit-binding' property to 'binding' (the name in the specification) Test: fast/xbl/xbl-css-attachment.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): * css/CSSPropertyNames.in: * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::applyProperty): (WebCore::CSSStyleSelector::removeBindings): Added remove bindings and the style information associated. * css/CSSStyleSelector.h: * dom/Element.cpp: (WebCore::Element::hasBinding): Update the style as it will cause binding updates. * rendering/style/RenderStyle.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::~StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator==): (WebCore::BindingURI::BindingURI): * rendering/style/RenderStyle.h: * xbl/XBLBindingManager.cpp: (WebCore::XBLBindingManager::addBinding): Limit to one binding per element with the same uri as the CSS attachment code can be hit twice. 2008-07-28 Julien Chaffraix Reviewed by Eric. Bug 20171: [XBL] Add 'element' attribute * DerivedSources.make: Add attrs file. * GNUmakefile.am: Ditto. * WebCore.pro: Ditto. * xbl/xblattrs.in: Added. 2008-07-26 Julien Chaffraix Reviewed by David Hyatt. Bug 20172: [XBL] XBL elements should not be rendered - Roll out renderer disabling bits as they were bogus. - Add XBL CSS default rules to html4.css. Test: fast/xbl/xbl-default-rules.xhtml * css/html4.css: * xbl/XBLDocument.h: (WebCore::XBLDocument::XBLDocument): * xbl/XBLElement.h: (WebCore::XBLElement::isXBLElement): 2008-07-24 Julien Chaffraix Reviewed by Eric. Bug 20029: [XBL] Add more tags Add and