Changeset 61293 in webkit


Ignore:
Timestamp:
Jun 16, 2010 4:07:32 PM (14 years ago)
Author:
Darin Adler
Message:

2010-06-16 Darin Adler <Darin Adler>

Reviewed by David Levin.

Deploy adoptRef in more places, including all HTML and MathML elements
https://bugs.webkit.org/show_bug.cgi?id=39941

  • wtf/ThreadSafeShared.h: Made the constructor protected and removed the unneeded support for initial reference counts other than 1.

2010-06-16 Darin Adler <Darin Adler>

Reviewed by David Levin.

Deploy adoptRef in more places, including all HTML and MathML elements
https://bugs.webkit.org/show_bug.cgi?id=39941

  • dom/Element.cpp: (WebCore::Element::dispatchAttrRemovalEvent): Use create instead of new in commented-out code. (WebCore::Element::dispatchAttrAdditionEvent): Ditto.
  • dom/Node.h: Removed now-unused CreateElementZeroRefCount and CreateHTMLElementZeroRefCount.
  • editing/InsertListCommand.cpp: (WebCore::InsertListCommand::insertList): Use create instead of new, fixing a storage leak.
  • editing/ModifySelectionListLevel.cpp: (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel): Removed "WithType" from function name. Use create instead of new, fixing a storage leak. (WebCore::DecreaseSelectionListLevelCommand::decreaseSelectionListLevel): Use create instead of new, fixing a storage leak.
  • storage/IndexedDatabaseImpl.cpp: (WebCore::IndexedDatabaseImpl::create): Use adoptRef, fixing a storage leak.
  • editing/ModifySelectionListLevel.h: Added create functions.
  • html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::HTMLAnchorElement):
  • html/HTMLFrameOwnerElement.cpp: (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement):
  • html/HTMLMeterElement.cpp: (WebCore::HTMLMeterElement::HTMLMeterElement):
  • html/HTMLProgressElement.cpp: (WebCore::HTMLProgressElement::HTMLProgressElement): Removed code to explicitly pass CreateHTMLElement construction type since that's now the type used for all HTML elements.
  • html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::HTMLFormControlElement):
  • html/HTMLFormControlElement.h: Removed construction type argument, since CreateHTMLElement is now the type used for all HTML elements.
  • mathml/MathMLElement.cpp: (WebCore::MathMLElement::MathMLElement): Removed construction type of CreateStyledElementZeroRefCount so we'll use the default construction type, CreateStyledElement. (WebCore::MathMLElement::create): Use adoptRef.
  • mathml/MathMLElement.h: Made isMathMLElement function private and removed unneeded override of createRenderer, because it did the same thing as the base class's createRenderer function.
  • mathml/MathMLInlineContainerElement.cpp: (WebCore::MathMLInlineContainerElement::create): Use adoptRef. (WebCore::MathMLInlineContainerElement::createRenderer): Removed unnecessarily initialization of local variable and removed the case for mathTag, since that uses a different derived class.
  • mathml/MathMLInlineContainerElement.h: Made createRenderrer override private.
  • mathml/MathMLMathElement.cpp: (WebCore::MathMLMathElement::MathMLMathElement): Marked inline since it is called in only one place. (WebCore::MathMLMathElement::create): Use adoptRef. (WebCore::MathMLMathElement::createRenderer): Added. Creates a RenderMathMLMath object.
  • mathml/MathMLMathElement.h: Made constructor private and added a private override of createRenderer.
  • mathml/MathMLTextElement.cpp: (WebCore::MathMLTextElement::MathMLTextElement): Marked inline since it is called in only one place. (WebCore::MathMLTextElement::create): Use adoptRef. (WebCore::MathMLTextElement::createRenderer): Changed to call through to the base class instead of calling RenderObject::createObject directly.
  • mathml/MathMLTextElement.h: Made the constructor and createRenderer function private.
  • rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::RenderFileUploadControl): Removed an unneeded initializer.
  • rendering/RenderProgress.cpp: Tweaked includes.
  • rendering/ShadowElement.cpp: Added a "using namespace" directive.
  • rendering/ShadowElement.h: Tweaked formatting. Made more functions private.
  • editing/DeleteButton.cpp: (WebCore::DeleteButton::create):
  • html/HTMLAudioElement.cpp: (WebCore::HTMLAudioElement::create): (WebCore::HTMLAudioElement::createForJSConstructor):
  • html/HTMLBRElement.cpp: (WebCore::HTMLBRElement::create):
  • html/HTMLBaseElement.cpp: (WebCore::HTMLBaseElement::create):
  • html/HTMLBaseFontElement.cpp: (WebCore::HTMLBaseFontElement::create):
  • html/HTMLBlockquoteElement.cpp: (WebCore::HTMLBlockquoteElement::create):
  • html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::create):
  • html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::create):
  • html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::create):
  • html/HTMLDListElement.cpp: (WebCore::HTMLDListElement::create):
  • html/HTMLDataGridCellElement.cpp: (WebCore::HTMLDataGridCellElement::create):
  • html/HTMLDataGridColElement.cpp: (WebCore::HTMLDataGridColElement::create):
  • html/HTMLDataGridElement.cpp: (WebCore::HTMLDataGridElement::create):
  • html/HTMLDataGridRowElement.cpp: (WebCore::HTMLDataGridRowElement::create):
  • html/HTMLDataListElement.cpp: (WebCore::HTMLDataListElement::create):
  • html/HTMLDivElement.cpp: (WebCore::HTMLDivElement::create):
  • html/HTMLElement.cpp: (WebCore::HTMLElement::create):
  • html/HTMLElement.h: (WebCore::HTMLElement::HTMLElement):
  • html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::create):
  • html/HTMLFontElement.cpp: (WebCore::HTMLFontElement::create):
  • html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::create):
  • html/HTMLFrameSetElement.cpp: (WebCore::HTMLFrameSetElement::create):
  • html/HTMLHRElement.cpp: (WebCore::HTMLHRElement::create):
  • html/HTMLHeadElement.cpp: (WebCore::HTMLHeadElement::create):
  • html/HTMLHeadingElement.cpp: (WebCore::HTMLHeadingElement::create):
  • html/HTMLHtmlElement.cpp: (WebCore::HTMLHtmlElement::create):
  • html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::create): (WebCore::HTMLImageElement::createForJSConstructor):
  • html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::create):
  • html/HTMLIsIndexElement.cpp: (WebCore::HTMLIsIndexElement::create):
  • html/HTMLKeygenElement.cpp: (WebCore::HTMLKeygenElement::create):
  • html/HTMLLIElement.cpp: (WebCore::HTMLLIElement::create):
  • html/HTMLLabelElement.cpp: (WebCore::HTMLLabelElement::create):
  • html/HTMLLegendElement.cpp: (WebCore::HTMLLegendElement::create):
  • html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::create):
  • html/HTMLMapElement.cpp: (WebCore::HTMLMapElement::create):
  • html/HTMLMarqueeElement.cpp: (WebCore::HTMLMarqueeElement::create):
  • html/HTMLMenuElement.cpp: (WebCore::HTMLMenuElement::create):
  • html/HTMLMetaElement.cpp: (WebCore::HTMLMetaElement::create):
  • html/HTMLModElement.cpp: (WebCore::HTMLModElement::create):
  • html/HTMLNoScriptElement.cpp: (WebCore::HTMLNoScriptElement::create):
  • html/HTMLOListElement.cpp: (WebCore::HTMLOListElement::create):
  • html/HTMLOptGroupElement.cpp: (WebCore::HTMLOptGroupElement::create):
  • html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::create): (WebCore::HTMLOptionElement::createForJSConstructor):
  • html/HTMLParagraphElement.cpp: (WebCore::HTMLParagraphElement::create):
  • html/HTMLParamElement.cpp: (WebCore::HTMLParamElement::create):
  • html/HTMLPreElement.cpp: (WebCore::HTMLPreElement::create):
  • html/HTMLQuoteElement.cpp: (WebCore::HTMLQuoteElement::create):
  • html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::create):
  • html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::create):
  • html/HTMLSourceElement.cpp: (WebCore::HTMLSourceElement::create):
  • html/HTMLStyleElement.cpp: (WebCore::HTMLStyleElement::create):
  • html/HTMLTableCaptionElement.cpp: (WebCore::HTMLTableCaptionElement::create):
  • html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::create):
  • html/HTMLTableColElement.cpp: (WebCore::HTMLTableColElement::create):
  • html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::create):
  • html/HTMLTableRowElement.cpp: (WebCore::HTMLTableRowElement::create):
  • html/HTMLTableSectionElement.cpp: (WebCore::HTMLTableSectionElement::create):
  • html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::create):
  • html/HTMLTitleElement.cpp: (WebCore::HTMLTitleElement::create):
  • html/HTMLUListElement.cpp: (WebCore::HTMLUListElement::create):
  • html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::create):
  • loader/ImageDocument.cpp: (WebCore::ImageDocumentElement::create):
  • rendering/MediaControlElements.cpp: (WebCore::MediaControlShadowRootElement::create): (WebCore::MediaControlElement::create): (WebCore::MediaControlTimelineContainerElement::create): (WebCore::MediaControlVolumeSliderContainerElement::create): (WebCore::MediaControlStatusDisplayElement::create): (WebCore::MediaControlMuteButtonElement::create): (WebCore::MediaControlPlayButtonElement::create): (WebCore::MediaControlSeekButtonElement::create): (WebCore::MediaControlRewindButtonElement::create): (WebCore::MediaControlReturnToRealtimeButtonElement::create): (WebCore::MediaControlToggleClosedCaptionsButtonElement::create): (WebCore::MediaControlTimelineElement::create): (WebCore::MediaControlVolumeSliderElement::create): (WebCore::MediaControlFullscreenButtonElement::create): (WebCore::MediaControlTimeDisplayElement::create):
  • rendering/RenderSlider.cpp: (WebCore::SliderThumbElement::create):
  • rendering/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::create): (WebCore::TextControlInnerTextElement::create): (WebCore::SearchFieldResultsButtonElement::create): (WebCore::SearchFieldCancelButtonElement::create): (WebCore::SpinButtonElement::create): Use adoptRef.
