WebCore:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Mar 2009 17:15:41 +0000 (17:15 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Mar 2009 17:15:41 +0000 (17:15 +0000)
2009-03-29  Darin Adler  <darin@apple.com>

        Reviewed by Cameron Zwarich.

        Bug 24921: remove include of HTMLFormElement.h from Document.h
        https://bugs.webkit.org/show_bug.cgi?id=24921

        * GNUmakefile.am: Added CheckedRadioButtons source files.
        * WebCore.scons: Ditto.
        * WebCore.vcproj/WebCore.vcproj: Ditto.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * WebCoreSources.bkl: Ditto.

        * bindings/objc/PublicDOMInterfaces.h: Changed type of parentElement to Element.

        * dom/CheckedRadioButtons.cpp: Copied from WebCore/html/HTMLFormElement.cpp.
        Removed all the code except for CheckedRadioButtons, and moved that out to be
        a namespace-level class instead of a member of HTMLFormElement.

        * dom/CheckedRadioButtons.h: Copied from WebCore/html/HTMLFormElement.h.
        Removed all the code except for CheckedRadioButtons, and moved that out to be
        a namespace-level class instead of a member of HTMLFormElement.

        * dom/Document.h: Removed unneeded includes, including HTMLFormElement.h.
        Added include of CheckedRadioButtons.h. Changed uses of CheckedRadioButtons
        class to use a namespace-level class instead of a member of HTMLFormElement.

        * dom/Node.idl: Changed the type of parentElement from Node to Element for
        two reasons. 1) Node was incorrect, since parentElement returns an Element.
        2) The bindings won't compile any more unless they know parentElement's
        return value is an Element due to include changes.

        * html/HTMLFormElement.cpp: Moved definitions of the functions in the
        CheckedRadioButtons class to the new CheckedRadioButtons.cpp.

        * html/HTMLFormElement.h: Moved definition of the CheckedRadioButtons
        class to the new CheckedRadioButtons.h.

        * html/HTMLInputElement.cpp:
        (WebCore::checkedRadioButtons): Changed use of CheckedRadioButtons
        class to use a namespace-level class instead of a member of HTMLFormElement.

        * page/Chrome.cpp:
        (WebCore::Chrome::createWindow): Tweaked formatting.

        * css/CSSGrammar.y: Added newly-needed include.
        * dom/Range.cpp: Ditto.
        * editing/BreakBlockquoteCommand.cpp: Ditto.
        * editing/CompositeEditCommand.cpp: Ditto.
        * editing/InsertLineBreakCommand.cpp: Ditto.
        * editing/ModifySelectionListLevel.cpp: Ditto.
        * editing/RemoveFormatCommand.cpp: Ditto.
        * editing/TextIterator.cpp: Ditto.
        * editing/VisiblePosition.cpp: Ditto.
        * loader/DocLoader.cpp: Ditto.
        * page/AccessibilityRenderObject.cpp: Ditto.
        * page/Page.cpp: Ditto.
        * rendering/RenderBlock.cpp: Ditto.
        * rendering/RenderLayer.cpp: Ditto.
        * rendering/RenderObject.h: Ditto.
        * storage/LocalStorageArea.cpp: Ditto.
        * storage/SessionStorageArea.cpp: Ditto.

WebKit/mac:

2009-03-29  Darin Adler  <darin@apple.com>

        Reviewed by Cameron Zwarich.

        * Plugins/WebNullPluginView.mm: Added now-needed includes.
        * WebView/WebHTMLRepresentation.mm: Ditto.
        * WebView/WebHTMLView.mm: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@42084 268f45cc-cd09-0410-ab3c-d52691b4dbfc

36 files changed:
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.scons
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/WebCoreSources.bkl
WebCore/bindings/objc/PublicDOMInterfaces.h
WebCore/css/CSSGrammar.y
WebCore/dom/CheckedRadioButtons.cpp [new file with mode: 0644]
WebCore/dom/CheckedRadioButtons.h [new file with mode: 0644]
WebCore/dom/Document.h
WebCore/dom/Node.idl
WebCore/dom/Range.cpp
WebCore/editing/BreakBlockquoteCommand.cpp
WebCore/editing/CompositeEditCommand.cpp
WebCore/editing/InsertLineBreakCommand.cpp
WebCore/editing/ModifySelectionListLevel.cpp
WebCore/editing/RemoveFormatCommand.cpp
WebCore/editing/TextIterator.cpp
WebCore/editing/VisiblePosition.cpp
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLFormElement.h
WebCore/html/HTMLInputElement.cpp
WebCore/loader/DocLoader.cpp
WebCore/page/AccessibilityRenderObject.cpp
WebCore/page/Chrome.cpp
WebCore/page/Page.cpp
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderLayer.cpp
WebCore/rendering/RenderObject.h
WebCore/storage/LocalStorageArea.cpp
WebCore/storage/SessionStorageArea.cpp
WebKit/mac/ChangeLog
WebKit/mac/Plugins/WebNullPluginView.mm
WebKit/mac/WebView/WebHTMLRepresentation.mm
WebKit/mac/WebView/WebHTMLView.mm

