Commit 642f5008 authored by darin@apple.com's avatar darin@apple.com

WebCore:

2008-06-07  Darin Adler  <darin@apple.com>

        Reviewed by Mitz.

        - work on https://bugs.webkit.org/show_bug.cgi?id=17257
          start ref counts at 1 instead of 0 for speed

        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
        (WebCore::toHTMLCanvasStyle):
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::findOrCreateJSEventListener):
        (WebCore::JSDOMWindowBase::findOrCreateJSUnprotectedEventListener):
        * bindings/js/JSNodeFilterCondition.h:
        (WebCore::JSNodeFilterCondition::create):
        * bindings/js/JSNodeFilterCustom.cpp:
        (WebCore::toNodeFilter):
        * bindings/js/JSSVGLazyEventListener.h:
        (WebCore::JSSVGLazyEventListener::create):
        * bindings/js/JSSVGMatrixCustom.cpp:
        (WebCore::JSSVGMatrix::multiply):
        (WebCore::JSSVGMatrix::inverse):
        (WebCore::JSSVGMatrix::translate):
        (WebCore::JSSVGMatrix::scale):
        (WebCore::JSSVGMatrix::scaleNonUniform):
        (WebCore::JSSVGMatrix::rotate):
        (WebCore::JSSVGMatrix::rotateFromVector):
        (WebCore::JSSVGMatrix::flipX):
        (WebCore::JSSVGMatrix::flipY):
        (WebCore::JSSVGMatrix::skewX):
        (WebCore::JSSVGMatrix::skewY):
        * bindings/js/JSSVGPODTypeWrapper.h:
        (WebCore::JSSVGPODTypeWrapperCreatorReadWrite::create):
        (WebCore::JSSVGPODTypeWrapperCreatorReadWrite::JSSVGPODTypeWrapperCreatorReadWrite):
        (WebCore::JSSVGPODTypeWrapperCreatorReadOnly::create):
        (WebCore::JSSVGPODTypeWrapperCreatorReadOnly::JSSVGPODTypeWrapperCreatorReadOnly):
        (WebCore::JSSVGPODTypeWrapperCreatorForList::create):
        (WebCore::JSSVGPODTypeWrapperCreatorForList::JSSVGPODTypeWrapperCreatorForList):
        (WebCore::JSSVGPODTypeWrapperCache::lookupOrCreateWrapper):
        (WebCore::JSSVGPODTypeWrapperCache::forgetWrapper):
        * bindings/js/JSSVGPointListCustom.cpp:
        (WebCore::commonExit):
        (WebCore::commonExitReadOnly):
        (WebCore::JSSVGPointList::initialize):
        (WebCore::JSSVGPointList::getItem):
        (WebCore::JSSVGPointList::insertItemBefore):
        (WebCore::JSSVGPointList::replaceItem):
        (WebCore::JSSVGPointList::removeItem):
        (WebCore::JSSVGPointList::appendItem):
        * bindings/js/JSSVGTransformListCustom.cpp:
        (WebCore::JSSVGTransformList::initialize):
        (WebCore::JSSVGTransformList::getItem):
        (WebCore::JSSVGTransformList::insertItemBefore):
        (WebCore::JSSVGTransformList::replaceItem):
        (WebCore::JSSVGTransformList::removeItem):
        (WebCore::JSSVGTransformList::appendItem):
        * bindings/js/kjs_binding.cpp:
        (WebCore::setDOMException):
        * bindings/js/kjs_events.h:
        (WebCore::JSUnprotectedEventListener::create):
        (WebCore::JSEventListener::create):
        (WebCore::JSLazyEventListener::create):
        * bindings/js/kjs_proxy.cpp:
        (WebCore::KJSProxy::createHTMLEventHandler):
        (WebCore::KJSProxy::createSVGEventHandler):
        * bindings/objc/DOM.mm:
        (WebCore::ObjCNodeFilterCondition::create):
        (WebCore::ObjCNodeFilterCondition::ObjCNodeFilterCondition):
        (WebCore::ObjCNodeFilterCondition::acceptNode):
        (-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]):
        (-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]):
        * bindings/scripts/CodeGeneratorJS.pm:
        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::valueForNinePieceImage):
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
        * css/CSSFontFace.h:
        (WebCore::CSSFontFace::create):
        (WebCore::CSSFontFace::CSSFontFace):
        * css/CSSFontSelector.cpp:
        (WebCore::CSSFontSelector::addFontFaceRule):
        * css/CSSParser.cpp:
        (WebCore::CSSParser::parseDashboardRegions):
        (WebCore::CSSParser::parseCounterContent):
        (WebCore::CSSParser::parseShape):
        (WebCore::BorderImageParseContext::commitBorderImage):
        * css/CSSSegmentedFontFace.cpp:
        (WebCore::CSSSegmentedFontFace::CSSSegmentedFontFace):
        * css/CSSSegmentedFontFace.h:
        (WebCore::CSSSegmentedFontFace::create):
        * css/Counter.h:
        (WebCore::Counter::create):
        (WebCore::Counter::Counter):
        * css/DashboardRegion.h:
        (WebCore::DashboardRegion::create):
        (WebCore::DashboardRegion::DashboardRegion):
        * css/Rect.h:
        (WebCore::Rect::create):
        (WebCore::Rect::Rect):
        * dom/ChildNodeList.h:
        (WebCore::ChildNodeList::create):
        * dom/ClassNodeList.h:
        (WebCore::ClassNodeList::create):
        * dom/Clipboard.h:
        * dom/DOMCoreException.h:
        (WebCore::DOMCoreException::create):
        * dom/DOMImplementation.cpp:
        (WebCore::DOMImplementation::instance):
        * dom/DOMImplementation.h:
        (WebCore::DOMImplementation::DOMImplementation):
        * dom/Document.cpp:
        (WebCore::Document::addWindowEventListener):
        (WebCore::Document::removeWindowEventListener):
        (WebCore::Document::setDecoder):
        (WebCore::Document::images):
        (WebCore::Document::applets):
        (WebCore::Document::embeds):
        (WebCore::Document::plugins):
        (WebCore::Document::objects):
        (WebCore::Document::scripts):
        (WebCore::Document::links):
        (WebCore::Document::forms):
        (WebCore::Document::anchors):
        (WebCore::Document::all):
        (WebCore::Document::windowNamedItems):
        (WebCore::Document::documentNamedItems):
        * dom/Document.h:
        * dom/DynamicNodeList.h:
        * dom/EventException.h:
        (WebCore::EventException::create):
        (WebCore::EventException::EventException):
        * dom/EventListener.h:
        * dom/EventTarget.cpp:
        (WebCore::EventTarget::addEventListener):
        (WebCore::EventTarget::removeEventListener):
        * dom/ExceptionBase.cpp:
        (WebCore::ExceptionBase::ExceptionBase):
        * dom/ExceptionBase.h:
        * dom/NameNodeList.h:
        (WebCore::NameNodeList::create):
        * dom/Node.cpp:
        (WebCore::Node::childNodes):
        (WebCore::Node::getElementsByTagNameNS):
        (WebCore::Node::getElementsByName):
        (WebCore::Node::getElementsByClassName):
        (WebCore::Node::querySelectorAll):
        * dom/NodeFilterCondition.h:
        * dom/NodeList.h:
        * dom/RangeException.h:
        (WebCore::RangeException::create):
        (WebCore::RangeException::RangeException):
        * dom/RegisteredEventListener.h:
        (WebCore::RegisteredEventListener::create):
        * dom/SelectorNodeList.cpp:
        (WebCore::createSelectorNodeList):
        * dom/SelectorNodeList.h:
        * dom/StaticNodeList.cpp:
        (WebCore::StaticNodeList::StaticNodeList):
        * dom/StaticNodeList.h:
        (WebCore::StaticNodeList::adopt):
        * dom/TagNodeList.h:
        (WebCore::TagNodeList::create):
        * history/HistoryItem.cpp:
        (WebCore::defaultNotifyHistoryItemChanged):
        (WebCore::HistoryItem::HistoryItem):
        (WebCore::HistoryItem::copy):
        * history/HistoryItem.h:
        (WebCore::HistoryItem::create):
        * html/CanvasGradient.h:
        * html/CanvasPattern.cpp:
        (WebCore::CanvasPattern::CanvasPattern):
        * html/CanvasPattern.h:
        (WebCore::CanvasPattern::create):
        * html/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::State::State):
        (WebCore::CanvasRenderingContext2D::setStrokeColor):
        (WebCore::CanvasRenderingContext2D::setFillColor):
        (WebCore::CanvasRenderingContext2D::createPattern):
        * html/CanvasStyle.cpp:
        (WebCore::CanvasStyle::CanvasStyle):
        * html/CanvasStyle.h:
        (WebCore::CanvasStyle::create):
        * html/HTMLCollection.cpp:
        (WebCore::HTMLCollection::HTMLCollection):
        (WebCore::HTMLCollection::create):
        * html/HTMLCollection.h:
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::children):
        * html/HTMLFormCollection.cpp:
        (WebCore::HTMLFormCollection::create):
        * html/HTMLFormCollection.h:
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::elements):
        * html/HTMLMapElement.cpp:
        (WebCore::HTMLMapElement::areas):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::load):
        (WebCore::HTMLMediaElement::mediaPlayerNetworkStateChanged):
        (WebCore::HTMLMediaElement::willSaveToCache):
        * html/HTMLNameCollection.h:
        (WebCore::HTMLNameCollection::create):
        * html/HTMLOptionsCollection.cpp:
        (WebCore::HTMLOptionsCollection::create):
        * html/HTMLOptionsCollection.h:
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::options):
        * html/HTMLTableElement.cpp:
        (WebCore::HTMLTableElement::rows):
        (WebCore::HTMLTableElement::tBodies):
        * html/HTMLTableRowElement.cpp:
        (WebCore::HTMLTableRowElement::cells):
        * html/HTMLTableRowsCollection.cpp:
        (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
        (WebCore::HTMLTableRowsCollection::create):
        * html/HTMLTableRowsCollection.h:
        * html/HTMLTableSectionElement.cpp:
        (WebCore::HTMLTableSectionElement::rows):
        * html/MediaError.h:
        (WebCore::MediaError::create):
        (WebCore::MediaError::MediaError):
        * loader/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
        * loader/CachedFont.cpp:
        (WebCore::CachedFont::ensureSVGFontData):
        * loader/CachedXSLStyleSheet.cpp:
        (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::write):
        (WebCore::FrameLoader::createHistoryItem):
        * loader/ImageDocument.cpp:
        (WebCore::ImageEventListener::create):
        (WebCore::ImageEventListener::ImageEventListener):
        (WebCore::ImageDocument::createDocumentStructure):
        * loader/TextResourceDecoder.h:
        (WebCore::TextResourceDecoder::create):
        * page/Page.cpp:
        (WebCore::Page::userStyleSheet):
        * svg/SVGException.h:
        (WebCore::SVGException::create):
        (WebCore::SVGException::SVGException):
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::ConditionEventListener::create):
        (WebCore::ConditionEventListener::ConditionEventListener):
        (WebCore::SVGSMILElement::connectConditions):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::didReceiveData):
        * xml/XMLHttpRequestException.h:
        (WebCore::XMLHttpRequestException::create):
        (WebCore::XMLHttpRequestException::XMLHttpRequestException):
        * xml/XPathException.h:
        (WebCore::XPathException::create):
        (WebCore::XPathException::XPathException):
        * xml/XPathResult.cpp:
        (WebCore::InvalidatingEventListener::create):
        (WebCore::InvalidatingEventListener::InvalidatingEventListener):
        (WebCore::XPathResult::XPathResult):
        * xml/XSLTProcessor.cpp:
        (WebCore::XSLTProcessor::createDocumentFromSource):