Location:
trunk
Files:
92 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r61244 r61293  
     12010-06-16  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by David Levin.
     4
     5        Deploy adoptRef in more places, including all HTML and MathML elements
     6        https://bugs.webkit.org/show_bug.cgi?id=39941
     7
     8        * wtf/ThreadSafeShared.h: Made the constructor protected and removed the
     9        unneeded support for initial reference counts other than 1.
     10
    1112010-06-16  Peter Varga  <pvarga@inf.u-szeged.hu>
    212
  • trunk/JavaScriptCore/wtf/ThreadSafeShared.h

    r58206 r61293  
    130130template<class T> class ThreadSafeShared : public ThreadSafeSharedBase {
    131131public:
    132     ThreadSafeShared(int initialRefCount = 1)
    133         : ThreadSafeSharedBase(initialRefCount)
    134     {
    135     }
    136 
    137132    void deref()
    138133    {
    139134        if (derefBase())
    140135            delete static_cast<T*>(this);
     136    }
     137
     138protected:
     139    ThreadSafeShared()
     140    {
    141141    }
    142142};
  • trunk/WebCore/ChangeLog

    r61286 r61293  
     12010-06-16  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by David Levin.
     4
     5        Deploy adoptRef in more places, including all HTML and MathML elements
     6        https://bugs.webkit.org/show_bug.cgi?id=39941
     7
     8        * dom/Element.cpp:
     9        (WebCore::Element::dispatchAttrRemovalEvent): Use create instead of new
     10        in commented-out code.
     11        (WebCore::Element::dispatchAttrAdditionEvent): Ditto.
     12
     13        * dom/Node.h: Removed now-unused CreateElementZeroRefCount and
     14        CreateHTMLElementZeroRefCount.
     15
     16        * editing/InsertListCommand.cpp:
     17        (WebCore::InsertListCommand::insertList): Use create instead of new, fixing
     18        a storage leak.
     19
     20        * editing/ModifySelectionListLevel.cpp:
     21        (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
     22        Removed "WithType" from function name. Use create instead of new, fixing a
     23        storage leak.
     24        (WebCore::DecreaseSelectionListLevelCommand::decreaseSelectionListLevel): Use
     25        create instead of new, fixing a storage leak.
     26
     27        * storage/IndexedDatabaseImpl.cpp:
     28        (WebCore::IndexedDatabaseImpl::create): Use adoptRef, fixing a storage leak.
     29
     30        * editing/ModifySelectionListLevel.h: Added create functions.
     31
     32        * html/HTMLAnchorElement.cpp:
     33        (WebCore::HTMLAnchorElement::HTMLAnchorElement):
     34        * html/HTMLFrameOwnerElement.cpp:
     35        (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement):
     36        * html/HTMLMeterElement.cpp:
     37        (WebCore::HTMLMeterElement::HTMLMeterElement):
     38        * html/HTMLProgressElement.cpp:
     39        (WebCore::HTMLProgressElement::HTMLProgressElement):
     40        Removed code to explicitly pass CreateHTMLElement construction type since that's
     41        now the type used for all HTML elements.
     42
     43        * html/HTMLFormControlElement.cpp:
     44        (WebCore::HTMLFormControlElement::HTMLFormControlElement):
     45        * html/HTMLFormControlElement.h:
     46        Removed construction type argument, since CreateHTMLElement is now the type used
     47        for all HTML elements.
     48
     49        * mathml/MathMLElement.cpp:
     50        (WebCore::MathMLElement::MathMLElement): Removed construction type of
     51        CreateStyledElementZeroRefCount so we'll use the default construction
     52        type, CreateStyledElement.
     53        (WebCore::MathMLElement::create): Use adoptRef.
     54
     55        * mathml/MathMLElement.h: Made isMathMLElement function private and
     56        removed unneeded override of createRenderer, because it did the
     57        same thing as the base class's createRenderer function.
     58
     59        * mathml/MathMLInlineContainerElement.cpp:
     60        (WebCore::MathMLInlineContainerElement::create): Use adoptRef.
     61        (WebCore::MathMLInlineContainerElement::createRenderer):
     62        Removed unnecessarily initialization of local variable and removed the
     63        case for mathTag, since that uses a different derived class.
     64
     65        * mathml/MathMLInlineContainerElement.h: Made createRenderrer override
     66        private.
     67
     68        * mathml/MathMLMathElement.cpp:
     69        (WebCore::MathMLMathElement::MathMLMathElement): Marked inline since
     70        it is called in only one place.
     71        (WebCore::MathMLMathElement::create): Use adoptRef.
     72        (WebCore::MathMLMathElement::createRenderer): Added. Creates a
     73        RenderMathMLMath object.
     74
     75        * mathml/MathMLMathElement.h: Made constructor private and added a
     76        private override of createRenderer.
     77
     78        * mathml/MathMLTextElement.cpp:
     79        (WebCore::MathMLTextElement::MathMLTextElement): Marked inline since
     80        it is called in only one place.
     81        (WebCore::MathMLTextElement::create): Use adoptRef.
     82        (WebCore::MathMLTextElement::createRenderer): Changed to call through
     83        to the base class instead of calling RenderObject::createObject directly.
     84
     85        * mathml/MathMLTextElement.h: Made the constructor and createRenderer
     86        function private.
     87
     88        * rendering/RenderFileUploadControl.cpp:
     89        (WebCore::RenderFileUploadControl::RenderFileUploadControl):
     90        Removed an unneeded initializer.
     91
     92        * rendering/RenderProgress.cpp: Tweaked includes.
     93
     94        * rendering/ShadowElement.cpp: Added a "using namespace" directive.
     95        * rendering/ShadowElement.h: Tweaked formatting. Made more functions
     96        private.
     97
     98        * editing/DeleteButton.cpp:
     99        (WebCore::DeleteButton::create):
     100        * html/HTMLAudioElement.cpp:
     101        (WebCore::HTMLAudioElement::create):
     102        (WebCore::HTMLAudioElement::createForJSConstructor):
     103        * html/HTMLBRElement.cpp:
     104        (WebCore::HTMLBRElement::create):
     105        * html/HTMLBaseElement.cpp:
     106        (WebCore::HTMLBaseElement::create):
     107        * html/HTMLBaseFontElement.cpp:
     108        (WebCore::HTMLBaseFontElement::create):
     109        * html/HTMLBlockquoteElement.cpp:
     110        (WebCore::HTMLBlockquoteElement::create):
     111        * html/HTMLBodyElement.cpp:
     112        (WebCore::HTMLBodyElement::create):
     113        * html/HTMLButtonElement.cpp:
     114        (WebCore::HTMLButtonElement::create):
     115        * html/HTMLCanvasElement.cpp:
     116        (WebCore::HTMLCanvasElement::create):
     117        * html/HTMLDListElement.cpp:
     118        (WebCore::HTMLDListElement::create):
     119        * html/HTMLDataGridCellElement.cpp:
     120        (WebCore::HTMLDataGridCellElement::create):
     121        * html/HTMLDataGridColElement.cpp:
     122        (WebCore::HTMLDataGridColElement::create):
     123        * html/HTMLDataGridElement.cpp:
     124        (WebCore::HTMLDataGridElement::create):
     125        * html/HTMLDataGridRowElement.cpp:
     126        (WebCore::HTMLDataGridRowElement::create):
     127        * html/HTMLDataListElement.cpp:
     128        (WebCore::HTMLDataListElement::create):
     129        * html/HTMLDivElement.cpp:
     130        (WebCore::HTMLDivElement::create):
     131        * html/HTMLElement.cpp:
     132        (WebCore::HTMLElement::create):
     133        * html/HTMLElement.h:
     134        (WebCore::HTMLElement::HTMLElement):
     135        * html/HTMLFieldSetElement.cpp:
     136        (WebCore::HTMLFieldSetElement::create):
     137        * html/HTMLFontElement.cpp:
     138        (WebCore::HTMLFontElement::create):
     139        * html/HTMLFormElement.cpp:
     140        (WebCore::HTMLFormElement::create):
     141        * html/HTMLFrameSetElement.cpp:
     142        (WebCore::HTMLFrameSetElement::create):
     143        * html/HTMLHRElement.cpp:
     144        (WebCore::HTMLHRElement::create):
     145        * html/HTMLHeadElement.cpp:
     146        (WebCore::HTMLHeadElement::create):
     147        * html/HTMLHeadingElement.cpp:
     148        (WebCore::HTMLHeadingElement::create):
     149        * html/HTMLHtmlElement.cpp:
     150        (WebCore::HTMLHtmlElement::create):
     151        * html/HTMLImageElement.cpp:
     152        (WebCore::HTMLImageElement::create):
     153        (WebCore::HTMLImageElement::createForJSConstructor):
     154        * html/HTMLInputElement.cpp:
     155        (WebCore::HTMLInputElement::create):
     156        * html/HTMLIsIndexElement.cpp:
     157        (WebCore::HTMLIsIndexElement::create):
     158        * html/HTMLKeygenElement.cpp:
     159        (WebCore::HTMLKeygenElement::create):
     160        * html/HTMLLIElement.cpp:
     161        (WebCore::HTMLLIElement::create):
     162        * html/HTMLLabelElement.cpp:
     163        (WebCore::HTMLLabelElement::create):
     164        * html/HTMLLegendElement.cpp:
     165        (WebCore::HTMLLegendElement::create):
     166        * html/HTMLLinkElement.cpp:
     167        (WebCore::HTMLLinkElement::create):
     168        * html/HTMLMapElement.cpp:
     169        (WebCore::HTMLMapElement::create):
     170        * html/HTMLMarqueeElement.cpp:
     171        (WebCore::HTMLMarqueeElement::create):
     172        * html/HTMLMenuElement.cpp:
     173        (WebCore::HTMLMenuElement::create):
     174        * html/HTMLMetaElement.cpp:
     175        (WebCore::HTMLMetaElement::create):
     176        * html/HTMLModElement.cpp:
     177        (WebCore::HTMLModElement::create):
     178        * html/HTMLNoScriptElement.cpp:
     179        (WebCore::HTMLNoScriptElement::create):
     180        * html/HTMLOListElement.cpp:
     181        (WebCore::HTMLOListElement::create):
     182        * html/HTMLOptGroupElement.cpp:
     183        (WebCore::HTMLOptGroupElement::create):
     184        * html/HTMLOptionElement.cpp:
     185        (WebCore::HTMLOptionElement::create):
     186        (WebCore::HTMLOptionElement::createForJSConstructor):
     187        * html/HTMLParagraphElement.cpp:
     188        (WebCore::HTMLParagraphElement::create):
     189        * html/HTMLParamElement.cpp:
     190        (WebCore::HTMLParamElement::create):
     191        * html/HTMLPreElement.cpp:
     192        (WebCore::HTMLPreElement::create):
     193        * html/HTMLQuoteElement.cpp:
     194        (WebCore::HTMLQuoteElement::create):
     195        * html/HTMLScriptElement.cpp:
     196        (WebCore::HTMLScriptElement::create):
     197        * html/HTMLSelectElement.cpp:
     198        (WebCore::HTMLSelectElement::create):
     199        * html/HTMLSourceElement.cpp:
     200        (WebCore::HTMLSourceElement::create):
     201        * html/HTMLStyleElement.cpp:
     202        (WebCore::HTMLStyleElement::create):
     203        * html/HTMLTableCaptionElement.cpp:
     204        (WebCore::HTMLTableCaptionElement::create):
     205        * html/HTMLTableCellElement.cpp:
     206        (WebCore::HTMLTableCellElement::create):
     207        * html/HTMLTableColElement.cpp:
     208        (WebCore::HTMLTableColElement::create):
     209        * html/HTMLTableElement.cpp:
     210        (WebCore::HTMLTableElement::create):
     211        * html/HTMLTableRowElement.cpp:
     212        (WebCore::HTMLTableRowElement::create):
     213        * html/HTMLTableSectionElement.cpp:
     214        (WebCore::HTMLTableSectionElement::create):
     215        * html/HTMLTextAreaElement.cpp:
     216        (WebCore::HTMLTextAreaElement::create):
     217        * html/HTMLTitleElement.cpp:
     218        (WebCore::HTMLTitleElement::create):
     219        * html/HTMLUListElement.cpp:
     220        (WebCore::HTMLUListElement::create):
     221        * html/HTMLVideoElement.cpp:
     222        (WebCore::HTMLVideoElement::create):
     223        * loader/ImageDocument.cpp:
     224        (WebCore::ImageDocumentElement::create):
     225        * rendering/MediaControlElements.cpp:
     226        (WebCore::MediaControlShadowRootElement::create):
     227        (WebCore::MediaControlElement::create):
     228        (WebCore::MediaControlTimelineContainerElement::create):
     229        (WebCore::MediaControlVolumeSliderContainerElement::create):
     230        (WebCore::MediaControlStatusDisplayElement::create):
     231        (WebCore::MediaControlMuteButtonElement::create):
     232        (WebCore::MediaControlPlayButtonElement::create):
     233        (WebCore::MediaControlSeekButtonElement::create):
     234        (WebCore::MediaControlRewindButtonElement::create):
     235        (WebCore::MediaControlReturnToRealtimeButtonElement::create):
     236        (WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
     237        (WebCore::MediaControlTimelineElement::create):
     238        (WebCore::MediaControlVolumeSliderElement::create):
     239        (WebCore::MediaControlFullscreenButtonElement::create):
     240        (WebCore::MediaControlTimeDisplayElement::create):
     241        * rendering/RenderSlider.cpp:
     242        (WebCore::SliderThumbElement::create):
     243        * rendering/TextControlInnerElements.cpp:
     244        (WebCore::TextControlInnerElement::create):
     245        (WebCore::TextControlInnerTextElement::create):
     246        (WebCore::SearchFieldResultsButtonElement::create):
     247        (WebCore::SearchFieldCancelButtonElement::create):
     248        (WebCore::SpinButtonElement::create):
     249        Use adoptRef.
     250
    12512010-06-16  Adam Barth  <abarth@webkit.org>
    2252
  • trunk/WebCore/dom/Element.cpp

    r61094 r61293  
    10991099        return;
    11001100    ExceptionCode ec = 0;
    1101     dispatchEvent(new MutationEvent(DOMAttrModifiedEvent, true, false, attr, attr->value(),
     1101    dispatchEvent(MutationEvent::create(DOMAttrModifiedEvent, true, attr, attr->value(),
    11021102        attr->value(), document()->attrName(attr->id()), MutationEvent::REMOVAL), ec);
    11031103#endif
     
    11121112        return;
    11131113    ExceptionCode ec = 0;
    1114     dispatchEvent(new MutationEvent(DOMAttrModifiedEvent, true, false, attr, attr->value(),
     1114    dispatchEvent(MutationEvent::create(DOMAttrModifiedEvent, true, attr, attr->value(),
    11151115        attr->value(), document()->attrName(attr->id()), MutationEvent::ADDITION), ec);
    11161116#endif
  • trunk/WebCore/dom/Node.h

    r60434 r61293  
    655655
    656656protected:
    657     // CreateElementZeroRefCount is deprecated and can be removed once we convert all element
     657    // CreateWithZeroRefCountFlag is deprecated and can be removed once we convert all element
    658658    // classes to start with a reference count of 1.
    659659    enum ConstructionType {
     
    663663        CreateContainer = DefaultNodeFlags | IsContainerFlag,
    664664        CreateElement = CreateContainer | IsElementFlag,
    665         CreateElementZeroRefCount = IsElementFlag | CreateWithZeroRefCountFlag,
    666665        CreateStyledElement = CreateElement | IsStyledElementFlag,
    667666        CreateStyledElementZeroRefCount =  CreateStyledElement | CreateWithZeroRefCountFlag,
    668667        CreateHTMLElement = CreateStyledElement | IsHTMLFlag,
    669         CreateHTMLElementZeroRefCount = CreateHTMLElement | CreateWithZeroRefCountFlag,
    670668        CreateSVGElement = CreateStyledElement | IsSVGFlag,
    671669        CreateSVGElementZeroRefCount = CreateSVGElement | CreateWithZeroRefCountFlag,
  • trunk/WebCore/editing/DeleteButton.cpp

    r60418 r61293  
    4646PassRefPtr<DeleteButton> DeleteButton::create(Document* document)
    4747{
    48     return new DeleteButton(document);
     48    return adoptRef(new DeleteButton(document));
    4949}
    5050
  • trunk/WebCore/editing/InsertListCommand.cpp

    r60877 r61293  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4040PassRefPtr<HTMLElement> InsertListCommand::insertList(Document* document, Type type)
    4141{
    42     RefPtr<InsertListCommand> insertCommand = new InsertListCommand(document, type);
     42    RefPtr<InsertListCommand> insertCommand = create(document, type);
    4343    insertCommand->apply();
    4444    return insertCommand->m_listElement;
  • trunk/WebCore/editing/ModifySelectionListLevel.cpp

    r42084 r61293  
    210210}
    211211
    212 PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevelWithType(Document* document, Type listType)
     212PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevel(Document* document, Type type)
    213213{
    214214    ASSERT(document);
    215215    ASSERT(document->frame());
    216     RefPtr<IncreaseSelectionListLevelCommand> modCommand = new IncreaseSelectionListLevelCommand(document, listType);
    217     modCommand->apply();
    218     return modCommand->m_listElement;
     216    RefPtr<IncreaseSelectionListLevelCommand> command = create(document, type);
     217    command->apply();
     218    return command->m_listElement.release();
    219219}
    220220
    221221PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevel(Document* document)
    222222{
    223     return increaseSelectionListLevelWithType(document, InheritedListType);
     223    return increaseSelectionListLevel(document, InheritedListType);
    224224}
    225225
    226226PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered(Document* document)
    227227{
    228     return increaseSelectionListLevelWithType(document, OrderedList);
     228    return increaseSelectionListLevel(document, OrderedList);
    229229}
    230230
    231231PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered(Document* document)
    232232{
    233     return increaseSelectionListLevelWithType(document, UnorderedList);
     233    return increaseSelectionListLevel(document, UnorderedList);
    234234}
    235235
     
    290290    ASSERT(document);
    291291    ASSERT(document->frame());
    292     applyCommand(new DecreaseSelectionListLevelCommand(document));
    293 }
    294 
    295 }
     292    applyCommand(create(document));
     293}
     294
     295}
  • trunk/WebCore/editing/ModifySelectionListLevel.h

    r39456 r61293  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    5656private:
    5757    enum Type { InheritedListType, OrderedList, UnorderedList };
    58     static PassRefPtr<Node> increaseSelectionListLevelWithType(Document*, Type listType);
     58    static PassRefPtr<Node> increaseSelectionListLevel(Document*, Type);
    5959
     60    static PassRefPtr<IncreaseSelectionListLevelCommand> create(Document* document, Type type)
     61    {
     62        return adoptRef(new IncreaseSelectionListLevelCommand(document, type));
     63    }
     64   
    6065    IncreaseSelectionListLevelCommand(Document*, Type);
     66
    6167    virtual void doApply();
    6268
     
    7278
    7379private:
     80    static PassRefPtr<DecreaseSelectionListLevelCommand> create(Document* document)
     81    {
     82        return adoptRef(new DecreaseSelectionListLevelCommand(document));
     83    }
     84
    7485    DecreaseSelectionListLevelCommand(Document*);
     86
    7587    virtual void doApply();
    7688};
  • trunk/WebCore/html/HTMLAnchorElement.cpp

    r59923 r61293  
    4343
    4444HTMLAnchorElement::HTMLAnchorElement(const QualifiedName& tagName, Document* document)
    45     : HTMLElement(tagName, document, CreateHTMLElement)
     45    : HTMLElement(tagName, document)
    4646    , m_wasShiftKeyDownOnMouseDown(false)
    4747    , m_linkRelations(0)
  • trunk/WebCore/html/HTMLAudioElement.cpp

    r60342 r61293  
    4444PassRefPtr<HTMLAudioElement> HTMLAudioElement::create(const QualifiedName& tagName, Document* document)
    4545{
    46     return new HTMLAudioElement(tagName, document);
     46    return adoptRef(new HTMLAudioElement(tagName, document));
    4747}
    4848
    4949PassRefPtr<HTMLAudioElement> HTMLAudioElement::createForJSConstructor(Document* document, const String& src)
    5050{
    51     RefPtr<HTMLAudioElement> audio = new HTMLAudioElement(audioTag, document);
     51    RefPtr<HTMLAudioElement> audio = adoptRef(new HTMLAudioElement(audioTag, document));
    5252    audio->setPreload("auto");
    5353    if (!src.isNull()) {
  • trunk/WebCore/html/HTMLBRElement.cpp

    r60342 r61293  
    4141PassRefPtr<HTMLBRElement> HTMLBRElement::create(Document* document)
    4242{
    43     return new HTMLBRElement(brTag, document);
     43    return adoptRef(new HTMLBRElement(brTag, document));
    4444}
    4545
    4646PassRefPtr<HTMLBRElement> HTMLBRElement::create(const QualifiedName& tagName, Document* document)
    4747{
    48     return new HTMLBRElement(tagName, document);
     48    return adoptRef(new HTMLBRElement(tagName, document));
    4949}
    5050
  • trunk/WebCore/html/HTMLBaseElement.cpp

    r60342 r61293  
    4343PassRefPtr<HTMLBaseElement> HTMLBaseElement::create(const QualifiedName& tagName, Document* document)
    4444{
    45     return new HTMLBaseElement(tagName, document);
     45    return adoptRef(new HTMLBaseElement(tagName, document));
    4646}
    4747
  • trunk/WebCore/html/HTMLBaseFontElement.cpp

    r60342 r61293  
    3838PassRefPtr<HTMLBaseFontElement> HTMLBaseFontElement::create(const QualifiedName& tagName, Document* document)
    3939{
    40     return new HTMLBaseFontElement(tagName, document);
     40    return adoptRef(new HTMLBaseFontElement(tagName, document));
    4141}
    4242
  • trunk/WebCore/html/HTMLBlockquoteElement.cpp

    r60342 r61293  
    3838PassRefPtr<HTMLBlockquoteElement> HTMLBlockquoteElement::create(Document* document)
    3939{
    40     return new HTMLBlockquoteElement(blockquoteTag, document);
     40    return adoptRef(new HTMLBlockquoteElement(blockquoteTag, document));
    4141}
    4242
    4343PassRefPtr<HTMLBlockquoteElement> HTMLBlockquoteElement::create(const QualifiedName& tagName, Document* document)
    4444{
    45     return new HTMLBlockquoteElement(tagName, document);
     45    return adoptRef(new HTMLBlockquoteElement(tagName, document));
    4646}
    4747
  • trunk/WebCore/html/HTMLBodyElement.cpp

    r60342 r61293  
    4848PassRefPtr<HTMLBodyElement> HTMLBodyElement::create(Document* document)
    4949{
    50     return new HTMLBodyElement(bodyTag, document);
     50    return adoptRef(new HTMLBodyElement(bodyTag, document));
    5151}
    5252
    5353PassRefPtr<HTMLBodyElement> HTMLBodyElement::create(const QualifiedName& tagName, Document* document)
    5454{
    55     return new HTMLBodyElement(tagName, document);
     55    return adoptRef(new HTMLBodyElement(tagName, document));
    5656}
    5757
  • trunk/WebCore/html/HTMLButtonElement.cpp

    r60342 r61293  
    5151PassRefPtr<HTMLButtonElement> HTMLButtonElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    5252{
    53     return new HTMLButtonElement(tagName, document, form);
     53    return adoptRef(new HTMLButtonElement(tagName, document, form));
    5454}
    5555
  • trunk/WebCore/html/HTMLCanvasElement.cpp

    r60930 r61293  
    6666PassRefPtr<HTMLCanvasElement> HTMLCanvasElement::create(Document* document)
    6767{
    68     return new HTMLCanvasElement(canvasTag, document);
     68    return adoptRef(new HTMLCanvasElement(canvasTag, document));
    6969}
    7070
    7171PassRefPtr<HTMLCanvasElement> HTMLCanvasElement::create(const QualifiedName& tagName, Document* document)
    7272{
    73     return new HTMLCanvasElement(tagName, document);
     73    return adoptRef(new HTMLCanvasElement(tagName, document));
    7474}
    7575
  • trunk/WebCore/html/HTMLDListElement.cpp

    r60342 r61293  
    3838PassRefPtr<HTMLDListElement> HTMLDListElement::create(const QualifiedName& tagName, Document* document)
    3939{
    40     return new HTMLDListElement(tagName, document);
     40    return adoptRef(new HTMLDListElement(tagName, document));
    4141}
    4242
  • trunk/WebCore/html/HTMLDataGridCellElement.cpp

    r60342 r61293  
    4343PassRefPtr<HTMLDataGridCellElement> HTMLDataGridCellElement::create(const QualifiedName& name, Document* document)
    4444{
    45     return new HTMLDataGridCellElement(name, document);
     45    return adoptRef(new HTMLDataGridCellElement(name, document));
    4646}
    4747
  • trunk/WebCore/html/HTMLDataGridColElement.cpp

    r61094 r61293  
    4747PassRefPtr<HTMLDataGridColElement> HTMLDataGridColElement::create(const QualifiedName& name, Document* document)
    4848{
    49     return new HTMLDataGridColElement(name, document);
     49    return adoptRef(new HTMLDataGridColElement(name, document));
    5050}
    5151
  • trunk/WebCore/html/HTMLDataGridElement.cpp

    r60342 r61293  
    4848PassRefPtr<HTMLDataGridElement> HTMLDataGridElement::create(const QualifiedName& tagName, Document* document)
    4949{
    50     return new HTMLDataGridElement(tagName, document);
     50    return adoptRef(new HTMLDataGridElement(tagName, document));
    5151}
    5252
  • trunk/WebCore/html/HTMLDataGridRowElement.cpp

    r60342 r61293  
    4343PassRefPtr<HTMLDataGridRowElement> HTMLDataGridRowElement::create(const QualifiedName& name, Document* document)
    4444{
    45     return new HTMLDataGridRowElement(name, document);
     45    return adoptRef(new HTMLDataGridRowElement(name, document));
    4646}
    4747
  • trunk/WebCore/html/HTMLDataListElement.cpp

    r60342 r61293  
    4545PassRefPtr<HTMLDataListElement> HTMLDataListElement::create(const QualifiedName& tagName, Document* document)
    4646{
    47     return new HTMLDataListElement(tagName, document);
     47    return adoptRef(new HTMLDataListElement(tagName, document));
    4848}
    4949
  • trunk/WebCore/html/HTMLDivElement.cpp

    r60418 r61293  
    4141PassRefPtr<HTMLDivElement> HTMLDivElement::create(Document* document)
    4242{
    43     return new HTMLDivElement(divTag, document);
     43    return adoptRef(new HTMLDivElement(divTag, document));
    4444}
    4545
    4646PassRefPtr<HTMLDivElement> HTMLDivElement::create(const QualifiedName& tagName, Document* document)
    4747{
    48     return new HTMLDivElement(tagName, document);
     48    return adoptRef(new HTMLDivElement(tagName, document));
    4949}
    5050
  • trunk/WebCore/html/HTMLElement.cpp

    r61094 r61293  
    5959PassRefPtr<HTMLElement> HTMLElement::create(const QualifiedName& tagName, Document* document)
    6060{
    61     return adoptRef(new HTMLElement(tagName, document, CreateHTMLElement));
     61    return adoptRef(new HTMLElement(tagName, document));
    6262}
    6363
  • trunk/WebCore/html/HTMLElement.h

    r59773 r61293  
    8383
    8484protected:
    85     HTMLElement(const QualifiedName& tagName, Document*, ConstructionType = CreateHTMLElementZeroRefCount);
     85    HTMLElement(const QualifiedName& tagName, Document*);
    8686
    8787    void addHTMLAlignment(Attribute*);
     
    112112};
    113113
    114 inline HTMLElement::HTMLElement(const QualifiedName& tagName, Document* document, ConstructionType type)
    115     : StyledElement(tagName, document, type)
     114inline HTMLElement::HTMLElement(const QualifiedName& tagName, Document* document)
     115    : StyledElement(tagName, document, CreateHTMLElement)
    116116{
    117117    ASSERT(tagName.localName().impl());
  • trunk/WebCore/html/HTMLFieldSetElement.cpp

    r60342 r61293  
    4242PassRefPtr<HTMLFieldSetElement> HTMLFieldSetElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    4343{
    44     return new HTMLFieldSetElement(tagName, document, form);
     44    return adoptRef(new HTMLFieldSetElement(tagName, document, form));
    4545}
    4646
  • trunk/WebCore/html/HTMLFontElement.cpp

    r60418 r61293  
    4343PassRefPtr<HTMLFontElement> HTMLFontElement::create(const QualifiedName& tagName, Document* document)
    4444{
    45     return new HTMLFontElement(tagName, document);
     45    return adoptRef(new HTMLFontElement(tagName, document));
    4646}
    4747
  • trunk/WebCore/html/HTMLFormControlElement.cpp

    r61107 r61293  
    5454using namespace HTMLNames;
    5555
    56 HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* f, ConstructionType constructionType)
    57     : HTMLElement(tagName, doc, constructionType)
    58     , m_form(f)
     56HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
     57    : HTMLElement(tagName, document)
     58    , m_form(form)
    5959    , m_disabled(false)
    6060    , m_readOnly(false)
  • trunk/WebCore/html/HTMLFormControlElement.h

    r60419 r61293  
    3535class VisibleSelection;
    3636
     37// FIXME: The HTML5 specification calls these form-associated elements.
     38// So consider renaming this to HTMLFormAssociatedElement.
    3739class HTMLFormControlElement : public HTMLElement {
    3840public:
     
    4547    void setFormNoValidate(bool);
    4648
    47     virtual void reset() {}
     49    virtual void reset() { }
    4850
    4951    virtual bool formControlValueMatchesRenderer() const { return m_valueMatchesRenderer; }
     
    7880    virtual bool canTriggerImplicitSubmission() const { return false; }
    7981
    80     /* Override in derived classes to get the encoded name=value pair for submitting.
    81      * Return true for a successful control (see HTML4-17.13.2).
    82      */
     82    // Override in derived classes to get the encoded name=value pair for submitting.
     83    // Return true for a successful control (see HTML4-17.13.2).
    8384    virtual bool appendFormData(FormDataList&, bool) { return false; }
    8485
     
    105106
    106107protected:
    107     HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*, ConstructionType = CreateHTMLElementZeroRefCount);
     108    HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*);
    108109
    109110    virtual void parseMappedAttribute(Attribute*);
     
    121122
    122123    void removeFromForm();
     124
    123125    // This must be called any time the result of willValidate() has changed.
    124126    void setNeedsWillValidateCheck();
     
    148150    bool m_required : 1;
    149151    bool m_valueMatchesRenderer : 1;
    150     // The initial value of m_willValidate depends on a subclass, and we can't
     152
     153    // The initial value of m_willValidate depends on the derived class. We can't
    151154    // initialize it with a virtual function in the constructor. m_willValidate
    152     // is not deterministic during m_willValidateInitialized=false.
     155    // is not deterministic as long as m_willValidateInitialized is false.
    153156    mutable bool m_willValidateInitialized: 1;
    154157    mutable bool m_willValidate : 1;
     158
    155159    // Cache of validity()->valid().
    156     // "candidate for constraint validation" doesn't affect to m_isValid.
     160    // But "candidate for constraint validation" doesn't affect m_isValid.
    157161    bool m_isValid : 1;
    158162};
    159163
     164// FIXME: Give this class its own header file.
    160165class HTMLFormControlElementWithState : public HTMLFormControlElement {
    161166public:
     
    176181};
    177182
     183// FIXME: Give this class its own header file.
    178184class HTMLTextFormControlElement : public HTMLFormControlElementWithState {
    179185public:
     
    207213    virtual int cachedSelectionEnd() const = 0;
    208214
    209     // A subclass should return true if placeholder processing is needed.
     215    // The derived class should return true if placeholder processing is needed.
    210216    virtual bool supportsPlaceholder() const = 0;
    211     // Returns true if user-editable value is empty.  This is used to check placeholder visibility.
     217    // Returns true if user-editable value is empty. Used to check placeholder visibility.
    212218    virtual bool isEmptyValue() const = 0;
    213219    // Called in dispatchFocusEvent(), after placeholder process, before calling parent's dispatchFocusEvent().
     
    215221    // Called in dispatchBlurEvent(), after placeholder process, before calling parent's dispatchBlurEvent().
    216222    virtual void handleBlurEvent() { }
     223
    217224    RenderTextControl* textRendererAfterUpdateLayout();
    218225};
  • trunk/WebCore/html/HTMLFormElement.cpp

    r61156 r61293  
    8787PassRefPtr<HTMLFormElement> HTMLFormElement::create(Document* document)
    8888{
    89     return new HTMLFormElement(formTag, document);
     89    return adoptRef(new HTMLFormElement(formTag, document));
    9090}
    9191
    9292PassRefPtr<HTMLFormElement> HTMLFormElement::create(const QualifiedName& tagName, Document* document)
    9393{
    94     return new HTMLFormElement(tagName, document);
     94    return adoptRef(new HTMLFormElement(tagName, document));
    9595}
    9696
  • trunk/WebCore/html/HTMLFrameOwnerElement.cpp

    r58914 r61293  
    3434
    3535HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Document* document)
    36     : HTMLElement(tagName, document, CreateHTMLElement)
     36    : HTMLElement(tagName, document)
    3737    , m_contentFrame(0)
    3838    , m_sandboxFlags(SandboxNone)
  • trunk/WebCore/html/HTMLFrameSetElement.cpp

    r60418 r61293  
    5757PassRefPtr<HTMLFrameSetElement> HTMLFrameSetElement::create(const QualifiedName& tagName, Document* document)
    5858{
    59     return new HTMLFrameSetElement(tagName, document);
     59    return adoptRef(new HTMLFrameSetElement(tagName, document));
    6060}
    6161
  • trunk/WebCore/html/HTMLHRElement.cpp

    r60418 r61293  
    4141PassRefPtr<HTMLHRElement> HTMLHRElement::create(Document* document)
    4242{
    43     return new HTMLHRElement(hrTag, document);
     43    return adoptRef(new HTMLHRElement(hrTag, document));
    4444}
    4545
    4646PassRefPtr<HTMLHRElement> HTMLHRElement::create(const QualifiedName& tagName, Document* document)
    4747{
    48     return new HTMLHRElement(tagName, document);
     48    return adoptRef(new HTMLHRElement(tagName, document));
    4949}
    5050
  • trunk/WebCore/html/HTMLHeadElement.cpp

    r60418 r61293  
    4040PassRefPtr<HTMLHeadElement> HTMLHeadElement::create(Document* document)
    4141{
    42     return new HTMLHeadElement(headTag, document);
     42    return adoptRef(new HTMLHeadElement(headTag, document));
    4343}
    4444
    4545PassRefPtr<HTMLHeadElement> HTMLHeadElement::create(const QualifiedName& tagName, Document* document)
    4646{
    47     return new HTMLHeadElement(tagName, document);
     47    return adoptRef(new HTMLHeadElement(tagName, document));
    4848}
    4949
  • trunk/WebCore/html/HTMLHeadingElement.cpp

    r60418 r61293  
    3737PassRefPtr<HTMLHeadingElement> HTMLHeadingElement::create(const QualifiedName& tagName, Document* document)
    3838{
    39     return new HTMLHeadingElement(tagName, document);
     39    return adoptRef(new HTMLHeadingElement(tagName, document));
    4040}
    4141
  • trunk/WebCore/html/HTMLHtmlElement.cpp

    r60418 r61293  
    4343PassRefPtr<HTMLHtmlElement> HTMLHtmlElement::create(Document* document)
    4444{
    45     return new HTMLHtmlElement(htmlTag, document);
     45    return adoptRef(new HTMLHtmlElement(htmlTag, document));
    4646}
    4747
    4848PassRefPtr<HTMLHtmlElement> HTMLHtmlElement::create(const QualifiedName& tagName, Document* document)
    4949{
    50     return new HTMLHtmlElement(tagName, document);
     50    return adoptRef(new HTMLHtmlElement(tagName, document));
    5151}
    5252
  • trunk/WebCore/html/HTMLImageElement.cpp

    r61094 r61293  
    5656PassRefPtr<HTMLImageElement> HTMLImageElement::create(Document* document)
    5757{
    58     return new HTMLImageElement(imgTag, document);
     58    return adoptRef(new HTMLImageElement(imgTag, document));
    5959}
    6060
    6161PassRefPtr<HTMLImageElement> HTMLImageElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    6262{
    63     return new HTMLImageElement(tagName, document, form);
     63    return adoptRef(new HTMLImageElement(tagName, document, form));
    6464}
    6565
     
    7272PassRefPtr<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document* document, const int* optionalWidth, const int* optionalHeight)
    7373{
    74     RefPtr<HTMLImageElement> image = new HTMLImageElement(imgTag, document);
     74    RefPtr<HTMLImageElement> image = adoptRef(new HTMLImageElement(imgTag, document));
    7575    if (optionalWidth)
    7676        image->setWidth(*optionalWidth);
  • trunk/WebCore/html/HTMLInputElement.cpp

    r61107 r61293  
    126126PassRefPtr<HTMLInputElement> HTMLInputElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    127127{
    128     return new HTMLInputElement(tagName, document, form);
     128    return adoptRef(new HTMLInputElement(tagName, document, form));
    129129}
    130130
  • trunk/WebCore/html/HTMLIsIndexElement.cpp

    r60418 r61293  
    4242PassRefPtr<HTMLIsIndexElement> HTMLIsIndexElement::create(Document* document, HTMLFormElement* form)
    4343{
    44     return new HTMLIsIndexElement(isindexTag, document, form);
     44    return adoptRef(new HTMLIsIndexElement(isindexTag, document, form));
    4545}
    4646
    4747PassRefPtr<HTMLIsIndexElement> HTMLIsIndexElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    4848{
    49     return new HTMLIsIndexElement(tagName, document, form);
     49    return adoptRef(new HTMLIsIndexElement(tagName, document, form));
    5050}
    5151
  • trunk/WebCore/html/HTMLKeygenElement.cpp

    r60361 r61293  
    5858PassRefPtr<HTMLKeygenElement> HTMLKeygenElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    5959{
    60     return new HTMLKeygenElement(tagName, document, form);
     60    return adoptRef(new HTMLKeygenElement(tagName, document, form));
    6161}
    6262
  • trunk/WebCore/html/HTMLLIElement.cpp

    r60418 r61293  
    4343PassRefPtr<HTMLLIElement> HTMLLIElement::create(Document* document)
    4444{
    45     return new HTMLLIElement(liTag, document);
     45    return adoptRef(new HTMLLIElement(liTag, document));
    4646}
    4747
    4848PassRefPtr<HTMLLIElement> HTMLLIElement::create(const QualifiedName& tagName, Document* document)
    4949{
    50     return new HTMLLIElement(tagName, document);
     50    return adoptRef(new HTMLLIElement(tagName, document));
    5151}
    5252
  • trunk/WebCore/html/HTMLLabelElement.cpp

    r60418 r61293  
    5757PassRefPtr<HTMLLabelElement> HTMLLabelElement::create(const QualifiedName& tagName, Document* document)
    5858{
    59     return new HTMLLabelElement(tagName, document);
     59    return adoptRef(new HTMLLabelElement(tagName, document));
    6060}
    6161
  • trunk/WebCore/html/HTMLLegendElement.cpp

    r60418 r61293  
    4141PassRefPtr<HTMLLegendElement> HTMLLegendElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    4242{
    43     return new HTMLLegendElement(tagName, document, form);
     43    return adoptRef(new HTMLLegendElement(tagName, document, form));
    4444}
    4545
  • trunk/WebCore/html/HTMLLinkElement.cpp

    r60418 r61293  
    5858PassRefPtr<HTMLLinkElement> HTMLLinkElement::create(const QualifiedName& tagName, Document* document, bool createdByParser)
    5959{
    60     return new HTMLLinkElement(tagName, document, createdByParser);
     60    return adoptRef(new HTMLLinkElement(tagName, document, createdByParser));
    6161}
    6262
  • trunk/WebCore/html/HTMLMapElement.cpp

    r61094 r61293  
    4747PassRefPtr<HTMLMapElement> HTMLMapElement::create(Document* document)
    4848{
    49     return new HTMLMapElement(mapTag, document);
     49    return adoptRef(new HTMLMapElement(mapTag, document));
    5050}
    5151
    5252PassRefPtr<HTMLMapElement> HTMLMapElement::create(const QualifiedName& tagName, Document* document)
    5353{
    54     return new HTMLMapElement(tagName, document);
     54    return adoptRef(new HTMLMapElement(tagName, document));
    5555}
    5656
  • trunk/WebCore/html/HTMLMarqueeElement.cpp

    r60361 r61293  
    4848PassRefPtr<HTMLMarqueeElement> HTMLMarqueeElement::create(const QualifiedName& tagName, Document* document)
    4949{
    50     return new HTMLMarqueeElement(tagName, document);
     50    return adoptRef(new HTMLMarqueeElement(tagName, document));
    5151}
    5252
  • trunk/WebCore/html/HTMLMenuElement.cpp

    r60361 r61293  
    3838PassRefPtr<HTMLMenuElement> HTMLMenuElement::create(const QualifiedName& tagName, Document* document)
    3939{
    40     return new HTMLMenuElement(tagName, document);
     40    return adoptRef(new HTMLMenuElement(tagName, document));
    4141}
    4242
  • trunk/WebCore/html/HTMLMetaElement.cpp

    r60361 r61293  
    4040PassRefPtr<HTMLMetaElement> HTMLMetaElement::create(const QualifiedName& tagName, Document* document)
    4141{
    42     return new HTMLMetaElement(tagName, document);
     42    return adoptRef(new HTMLMetaElement(tagName, document));
    4343}
    4444
  • trunk/WebCore/html/HTMLMeterElement.cpp

    r61107 r61293  
    3737using namespace HTMLNames;
    3838
     39// FIXME: This constructor should take an explicit form element pointer passed from the
     40// parser like the constructors for all the other classes derived from HTMLFormControlElement.
    3941HTMLMeterElement::HTMLMeterElement(const QualifiedName& tagName, Document* document)
    40     : HTMLFormControlElement(tagName, document, 0, CreateHTMLElement)
     42    : HTMLFormControlElement(tagName, document, 0)
    4143{
    4244    ASSERT(hasTagName(meterTag));
  • trunk/WebCore/html/HTMLModElement.cpp

    r60342 r61293  
    3737PassRefPtr<HTMLModElement> HTMLModElement::create(const QualifiedName& tagName, Document* document)
    3838{
    39     return new HTMLModElement(tagName, document);
     39    return adoptRef(new HTMLModElement(tagName, document));
    4040}
    4141
  • trunk/WebCore/html/HTMLNoScriptElement.cpp

    r60361 r61293  
    4040PassRefPtr<HTMLNoScriptElement> HTMLNoScriptElement::create(const QualifiedName& tagName, Document* document)
    4141{
    42     return new HTMLNoScriptElement(tagName, document);
     42    return adoptRef(new HTMLNoScriptElement(tagName, document));
    4343}
    4444
  • trunk/WebCore/html/HTMLOListElement.cpp

    r60361 r61293  
    4343PassRefPtr<HTMLOListElement> HTMLOListElement::create(Document* document)
    4444{
    45     return new HTMLOListElement(olTag, document);
     45    return adoptRef(new HTMLOListElement(olTag, document));
    4646}
    4747
    4848PassRefPtr<HTMLOListElement> HTMLOListElement::create(const QualifiedName& tagName, Document* document)
    4949{
    50     return new HTMLOListElement(tagName, document);
     50    return adoptRef(new HTMLOListElement(tagName, document));
    5151}
    5252
  • trunk/WebCore/html/HTMLOptGroupElement.cpp

    r60361 r61293  
    4646PassRefPtr<HTMLOptGroupElement> HTMLOptGroupElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    4747{
    48     return new HTMLOptGroupElement(tagName, document, form);
     48    return adoptRef(new HTMLOptGroupElement(tagName, document, form));
    4949}
    5050
  • trunk/WebCore/html/HTMLOptionElement.cpp

    r60361 r61293  
    5151PassRefPtr<HTMLOptionElement> HTMLOptionElement::create(Document* document, HTMLFormElement* form)
    5252{
    53     return new HTMLOptionElement(optionTag, document, form);
     53    return adoptRef(new HTMLOptionElement(optionTag, document, form));
    5454}
    5555
    5656PassRefPtr<HTMLOptionElement> HTMLOptionElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    5757{
    58     return new HTMLOptionElement(tagName, document, form);
     58    return adoptRef(new HTMLOptionElement(tagName, document, form));
    5959}
    6060
     
    6262        bool defaultSelected, bool selected, ExceptionCode& ec)
    6363{
    64     RefPtr<HTMLOptionElement> element = new HTMLOptionElement(optionTag, document);
     64    RefPtr<HTMLOptionElement> element = adoptRef(new HTMLOptionElement(optionTag, document));
    6565
    6666    RefPtr<Text> text = Text::create(document, data.isNull() ? "" : data);
  • trunk/WebCore/html/HTMLParagraphElement.cpp

    r60361 r61293  
    4242PassRefPtr<HTMLParagraphElement> HTMLParagraphElement::create(const QualifiedName& tagName, Document* document)
    4343{
    44     return new HTMLParagraphElement(tagName, document);
     44    return adoptRef(new HTMLParagraphElement(tagName, document));
    4545}
    4646
  • trunk/WebCore/html/HTMLParamElement.cpp

    r61094 r61293  
    4040PassRefPtr<HTMLParamElement> HTMLParamElement::create(const QualifiedName& tagName, Document* document)
    4141{
    42     return new HTMLParamElement(tagName, document);
     42    return adoptRef(new HTMLParamElement(tagName, document));
    4343}
    4444
  • trunk/WebCore/html/HTMLPreElement.cpp

    r60361 r61293  
    4040PassRefPtr<HTMLPreElement> HTMLPreElement::create(const QualifiedName& tagName, Document* document)
    4141{
    42     return new HTMLPreElement(tagName, document);
     42    return adoptRef(new HTMLPreElement(tagName, document));
    4343}
    4444
  • trunk/WebCore/html/HTMLProgressElement.cpp

    r61107 r61293  
    3838
    3939HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    40     : HTMLFormControlElement(tagName, document, form, CreateHTMLElement)
     40    : HTMLFormControlElement(tagName, document, form)
    4141{
    4242    ASSERT(hasTagName(progressTag));
  • trunk/WebCore/html/HTMLQuoteElement.cpp

    r60361 r61293  
    3939PassRefPtr<HTMLQuoteElement> HTMLQuoteElement::create(const QualifiedName& tagName, Document* document)
    4040{
    41     return new HTMLQuoteElement(tagName, document);
     41    return adoptRef(new HTMLQuoteElement(tagName, document));
    4242}
    4343
  • trunk/WebCore/html/HTMLScriptElement.cpp

    r60361 r61293  
    4646PassRefPtr<HTMLScriptElement> HTMLScriptElement::create(const QualifiedName& tagName, Document* document, bool createdByParser)
    4747{
    48     return new HTMLScriptElement(tagName, document, createdByParser);
     48    return adoptRef(new HTMLScriptElement(tagName, document, createdByParser));
    4949}
    5050
  • trunk/WebCore/html/HTMLSelectElement.cpp

    r60361 r61293  
    5656{
    5757    ASSERT(tagName.matches(selectTag));
    58     return new HTMLSelectElement(tagName, document, form);
     58    return adoptRef(new HTMLSelectElement(tagName, document, form));
    5959}
    6060
  • trunk/WebCore/html/HTMLSourceElement.cpp

    r60361 r61293  
    5050PassRefPtr<HTMLSourceElement> HTMLSourceElement::create(const QualifiedName& tagName, Document* document)
    5151{
    52     return new HTMLSourceElement(tagName, document);
     52    return adoptRef(new HTMLSourceElement(tagName, document));
    5353}
    5454
  • trunk/WebCore/html/HTMLStyleElement.cpp

    r60361 r61293  
    4343PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(const QualifiedName& tagName, Document* document, bool createdByParser)
    4444{
    45     return new HTMLStyleElement(tagName, document, createdByParser);
     45    return adoptRef(new HTMLStyleElement(tagName, document, createdByParser));
    4646}
    4747
  • trunk/WebCore/html/HTMLTableCaptionElement.cpp

    r60342 r61293  
    4242PassRefPtr<HTMLTableCaptionElement> HTMLTableCaptionElement::create(const QualifiedName& tagName, Document* document)
    4343{
    44     return new HTMLTableCaptionElement(tagName, document);
     44    return adoptRef(new HTMLTableCaptionElement(tagName, document));
    4545}
    4646
  • trunk/WebCore/html/HTMLTableCellElement.cpp

    r60361 r61293  
    5454PassRefPtr<HTMLTableCellElement> HTMLTableCellElement::create(const QualifiedName& tagName, Document* document)
    5555{
    56     return new HTMLTableCellElement(tagName, document);
     56    return adoptRef(new HTMLTableCellElement(tagName, document));
    5757}
    5858
  • trunk/WebCore/html/HTMLTableColElement.cpp

    r60342 r61293  
    4545PassRefPtr<HTMLTableColElement> HTMLTableColElement::create(const QualifiedName& tagName, Document* document)
    4646{
    47     return new HTMLTableColElement(tagName, document);
     47    return adoptRef(new HTMLTableColElement(tagName, document));
    4848}
    4949
  • trunk/WebCore/html/HTMLTableElement.cpp

    r60361 r61293  
    5656PassRefPtr<HTMLTableElement> HTMLTableElement::create(Document* document)
    5757{
    58     return new HTMLTableElement(tableTag, document);
     58    return adoptRef(new HTMLTableElement(tableTag, document));
    5959}
    6060
    6161PassRefPtr<HTMLTableElement> HTMLTableElement::create(const QualifiedName& tagName, Document* document)
    6262{
    63     return new HTMLTableElement(tagName, document);
     63    return adoptRef(new HTMLTableElement(tagName, document));
    6464}
    6565
  • trunk/WebCore/html/HTMLTableRowElement.cpp

    r60361 r61293  
    4747PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(Document* document)
    4848{
    49     return new HTMLTableRowElement(trTag, document);
     49    return adoptRef(new HTMLTableRowElement(trTag, document));
    5050}
    5151
    5252PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(const QualifiedName& tagName, Document* document)
    5353{
    54     return new HTMLTableRowElement(tagName, document);
     54    return adoptRef(new HTMLTableRowElement(tagName, document));
    5555}
    5656
  • trunk/WebCore/html/HTMLTableSectionElement.cpp

    r60361 r61293  
    4545PassRefPtr<HTMLTableSectionElement> HTMLTableSectionElement::create(const QualifiedName& tagName, Document* document)
    4646{
    47     return new HTMLTableSectionElement(tagName, document);
     47    return adoptRef(new HTMLTableSectionElement(tagName, document));
    4848}
    4949
  • trunk/WebCore/html/HTMLTextAreaElement.cpp

    r60361 r61293  
    8080PassRefPtr<HTMLTextAreaElement> HTMLTextAreaElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    8181{
    82     return new HTMLTextAreaElement(tagName, document, form);
     82    return adoptRef(new HTMLTextAreaElement(tagName, document, form));
    8383}
    8484
  • trunk/WebCore/html/HTMLTitleElement.cpp

    r60361 r61293  
    4141PassRefPtr<HTMLTitleElement> HTMLTitleElement::create(const QualifiedName& tagName, Document* document)
    4242{
    43     return new HTMLTitleElement(tagName, document);
     43    return adoptRef(new HTMLTitleElement(tagName, document));
    4444}
    4545
  • trunk/WebCore/html/HTMLUListElement.cpp

    r60361 r61293  
    4040PassRefPtr<HTMLUListElement> HTMLUListElement::create(Document* document)
    4141{
    42     return new HTMLUListElement(ulTag, document);
     42    return adoptRef(new HTMLUListElement(ulTag, document));
    4343}
    4444
    4545PassRefPtr<HTMLUListElement> HTMLUListElement::create(const QualifiedName& tagName, Document* document)
    4646{
    47     return new HTMLUListElement(tagName, document);
     47    return adoptRef(new HTMLUListElement(tagName, document));
    4848}
    4949
  • trunk/WebCore/html/HTMLVideoElement.cpp

    r60361 r61293  
    5555PassRefPtr<HTMLVideoElement> HTMLVideoElement::create(const QualifiedName& tagName, Document* document)
    5656{
    57     return new HTMLVideoElement(tagName, document);
     57    return adoptRef(new HTMLVideoElement(tagName, document));
    5858}
    5959
  • trunk/WebCore/loader/ImageDocument.cpp

    r61286 r61293  
    112112inline PassRefPtr<ImageDocumentElement> ImageDocumentElement::create(ImageDocument* document)
    113113{
    114     return new ImageDocumentElement(document);
     114    return adoptRef(new ImageDocumentElement(document));
    115115}
    116116
  • trunk/WebCore/mathml/MathMLElement.cpp

    r58914 r61293  
    11/*
    22 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
     3 * Copyright (C) 2010 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3839   
    3940MathMLElement::MathMLElement(const QualifiedName& tagName, Document* document)
    40     : StyledElement(tagName, document, CreateStyledElementZeroRefCount)
     41    : StyledElement(tagName, document)
    4142{
    4243}
     
    4445PassRefPtr<MathMLElement> MathMLElement::create(const QualifiedName& tagName, Document* document)
    4546{
    46     return new MathMLElement(tagName, document);
     47    return adoptRef(new MathMLElement(tagName, document));
    4748}
    48 
    49 RenderObject* MathMLElement::createRenderer(RenderArena*, RenderStyle* style)
    50 {
    51     return RenderObject::createObject(this, style);
    52 }
    53    
    5449   
    5550}
  • trunk/WebCore/mathml/MathMLElement.h

    r52721 r61293  
    11/*
    22 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
     3 * Copyright (C) 2010 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3132
    3233namespace WebCore {
    33    
     34
    3435class MathMLElement : public StyledElement {
    3536public:
    3637    static PassRefPtr<MathMLElement> create(const QualifiedName& tagName, Document*);
    37    
    38     virtual bool isMathMLElement() const { return true; }
    39    
    40     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
    41    
     38
    4239protected:
    4340    MathMLElement(const QualifiedName& tagName, Document*);
    44    
     41
     42private:   
     43    virtual bool isMathMLElement() const { return true; }
    4544};
    4645   
  • trunk/WebCore/mathml/MathMLInlineContainerElement.cpp

    r58349 r61293  
    11/*
    22 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
     3 * Copyright (C) 2010 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3334#include "RenderMathMLBlock.h"
    3435#include "RenderMathMLFraction.h"
    35 #include "RenderMathMLMath.h"
    3636#include "RenderMathMLRoot.h"
    3737#include "RenderMathMLRow.h"
     
    5151PassRefPtr<MathMLInlineContainerElement> MathMLInlineContainerElement::create(const QualifiedName& tagName, Document* document)
    5252{
    53     return new MathMLInlineContainerElement(tagName, document);
     53    return adoptRef(new MathMLInlineContainerElement(tagName, document));
    5454}
    5555
    56 RenderObject* MathMLInlineContainerElement::createRenderer(RenderArena *arena, RenderStyle* style)
     56RenderObject* MathMLInlineContainerElement::createRenderer(RenderArena* arena, RenderStyle* style)
    5757{
    58     RenderObject* object = 0;
     58    RenderObject* object;
    5959    if (hasLocalName(MathMLNames::mrowTag))
    6060        object = new (arena) RenderMathMLRow(this);
    61     else if (hasLocalName(MathMLNames::mathTag))
    62         object = new (arena) RenderMathMLMath(this);
    6361    else if (hasLocalName(MathMLNames::msubTag))
    6462        object = new (arena) RenderMathMLSubSup(this);
     
    8482    return object;
    8583}
    86    
    87    
     84
    8885}
    8986
    9087#endif // ENABLE(MATHML)
    91 
  • trunk/WebCore/mathml/MathMLInlineContainerElement.h

    r52721 r61293  
    11/*
    22 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
     3 * Copyright (C) 2010 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3637    static PassRefPtr<MathMLInlineContainerElement> create(const QualifiedName& tagName, Document*);
    3738
    38     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
    39 
    4039protected:
    4140    MathMLInlineContainerElement(const QualifiedName& tagName, Document*);
    4241
     42private:
     43    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
    4344};
    4445   
  • trunk/WebCore/mathml/MathMLMathElement.cpp

    r52721 r61293  
    11/*
    22 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
     3 * Copyright (C) 2010 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3031#include "MathMLMathElement.h"
    3132
    32 #include "MathMLNames.h"
    33 #include "RenderObject.h"
     33#include "RenderMathMLMath.h"
    3434
    3535namespace WebCore {
    36    
    37 using namespace MathMLNames;
    3836
    39 MathMLMathElement::MathMLMathElement(const QualifiedName& tagName, Document* document)
     37inline MathMLMathElement::MathMLMathElement(const QualifiedName& tagName, Document* document)
    4038    : MathMLInlineContainerElement(tagName, document)
    4139{
     
    4442PassRefPtr<MathMLMathElement> MathMLMathElement::create(const QualifiedName& tagName, Document* document)
    4543{
    46     return new MathMLMathElement(tagName, document);
     44    return adoptRef(new MathMLMathElement(tagName, document));
     45}
     46
     47RenderObject* MathMLMathElement::createRenderer(RenderArena* arena, RenderStyle* style)
     48{
     49    RenderMathMLMath* renderer = new (arena) RenderMathMLMath(this);
     50    renderer->setStyle(style);
     51    return renderer;
    4752}
    4853
  • trunk/WebCore/mathml/MathMLMathElement.h

    r52721 r61293  
    11/*
    22 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
     3 * Copyright (C) 2010 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3132
    3233namespace WebCore {
    33    
     34
    3435class MathMLMathElement : public MathMLInlineContainerElement {
    3536public:
    3637    static PassRefPtr<MathMLMathElement> create(const QualifiedName& tagName, Document*);
    37    
    38 protected:
     38
     39private:
    3940    MathMLMathElement(const QualifiedName& tagName, Document*);
    40    
     41
     42    virtual createRenderer(RenderArena*, RenderStyle*);
    4143};
    4244   
  • trunk/WebCore/mathml/MathMLTextElement.cpp

    r55607 r61293  
    11/*
    22 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
     3 * Copyright (C) 2010 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3738using namespace MathMLNames;
    3839
    39 MathMLTextElement::MathMLTextElement(const QualifiedName& tagName, Document* document)
     40inline MathMLTextElement::MathMLTextElement(const QualifiedName& tagName, Document* document)
    4041    : MathMLElement(tagName, document)
    4142{
     
    4445PassRefPtr<MathMLTextElement> MathMLTextElement::create(const QualifiedName& tagName, Document* document)
    4546{
    46     return new MathMLTextElement(tagName, document);
     47    return adoptRef(new MathMLTextElement(tagName, document));
    4748}
    4849
     
    5556    }
    5657
    57     return RenderObject::createObject(this, style);
     58    return MathMLElement::createRenderer(arena, style);
    5859}
    5960
    60    
    6161}
    6262
    6363#endif // ENABLE(MATHML)
    64 
  • trunk/WebCore/mathml/MathMLTextElement.h

    r53764 r61293  
    11/*
    22 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
     3 * Copyright (C) 2010 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3637    static PassRefPtr<MathMLTextElement> create(const QualifiedName& tagName, Document*);
    3738
     39private:
     40    MathMLTextElement(const QualifiedName& tagName, Document*);
     41
    3842    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
    39    
    40 protected:
    41     MathMLTextElement(const QualifiedName& tagName, Document*);
    42    
    4343};
    4444   
  • trunk/WebCore/rendering/MediaControlElements.cpp

    r60418 r61293  
    7171PassRefPtr<MediaControlShadowRootElement> MediaControlShadowRootElement::create(HTMLMediaElement* mediaElement)
    7272{
    73     RefPtr<MediaControlShadowRootElement> element = new MediaControlShadowRootElement(mediaElement);
     73    RefPtr<MediaControlShadowRootElement> element = adoptRef(new MediaControlShadowRootElement(mediaElement));
    7474
    7575    RefPtr<RenderStyle> rootStyle = RenderStyle::create();
     
    131131PassRefPtr<MediaControlElement> MediaControlElement::create(HTMLMediaElement* mediaElement, PseudoId pseudoStyleId)
    132132{
    133     return new MediaControlElement(mediaElement, pseudoStyleId);
     133    return adoptRef(new MediaControlElement(mediaElement, pseudoStyleId));
    134134}
    135135
     
    223223PassRefPtr<MediaControlTimelineContainerElement> MediaControlTimelineContainerElement::create(HTMLMediaElement* mediaElement)
    224224{
    225     return new MediaControlTimelineContainerElement(mediaElement);
     225    return adoptRef(new MediaControlTimelineContainerElement(mediaElement));
    226226}
    227227
     
    253253PassRefPtr<MediaControlVolumeSliderContainerElement> MediaControlVolumeSliderContainerElement::create(HTMLMediaElement* mediaElement)
    254254{
    255     return new MediaControlVolumeSliderContainerElement(mediaElement);
     255    return adoptRef(new MediaControlVolumeSliderContainerElement(mediaElement));
    256256}
    257257
     
    299299PassRefPtr<MediaControlStatusDisplayElement> MediaControlStatusDisplayElement::create(HTMLMediaElement* mediaElement)
    300300{
    301     return new MediaControlStatusDisplayElement(mediaElement);
     301    return adoptRef(new MediaControlStatusDisplayElement(mediaElement));
    302302}
    303303
     
    483483PassRefPtr<MediaControlMuteButtonElement> MediaControlMuteButtonElement::create(HTMLMediaElement* mediaElement)
    484484{
    485     return new MediaControlMuteButtonElement(mediaElement);
     485    return adoptRef(new MediaControlMuteButtonElement(mediaElement));
    486486}
    487487
     
    509509PassRefPtr<MediaControlPlayButtonElement> MediaControlPlayButtonElement::create(HTMLMediaElement* mediaElement)
    510510{
    511     return new MediaControlPlayButtonElement(mediaElement);
     511    return adoptRef(new MediaControlPlayButtonElement(mediaElement));
    512512}
    513513
     
    538538PassRefPtr<MediaControlSeekButtonElement> MediaControlSeekButtonElement::create(HTMLMediaElement* mediaElement, PseudoId pseudoStyleId)
    539539{
    540     return new MediaControlSeekButtonElement(mediaElement, pseudoStyleId);
     540    return adoptRef(new MediaControlSeekButtonElement(mediaElement, pseudoStyleId));
    541541}
    542542
     
    602602PassRefPtr<MediaControlRewindButtonElement> MediaControlRewindButtonElement::create(HTMLMediaElement* mediaElement)
    603603{
    604     return new MediaControlRewindButtonElement(mediaElement);
     604    return adoptRef(new MediaControlRewindButtonElement(mediaElement));
    605605}
    606606
     
    624624PassRefPtr<MediaControlReturnToRealtimeButtonElement> MediaControlReturnToRealtimeButtonElement::create(HTMLMediaElement* mediaElement)
    625625{
    626     return new MediaControlReturnToRealtimeButtonElement(mediaElement);
     626    return adoptRef(new MediaControlReturnToRealtimeButtonElement(mediaElement));
    627627}
    628628
     
    646646PassRefPtr<MediaControlToggleClosedCaptionsButtonElement> MediaControlToggleClosedCaptionsButtonElement::create(HTMLMediaElement* mediaElement)
    647647{
    648     return new MediaControlToggleClosedCaptionsButtonElement(mediaElement);
     648    return adoptRef(new MediaControlToggleClosedCaptionsButtonElement(mediaElement));
    649649}
    650650
     
    673673PassRefPtr<MediaControlTimelineElement> MediaControlTimelineElement::create(HTMLMediaElement* mediaElement)
    674674{
    675     return new MediaControlTimelineElement(mediaElement);
     675    return adoptRef(new MediaControlTimelineElement(mediaElement));
    676676}
    677677
     
    726726PassRefPtr<MediaControlVolumeSliderElement> MediaControlVolumeSliderElement::create(HTMLMediaElement* mediaElement)
    727727{
    728     return new MediaControlVolumeSliderElement(mediaElement);
     728    return adoptRef(new MediaControlVolumeSliderElement(mediaElement));
    729729}
    730730
     
    768768PassRefPtr<MediaControlFullscreenButtonElement> MediaControlFullscreenButtonElement::create(HTMLMediaElement* mediaElement)
    769769{
    770     return new MediaControlFullscreenButtonElement(mediaElement);
     770    return adoptRef(new MediaControlFullscreenButtonElement(mediaElement));
    771771}
    772772
     
    791791PassRefPtr<MediaControlTimeDisplayElement> MediaControlTimeDisplayElement::create(HTMLMediaElement* mediaElement, PseudoId pseudoStyleId)
    792792{
    793     return new MediaControlTimeDisplayElement(mediaElement, pseudoStyleId);
     793    return adoptRef(new MediaControlTimeDisplayElement(mediaElement, pseudoStyleId));
    794794}
    795795
  • trunk/WebCore/rendering/RenderFileUploadControl.cpp

    r61094 r61293  
    5454RenderFileUploadControl::RenderFileUploadControl(HTMLInputElement* input)
    5555    : RenderBlock(input)
    56     , m_button(0)
    5756{
    5857    FileList* list = input->files();
  • trunk/WebCore/rendering/RenderProgress.cpp

    r61094 r61293  
    2424
    2525#include "RenderProgress.h"
    26 #include "ShadowElement.h"
    27 #include "HTMLNames.h"
     26
    2827#include "HTMLProgressElement.h"
    2928#include "RenderTheme.h"
    3029#include "RenderView.h"
     30#include "ShadowElement.h"
    3131#include <wtf/CurrentTime.h>
    3232#include <wtf/RefPtr.h>
  • trunk/WebCore/rendering/RenderSlider.cpp

    r61107 r61293  
    5353}
    5454
    55 // FIXME: Could share code with the SliderDivElement class in RenderProgress.
    5655class SliderThumbElement : public ShadowBlockElement {
    5756public:
     
    6564private:       
    6665    SliderThumbElement(Node* shadowParent);
    67    
     66
    6867    FloatPoint m_offsetToThumb;
    6968    bool m_inDragMode;
     
    7877inline PassRefPtr<SliderThumbElement> SliderThumbElement::create(Node* shadowParent)
    7978{
    80     return new SliderThumbElement(shadowParent);
     79    return adoptRef(new SliderThumbElement(shadowParent));
    8180}
    8281
     
    108107
    109108                m_inDragMode = true;
    110                 document()->frame()->eventHandler()->setCapturingMouseEventsNode(shadowParentNode());
     109                document()->frame()->eventHandler()->setCapturingMouseEventsNode(shadowParent());
    111110                event->setDefaultHandled();
    112111                return;
  • trunk/WebCore/rendering/ShadowElement.cpp

    r60951 r61293  
    2626namespace WebCore {
    2727
     28using namespace HTMLNames;
     29
    2830PassRefPtr<ShadowBlockElement> ShadowBlockElement::create(Node* shadowParent)
    2931{
     
    3234
    3335ShadowBlockElement::ShadowBlockElement(Node* shadowParent)
    34     : ShadowElement<HTMLDivElement>(HTMLNames::divTag, shadowParent)
     36    : ShadowElement<HTMLDivElement>(divTag, shadowParent)
    3537{
    3638}
     
    4244
    4345ShadowInputElement::ShadowInputElement(Node* shadowParent)
    44     : ShadowElement<HTMLInputElement>(HTMLNames::inputTag, shadowParent)
     46    : ShadowElement<HTMLInputElement>(inputTag, shadowParent)
    4547{
    4648}
  • trunk/WebCore/rendering/ShadowElement.h

    r60951 r61293  
    4141        : BaseElement(name, shadowParent->document())
    4242        , m_shadowParent(shadowParent)
    43     {}
     43    {
     44    }
    4445
     46    Node* shadowParent() const { return m_shadowParent; }
     47
     48private:
    4549    virtual bool isShadowNode() const { return true; }
    4650    virtual Node* shadowParentNode() { return m_shadowParent; }
    4751
    48 private:
    4952    Node* m_shadowParent;
    5053};
  • trunk/WebCore/rendering/TextControlInnerElements.cpp

    r60418 r61293  
    9090PassRefPtr<TextControlInnerElement> TextControlInnerElement::create(Node* shadowParent)
    9191{
    92     return new TextControlInnerElement(shadowParent->document(), shadowParent);
     92    return adoptRef(new TextControlInnerElement(shadowParent->document(), shadowParent));
    9393}
    9494
     
    127127PassRefPtr<TextControlInnerTextElement> TextControlInnerTextElement::create(Document* document, Node* shadowParent)
    128128{
    129     return new TextControlInnerTextElement(document, shadowParent);
     129    return adoptRef(new TextControlInnerTextElement(document, shadowParent));
    130130}
    131131
     
    163163PassRefPtr<SearchFieldResultsButtonElement> SearchFieldResultsButtonElement::create(Document* document)
    164164{
    165     return new SearchFieldResultsButtonElement(document);
     165    return adoptRef(new SearchFieldResultsButtonElement(document));
    166166}
    167167
     
    195195PassRefPtr<SearchFieldCancelButtonElement> SearchFieldCancelButtonElement::create(Document* document)
    196196{
    197     return new SearchFieldCancelButtonElement(document);
     197    return adoptRef(new SearchFieldCancelButtonElement(document));
    198198}
    199199
     
    252252PassRefPtr<SpinButtonElement> SpinButtonElement::create(Node* shadowParent)
    253253{
    254     return new SpinButtonElement(shadowParent);
     254    return adoptRef(new SpinButtonElement(shadowParent));
    255255}
    256256
  • trunk/WebCore/storage/IndexedDatabaseImpl.cpp

    r60484 r61293  
    4141PassRefPtr<IndexedDatabaseImpl> IndexedDatabaseImpl::create()
    4242{
    43     return new IndexedDatabaseImpl();
     43    return adoptRef(new IndexedDatabaseImpl);
    4444}
    4545
Note: See TracChangeset for help on using the changeset viewer.