index 0c9d4bc..d92be32 100644 (file)
@@ -1,5 +1,68 @@
 2009-03-29  Darin Adler  <darin@apple.com>
 
+        Reviewed by Cameron Zwarich.
+
+        Bug 24921: remove include of HTMLFormElement.h from Document.h
+        https://bugs.webkit.org/show_bug.cgi?id=24921
+
+        * GNUmakefile.am: Added CheckedRadioButtons source files.
+        * WebCore.scons: Ditto.
+        * WebCore.vcproj/WebCore.vcproj: Ditto.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+        * WebCoreSources.bkl: Ditto.
+
+        * bindings/objc/PublicDOMInterfaces.h: Changed type of parentElement to Element.
+
+        * dom/CheckedRadioButtons.cpp: Copied from WebCore/html/HTMLFormElement.cpp.
+        Removed all the code except for CheckedRadioButtons, and moved that out to be
+        a namespace-level class instead of a member of HTMLFormElement.
+
+        * dom/CheckedRadioButtons.h: Copied from WebCore/html/HTMLFormElement.h.
+        Removed all the code except for CheckedRadioButtons, and moved that out to be
+        a namespace-level class instead of a member of HTMLFormElement.
+
+        * dom/Document.h: Removed unneeded includes, including HTMLFormElement.h.
+        Added include of CheckedRadioButtons.h. Changed uses of CheckedRadioButtons
+        class to use a namespace-level class instead of a member of HTMLFormElement.
+
+        * dom/Node.idl: Changed the type of parentElement from Node to Element for
+        two reasons. 1) Node was incorrect, since parentElement returns an Element.
+        2) The bindings won't compile any more unless they know parentElement's
+        return value is an Element due to include changes.
+
+        * html/HTMLFormElement.cpp: Moved definitions of the functions in the
+        CheckedRadioButtons class to the new CheckedRadioButtons.cpp.
+
+        * html/HTMLFormElement.h: Moved definition of the CheckedRadioButtons
+        class to the new CheckedRadioButtons.h.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::checkedRadioButtons): Changed use of CheckedRadioButtons
+        class to use a namespace-level class instead of a member of HTMLFormElement.
+
+        * page/Chrome.cpp:
+        (WebCore::Chrome::createWindow): Tweaked formatting.
+
+        * css/CSSGrammar.y: Added newly-needed include.
+        * dom/Range.cpp: Ditto.
+        * editing/BreakBlockquoteCommand.cpp: Ditto.
+        * editing/CompositeEditCommand.cpp: Ditto.
+        * editing/InsertLineBreakCommand.cpp: Ditto.
+        * editing/ModifySelectionListLevel.cpp: Ditto.
+        * editing/RemoveFormatCommand.cpp: Ditto.
+        * editing/TextIterator.cpp: Ditto.
+        * editing/VisiblePosition.cpp: Ditto.
+        * loader/DocLoader.cpp: Ditto.
+        * page/AccessibilityRenderObject.cpp: Ditto.
+        * page/Page.cpp: Ditto.
+        * rendering/RenderBlock.cpp: Ditto.
+        * rendering/RenderLayer.cpp: Ditto.
+        * rendering/RenderObject.h: Ditto.
+        * storage/LocalStorageArea.cpp: Ditto.
+        * storage/SessionStorageArea.cpp: Ditto.
+
+2009-03-29  Darin Adler  <darin@apple.com>
+
         Reviewed by Dan Bernstein.
 
         <rdar://problem/6015407> attr parsing should allow only identifiers
index 2a25e6a..f858f22 100644 (file)
@@ -560,6 +560,8 @@ webcore_sources += \
        WebCore/dom/CSSMappedAttributeDeclaration.h \
        WebCore/dom/CharacterData.cpp \
        WebCore/dom/CharacterData.h \
+       WebCore/dom/CheckedRadioButtons.cpp \
+       WebCore/dom/CheckedRadioButtons.h \
        WebCore/dom/ChildNodeList.cpp \
        WebCore/dom/ChildNodeList.h \
        WebCore/dom/ClassNames.cpp \
index 914cd57..0908020 100644 (file)
@@ -71,6 +71,7 @@ sources['dom'] = [
     'dom/BeforeUnloadEvent.cpp',
     'dom/CDATASection.cpp',
     'dom/CharacterData.cpp',
+    'dom/CheckedRadioButtons.cpp',
     'dom/ChildNodeList.cpp',
     'dom/ClassNames.cpp',
     'dom/ClassNodeList.cpp',
index 45aa72e..4ec4115 100644 (file)
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\dom\CheckedRadioButtons.cpp"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Release_PGO|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               WholeProgramOptimization="true"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\dom\CheckedRadioButtons.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\dom\ChildNodeList.cpp"\r
                                >\r
                                <FileConfiguration\r
index cb87b1b..43661d9 100644 (file)
                93F19B1508245E59001E9ABC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C2869502846DCD018635CA /* Cocoa.framework */; };
                93F19B1608245E59001E9ABC /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8216299029F4FB501000131 /* JavaScriptCore.framework */; };
                93F19B1708245E59001E9ABC /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 93F1D31A0558CC5C00821BC0 /* libicucore.dylib */; };
+               93F925430F7EF5B8007E37C9 /* CheckedRadioButtons.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F925410F7EF5B8007E37C9 /* CheckedRadioButtons.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               93F925440F7EF5B8007E37C9 /* CheckedRadioButtons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F925420F7EF5B8007E37C9 /* CheckedRadioButtons.cpp */; };
                93F9B6560BA0F35E00854064 /* DOMHTMLCanvasElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 93F9B6530BA0F35E00854064 /* DOMHTMLCanvasElement.h */; settings = {ATTRIBUTES = (); }; };
                93F9B6570BA0F35E00854064 /* DOMHTMLCanvasElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93F9B6540BA0F35E00854064 /* DOMHTMLCanvasElement.mm */; };
                93F9B6580BA0F35E00854064 /* DOMHTMLCanvasElementInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F9B6550BA0F35E00854064 /* DOMHTMLCanvasElementInternal.h */; };
                93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = CodeGeneratorJS.pm; path = ../scripts/CodeGeneratorJS.pm; sourceTree = "<group>"; };
                93F8B3070A300FEA00F61AB8 /* generate-bindings.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = "generate-bindings.pl"; path = "scripts/generate-bindings.pl"; sourceTree = "<group>"; };
                93F8B3080A300FEA00F61AB8 /* IDLStructure.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = IDLStructure.pm; path = scripts/IDLStructure.pm; sourceTree = "<group>"; };
+               93F925410F7EF5B8007E37C9 /* CheckedRadioButtons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckedRadioButtons.h; sourceTree = "<group>"; };
+               93F925420F7EF5B8007E37C9 /* CheckedRadioButtons.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CheckedRadioButtons.cpp; sourceTree = "<group>"; };
                93F9B6530BA0F35E00854064 /* DOMHTMLCanvasElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLCanvasElement.h; sourceTree = "<group>"; };
                93F9B6540BA0F35E00854064 /* DOMHTMLCanvasElement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLCanvasElement.mm; sourceTree = "<group>"; };
                93F9B6550BA0F35E00854064 /* DOMHTMLCanvasElementInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLCanvasElementInternal.h; sourceTree = "<group>"; };
                                6550B695099DF0270090D781 /* CharacterData.cpp */,
                                6550B696099DF0270090D781 /* CharacterData.h */,
                                93EEC1E609C2877700C515D1 /* CharacterData.idl */,
+                               93F925410F7EF5B8007E37C9 /* CheckedRadioButtons.h */,
+                               93F925420F7EF5B8007E37C9 /* CheckedRadioButtons.cpp */,
                                A818721A0977D3C0005826D9 /* ChildNodeList.cpp */,
                                A81872150977D3C0005826D9 /* ChildNodeList.h */,
                                BC4BF9E20D11E133007D247F /* ClassNames.cpp */,
                                FE6FD48E0F676E9300092873 /* JSCoordinates.h in Headers */,
                                1C63A2480F71646600C09D5A /* RunLoopTimer.h in Headers */,
                                935F45430F7C3B5F00D7C1FB /* JSLazyEventListener.h in Headers */,
+                               93F925430F7EF5B8007E37C9 /* CheckedRadioButtons.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                FE6FD48D0F676E9300092873 /* JSCoordinates.cpp in Sources */,
                                1C63A2490F71646600C09D5A /* RunLoopTimerCF.cpp in Sources */,
                                935F45420F7C3B5F00D7C1FB /* JSLazyEventListener.cpp in Sources */,
+                               93F925440F7EF5B8007E37C9 /* CheckedRadioButtons.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index dfc3094..6acae27 100644 (file)
@@ -401,6 +401,7 @@ This file contains the list of files needed to build WebCore.
         dom/CDATASection.cpp
         dom/CSSMappedAttributeDeclaration.cpp
         dom/CharacterData.cpp
+        dom/CheckedRadioButtons.cpp
         dom/ChildNodeList.cpp
         dom/ClassNames.cpp
         dom/ClassNodeList.cpp
index 26d0628..9221037 100644 (file)
 @property(readonly, copy) NSString *localName;
 @property(copy) NSString *textContent AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
 @property(readonly, copy) NSString *baseURI AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
-@property(readonly, retain) DOMNode *parentElement AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+@property(readonly, retain) DOMElement *parentElement AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
 @property(readonly) BOOL isContentEditable AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
 - (DOMNode *)insertBefore:(DOMNode *)newChild :(DOMNode *)refChild;
 - (DOMNode *)insertBefore:(DOMNode *)newChild refChild:(DOMNode *)refChild AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
index 3411b2f..7c3cb77 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "CSSMediaRule.h"
 #include "CSSParser.h"
+#include "CSSPrimitiveValue.h"
 #include "CSSPropertyNames.h"
 #include "CSSRuleList.h"
 #include "CSSSelector.h"
diff --git a/WebCore/dom/CheckedRadioButtons.cpp b/WebCore/dom/CheckedRadioButtons.cpp
new file mode 100644 (file)
index 0000000..9883f58
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "CheckedRadioButtons.h"
+
+#include "HTMLInputElement.h"
+
+namespace WebCore {
+
+void CheckedRadioButtons::addButton(HTMLFormControlElement* element)
+{
+    // We only want to add radio buttons.
+    if (!element->isRadioButton())
+        return;
+
+    // Without a name, there is no group.
+    if (element->name().isEmpty())
+        return;
+
+    HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(element);
+
+    // We only track checked buttons.
+    if (!inputElement->checked())
+        return;
+
+    if (!m_nameToCheckedRadioButtonMap)
+        m_nameToCheckedRadioButtonMap.set(new NameToInputMap);
+
+    pair<NameToInputMap::iterator, bool> result = m_nameToCheckedRadioButtonMap->add(element->name().impl(), inputElement);
+    if (result.second)
+        return;
+    
+    HTMLInputElement* oldCheckedButton = result.first->second;
+    if (oldCheckedButton == inputElement)
+        return;
+
+    result.first->second = inputElement;
+    oldCheckedButton->setChecked(false);
+}
+
+HTMLInputElement* CheckedRadioButtons::checkedButtonForGroup(const AtomicString& name) const
+{
+    if (!m_nameToCheckedRadioButtonMap)
+        return 0;
+    
+    return m_nameToCheckedRadioButtonMap->get(name.impl());
+}
+
+void CheckedRadioButtons::removeButton(HTMLFormControlElement* element)
+{
+    if (element->name().isEmpty() || !m_nameToCheckedRadioButtonMap)
+        return;
+    
+    NameToInputMap::iterator it = m_nameToCheckedRadioButtonMap->find(element->name().impl());
+    if (it == m_nameToCheckedRadioButtonMap->end() || it->second != element)
+        return;
+    
+    InputElement* inputElement = toInputElement(element);
+    ASSERT_UNUSED(inputElement, inputElement);
+    ASSERT(inputElement->isChecked());
+    ASSERT(element->isRadioButton());
+
+    m_nameToCheckedRadioButtonMap->remove(it);
+    if (m_nameToCheckedRadioButtonMap->isEmpty())
+        m_nameToCheckedRadioButtonMap.clear();
+}
+
+} // namespace
diff --git a/WebCore/dom/CheckedRadioButtons.h b/WebCore/dom/CheckedRadioButtons.h
new file mode 100644 (file)
index 0000000..5a57955
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef CheckedRadioButtons_h
+#define CheckedRadioButtons_h
+
+#include <wtf/HashMap.h>
+#include <wtf/OwnPtr.h>
+
+namespace WebCore {
+
+class AtomicString;
+class AtomicStringImpl;
+class HTMLInputElement;
+class HTMLFormControlElement;
+
+class CheckedRadioButtons {
+public:
+    void addButton(HTMLFormControlElement*);
+    void removeButton(HTMLFormControlElement*);
+    HTMLInputElement* checkedButtonForGroup(const AtomicString& groupName) const;
+
+private:
+    typedef HashMap<AtomicStringImpl*, HTMLInputElement*> NameToInputMap;
+    OwnPtr<NameToInputMap> m_nameToCheckedRadioButtonMap;
+};
+
+} // namespace WebCore
+
+#endif // CheckedRadioButtons_h
index eb00795..353752d 100644 (file)
 #define Document_h
 
 #include "Attr.h"
+#include "CheckedRadioButtons.h"
 #include "Color.h"
 #include "DocumentMarker.h"
 #include "HTMLCollection.h"
-#include "HTMLFormElement.h"
 #include "ScriptExecutionContext.h"
-#include "StringHash.h"
 #include "Timer.h"
-#include <wtf/HashCountedSet.h>
-#include <wtf/ListHashSet.h>
 
 // FIXME: We should move Mac off of the old Frame-based user stylesheet loading
 // code and onto the new code in Page. We can't do that until the code in Page
@@ -49,8 +46,6 @@
 namespace WebCore {
 
     class AXObjectCache;
-    class Attr;
-    class Attribute;
     class CDATASection;
     class CachedCSSStyleSheet;
     class CanvasRenderingContext2D;
@@ -988,7 +983,7 @@ public:
     void registerDisconnectedNodeWithEventListeners(Node*);
     void unregisterDisconnectedNodeWithEventListeners(Node*);
     
-    HTMLFormElement::CheckedRadioButtons& checkedRadioButtons() { return m_checkedRadioButtons; }
+    CheckedRadioButtons& checkedRadioButtons() { return m_checkedRadioButtons; }
     
 #if ENABLE(SVG)
     const SVGDocumentExtensions* svgExtensions();
@@ -1048,7 +1043,7 @@ private:
     
     int m_selfOnlyRefCount;
 
-    HTMLFormElement::CheckedRadioButtons m_checkedRadioButtons;
+    CheckedRadioButtons m_checkedRadioButtons;
 
     typedef HashMap<AtomicStringImpl*, HTMLCollection::CollectionInfo*> NamedCollectionMap;
     HTMLCollection::CollectionInfo m_collectionInfo[HTMLCollection::NumUnnamedDocumentCachedTypes];
index 328f8ec..c778236 100644 (file)
@@ -125,8 +125,8 @@ module core {
         DOMUserData        getUserData(in DOMString key);
 #endif /* 0 */
 