WebKit/mac:

2008-06-07  Darin Adler  <darin@apple.com>

        Reviewed by Mitz.

        - work on https://bugs.webkit.org/show_bug.cgi?id=17257
          start ref counts at 1 instead of 0 for speed

        * History/WebHistoryItem.mm:
        (-[WebHistoryItem init]):
        (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]):
        (-[WebHistoryItem initWithURL:target:parent:title:]):
        (-[WebHistoryItem initWithURLString:title:displayTitle:lastVisitedTimeInterval:]):
        * WebView/WebView.mm:
        (+[WebView _decodeData:]):

WebKit/win:

2008-06-07  Darin Adler  <darin@apple.com>

        Reviewed by Mitz.

        - work on https://bugs.webkit.org/show_bug.cgi?id=17257
          start ref counts at 1 instead of 0 for speed

        * WebHistoryItem.cpp:
        (WebHistoryItem::createInstance):
        (WebHistoryItem::initFromDictionaryRepresentation):
        (WebHistoryItem::initWithURLString):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a3a48766
2008-06-07 Darin Adler <darin@apple.com>
Reviewed by Mitz.
- work on https://bugs.webkit.org/show_bug.cgi?id=17257
start ref counts at 1 instead of 0 for speed
* bindings/js/JSCanvasRenderingContext2DCustom.cpp:
(WebCore::toHTMLCanvasStyle):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::findOrCreateJSEventListener):
(WebCore::JSDOMWindowBase::findOrCreateJSUnprotectedEventListener):
* bindings/js/JSNodeFilterCondition.h:
(WebCore::JSNodeFilterCondition::create):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::toNodeFilter):
* bindings/js/JSSVGLazyEventListener.h:
(WebCore::JSSVGLazyEventListener::create):
* bindings/js/JSSVGMatrixCustom.cpp:
(WebCore::JSSVGMatrix::multiply):
(WebCore::JSSVGMatrix::inverse):
(WebCore::JSSVGMatrix::translate):
(WebCore::JSSVGMatrix::scale):
(WebCore::JSSVGMatrix::scaleNonUniform):
(WebCore::JSSVGMatrix::rotate):
(WebCore::JSSVGMatrix::rotateFromVector):
(WebCore::JSSVGMatrix::flipX):
(WebCore::JSSVGMatrix::flipY):
(WebCore::JSSVGMatrix::skewX):
(WebCore::JSSVGMatrix::skewY):
* bindings/js/JSSVGPODTypeWrapper.h:
(WebCore::JSSVGPODTypeWrapperCreatorReadWrite::create):
(WebCore::JSSVGPODTypeWrapperCreatorReadWrite::JSSVGPODTypeWrapperCreatorReadWrite):
(WebCore::JSSVGPODTypeWrapperCreatorReadOnly::create):
(WebCore::JSSVGPODTypeWrapperCreatorReadOnly::JSSVGPODTypeWrapperCreatorReadOnly):
(WebCore::JSSVGPODTypeWrapperCreatorForList::create):
(WebCore::JSSVGPODTypeWrapperCreatorForList::JSSVGPODTypeWrapperCreatorForList):
(WebCore::JSSVGPODTypeWrapperCache::lookupOrCreateWrapper):
(WebCore::JSSVGPODTypeWrapperCache::forgetWrapper):
* bindings/js/JSSVGPointListCustom.cpp:
(WebCore::commonExit):
(WebCore::commonExitReadOnly):
(WebCore::JSSVGPointList::initialize):
(WebCore::JSSVGPointList::getItem):
(WebCore::JSSVGPointList::insertItemBefore):
(WebCore::JSSVGPointList::replaceItem):
(WebCore::JSSVGPointList::removeItem):
(WebCore::JSSVGPointList::appendItem):
* bindings/js/JSSVGTransformListCustom.cpp:
(WebCore::JSSVGTransformList::initialize):
(WebCore::JSSVGTransformList::getItem):
(WebCore::JSSVGTransformList::insertItemBefore):
(WebCore::JSSVGTransformList::replaceItem):
(WebCore::JSSVGTransformList::removeItem):
(WebCore::JSSVGTransformList::appendItem):
* bindings/js/kjs_binding.cpp:
(WebCore::setDOMException):
* bindings/js/kjs_events.h:
(WebCore::JSUnprotectedEventListener::create):
(WebCore::JSEventListener::create):
(WebCore::JSLazyEventListener::create):
* bindings/js/kjs_proxy.cpp:
(WebCore::KJSProxy::createHTMLEventHandler):
(WebCore::KJSProxy::createSVGEventHandler):
* bindings/objc/DOM.mm:
(WebCore::ObjCNodeFilterCondition::create):
(WebCore::ObjCNodeFilterCondition::ObjCNodeFilterCondition):
(WebCore::ObjCNodeFilterCondition::acceptNode):
(-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]):
(-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]):
* bindings/scripts/CodeGeneratorJS.pm:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForNinePieceImage):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSFontFace.h:
(WebCore::CSSFontFace::create):
(WebCore::CSSFontFace::CSSFontFace):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseDashboardRegions):
(WebCore::CSSParser::parseCounterContent):
(WebCore::CSSParser::parseShape):
(WebCore::BorderImageParseContext::commitBorderImage):
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::CSSSegmentedFontFace):
* css/CSSSegmentedFontFace.h:
(WebCore::CSSSegmentedFontFace::create):
* css/Counter.h:
(WebCore::Counter::create):
(WebCore::Counter::Counter):
* css/DashboardRegion.h:
(WebCore::DashboardRegion::create):
(WebCore::DashboardRegion::DashboardRegion):
* css/Rect.h:
(WebCore::Rect::create):
(WebCore::Rect::Rect):
* dom/ChildNodeList.h:
(WebCore::ChildNodeList::create):
* dom/ClassNodeList.h:
(WebCore::ClassNodeList::create):
* dom/Clipboard.h:
* dom/DOMCoreException.h:
(WebCore::DOMCoreException::create):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::instance):
* dom/DOMImplementation.h:
(WebCore::DOMImplementation::DOMImplementation):
* dom/Document.cpp:
(WebCore::Document::addWindowEventListener):
(WebCore::Document::removeWindowEventListener):
(WebCore::Document::setDecoder):
(WebCore::Document::images):
(WebCore::Document::applets):
(WebCore::Document::embeds):
(WebCore::Document::plugins):
(WebCore::Document::objects):
(WebCore::Document::scripts):
(WebCore::Document::links):
(WebCore::Document::forms):
(WebCore::Document::anchors):
(WebCore::Document::all):
(WebCore::Document::windowNamedItems):
(WebCore::Document::documentNamedItems):
* dom/Document.h:
* dom/DynamicNodeList.h:
* dom/EventException.h:
(WebCore::EventException::create):
(WebCore::EventException::EventException):
* dom/EventListener.h:
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
(WebCore::EventTarget::removeEventListener):
* dom/ExceptionBase.cpp:
(WebCore::ExceptionBase::ExceptionBase):
* dom/ExceptionBase.h:
* dom/NameNodeList.h:
(WebCore::NameNodeList::create):
* dom/Node.cpp:
(WebCore::Node::childNodes):
(WebCore::Node::getElementsByTagNameNS):
(WebCore::Node::getElementsByName):
(WebCore::Node::getElementsByClassName):
(WebCore::Node::querySelectorAll):
* dom/NodeFilterCondition.h:
* dom/NodeList.h:
* dom/RangeException.h:
(WebCore::RangeException::create):
(WebCore::RangeException::RangeException):
* dom/RegisteredEventListener.h:
(WebCore::RegisteredEventListener::create):
* dom/SelectorNodeList.cpp:
(WebCore::createSelectorNodeList):
* dom/SelectorNodeList.h:
* dom/StaticNodeList.cpp:
(WebCore::StaticNodeList::StaticNodeList):
* dom/StaticNodeList.h:
(WebCore::StaticNodeList::adopt):
* dom/TagNodeList.h:
(WebCore::TagNodeList::create):
* history/HistoryItem.cpp:
(WebCore::defaultNotifyHistoryItemChanged):
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::copy):
* history/HistoryItem.h:
(WebCore::HistoryItem::create):
* html/CanvasGradient.h:
* html/CanvasPattern.cpp:
(WebCore::CanvasPattern::CanvasPattern):
* html/CanvasPattern.h:
(WebCore::CanvasPattern::create):
* html/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::State::State):
(WebCore::CanvasRenderingContext2D::setStrokeColor):
(WebCore::CanvasRenderingContext2D::setFillColor):
(WebCore::CanvasRenderingContext2D::createPattern):
* html/CanvasStyle.cpp:
(WebCore::CanvasStyle::CanvasStyle):
* html/CanvasStyle.h:
(WebCore::CanvasStyle::create):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::HTMLCollection):
(WebCore::HTMLCollection::create):
* html/HTMLCollection.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::children):
* html/HTMLFormCollection.cpp:
(WebCore::HTMLFormCollection::create):
* html/HTMLFormCollection.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::elements):
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::areas):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::load):
(WebCore::HTMLMediaElement::mediaPlayerNetworkStateChanged):
(WebCore::HTMLMediaElement::willSaveToCache):
* html/HTMLNameCollection.h:
(WebCore::HTMLNameCollection::create):
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::create):
* html/HTMLOptionsCollection.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::options):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::rows):
(WebCore::HTMLTableElement::tBodies):
* html/HTMLTableRowElement.cpp:
(WebCore::HTMLTableRowElement::cells):
* html/HTMLTableRowsCollection.cpp:
(WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
(WebCore::HTMLTableRowsCollection::create):
* html/HTMLTableRowsCollection.h:
* html/HTMLTableSectionElement.cpp:
(WebCore::HTMLTableSectionElement::rows):
* html/MediaError.h:
(WebCore::MediaError::create):
(WebCore::MediaError::MediaError):
* loader/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
* loader/CachedFont.cpp:
(WebCore::CachedFont::ensureSVGFontData):
* loader/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::write):
(WebCore::FrameLoader::createHistoryItem):
* loader/ImageDocument.cpp:
(WebCore::ImageEventListener::create):
(WebCore::ImageEventListener::ImageEventListener):
(WebCore::ImageDocument::createDocumentStructure):
* loader/TextResourceDecoder.h:
(WebCore::TextResourceDecoder::create):
* page/Page.cpp:
(WebCore::Page::userStyleSheet):
* svg/SVGException.h:
(WebCore::SVGException::create):
(WebCore::SVGException::SVGException):
* svg/animation/SVGSMILElement.cpp:
(WebCore::ConditionEventListener::create):
(WebCore::ConditionEventListener::ConditionEventListener):
(WebCore::SVGSMILElement::connectConditions):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didReceiveData):
* xml/XMLHttpRequestException.h:
(WebCore::XMLHttpRequestException::create):
(WebCore::XMLHttpRequestException::XMLHttpRequestException):
* xml/XPathException.h:
(WebCore::XPathException::create):
(WebCore::XPathException::XPathException):
* xml/XPathResult.cpp:
(WebCore::InvalidatingEventListener::create):
(WebCore::InvalidatingEventListener::InvalidatingEventListener):
(WebCore::XPathResult::XPathResult):
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource):
2008-06-07 Christian Dywan <christian@twotoasts.de> 2008-06-07 Christian Dywan <christian@twotoasts.de>
Reviewed by Alp Toker. Reviewed by Alp Toker.
...@@ -52,14 +52,14 @@ static JSValue* toJS(ExecState* exec, CanvasStyle* style) ...@@ -52,14 +52,14 @@ static JSValue* toJS(ExecState* exec, CanvasStyle* style)
static PassRefPtr<CanvasStyle> toHTMLCanvasStyle(ExecState* exec, JSValue* value) static PassRefPtr<CanvasStyle> toHTMLCanvasStyle(ExecState* exec, JSValue* value)
{ {
if (value->isString()) if (value->isString())
return new CanvasStyle(value->toString(exec)); return CanvasStyle::create(value->toString(exec));
if (!value->isObject()) if (!value->isObject())
return 0; return 0;
JSObject* object = static_cast<JSObject*>(value); JSObject* object = static_cast<JSObject*>(value);
if (object->inherits(&JSCanvasGradient::s_info)) if (object->inherits(&JSCanvasGradient::s_info))
return new CanvasStyle(static_cast<JSCanvasGradient*>(object)->impl()); return CanvasStyle::create(static_cast<JSCanvasGradient*>(object)->impl());
if (object->inherits(&JSCanvasPattern::s_info)) if (object->inherits(&JSCanvasPattern::s_info))
return new CanvasStyle(static_cast<JSCanvasPattern*>(object)->impl()); return CanvasStyle::create(static_cast<JSCanvasPattern*>(object)->impl());
return 0; return 0;
} }
......
...@@ -73,10 +73,10 @@ JSValue* JSDOMApplicationCache::addEventListener(ExecState* exec, const List& ar ...@@ -73,10 +73,10 @@ JSValue* JSDOMApplicationCache::addEventListener(ExecState* exec, const List& ar
Frame* frame = impl()->frame(); Frame* frame = impl()->frame();
if (!frame) if (!frame)
return jsUndefined(); return jsUndefined();
JSUnprotectedEventListener* listener = toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(args[1], true); RefPtr<JSUnprotectedEventListener> listener = toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(args[1], true);
if (!listener) if (!listener)
return jsUndefined(); return jsUndefined();
impl()->addEventListener(args[0]->toString(exec), listener, args[2]->toBoolean(exec)); impl()->addEventListener(args[0]->toString(exec), listener.release(), args[2]->toBoolean(exec));
return jsUndefined(); return jsUndefined();
} }
...@@ -85,7 +85,7 @@ JSValue* JSDOMApplicationCache::removeEventListener(ExecState* exec, const List& ...@@ -85,7 +85,7 @@ JSValue* JSDOMApplicationCache::removeEventListener(ExecState* exec, const List&
Frame* frame = impl()->frame(); Frame* frame = impl()->frame();
if (!frame) if (!frame)
return jsUndefined(); return jsUndefined();
JSUnprotectedEventListener* listener = toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(args[1], true); JSUnprotectedEventListener* listener = toJSDOMWindow(frame)->findJSUnprotectedEventListener(args[1], true);
if (!listener) if (!listener)
return jsUndefined(); return jsUndefined();
impl()->removeEventListener(args[0]->toString(exec), listener, args[2]->toBoolean(exec)); impl()->removeEventListener(args[0]->toString(exec), listener, args[2]->toBoolean(exec));
......
...@@ -817,7 +817,7 @@ JSEventListener* JSDOMWindowBase::findJSEventListener(JSValue* val, bool html) ...@@ -817,7 +817,7 @@ JSEventListener* JSDOMWindowBase::findJSEventListener(JSValue* val, bool html)
return listeners.get(object); return listeners.get(object);
} }
JSEventListener* JSDOMWindowBase::findOrCreateJSEventListener(JSValue* val, bool html) PassRefPtr<JSEventListener> JSDOMWindowBase::findOrCreateJSEventListener(JSValue* val, bool html)
{ {
JSEventListener* listener = findJSEventListener(val, html); JSEventListener* listener = findJSEventListener(val, html);
if (listener) if (listener)
...@@ -828,7 +828,7 @@ JSEventListener* JSDOMWindowBase::findOrCreateJSEventListener(JSValue* val, bool ...@@ -828,7 +828,7 @@ JSEventListener* JSDOMWindowBase::findOrCreateJSEventListener(JSValue* val, bool
JSObject* object = static_cast<JSObject*>(val); JSObject* object = static_cast<JSObject*>(val);
// Note that the JSEventListener constructor adds it to our jsEventListeners list // Note that the JSEventListener constructor adds it to our jsEventListeners list
return new JSEventListener(object, static_cast<JSDOMWindow*>(this), html); return JSEventListener::create(object, static_cast<JSDOMWindow*>(this), html).get();
} }
JSUnprotectedEventListener* JSDOMWindowBase::findJSUnprotectedEventListener(JSValue* val, bool html) JSUnprotectedEventListener* JSDOMWindowBase::findJSUnprotectedEventListener(JSValue* val, bool html)
...@@ -840,7 +840,7 @@ JSUnprotectedEventListener* JSDOMWindowBase::findJSUnprotectedEventListener(JSVa ...@@ -840,7 +840,7 @@ JSUnprotectedEventListener* JSDOMWindowBase::findJSUnprotectedEventListener(JSVa
return listeners.get(object); return listeners.get(object);
} }
JSUnprotectedEventListener* JSDOMWindowBase::findOrCreateJSUnprotectedEventListener(JSValue* val, bool html) PassRefPtr<JSUnprotectedEventListener> JSDOMWindowBase::findOrCreateJSUnprotectedEventListener(JSValue* val, bool html)
{ {
JSUnprotectedEventListener* listener = findJSUnprotectedEventListener(val, html); JSUnprotectedEventListener* listener = findJSUnprotectedEventListener(val, html);
if (listener) if (listener)
...@@ -850,7 +850,7 @@ JSUnprotectedEventListener* JSDOMWindowBase::findOrCreateJSUnprotectedEventListe ...@@ -850,7 +850,7 @@ JSUnprotectedEventListener* JSDOMWindowBase::findOrCreateJSUnprotectedEventListe
JSObject* object = static_cast<JSObject*>(val); JSObject* object = static_cast<JSObject*>(val);
// The JSUnprotectedEventListener constructor adds it to our jsUnprotectedEventListeners map. // The JSUnprotectedEventListener constructor adds it to our jsUnprotectedEventListeners map.
return new JSUnprotectedEventListener(object, static_cast<JSDOMWindow*>(this), html); return JSUnprotectedEventListener::create(object, static_cast<JSDOMWindow*>(this), html).get();
} }
void JSDOMWindowBase::clearHelperObjectProperties() void JSDOMWindowBase::clearHelperObjectProperties()
...@@ -1098,9 +1098,9 @@ JSValue* windowProtoFuncAddEventListener(ExecState* exec, JSObject* thisObj, con ...@@ -1098,9 +1098,9 @@ JSValue* windowProtoFuncAddEventListener(ExecState* exec, JSObject* thisObj, con
if (!frame) if (!frame)
return jsUndefined(); return jsUndefined();
if (JSEventListener* listener = window->findOrCreateJSEventListener(args[1])) { if (RefPtr<JSEventListener> listener = window->findOrCreateJSEventListener(args[1])) {
if (Document* doc = frame->document()) if (Document* doc = frame->document())
doc->addWindowEventListener(AtomicString(args[0]->toString(exec)), listener, args[2]->toBoolean(exec)); doc->addWindowEventListener(AtomicString(args[0]->toString(exec)), listener.release(), args[2]->toBoolean(exec));
} }
return jsUndefined(); return jsUndefined();
......
...@@ -76,13 +76,13 @@ namespace WebCore { ...@@ -76,13 +76,13 @@ namespace WebCore {
JSEventListener* findJSEventListener(KJS::JSValue*, bool html = false); JSEventListener* findJSEventListener(KJS::JSValue*, bool html = false);
// Finds or creates a wrapper of a JS EventListener. JS EventListener object is GC-protected. // Finds or creates a wrapper of a JS EventListener. JS EventListener object is GC-protected.
JSEventListener* findOrCreateJSEventListener(KJS::JSValue*, bool html = false); PassRefPtr<JSEventListener> findOrCreateJSEventListener(KJS::JSValue*, bool html = false);
// Finds a wrapper of a GC-unprotected JS EventListener, returns 0 if no existing one. // Finds a wrapper of a GC-unprotected JS EventListener, returns 0 if no existing one.
JSUnprotectedEventListener* findJSUnprotectedEventListener(KJS::JSValue*, bool html = false); JSUnprotectedEventListener* findJSUnprotectedEventListener(KJS::JSValue*, bool html = false);
// Finds or creates a wrapper of a JS EventListener. JS EventListener object is *NOT* GC-protected. // Finds or creates a wrapper of a JS EventListener. JS EventListener object is *NOT* GC-protected.
JSUnprotectedEventListener* findOrCreateJSUnprotectedEventListener(KJS::JSValue*, bool html = false); PassRefPtr<JSUnprotectedEventListener> findOrCreateJSUnprotectedEventListener(KJS::JSValue*, bool html = false);
void clear(); void clear();
......
...@@ -106,8 +106,8 @@ JSValue* jsEventTargetAddEventListener(ExecState* exec, JSObject* thisObj, const ...@@ -106,8 +106,8 @@ JSValue* jsEventTargetAddEventListener(ExecState* exec, JSObject* thisObj, const
if (!frame) if (!frame)
return jsUndefined(); return jsUndefined();
if (JSEventListener* listener = toJSDOMWindow(frame)->findOrCreateJSEventListener(args[1])) if (RefPtr<JSEventListener> listener = toJSDOMWindow(frame)->findOrCreateJSEventListener(args[1]))
eventTarget->addEventListener(args[0]->toString(exec), listener, args[2]->toBoolean(exec)); eventTarget->addEventListener(args[0]->toString(exec), listener.release(), args[2]->toBoolean(exec));
return jsUndefined(); return jsUndefined();
} }
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#define JSNodeFilterCondition_h #define JSNodeFilterCondition_h
#include "NodeFilterCondition.h" #include "NodeFilterCondition.h"
#include <wtf/PassRefPtr.h>
namespace KJS { namespace KJS {
class JSObject; class JSObject;
...@@ -32,11 +33,16 @@ namespace WebCore { ...@@ -32,11 +33,16 @@ namespace WebCore {
class JSNodeFilterCondition : public NodeFilterCondition { class JSNodeFilterCondition : public NodeFilterCondition {
public: public:
JSNodeFilterCondition(KJS::JSObject* filter); static PassRefPtr<JSNodeFilterCondition> create(KJS::JSObject* filter)
{
return adoptRef(new JSNodeFilterCondition(filter));
}
virtual short acceptNode(Node*, KJS::JSValue*& exception) const; virtual short acceptNode(Node*, KJS::JSValue*& exception) const;
virtual void mark(); virtual void mark();
protected: private:
JSNodeFilterCondition(KJS::JSObject* filter);
KJS::JSObject* m_filter; KJS::JSObject* m_filter;
}; };
......
...@@ -60,7 +60,7 @@ NodeFilter* toNodeFilter(KJS::JSValue* val) ...@@ -60,7 +60,7 @@ NodeFilter* toNodeFilter(KJS::JSValue* val)
KJS::JSObject* o = static_cast<KJS::JSObject*>(val); KJS::JSObject* o = static_cast<KJS::JSObject*>(val);
if (o->implementsCall()) if (o->implementsCall())
return new NodeFilter(new JSNodeFilterCondition(o)); return new NodeFilter(JSNodeFilterCondition::create(o));
return 0; return 0;
} }
......
/* /*
Copyright (C) 2006 Apple Computer, Inc. Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
This file is part of the WebKit project
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
...@@ -21,21 +19,28 @@ ...@@ -21,21 +19,28 @@
#ifndef JSSVGLazyEventListener_h #ifndef JSSVGLazyEventListener_h
#define JSSVGLazyEventListener_h #define JSSVGLazyEventListener_h
#if ENABLE(SVG)
#include "kjs_events.h" #include "kjs_events.h"
#if ENABLE(SVG)
namespace WebCore { namespace WebCore {
class JSSVGLazyEventListener : public JSLazyEventListener { class JSSVGLazyEventListener : public JSLazyEventListener {
public: public:
JSSVGLazyEventListener(const String& functionName, const String& code, JSDOMWindow*, Node*, int lineNumber = 0); static PassRefPtr<JSSVGLazyEventListener> create(const String& functionName, const String& code, JSDOMWindow* window, Node* node, int lineNumber)
{
return adoptRef(new JSSVGLazyEventListener(functionName, code, window, node, lineNumber));
}
private: private:
JSSVGLazyEventListener(const String& functionName, const String& code, JSDOMWindow*, Node*, int lineNumber);
virtual KJS::JSValue* eventParameterName() const; virtual KJS::JSValue* eventParameterName() const;
}; };
} // namespace WebCore } // namespace WebCore
#endif // ENABLE(SVG) #endif // ENABLE(SVG)
#endif // JSSVGLazyEventListener_h #endif // JSSVGLazyEventListener_h
...@@ -211,10 +211,10 @@ JSValue* JSXMLHttpRequest::addEventListener(ExecState* exec, const List& args) ...@@ -211,10 +211,10 @@ JSValue* JSXMLHttpRequest::addEventListener(ExecState* exec, const List& args)
Frame* frame = document->frame(); Frame* frame = document->frame();
if (!frame) if (!frame)
return jsUndefined(); return jsUndefined();
JSUnprotectedEventListener* listener = toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(args[1], true); RefPtr<JSUnprotectedEventListener> listener = toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(args[1], true);
if (!listener) if (!listener)
return jsUndefined(); return jsUndefined();
impl()->addEventListener(args[0]->toString(exec), listener, args[2]->toBoolean(exec)); impl()->addEventListener(args[0]->toString(exec), listener.release(), args[2]->toBoolean(exec));
return jsUndefined(); return jsUndefined();
} }
...@@ -226,7 +226,7 @@ JSValue* JSXMLHttpRequest::removeEventListener(ExecState* exec, const List& args ...@@ -226,7 +226,7 @@ JSValue* JSXMLHttpRequest::removeEventListener(ExecState* exec, const List& args
Frame* frame = document->frame(); Frame* frame = document->frame();
if (!frame) if (!frame)
return jsUndefined(); return jsUndefined();
JSUnprotectedEventListener* listener = toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(args[1], true); JSUnprotectedEventListener* listener = toJSDOMWindow(frame)->findJSUnprotectedEventListener(args[1], true);
if (!listener) if (!listener)
return jsUndefined(); return jsUndefined();
impl()->removeEventListener(args[0]->toString(exec), listener, args[2]->toBoolean(exec)); impl()->removeEventListener(args[0]->toString(exec), listener, args[2]->toBoolean(exec));
......
...@@ -278,25 +278,25 @@ void setDOMException(ExecState* exec, ExceptionCode ec) ...@@ -278,25 +278,25 @@ void setDOMException(ExecState* exec, ExceptionCode ec)
JSValue* errorObject = 0; JSValue* errorObject = 0;
switch (description.type) { switch (description.type) {
case DOMExceptionType: case DOMExceptionType:
errorObject = toJS(exec, new DOMCoreException(description)); errorObject = toJS(exec, DOMCoreException::create(description));
break; break;
case RangeExceptionType: case RangeExceptionType: