Changeset 61293 in webkit
- Timestamp:
- Jun 16, 2010 4:07:32 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 92 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r61244 r61293 1 2010-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 1 11 2010-06-16 Peter Varga <pvarga@inf.u-szeged.hu> 2 12 -
trunk/JavaScriptCore/wtf/ThreadSafeShared.h
r58206 r61293 130 130 template<class T> class ThreadSafeShared : public ThreadSafeSharedBase { 131 131 public: 132 ThreadSafeShared(int initialRefCount = 1)133 : ThreadSafeSharedBase(initialRefCount)134 {135 }136 137 132 void deref() 138 133 { 139 134 if (derefBase()) 140 135 delete static_cast<T*>(this); 136 } 137 138 protected: 139 ThreadSafeShared() 140 { 141 141 } 142 142 }; -
trunk/WebCore/ChangeLog
r61286 r61293 1 2010-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 1 251 2010-06-16 Adam Barth <abarth@webkit.org> 2 252 -
trunk/WebCore/dom/Element.cpp
r61094 r61293 1099 1099 return; 1100 1100 ExceptionCode ec = 0; 1101 dispatchEvent( new MutationEvent(DOMAttrModifiedEvent, true, false, attr, attr->value(),1101 dispatchEvent(MutationEvent::create(DOMAttrModifiedEvent, true, attr, attr->value(), 1102 1102 attr->value(), document()->attrName(attr->id()), MutationEvent::REMOVAL), ec); 1103 1103 #endif … … 1112 1112 return; 1113 1113 ExceptionCode ec = 0; 1114 dispatchEvent( new MutationEvent(DOMAttrModifiedEvent, true, false, attr, attr->value(),1114 dispatchEvent(MutationEvent::create(DOMAttrModifiedEvent, true, attr, attr->value(), 1115 1115 attr->value(), document()->attrName(attr->id()), MutationEvent::ADDITION), ec); 1116 1116 #endif -
trunk/WebCore/dom/Node.h
r60434 r61293 655 655 656 656 protected: 657 // Create ElementZeroRefCountis deprecated and can be removed once we convert all element657 // CreateWithZeroRefCountFlag is deprecated and can be removed once we convert all element 658 658 // classes to start with a reference count of 1. 659 659 enum ConstructionType { … … 663 663 CreateContainer = DefaultNodeFlags | IsContainerFlag, 664 664 CreateElement = CreateContainer | IsElementFlag, 665 CreateElementZeroRefCount = IsElementFlag | CreateWithZeroRefCountFlag,666 665 CreateStyledElement = CreateElement | IsStyledElementFlag, 667 666 CreateStyledElementZeroRefCount = CreateStyledElement | CreateWithZeroRefCountFlag, 668 667 CreateHTMLElement = CreateStyledElement | IsHTMLFlag, 669 CreateHTMLElementZeroRefCount = CreateHTMLElement | CreateWithZeroRefCountFlag,670 668 CreateSVGElement = CreateStyledElement | IsSVGFlag, 671 669 CreateSVGElementZeroRefCount = CreateSVGElement | CreateWithZeroRefCountFlag, -
trunk/WebCore/editing/DeleteButton.cpp
r60418 r61293 46 46 PassRefPtr<DeleteButton> DeleteButton::create(Document* document) 47 47 { 48 return new DeleteButton(document);48 return adoptRef(new DeleteButton(document)); 49 49 } 50 50 -
trunk/WebCore/editing/InsertListCommand.cpp
r60877 r61293 1 1 /* 2 * Copyright (C) 2006 Apple Computer, Inc.All rights reserved.2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 40 40 PassRefPtr<HTMLElement> InsertListCommand::insertList(Document* document, Type type) 41 41 { 42 RefPtr<InsertListCommand> insertCommand = new InsertListCommand(document, type);42 RefPtr<InsertListCommand> insertCommand = create(document, type); 43 43 insertCommand->apply(); 44 44 return insertCommand->m_listElement; -
trunk/WebCore/editing/ModifySelectionListLevel.cpp
r42084 r61293 210 210 } 211 211 212 PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevel WithType(Document* document, Type listType)212 PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevel(Document* document, Type type) 213 213 { 214 214 ASSERT(document); 215 215 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(); 219 219 } 220 220 221 221 PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevel(Document* document) 222 222 { 223 return increaseSelectionListLevel WithType(document, InheritedListType);223 return increaseSelectionListLevel(document, InheritedListType); 224 224 } 225 225 226 226 PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered(Document* document) 227 227 { 228 return increaseSelectionListLevel WithType(document, OrderedList);228 return increaseSelectionListLevel(document, OrderedList); 229 229 } 230 230 231 231 PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered(Document* document) 232 232 { 233 return increaseSelectionListLevel WithType(document, UnorderedList);233 return increaseSelectionListLevel(document, UnorderedList); 234 234 } 235 235 … … 290 290 ASSERT(document); 291 291 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 1 1 /* 2 * Copyright (C) 2006 Apple Computer, Inc.All rights reserved.2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 56 56 private: 57 57 enum Type { InheritedListType, OrderedList, UnorderedList }; 58 static PassRefPtr<Node> increaseSelectionListLevel WithType(Document*, Type listType);58 static PassRefPtr<Node> increaseSelectionListLevel(Document*, Type); 59 59 60 static PassRefPtr<IncreaseSelectionListLevelCommand> create(Document* document, Type type) 61 { 62 return adoptRef(new IncreaseSelectionListLevelCommand(document, type)); 63 } 64 60 65 IncreaseSelectionListLevelCommand(Document*, Type); 66 61 67 virtual void doApply(); 62 68 … … 72 78 73 79 private: 80 static PassRefPtr<DecreaseSelectionListLevelCommand> create(Document* document) 81 { 82 return adoptRef(new DecreaseSelectionListLevelCommand(document)); 83 } 84 74 85 DecreaseSelectionListLevelCommand(Document*); 86 75 87 virtual void doApply(); 76 88 }; -
trunk/WebCore/html/HTMLAnchorElement.cpp
r59923 r61293 43 43 44 44 HTMLAnchorElement::HTMLAnchorElement(const QualifiedName& tagName, Document* document) 45 : HTMLElement(tagName, document , CreateHTMLElement)45 : HTMLElement(tagName, document) 46 46 , m_wasShiftKeyDownOnMouseDown(false) 47 47 , m_linkRelations(0) -
trunk/WebCore/html/HTMLAudioElement.cpp
r60342 r61293 44 44 PassRefPtr<HTMLAudioElement> HTMLAudioElement::create(const QualifiedName& tagName, Document* document) 45 45 { 46 return new HTMLAudioElement(tagName, document);46 return adoptRef(new HTMLAudioElement(tagName, document)); 47 47 } 48 48 49 49 PassRefPtr<HTMLAudioElement> HTMLAudioElement::createForJSConstructor(Document* document, const String& src) 50 50 { 51 RefPtr<HTMLAudioElement> audio = new HTMLAudioElement(audioTag, document);51 RefPtr<HTMLAudioElement> audio = adoptRef(new HTMLAudioElement(audioTag, document)); 52 52 audio->setPreload("auto"); 53 53 if (!src.isNull()) { -
trunk/WebCore/html/HTMLBRElement.cpp
r60342 r61293 41 41 PassRefPtr<HTMLBRElement> HTMLBRElement::create(Document* document) 42 42 { 43 return new HTMLBRElement(brTag, document);43 return adoptRef(new HTMLBRElement(brTag, document)); 44 44 } 45 45 46 46 PassRefPtr<HTMLBRElement> HTMLBRElement::create(const QualifiedName& tagName, Document* document) 47 47 { 48 return new HTMLBRElement(tagName, document);48 return adoptRef(new HTMLBRElement(tagName, document)); 49 49 } 50 50 -
trunk/WebCore/html/HTMLBaseElement.cpp
r60342 r61293 43 43 PassRefPtr<HTMLBaseElement> HTMLBaseElement::create(const QualifiedName& tagName, Document* document) 44 44 { 45 return new HTMLBaseElement(tagName, document);45 return adoptRef(new HTMLBaseElement(tagName, document)); 46 46 } 47 47 -
trunk/WebCore/html/HTMLBaseFontElement.cpp
r60342 r61293 38 38 PassRefPtr<HTMLBaseFontElement> HTMLBaseFontElement::create(const QualifiedName& tagName, Document* document) 39 39 { 40 return new HTMLBaseFontElement(tagName, document);40 return adoptRef(new HTMLBaseFontElement(tagName, document)); 41 41 } 42 42 -
trunk/WebCore/html/HTMLBlockquoteElement.cpp
r60342 r61293 38 38 PassRefPtr<HTMLBlockquoteElement> HTMLBlockquoteElement::create(Document* document) 39 39 { 40 return new HTMLBlockquoteElement(blockquoteTag, document);40 return adoptRef(new HTMLBlockquoteElement(blockquoteTag, document)); 41 41 } 42 42 43 43 PassRefPtr<HTMLBlockquoteElement> HTMLBlockquoteElement::create(const QualifiedName& tagName, Document* document) 44 44 { 45 return new HTMLBlockquoteElement(tagName, document);45 return adoptRef(new HTMLBlockquoteElement(tagName, document)); 46 46 } 47 47 -
trunk/WebCore/html/HTMLBodyElement.cpp
r60342 r61293 48 48 PassRefPtr<HTMLBodyElement> HTMLBodyElement::create(Document* document) 49 49 { 50 return new HTMLBodyElement(bodyTag, document);50 return adoptRef(new HTMLBodyElement(bodyTag, document)); 51 51 } 52 52 53 53 PassRefPtr<HTMLBodyElement> HTMLBodyElement::create(const QualifiedName& tagName, Document* document) 54 54 { 55 return new HTMLBodyElement(tagName, document);55 return adoptRef(new HTMLBodyElement(tagName, document)); 56 56 } 57 57 -
trunk/WebCore/html/HTMLButtonElement.cpp
r60342 r61293 51 51 PassRefPtr<HTMLButtonElement> HTMLButtonElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 52 52 { 53 return new HTMLButtonElement(tagName, document, form);53 return adoptRef(new HTMLButtonElement(tagName, document, form)); 54 54 } 55 55 -
trunk/WebCore/html/HTMLCanvasElement.cpp
r60930 r61293 66 66 PassRefPtr<HTMLCanvasElement> HTMLCanvasElement::create(Document* document) 67 67 { 68 return new HTMLCanvasElement(canvasTag, document);68 return adoptRef(new HTMLCanvasElement(canvasTag, document)); 69 69 } 70 70 71 71 PassRefPtr<HTMLCanvasElement> HTMLCanvasElement::create(const QualifiedName& tagName, Document* document) 72 72 { 73 return new HTMLCanvasElement(tagName, document);73 return adoptRef(new HTMLCanvasElement(tagName, document)); 74 74 } 75 75 -
trunk/WebCore/html/HTMLDListElement.cpp
r60342 r61293 38 38 PassRefPtr<HTMLDListElement> HTMLDListElement::create(const QualifiedName& tagName, Document* document) 39 39 { 40 return new HTMLDListElement(tagName, document);40 return adoptRef(new HTMLDListElement(tagName, document)); 41 41 } 42 42 -
trunk/WebCore/html/HTMLDataGridCellElement.cpp
r60342 r61293 43 43 PassRefPtr<HTMLDataGridCellElement> HTMLDataGridCellElement::create(const QualifiedName& name, Document* document) 44 44 { 45 return new HTMLDataGridCellElement(name, document);45 return adoptRef(new HTMLDataGridCellElement(name, document)); 46 46 } 47 47 -
trunk/WebCore/html/HTMLDataGridColElement.cpp
r61094 r61293 47 47 PassRefPtr<HTMLDataGridColElement> HTMLDataGridColElement::create(const QualifiedName& name, Document* document) 48 48 { 49 return new HTMLDataGridColElement(name, document);49 return adoptRef(new HTMLDataGridColElement(name, document)); 50 50 } 51 51 -
trunk/WebCore/html/HTMLDataGridElement.cpp
r60342 r61293 48 48 PassRefPtr<HTMLDataGridElement> HTMLDataGridElement::create(const QualifiedName& tagName, Document* document) 49 49 { 50 return new HTMLDataGridElement(tagName, document);50 return adoptRef(new HTMLDataGridElement(tagName, document)); 51 51 } 52 52 -
trunk/WebCore/html/HTMLDataGridRowElement.cpp
r60342 r61293 43 43 PassRefPtr<HTMLDataGridRowElement> HTMLDataGridRowElement::create(const QualifiedName& name, Document* document) 44 44 { 45 return new HTMLDataGridRowElement(name, document);45 return adoptRef(new HTMLDataGridRowElement(name, document)); 46 46 } 47 47 -
trunk/WebCore/html/HTMLDataListElement.cpp
r60342 r61293 45 45 PassRefPtr<HTMLDataListElement> HTMLDataListElement::create(const QualifiedName& tagName, Document* document) 46 46 { 47 return new HTMLDataListElement(tagName, document);47 return adoptRef(new HTMLDataListElement(tagName, document)); 48 48 } 49 49 -
trunk/WebCore/html/HTMLDivElement.cpp
r60418 r61293 41 41 PassRefPtr<HTMLDivElement> HTMLDivElement::create(Document* document) 42 42 { 43 return new HTMLDivElement(divTag, document);43 return adoptRef(new HTMLDivElement(divTag, document)); 44 44 } 45 45 46 46 PassRefPtr<HTMLDivElement> HTMLDivElement::create(const QualifiedName& tagName, Document* document) 47 47 { 48 return new HTMLDivElement(tagName, document);48 return adoptRef(new HTMLDivElement(tagName, document)); 49 49 } 50 50 -
trunk/WebCore/html/HTMLElement.cpp
r61094 r61293 59 59 PassRefPtr<HTMLElement> HTMLElement::create(const QualifiedName& tagName, Document* document) 60 60 { 61 return adoptRef(new HTMLElement(tagName, document , CreateHTMLElement));61 return adoptRef(new HTMLElement(tagName, document)); 62 62 } 63 63 -
trunk/WebCore/html/HTMLElement.h
r59773 r61293 83 83 84 84 protected: 85 HTMLElement(const QualifiedName& tagName, Document* , ConstructionType = CreateHTMLElementZeroRefCount);85 HTMLElement(const QualifiedName& tagName, Document*); 86 86 87 87 void addHTMLAlignment(Attribute*); … … 112 112 }; 113 113 114 inline HTMLElement::HTMLElement(const QualifiedName& tagName, Document* document , ConstructionType type)115 : StyledElement(tagName, document, type)114 inline HTMLElement::HTMLElement(const QualifiedName& tagName, Document* document) 115 : StyledElement(tagName, document, CreateHTMLElement) 116 116 { 117 117 ASSERT(tagName.localName().impl()); -
trunk/WebCore/html/HTMLFieldSetElement.cpp
r60342 r61293 42 42 PassRefPtr<HTMLFieldSetElement> HTMLFieldSetElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 43 43 { 44 return new HTMLFieldSetElement(tagName, document, form);44 return adoptRef(new HTMLFieldSetElement(tagName, document, form)); 45 45 } 46 46 -
trunk/WebCore/html/HTMLFontElement.cpp
r60418 r61293 43 43 PassRefPtr<HTMLFontElement> HTMLFontElement::create(const QualifiedName& tagName, Document* document) 44 44 { 45 return new HTMLFontElement(tagName, document);45 return adoptRef(new HTMLFontElement(tagName, document)); 46 46 } 47 47 -
trunk/WebCore/html/HTMLFormControlElement.cpp
r61107 r61293 54 54 using namespace HTMLNames; 55 55 56 HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* doc , HTMLFormElement* f, ConstructionType constructionType)57 : HTMLElement(tagName, doc , constructionType)58 , m_form(f )56 HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 57 : HTMLElement(tagName, document) 58 , m_form(form) 59 59 , m_disabled(false) 60 60 , m_readOnly(false) -
trunk/WebCore/html/HTMLFormControlElement.h
r60419 r61293 35 35 class VisibleSelection; 36 36 37 // FIXME: The HTML5 specification calls these form-associated elements. 38 // So consider renaming this to HTMLFormAssociatedElement. 37 39 class HTMLFormControlElement : public HTMLElement { 38 40 public: … … 45 47 void setFormNoValidate(bool); 46 48 47 virtual void reset() { }49 virtual void reset() { } 48 50 49 51 virtual bool formControlValueMatchesRenderer() const { return m_valueMatchesRenderer; } … … 78 80 virtual bool canTriggerImplicitSubmission() const { return false; } 79 81 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). 83 84 virtual bool appendFormData(FormDataList&, bool) { return false; } 84 85 … … 105 106 106 107 protected: 107 HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement* , ConstructionType = CreateHTMLElementZeroRefCount);108 HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*); 108 109 109 110 virtual void parseMappedAttribute(Attribute*); … … 121 122 122 123 void removeFromForm(); 124 123 125 // This must be called any time the result of willValidate() has changed. 124 126 void setNeedsWillValidateCheck(); … … 148 150 bool m_required : 1; 149 151 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 151 154 // 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. 153 156 mutable bool m_willValidateInitialized: 1; 154 157 mutable bool m_willValidate : 1; 158 155 159 // Cache of validity()->valid(). 156 // "candidate for constraint validation" doesn't affect tom_isValid.160 // But "candidate for constraint validation" doesn't affect m_isValid. 157 161 bool m_isValid : 1; 158 162 }; 159 163 164 // FIXME: Give this class its own header file. 160 165 class HTMLFormControlElementWithState : public HTMLFormControlElement { 161 166 public: … … 176 181 }; 177 182 183 // FIXME: Give this class its own header file. 178 184 class HTMLTextFormControlElement : public HTMLFormControlElementWithState { 179 185 public: … … 207 213 virtual int cachedSelectionEnd() const = 0; 208 214 209 // A subclass should return true if placeholder processing is needed.215 // The derived class should return true if placeholder processing is needed. 210 216 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. 212 218 virtual bool isEmptyValue() const = 0; 213 219 // Called in dispatchFocusEvent(), after placeholder process, before calling parent's dispatchFocusEvent(). … … 215 221 // Called in dispatchBlurEvent(), after placeholder process, before calling parent's dispatchBlurEvent(). 216 222 virtual void handleBlurEvent() { } 223 217 224 RenderTextControl* textRendererAfterUpdateLayout(); 218 225 }; -
trunk/WebCore/html/HTMLFormElement.cpp
r61156 r61293 87 87 PassRefPtr<HTMLFormElement> HTMLFormElement::create(Document* document) 88 88 { 89 return new HTMLFormElement(formTag, document);89 return adoptRef(new HTMLFormElement(formTag, document)); 90 90 } 91 91 92 92 PassRefPtr<HTMLFormElement> HTMLFormElement::create(const QualifiedName& tagName, Document* document) 93 93 { 94 return new HTMLFormElement(tagName, document);94 return adoptRef(new HTMLFormElement(tagName, document)); 95 95 } 96 96 -
trunk/WebCore/html/HTMLFrameOwnerElement.cpp
r58914 r61293 34 34 35 35 HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Document* document) 36 : HTMLElement(tagName, document , CreateHTMLElement)36 : HTMLElement(tagName, document) 37 37 , m_contentFrame(0) 38 38 , m_sandboxFlags(SandboxNone) -
trunk/WebCore/html/HTMLFrameSetElement.cpp
r60418 r61293 57 57 PassRefPtr<HTMLFrameSetElement> HTMLFrameSetElement::create(const QualifiedName& tagName, Document* document) 58 58 { 59 return new HTMLFrameSetElement(tagName, document);59 return adoptRef(new HTMLFrameSetElement(tagName, document)); 60 60 } 61 61 -
trunk/WebCore/html/HTMLHRElement.cpp
r60418 r61293 41 41 PassRefPtr<HTMLHRElement> HTMLHRElement::create(Document* document) 42 42 { 43 return new HTMLHRElement(hrTag, document);43 return adoptRef(new HTMLHRElement(hrTag, document)); 44 44 } 45 45 46 46 PassRefPtr<HTMLHRElement> HTMLHRElement::create(const QualifiedName& tagName, Document* document) 47 47 { 48 return new HTMLHRElement(tagName, document);48 return adoptRef(new HTMLHRElement(tagName, document)); 49 49 } 50 50 -
trunk/WebCore/html/HTMLHeadElement.cpp
r60418 r61293 40 40 PassRefPtr<HTMLHeadElement> HTMLHeadElement::create(Document* document) 41 41 { 42 return new HTMLHeadElement(headTag, document);42 return adoptRef(new HTMLHeadElement(headTag, document)); 43 43 } 44 44 45 45 PassRefPtr<HTMLHeadElement> HTMLHeadElement::create(const QualifiedName& tagName, Document* document) 46 46 { 47 return new HTMLHeadElement(tagName, document);47 return adoptRef(new HTMLHeadElement(tagName, document)); 48 48 } 49 49 -
trunk/WebCore/html/HTMLHeadingElement.cpp
r60418 r61293 37 37 PassRefPtr<HTMLHeadingElement> HTMLHeadingElement::create(const QualifiedName& tagName, Document* document) 38 38 { 39 return new HTMLHeadingElement(tagName, document);39 return adoptRef(new HTMLHeadingElement(tagName, document)); 40 40 } 41 41 -
trunk/WebCore/html/HTMLHtmlElement.cpp
r60418 r61293 43 43 PassRefPtr<HTMLHtmlElement> HTMLHtmlElement::create(Document* document) 44 44 { 45 return new HTMLHtmlElement(htmlTag, document);45 return adoptRef(new HTMLHtmlElement(htmlTag, document)); 46 46 } 47 47 48 48 PassRefPtr<HTMLHtmlElement> HTMLHtmlElement::create(const QualifiedName& tagName, Document* document) 49 49 { 50 return new HTMLHtmlElement(tagName, document);50 return adoptRef(new HTMLHtmlElement(tagName, document)); 51 51 } 52 52 -
trunk/WebCore/html/HTMLImageElement.cpp
r61094 r61293 56 56 PassRefPtr<HTMLImageElement> HTMLImageElement::create(Document* document) 57 57 { 58 return new HTMLImageElement(imgTag, document);58 return adoptRef(new HTMLImageElement(imgTag, document)); 59 59 } 60 60 61 61 PassRefPtr<HTMLImageElement> HTMLImageElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 62 62 { 63 return new HTMLImageElement(tagName, document, form);63 return adoptRef(new HTMLImageElement(tagName, document, form)); 64 64 } 65 65 … … 72 72 PassRefPtr<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document* document, const int* optionalWidth, const int* optionalHeight) 73 73 { 74 RefPtr<HTMLImageElement> image = new HTMLImageElement(imgTag, document);74 RefPtr<HTMLImageElement> image = adoptRef(new HTMLImageElement(imgTag, document)); 75 75 if (optionalWidth) 76 76 image->setWidth(*optionalWidth); -
trunk/WebCore/html/HTMLInputElement.cpp
r61107 r61293 126 126 PassRefPtr<HTMLInputElement> HTMLInputElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 127 127 { 128 return new HTMLInputElement(tagName, document, form);128 return adoptRef(new HTMLInputElement(tagName, document, form)); 129 129 } 130 130 -
trunk/WebCore/html/HTMLIsIndexElement.cpp
r60418 r61293 42 42 PassRefPtr<HTMLIsIndexElement> HTMLIsIndexElement::create(Document* document, HTMLFormElement* form) 43 43 { 44 return new HTMLIsIndexElement(isindexTag, document, form);44 return adoptRef(new HTMLIsIndexElement(isindexTag, document, form)); 45 45 } 46 46 47 47 PassRefPtr<HTMLIsIndexElement> HTMLIsIndexElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 48 48 { 49 return new HTMLIsIndexElement(tagName, document, form);49 return adoptRef(new HTMLIsIndexElement(tagName, document, form)); 50 50 } 51 51 -
trunk/WebCore/html/HTMLKeygenElement.cpp
r60361 r61293 58 58 PassRefPtr<HTMLKeygenElement> HTMLKeygenElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 59 59 { 60 return new HTMLKeygenElement(tagName, document, form);60 return adoptRef(new HTMLKeygenElement(tagName, document, form)); 61 61 } 62 62 -
trunk/WebCore/html/HTMLLIElement.cpp
r60418 r61293 43 43 PassRefPtr<HTMLLIElement> HTMLLIElement::create(Document* document) 44 44 { 45 return new HTMLLIElement(liTag, document);45 return adoptRef(new HTMLLIElement(liTag, document)); 46 46 } 47 47 48 48 PassRefPtr<HTMLLIElement> HTMLLIElement::create(const QualifiedName& tagName, Document* document) 49 49 { 50 return new HTMLLIElement(tagName, document);50 return adoptRef(new HTMLLIElement(tagName, document)); 51 51 } 52 52 -
trunk/WebCore/html/HTMLLabelElement.cpp
r60418 r61293 57 57 PassRefPtr<HTMLLabelElement> HTMLLabelElement::create(const QualifiedName& tagName, Document* document) 58 58 { 59 return new HTMLLabelElement(tagName, document);59 return adoptRef(new HTMLLabelElement(tagName, document)); 60 60 } 61 61 -
trunk/WebCore/html/HTMLLegendElement.cpp
r60418 r61293 41 41 PassRefPtr<HTMLLegendElement> HTMLLegendElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 42 42 { 43 return new HTMLLegendElement(tagName, document, form);43 return adoptRef(new HTMLLegendElement(tagName, document, form)); 44 44 } 45 45 -
trunk/WebCore/html/HTMLLinkElement.cpp
r60418 r61293 58 58 PassRefPtr<HTMLLinkElement> HTMLLinkElement::create(const QualifiedName& tagName, Document* document, bool createdByParser) 59 59 { 60 return new HTMLLinkElement(tagName, document, createdByParser);60 return adoptRef(new HTMLLinkElement(tagName, document, createdByParser)); 61 61 } 62 62 -
trunk/WebCore/html/HTMLMapElement.cpp
r61094 r61293 47 47 PassRefPtr<HTMLMapElement> HTMLMapElement::create(Document* document) 48 48 { 49 return new HTMLMapElement(mapTag, document);49 return adoptRef(new HTMLMapElement(mapTag, document)); 50 50 } 51 51 52 52 PassRefPtr<HTMLMapElement> HTMLMapElement::create(const QualifiedName& tagName, Document* document) 53 53 { 54 return new HTMLMapElement(tagName, document);54 return adoptRef(new HTMLMapElement(tagName, document)); 55 55 } 56 56 -
trunk/WebCore/html/HTMLMarqueeElement.cpp
r60361 r61293 48 48 PassRefPtr<HTMLMarqueeElement> HTMLMarqueeElement::create(const QualifiedName& tagName, Document* document) 49 49 { 50 return new HTMLMarqueeElement(tagName, document);50 return adoptRef(new HTMLMarqueeElement(tagName, document)); 51 51 } 52 52 -
trunk/WebCore/html/HTMLMenuElement.cpp
r60361 r61293 38 38 PassRefPtr<HTMLMenuElement> HTMLMenuElement::create(const QualifiedName& tagName, Document* document) 39 39 { 40 return new HTMLMenuElement(tagName, document);40 return adoptRef(new HTMLMenuElement(tagName, document)); 41 41 } 42 42 -
trunk/WebCore/html/HTMLMetaElement.cpp
r60361 r61293 40 40 PassRefPtr<HTMLMetaElement> HTMLMetaElement::create(const QualifiedName& tagName, Document* document) 41 41 { 42 return new HTMLMetaElement(tagName, document);42 return adoptRef(new HTMLMetaElement(tagName, document)); 43 43 } 44 44 -
trunk/WebCore/html/HTMLMeterElement.cpp
r61107 r61293 37 37 using namespace HTMLNames; 38 38 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. 39 41 HTMLMeterElement::HTMLMeterElement(const QualifiedName& tagName, Document* document) 40 : HTMLFormControlElement(tagName, document, 0 , CreateHTMLElement)42 : HTMLFormControlElement(tagName, document, 0) 41 43 { 42 44 ASSERT(hasTagName(meterTag)); -
trunk/WebCore/html/HTMLModElement.cpp
r60342 r61293 37 37 PassRefPtr<HTMLModElement> HTMLModElement::create(const QualifiedName& tagName, Document* document) 38 38 { 39 return new HTMLModElement(tagName, document);39 return adoptRef(new HTMLModElement(tagName, document)); 40 40 } 41 41 -
trunk/WebCore/html/HTMLNoScriptElement.cpp
r60361 r61293 40 40 PassRefPtr<HTMLNoScriptElement> HTMLNoScriptElement::create(const QualifiedName& tagName, Document* document) 41 41 { 42 return new HTMLNoScriptElement(tagName, document);42 return adoptRef(new HTMLNoScriptElement(tagName, document)); 43 43 } 44 44 -
trunk/WebCore/html/HTMLOListElement.cpp
r60361 r61293 43 43 PassRefPtr<HTMLOListElement> HTMLOListElement::create(Document* document) 44 44 { 45 return new HTMLOListElement(olTag, document);45 return adoptRef(new HTMLOListElement(olTag, document)); 46 46 } 47 47 48 48 PassRefPtr<HTMLOListElement> HTMLOListElement::create(const QualifiedName& tagName, Document* document) 49 49 { 50 return new HTMLOListElement(tagName, document);50 return adoptRef(new HTMLOListElement(tagName, document)); 51 51 } 52 52 -
trunk/WebCore/html/HTMLOptGroupElement.cpp
r60361 r61293 46 46 PassRefPtr<HTMLOptGroupElement> HTMLOptGroupElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 47 47 { 48 return new HTMLOptGroupElement(tagName, document, form);48 return adoptRef(new HTMLOptGroupElement(tagName, document, form)); 49 49 } 50 50 -
trunk/WebCore/html/HTMLOptionElement.cpp
r60361 r61293 51 51 PassRefPtr<HTMLOptionElement> HTMLOptionElement::create(Document* document, HTMLFormElement* form) 52 52 { 53 return new HTMLOptionElement(optionTag, document, form);53 return adoptRef(new HTMLOptionElement(optionTag, document, form)); 54 54 } 55 55 56 56 PassRefPtr<HTMLOptionElement> HTMLOptionElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 57 57 { 58 return new HTMLOptionElement(tagName, document, form);58 return adoptRef(new HTMLOptionElement(tagName, document, form)); 59 59 } 60 60 … … 62 62 bool defaultSelected, bool selected, ExceptionCode& ec) 63 63 { 64 RefPtr<HTMLOptionElement> element = new HTMLOptionElement(optionTag, document);64 RefPtr<HTMLOptionElement> element = adoptRef(new HTMLOptionElement(optionTag, document)); 65 65 66 66 RefPtr<Text> text = Text::create(document, data.isNull() ? "" : data); -
trunk/WebCore/html/HTMLParagraphElement.cpp
r60361 r61293 42 42 PassRefPtr<HTMLParagraphElement> HTMLParagraphElement::create(const QualifiedName& tagName, Document* document) 43 43 { 44 return new HTMLParagraphElement(tagName, document);44 return adoptRef(new HTMLParagraphElement(tagName, document)); 45 45 } 46 46 -
trunk/WebCore/html/HTMLParamElement.cpp
r61094 r61293 40 40 PassRefPtr<HTMLParamElement> HTMLParamElement::create(const QualifiedName& tagName, Document* document) 41 41 { 42 return new HTMLParamElement(tagName, document);42 return adoptRef(new HTMLParamElement(tagName, document)); 43 43 } 44 44 -
trunk/WebCore/html/HTMLPreElement.cpp
r60361 r61293 40 40 PassRefPtr<HTMLPreElement> HTMLPreElement::create(const QualifiedName& tagName, Document* document) 41 41 { 42 return new HTMLPreElement(tagName, document);42 return adoptRef(new HTMLPreElement(tagName, document)); 43 43 } 44 44 -
trunk/WebCore/html/HTMLProgressElement.cpp
r61107 r61293 38 38 39 39 HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 40 : HTMLFormControlElement(tagName, document, form , CreateHTMLElement)40 : HTMLFormControlElement(tagName, document, form) 41 41 { 42 42 ASSERT(hasTagName(progressTag)); -
trunk/WebCore/html/HTMLQuoteElement.cpp
r60361 r61293 39 39 PassRefPtr<HTMLQuoteElement> HTMLQuoteElement::create(const QualifiedName& tagName, Document* document) 40 40 { 41 return new HTMLQuoteElement(tagName, document);41 return adoptRef(new HTMLQuoteElement(tagName, document)); 42 42 } 43 43 -
trunk/WebCore/html/HTMLScriptElement.cpp
r60361 r61293 46 46 PassRefPtr<HTMLScriptElement> HTMLScriptElement::create(const QualifiedName& tagName, Document* document, bool createdByParser) 47 47 { 48 return new HTMLScriptElement(tagName, document, createdByParser);48 return adoptRef(new HTMLScriptElement(tagName, document, createdByParser)); 49 49 } 50 50 -
trunk/WebCore/html/HTMLSelectElement.cpp
r60361 r61293 56 56 { 57 57 ASSERT(tagName.matches(selectTag)); 58 return new HTMLSelectElement(tagName, document, form);58 return adoptRef(new HTMLSelectElement(tagName, document, form)); 59 59 } 60 60 -
trunk/WebCore/html/HTMLSourceElement.cpp
r60361 r61293 50 50 PassRefPtr<HTMLSourceElement> HTMLSourceElement::create(const QualifiedName& tagName, Document* document) 51 51 { 52 return new HTMLSourceElement(tagName, document);52 return adoptRef(new HTMLSourceElement(tagName, document)); 53 53 } 54 54 -
trunk/WebCore/html/HTMLStyleElement.cpp
r60361 r61293 43 43 PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(const QualifiedName& tagName, Document* document, bool createdByParser) 44 44 { 45 return new HTMLStyleElement(tagName, document, createdByParser);45 return adoptRef(new HTMLStyleElement(tagName, document, createdByParser)); 46 46 } 47 47 -
trunk/WebCore/html/HTMLTableCaptionElement.cpp
r60342 r61293 42 42 PassRefPtr<HTMLTableCaptionElement> HTMLTableCaptionElement::create(const QualifiedName& tagName, Document* document) 43 43 { 44 return new HTMLTableCaptionElement(tagName, document);44 return adoptRef(new HTMLTableCaptionElement(tagName, document)); 45 45 } 46 46 -
trunk/WebCore/html/HTMLTableCellElement.cpp
r60361 r61293 54 54 PassRefPtr<HTMLTableCellElement> HTMLTableCellElement::create(const QualifiedName& tagName, Document* document) 55 55 { 56 return new HTMLTableCellElement(tagName, document);56 return adoptRef(new HTMLTableCellElement(tagName, document)); 57 57 } 58 58 -
trunk/WebCore/html/HTMLTableColElement.cpp
r60342 r61293 45 45 PassRefPtr<HTMLTableColElement> HTMLTableColElement::create(const QualifiedName& tagName, Document* document) 46 46 { 47 return new HTMLTableColElement(tagName, document);47 return adoptRef(new HTMLTableColElement(tagName, document)); 48 48 } 49 49 -
trunk/WebCore/html/HTMLTableElement.cpp
r60361 r61293 56 56 PassRefPtr<HTMLTableElement> HTMLTableElement::create(Document* document) 57 57 { 58 return new HTMLTableElement(tableTag, document);58 return adoptRef(new HTMLTableElement(tableTag, document)); 59 59 } 60 60 61 61 PassRefPtr<HTMLTableElement> HTMLTableElement::create(const QualifiedName& tagName, Document* document) 62 62 { 63 return new HTMLTableElement(tagName, document);63 return adoptRef(new HTMLTableElement(tagName, document)); 64 64 } 65 65 -
trunk/WebCore/html/HTMLTableRowElement.cpp
r60361 r61293 47 47 PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(Document* document) 48 48 { 49 return new HTMLTableRowElement(trTag, document);49 return adoptRef(new HTMLTableRowElement(trTag, document)); 50 50 } 51 51 52 52 PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(const QualifiedName& tagName, Document* document) 53 53 { 54 return new HTMLTableRowElement(tagName, document);54 return adoptRef(new HTMLTableRowElement(tagName, document)); 55 55 } 56 56 -
trunk/WebCore/html/HTMLTableSectionElement.cpp
r60361 r61293 45 45 PassRefPtr<HTMLTableSectionElement> HTMLTableSectionElement::create(const QualifiedName& tagName, Document* document) 46 46 { 47 return new HTMLTableSectionElement(tagName, document);47 return adoptRef(new HTMLTableSectionElement(tagName, document)); 48 48 } 49 49 -
trunk/WebCore/html/HTMLTextAreaElement.cpp
r60361 r61293 80 80 PassRefPtr<HTMLTextAreaElement> HTMLTextAreaElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 81 81 { 82 return new HTMLTextAreaElement(tagName, document, form);82 return adoptRef(new HTMLTextAreaElement(tagName, document, form)); 83 83 } 84 84 -
trunk/WebCore/html/HTMLTitleElement.cpp
r60361 r61293 41 41 PassRefPtr<HTMLTitleElement> HTMLTitleElement::create(const QualifiedName& tagName, Document* document) 42 42 { 43 return new HTMLTitleElement(tagName, document);43 return adoptRef(new HTMLTitleElement(tagName, document)); 44 44 } 45 45 -
trunk/WebCore/html/HTMLUListElement.cpp
r60361 r61293 40 40 PassRefPtr<HTMLUListElement> HTMLUListElement::create(Document* document) 41 41 { 42 return new HTMLUListElement(ulTag, document);42 return adoptRef(new HTMLUListElement(ulTag, document)); 43 43 } 44 44 45 45 PassRefPtr<HTMLUListElement> HTMLUListElement::create(const QualifiedName& tagName, Document* document) 46 46 { 47 return new HTMLUListElement(tagName, document);47 return adoptRef(new HTMLUListElement(tagName, document)); 48 48 } 49 49 -
trunk/WebCore/html/HTMLVideoElement.cpp
r60361 r61293 55 55 PassRefPtr<HTMLVideoElement> HTMLVideoElement::create(const QualifiedName& tagName, Document* document) 56 56 { 57 return new HTMLVideoElement(tagName, document);57 return adoptRef(new HTMLVideoElement(tagName, document)); 58 58 } 59 59 -
trunk/WebCore/loader/ImageDocument.cpp
r61286 r61293 112 112 inline PassRefPtr<ImageDocumentElement> ImageDocumentElement::create(ImageDocument* document) 113 113 { 114 return new ImageDocumentElement(document);114 return adoptRef(new ImageDocumentElement(document)); 115 115 } 116 116 -
trunk/WebCore/mathml/MathMLElement.cpp
r58914 r61293 1 1 /* 2 2 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 38 39 39 40 MathMLElement::MathMLElement(const QualifiedName& tagName, Document* document) 40 : StyledElement(tagName, document , CreateStyledElementZeroRefCount)41 : StyledElement(tagName, document) 41 42 { 42 43 } … … 44 45 PassRefPtr<MathMLElement> MathMLElement::create(const QualifiedName& tagName, Document* document) 45 46 { 46 return new MathMLElement(tagName, document);47 return adoptRef(new MathMLElement(tagName, document)); 47 48 } 48 49 RenderObject* MathMLElement::createRenderer(RenderArena*, RenderStyle* style)50 {51 return RenderObject::createObject(this, style);52 }53 54 49 55 50 } -
trunk/WebCore/mathml/MathMLElement.h
r52721 r61293 1 1 /* 2 2 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 31 32 32 33 namespace WebCore { 33 34 34 35 class MathMLElement : public StyledElement { 35 36 public: 36 37 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 42 39 protected: 43 40 MathMLElement(const QualifiedName& tagName, Document*); 44 41 42 private: 43 virtual bool isMathMLElement() const { return true; } 45 44 }; 46 45 -
trunk/WebCore/mathml/MathMLInlineContainerElement.cpp
r58349 r61293 1 1 /* 2 2 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 33 34 #include "RenderMathMLBlock.h" 34 35 #include "RenderMathMLFraction.h" 35 #include "RenderMathMLMath.h"36 36 #include "RenderMathMLRoot.h" 37 37 #include "RenderMathMLRow.h" … … 51 51 PassRefPtr<MathMLInlineContainerElement> MathMLInlineContainerElement::create(const QualifiedName& tagName, Document* document) 52 52 { 53 return new MathMLInlineContainerElement(tagName, document);53 return adoptRef(new MathMLInlineContainerElement(tagName, document)); 54 54 } 55 55 56 RenderObject* MathMLInlineContainerElement::createRenderer(RenderArena *arena, RenderStyle* style)56 RenderObject* MathMLInlineContainerElement::createRenderer(RenderArena* arena, RenderStyle* style) 57 57 { 58 RenderObject* object = 0;58 RenderObject* object; 59 59 if (hasLocalName(MathMLNames::mrowTag)) 60 60 object = new (arena) RenderMathMLRow(this); 61 else if (hasLocalName(MathMLNames::mathTag))62 object = new (arena) RenderMathMLMath(this);63 61 else if (hasLocalName(MathMLNames::msubTag)) 64 62 object = new (arena) RenderMathMLSubSup(this); … … 84 82 return object; 85 83 } 86 87 84 88 85 } 89 86 90 87 #endif // ENABLE(MATHML) 91 -
trunk/WebCore/mathml/MathMLInlineContainerElement.h
r52721 r61293 1 1 /* 2 2 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 36 37 static PassRefPtr<MathMLInlineContainerElement> create(const QualifiedName& tagName, Document*); 37 38 38 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);39 40 39 protected: 41 40 MathMLInlineContainerElement(const QualifiedName& tagName, Document*); 42 41 42 private: 43 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 43 44 }; 44 45 -
trunk/WebCore/mathml/MathMLMathElement.cpp
r52721 r61293 1 1 /* 2 2 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 30 31 #include "MathMLMathElement.h" 31 32 32 #include "MathMLNames.h" 33 #include "RenderObject.h" 33 #include "RenderMathMLMath.h" 34 34 35 35 namespace WebCore { 36 37 using namespace MathMLNames;38 36 39 MathMLMathElement::MathMLMathElement(const QualifiedName& tagName, Document* document)37 inline MathMLMathElement::MathMLMathElement(const QualifiedName& tagName, Document* document) 40 38 : MathMLInlineContainerElement(tagName, document) 41 39 { … … 44 42 PassRefPtr<MathMLMathElement> MathMLMathElement::create(const QualifiedName& tagName, Document* document) 45 43 { 46 return new MathMLMathElement(tagName, document); 44 return adoptRef(new MathMLMathElement(tagName, document)); 45 } 46 47 RenderObject* MathMLMathElement::createRenderer(RenderArena* arena, RenderStyle* style) 48 { 49 RenderMathMLMath* renderer = new (arena) RenderMathMLMath(this); 50 renderer->setStyle(style); 51 return renderer; 47 52 } 48 53 -
trunk/WebCore/mathml/MathMLMathElement.h
r52721 r61293 1 1 /* 2 2 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 31 32 32 33 namespace WebCore { 33 34 34 35 class MathMLMathElement : public MathMLInlineContainerElement { 35 36 public: 36 37 static PassRefPtr<MathMLMathElement> create(const QualifiedName& tagName, Document*); 37 38 pr otected:38 39 private: 39 40 MathMLMathElement(const QualifiedName& tagName, Document*); 40 41 42 virtual createRenderer(RenderArena*, RenderStyle*); 41 43 }; 42 44 -
trunk/WebCore/mathml/MathMLTextElement.cpp
r55607 r61293 1 1 /* 2 2 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 37 38 using namespace MathMLNames; 38 39 39 MathMLTextElement::MathMLTextElement(const QualifiedName& tagName, Document* document)40 inline MathMLTextElement::MathMLTextElement(const QualifiedName& tagName, Document* document) 40 41 : MathMLElement(tagName, document) 41 42 { … … 44 45 PassRefPtr<MathMLTextElement> MathMLTextElement::create(const QualifiedName& tagName, Document* document) 45 46 { 46 return new MathMLTextElement(tagName, document);47 return adoptRef(new MathMLTextElement(tagName, document)); 47 48 } 48 49 … … 55 56 } 56 57 57 return RenderObject::createObject(this, style);58 return MathMLElement::createRenderer(arena, style); 58 59 } 59 60 60 61 61 } 62 62 63 63 #endif // ENABLE(MATHML) 64 -
trunk/WebCore/mathml/MathMLTextElement.h
r53764 r61293 1 1 /* 2 2 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 36 37 static PassRefPtr<MathMLTextElement> create(const QualifiedName& tagName, Document*); 37 38 39 private: 40 MathMLTextElement(const QualifiedName& tagName, Document*); 41 38 42 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 39 40 protected:41 MathMLTextElement(const QualifiedName& tagName, Document*);42 43 43 }; 44 44 -
trunk/WebCore/rendering/MediaControlElements.cpp
r60418 r61293 71 71 PassRefPtr<MediaControlShadowRootElement> MediaControlShadowRootElement::create(HTMLMediaElement* mediaElement) 72 72 { 73 RefPtr<MediaControlShadowRootElement> element = new MediaControlShadowRootElement(mediaElement);73 RefPtr<MediaControlShadowRootElement> element = adoptRef(new MediaControlShadowRootElement(mediaElement)); 74 74 75 75 RefPtr<RenderStyle> rootStyle = RenderStyle::create(); … … 131 131 PassRefPtr<MediaControlElement> MediaControlElement::create(HTMLMediaElement* mediaElement, PseudoId pseudoStyleId) 132 132 { 133 return new MediaControlElement(mediaElement, pseudoStyleId);133 return adoptRef(new MediaControlElement(mediaElement, pseudoStyleId)); 134 134 } 135 135 … … 223 223 PassRefPtr<MediaControlTimelineContainerElement> MediaControlTimelineContainerElement::create(HTMLMediaElement* mediaElement) 224 224 { 225 return new MediaControlTimelineContainerElement(mediaElement);225 return adoptRef(new MediaControlTimelineContainerElement(mediaElement)); 226 226 } 227 227 … … 253 253 PassRefPtr<MediaControlVolumeSliderContainerElement> MediaControlVolumeSliderContainerElement::create(HTMLMediaElement* mediaElement) 254 254 { 255 return new MediaControlVolumeSliderContainerElement(mediaElement);255 return adoptRef(new MediaControlVolumeSliderContainerElement(mediaElement)); 256 256 } 257 257 … … 299 299 PassRefPtr<MediaControlStatusDisplayElement> MediaControlStatusDisplayElement::create(HTMLMediaElement* mediaElement) 300 300 { 301 return new MediaControlStatusDisplayElement(mediaElement);301 return adoptRef(new MediaControlStatusDisplayElement(mediaElement)); 302 302 } 303 303 … … 483 483 PassRefPtr<MediaControlMuteButtonElement> MediaControlMuteButtonElement::create(HTMLMediaElement* mediaElement) 484 484 { 485 return new MediaControlMuteButtonElement(mediaElement);485 return adoptRef(new MediaControlMuteButtonElement(mediaElement)); 486 486 } 487 487 … … 509 509 PassRefPtr<MediaControlPlayButtonElement> MediaControlPlayButtonElement::create(HTMLMediaElement* mediaElement) 510 510 { 511 return new MediaControlPlayButtonElement(mediaElement);511 return adoptRef(new MediaControlPlayButtonElement(mediaElement)); 512 512 } 513 513 … … 538 538 PassRefPtr<MediaControlSeekButtonElement> MediaControlSeekButtonElement::create(HTMLMediaElement* mediaElement, PseudoId pseudoStyleId) 539 539 { 540 return new MediaControlSeekButtonElement(mediaElement, pseudoStyleId);540 return adoptRef(new MediaControlSeekButtonElement(mediaElement, pseudoStyleId)); 541 541 } 542 542 … … 602 602 PassRefPtr<MediaControlRewindButtonElement> MediaControlRewindButtonElement::create(HTMLMediaElement* mediaElement) 603 603 { 604 return new MediaControlRewindButtonElement(mediaElement);604 return adoptRef(new MediaControlRewindButtonElement(mediaElement)); 605 605 } 606 606 … … 624 624 PassRefPtr<MediaControlReturnToRealtimeButtonElement> MediaControlReturnToRealtimeButtonElement::create(HTMLMediaElement* mediaElement) 625 625 { 626 return new MediaControlReturnToRealtimeButtonElement(mediaElement);626 return adoptRef(new MediaControlReturnToRealtimeButtonElement(mediaElement)); 627 627 } 628 628 … … 646 646 PassRefPtr<MediaControlToggleClosedCaptionsButtonElement> MediaControlToggleClosedCaptionsButtonElement::create(HTMLMediaElement* mediaElement) 647 647 { 648 return new MediaControlToggleClosedCaptionsButtonElement(mediaElement);648 return adoptRef(new MediaControlToggleClosedCaptionsButtonElement(mediaElement)); 649 649 } 650 650 … … 673 673 PassRefPtr<MediaControlTimelineElement> MediaControlTimelineElement::create(HTMLMediaElement* mediaElement) 674 674 { 675 return new MediaControlTimelineElement(mediaElement);675 return adoptRef(new MediaControlTimelineElement(mediaElement)); 676 676 } 677 677 … … 726 726 PassRefPtr<MediaControlVolumeSliderElement> MediaControlVolumeSliderElement::create(HTMLMediaElement* mediaElement) 727 727 { 728 return new MediaControlVolumeSliderElement(mediaElement);728 return adoptRef(new MediaControlVolumeSliderElement(mediaElement)); 729 729 } 730 730 … … 768 768 PassRefPtr<MediaControlFullscreenButtonElement> MediaControlFullscreenButtonElement::create(HTMLMediaElement* mediaElement) 769 769 { 770 return new MediaControlFullscreenButtonElement(mediaElement);770 return adoptRef(new MediaControlFullscreenButtonElement(mediaElement)); 771 771 } 772 772 … … 791 791 PassRefPtr<MediaControlTimeDisplayElement> MediaControlTimeDisplayElement::create(HTMLMediaElement* mediaElement, PseudoId pseudoStyleId) 792 792 { 793 return new MediaControlTimeDisplayElement(mediaElement, pseudoStyleId);793 return adoptRef(new MediaControlTimeDisplayElement(mediaElement, pseudoStyleId)); 794 794 } 795 795 -
trunk/WebCore/rendering/RenderFileUploadControl.cpp
r61094 r61293 54 54 RenderFileUploadControl::RenderFileUploadControl(HTMLInputElement* input) 55 55 : RenderBlock(input) 56 , m_button(0)57 56 { 58 57 FileList* list = input->files(); -
trunk/WebCore/rendering/RenderProgress.cpp
r61094 r61293 24 24 25 25 #include "RenderProgress.h" 26 #include "ShadowElement.h" 27 #include "HTMLNames.h" 26 28 27 #include "HTMLProgressElement.h" 29 28 #include "RenderTheme.h" 30 29 #include "RenderView.h" 30 #include "ShadowElement.h" 31 31 #include <wtf/CurrentTime.h> 32 32 #include <wtf/RefPtr.h> -
trunk/WebCore/rendering/RenderSlider.cpp
r61107 r61293 53 53 } 54 54 55 // FIXME: Could share code with the SliderDivElement class in RenderProgress.56 55 class SliderThumbElement : public ShadowBlockElement { 57 56 public: … … 65 64 private: 66 65 SliderThumbElement(Node* shadowParent); 67 66 68 67 FloatPoint m_offsetToThumb; 69 68 bool m_inDragMode; … … 78 77 inline PassRefPtr<SliderThumbElement> SliderThumbElement::create(Node* shadowParent) 79 78 { 80 return new SliderThumbElement(shadowParent);79 return adoptRef(new SliderThumbElement(shadowParent)); 81 80 } 82 81 … … 108 107 109 108 m_inDragMode = true; 110 document()->frame()->eventHandler()->setCapturingMouseEventsNode(shadowParent Node());109 document()->frame()->eventHandler()->setCapturingMouseEventsNode(shadowParent()); 111 110 event->setDefaultHandled(); 112 111 return; -
trunk/WebCore/rendering/ShadowElement.cpp
r60951 r61293 26 26 namespace WebCore { 27 27 28 using namespace HTMLNames; 29 28 30 PassRefPtr<ShadowBlockElement> ShadowBlockElement::create(Node* shadowParent) 29 31 { … … 32 34 33 35 ShadowBlockElement::ShadowBlockElement(Node* shadowParent) 34 : ShadowElement<HTMLDivElement>( HTMLNames::divTag, shadowParent)36 : ShadowElement<HTMLDivElement>(divTag, shadowParent) 35 37 { 36 38 } … … 42 44 43 45 ShadowInputElement::ShadowInputElement(Node* shadowParent) 44 : ShadowElement<HTMLInputElement>( HTMLNames::inputTag, shadowParent)46 : ShadowElement<HTMLInputElement>(inputTag, shadowParent) 45 47 { 46 48 } -
trunk/WebCore/rendering/ShadowElement.h
r60951 r61293 41 41 : BaseElement(name, shadowParent->document()) 42 42 , m_shadowParent(shadowParent) 43 {} 43 { 44 } 44 45 46 Node* shadowParent() const { return m_shadowParent; } 47 48 private: 45 49 virtual bool isShadowNode() const { return true; } 46 50 virtual Node* shadowParentNode() { return m_shadowParent; } 47 51 48 private:49 52 Node* m_shadowParent; 50 53 }; -
trunk/WebCore/rendering/TextControlInnerElements.cpp
r60418 r61293 90 90 PassRefPtr<TextControlInnerElement> TextControlInnerElement::create(Node* shadowParent) 91 91 { 92 return new TextControlInnerElement(shadowParent->document(), shadowParent);92 return adoptRef(new TextControlInnerElement(shadowParent->document(), shadowParent)); 93 93 } 94 94 … … 127 127 PassRefPtr<TextControlInnerTextElement> TextControlInnerTextElement::create(Document* document, Node* shadowParent) 128 128 { 129 return new TextControlInnerTextElement(document, shadowParent);129 return adoptRef(new TextControlInnerTextElement(document, shadowParent)); 130 130 } 131 131 … … 163 163 PassRefPtr<SearchFieldResultsButtonElement> SearchFieldResultsButtonElement::create(Document* document) 164 164 { 165 return new SearchFieldResultsButtonElement(document);165 return adoptRef(new SearchFieldResultsButtonElement(document)); 166 166 } 167 167 … … 195 195 PassRefPtr<SearchFieldCancelButtonElement> SearchFieldCancelButtonElement::create(Document* document) 196 196 { 197 return new SearchFieldCancelButtonElement(document);197 return adoptRef(new SearchFieldCancelButtonElement(document)); 198 198 } 199 199 … … 252 252 PassRefPtr<SpinButtonElement> SpinButtonElement::create(Node* shadowParent) 253 253 { 254 return new SpinButtonElement(shadowParent);254 return adoptRef(new SpinButtonElement(shadowParent)); 255 255 } 256 256 -
trunk/WebCore/storage/IndexedDatabaseImpl.cpp
r60484 r61293 41 41 PassRefPtr<IndexedDatabaseImpl> IndexedDatabaseImpl::create() 42 42 { 43 return new IndexedDatabaseImpl();43 return adoptRef(new IndexedDatabaseImpl); 44 44 } 45 45
Note: See TracChangeset
for help on using the changeset viewer.