-        // IE extentions
-        readonly attribute Node             parentElement;
+        // IE extensions
+        readonly attribute Element          parentElement;
 
 #if defined(LANGUAGE_OBJECTIVE_C)
         // Objective-C extensions
index 34b1d21..9412241 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "CString.h"
 #include "DocumentFragment.h"
+#include "HTMLElement.h"
 #include "NodeWithIndex.h"
 #include "ProcessingInstruction.h"
 #include "Text.h"
index 2a513a5..363b2f0 100644 (file)
 #include "config.h"
 #include "BreakBlockquoteCommand.h"
 
-#include "Element.h"
+#include "HTMLElement.h"
 #include "HTMLNames.h"
+#include "RenderListItem.h"
 #include "Text.h"
 #include "VisiblePosition.h"
 #include "htmlediting.h"
-#include "RenderListItem.h"
 
 namespace WebCore {
 
index 9052582..b24d0a5 100644 (file)
@@ -36,7 +36,7 @@
 #include "Document.h"
 #include "DocumentFragment.h"
 #include "EditorInsertAction.h"
-#include "Element.h"
+#include "HTMLElement.h"
 #include "HTMLNames.h"
 #include "InlineTextBox.h"
 #include "InsertIntoTextNodeCommand.h"
index a5c588d..05944b1 100644 (file)
@@ -28,8 +28,8 @@
 
 #include "CSSMutableStyleDeclaration.h"
 #include "Document.h"
-#include "Element.h"
 #include "Frame.h"
+#include "HTMLElement.h"
 #include "HTMLNames.h"
 #include "Range.h"
 #include "RenderObject.h"
index 5ea658c..9a7e105 100644 (file)
@@ -27,8 +27,8 @@
 #include "ModifySelectionListLevel.h"
 
 #include "Document.h"
-#include "Element.h"
 #include "Frame.h"
+#include "HTMLElement.h"
 #include "RenderObject.h"
 #include "SelectionController.h"
 #include "htmlediting.h"
index 609ab0e..6d681ee 100644 (file)
@@ -27,6 +27,7 @@
 #include "RemoveFormatCommand.h"
 
 #include "CSSComputedStyleDeclaration.h"
+#include "CSSMutableStyleDeclaration.h"
 #include "Editor.h"
 #include "Frame.h"
 #include "HTMLNames.h"
index 2d7e641..55e23a8 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "CharacterNames.h"
 #include "Document.h"
-#include "Element.h"
+#include "HTMLElement.h"
 #include "HTMLNames.h"
 #include "htmlediting.h"
 #include "InlineTextBox.h"
index 27ee146..fd5bc67 100644 (file)
@@ -28,8 +28,8 @@
 
 #include "CString.h"
 #include "Document.h"
-#include "Element.h"
 #include "FloatQuad.h"
+#include "HTMLElement.h"
 #include "HTMLNames.h"
 #include "InlineTextBox.h"
 #include "Logging.h"
index 824a107..66c8e8b 100644 (file)
@@ -608,62 +608,4 @@ void HTMLFormElement::didMoveToNewOwnerDocument()
         document()->registerForDocumentActivationCallbacks(this);
 }
 
-void HTMLFormElement::CheckedRadioButtons::addButton(HTMLFormControlElement* element)
-{
-    // We only want to add radio buttons.
-    if (!element->isRadioButton())
-        return;
-
-    // Without a name, there is no group.
-    if (element->name().isEmpty())
-        return;
-
-    HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(element);
-
-    // We only track checked buttons.
-    if (!inputElement->checked())
-        return;
-
-    if (!m_nameToCheckedRadioButtonMap)
-        m_nameToCheckedRadioButtonMap.set(new NameToInputMap);
-
-    pair<NameToInputMap::iterator, bool> result = m_nameToCheckedRadioButtonMap->add(element->name().impl(), inputElement);
-    if (result.second)
-        return;
-    
-    HTMLInputElement* oldCheckedButton = result.first->second;
-    if (oldCheckedButton == inputElement)
-        return;
-
-    result.first->second = inputElement;
-    oldCheckedButton->setChecked(false);
-}
-
-HTMLInputElement* HTMLFormElement::CheckedRadioButtons::checkedButtonForGroup(const AtomicString& name) const
-{
-    if (!m_nameToCheckedRadioButtonMap)
-        return 0;
-    
-    return m_nameToCheckedRadioButtonMap->get(name.impl());
-}
-
-void HTMLFormElement::CheckedRadioButtons::removeButton(HTMLFormControlElement* element)
-{
-    if (element->name().isEmpty() || !m_nameToCheckedRadioButtonMap)
-        return;
-    
-    NameToInputMap::iterator it = m_nameToCheckedRadioButtonMap->find(element->name().impl());
-    if (it == m_nameToCheckedRadioButtonMap->end() || it->second != element)
-        return;
-    
-    InputElement* inputElement = toInputElement(element);
-    ASSERT_UNUSED(inputElement, inputElement);
-    ASSERT(inputElement->isChecked());
-    ASSERT(element->isRadioButton());
-
-    m_nameToCheckedRadioButtonMap->remove(it);
-    if (m_nameToCheckedRadioButtonMap->isEmpty())
-        m_nameToCheckedRadioButtonMap.clear();
-}
-
 } // namespace
index 8e5027c..cd0c93d 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
  *           (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -24,6 +24,7 @@
 #ifndef HTMLFormElement_h
 #define HTMLFormElement_h
 
+#include "CheckedRadioButtons.h"
 #include "FormDataBuilder.h"
 #include "HTMLCollection.h" 
 #include "HTMLElement.h"
@@ -109,17 +110,6 @@ public:
     // FIXME: Change this to be private after getting rid of all the clients.
     Vector<HTMLFormControlElement*> formElements;
 
-    class CheckedRadioButtons {
-    public:
-        void addButton(HTMLFormControlElement*);
-        void removeButton(HTMLFormControlElement*);
-        HTMLInputElement* checkedButtonForGroup(const AtomicString& name) const;
-
-    private:
-        typedef HashMap<AtomicStringImpl*, HTMLInputElement*> NameToInputMap;
-        OwnPtr<NameToInputMap> m_nameToCheckedRadioButtonMap;
-    };
-    
     CheckedRadioButtons& checkedRadioButtons() { return m_checkedRadioButtons; }
     
     virtual void documentDidBecomeActive();
index 0373dde..d98be08 100644 (file)
@@ -113,8 +113,7 @@ bool HTMLInputElement::autoComplete() const
     return true;
 }
 
-
-static inline HTMLFormElement::CheckedRadioButtons& checkedRadioButtons(const HTMLInputElement *element)
+static inline CheckedRadioButtons& checkedRadioButtons(const HTMLInputElement *element)
 {
     if (HTMLFormElement* form = element->form())
         return form->checkedRadioButtons();
index 007dffa..82e8d3f 100644 (file)
@@ -37,6 +37,7 @@
 #include "CString.h"
 #include "Document.h"
 #include "DOMWindow.h"
+#include "HTMLElement.h"
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "loader.h"
index 8ed352a..15d774b 100644 (file)
@@ -39,6 +39,7 @@
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "HTMLAreaElement.h"
+#include "HTMLFormElement.h"
 #include "HTMLFrameElementBase.h"
 #include "HTMLImageElement.h"
 #include "HTMLInputElement.h"
index b37ebc4..e5b6f6c 100644 (file)
@@ -152,13 +152,14 @@ void Chrome::takeFocus(FocusDirection direction) const
 Page* Chrome::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features) const
 {
     Page* newPage = m_client->createWindow(frame, request, features);
+
 #if ENABLE(DOM_STORAGE)
-    
     if (newPage) {
         if (SessionStorage* oldSessionStorage = m_page->sessionStorage(false))
-                newPage->setSessionStorage(oldSessionStorage->copy(newPage));
+            newPage->setSessionStorage(oldSessionStorage->copy(newPage));
     }
 #endif
+
     return newPage;
 }
 
index b88e048..d4a2ff4 100644 (file)
 #include "config.h"
 #include "Page.h"
 
+#include "CSSStyleSelector.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
 #include "ContextMenuClient.h"
 #include "ContextMenuController.h"
-#include "CSSStyleSelector.h"
-#include "EditorClient.h"
 #include "DOMWindow.h"
 #include "DragController.h"
+#include "EditorClient.h"
 #include "EventNames.h"
 #include "FileSystem.h"
 #include "FocusController.h"
 #include "FrameLoader.h"
 #include "FrameTree.h"
 #include "FrameView.h"
+#include "HTMLElement.h"
 #include "HistoryItem.h"
 #include "InspectorController.h"
 #include "Logging.h"
-#include "NetworkStateNotifier.h"
 #include "Navigator.h"
+#include "NetworkStateNotifier.h"
 #include "PageGroup.h"
 #include "PluginData.h"
 #include "ProgressTracker.h"
 #include "RenderWidget.h"
+#include "ScriptController.h"
 #include "SelectionController.h"
 #include "Settings.h"
 #include "StringHash.h"
 #include "TextResourceDecoder.h"
 #include "Widget.h"
-#include "ScriptController.h"
 #include <wtf/HashMap.h>
 #include <wtf/RefCountedLeakCounter.h>
 #include <wtf/StdLibExtras.h>
index 59284ee..283fe44 100644 (file)
@@ -29,6 +29,7 @@
 #include "Frame.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
+#include "HTMLFormElement.h"
 #include "HTMLNames.h"
 #include "HitTestResult.h"
 #include "InlineTextBox.h"
index fd88120..7881657 100644 (file)
@@ -46,6 +46,7 @@
 
 #include "CString.h"
 #include "CSSPropertyNames.h"
+#include "CSSStyleDeclaration.h"
 #include "CSSStyleSelector.h"
 #include "Document.h"
 #include "EventHandler.h"
index a601962..d2c6c24 100644 (file)
@@ -26,8 +26,9 @@
 #define RenderObject_h
 
 #include "CachedResourceClient.h"
-#include "FloatQuad.h"
 #include "Document.h"
+#include "Element.h"
+#include "FloatQuad.h"
 #include "RenderObjectChildList.h"
 #include "RenderStyle.h"
 #include "TextAffinity.h"
index e0900e6..52290c0 100644 (file)
@@ -30,6 +30,7 @@
 #include "EventNames.h"
 #include "Frame.h"
 #include "FrameTree.h"
+#include "HTMLElement.h"
 #include "LocalStorage.h"
 #include "LocalStorageTask.h"
 #include "LocalStorageThread.h"
index 285922e..16a72ae 100644 (file)
@@ -29,6 +29,7 @@
 #include "EventNames.h"
 #include "Frame.h"
 #include "FrameTree.h"
+#include "HTMLElement.h"
 #include "Page.h"
 #include "PlatformString.h"
 #include "SecurityOrigin.h"
index e0a8409..5b399c4 100644 (file)
@@ -1,3 +1,11 @@
+2009-03-29  Darin Adler  <darin@apple.com>
+
+        Reviewed by Cameron Zwarich.
+
+        * Plugins/WebNullPluginView.mm: Added now-needed includes.
+        * WebView/WebHTMLRepresentation.mm: Ditto.
+        * WebView/WebHTMLView.mm: Ditto.
+
 2009-03-27  Timothy Hatcher  <timothy@apple.com>
 
         * MigrateHeaders.make: Remove DOMHTMLBodyElementPrivate.h since it
index 48e0e9d..2bab7c2 100644 (file)
@@ -31,6 +31,7 @@
 #import "WebFrameInternal.h"
 #import "WebViewInternal.h"
 #import <WebCore/Document.h>
+#import <WebCore/Element.h>
 
 @implementation WebNullPluginView
 
index 3f69870..b9ff79e 100644 (file)
@@ -47,6 +47,7 @@
 #import <WebCore/FrameLoader.h>
 #import <WebCore/FrameLoaderClient.h>
 #import <WebCore/HTMLFormControlElement.h>
+#import <WebCore/HTMLFormElement.h>
 #import <WebCore/HTMLInputElement.h>
 #import <WebCore/HTMLNames.h>
 #import <WebCore/MIMETypeRegistry.h>
index bcd69f8..ee03cf0 100644 (file)
@@ -32,7 +32,6 @@
 #import "DOMNodeInternal.h"
 #import "DOMRangeInternal.h"
 #import "WebArchive.h"
-#import "WebNetscapePluginView.h"
 #import "WebClipView.h"
 #import "WebDOMOperationsPrivate.h"
 #import "WebDataSourceInternal.h"
@@ -50,7 +49,6 @@
 #import "WebKitNSStringExtras.h"
 #import "WebKitVersionChecks.h"
 #import "WebLocalizableStrings.h"
-#import "WebNodeHighlight.h"
 #import "WebNSAttributedStringExtras.h"
 #import "WebNSEventExtras.h"
 #import "WebNSFileManagerExtras.h"
@@ -60,6 +58,8 @@
 #import "WebNSPrintOperationExtras.h"
 #import "WebNSURLExtras.h"
 #import "WebNSViewExtras.h"
+#import "WebNetscapePluginView.h"
+#import "WebNodeHighlight.h"
 #import "WebPluginController.h"
 #import "WebPreferences.h"
 #import "WebPreferencesPrivate.h"
@@ -70,7 +70,7 @@
 #import "WebViewInternal.h"
 #import <AppKit/NSAccessibility.h>
 #import <ApplicationServices/ApplicationServices.h>
-#import <dlfcn.h>
+#import <WebCore/CSSMutableStyleDeclaration.h>
 #import <WebCore/CachedImage.h>
 #import <WebCore/CachedResourceClient.h>
 #import <WebCore/ColorMac.h>
 #import <WebCore/ContextMenuController.h>
 #import <WebCore/Document.h>
 #import <WebCore/DocumentFragment.h>
+#import <WebCore/DragController.h>
 #import <WebCore/Editor.h>
 #import <WebCore/EditorDeleteAction.h>
 #import <WebCore/Element.h>
 #import <WebCore/EventHandler.h>
 #import <WebCore/ExceptionHandlers.h>
-#import <WebCore/DragController.h>
 #import <WebCore/FloatRect.h>
 #import <WebCore/FocusController.h>
 #import <WebCore/Frame.h>
 #import <WebCore/FrameLoader.h>
 #import <WebCore/FrameView.h>
-#import <WebCore/HitTestResult.h>
 #import <WebCore/HTMLNames.h>
+#import <WebCore/HitTestResult.h>
 #import <WebCore/Image.h>
 #import <WebCore/KeyboardEvent.h>
 #import <WebCore/LegacyWebArchive.h>
 #import <WebKit/DOMExtensions.h>
 #import <WebKit/DOMPrivate.h>
 #import <WebKitSystemInterface.h>
+#import <dlfcn.h>
 #import <limits>
 #import <runtime/InitializeThreading.h>