[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
japhet at chromium.org
japhet at chromium.org
Tue Jan 5 23:45:52 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 54f1d73b40b8339993e02d2516014e0c202673e7
Author: japhet at chromium.org <japhet at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Dec 9 17:43:16 2009 +0000
2009-12-09 Nate Chapin <japhet at chromium.org>
Reviewed by Darin Adler.
Rename dom/ClassNames to SpaceSplitString and update build files.
https://bugs.webkit.org/show_bug.cgi?id=32250
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* WebCoreSources.bkl:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::matchRules):
* dom/ClassNames.cpp: Removed.
* dom/ClassNames.h: Removed.
* dom/ClassNodeList.h:
* dom/NamedMappedAttrMap.h:
(WebCore::NamedMappedAttrMap::classNames):
* dom/SpaceSplitString.cpp: Copied from WebCore/dom/ClassNames.cpp.
(WebCore::SpaceSplitStringData::createVector):
(WebCore::SpaceSplitStringData::containsAll):
* dom/SpaceSplitString.h: Copied from WebCore/dom/ClassNames.h.
(WebCore::SpaceSplitStringData::SpaceSplitStringData):
(WebCore::SpaceSplitString::SpaceSplitString):
(WebCore::SpaceSplitString::set):
(WebCore::SpaceSplitString::containsAll):
* dom/StyledElement.h:
(WebCore::StyledElement::classNames):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::setRel):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51902 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index e95d92f..ec6cf94 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -104,7 +104,6 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
dom/CharacterData.cpp \
dom/CheckedRadioButtons.cpp \
dom/ChildNodeList.cpp \
- dom/ClassNames.cpp \
dom/ClassNodeList.cpp \
dom/ClientRect.cpp \
dom/ClientRectList.cpp \
@@ -160,6 +159,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
dom/ScriptExecutionContext.cpp \
dom/SelectElement.cpp \
dom/SelectorNodeList.cpp \
+ dom/SpaceSplitString.cpp \
dom/StaticNodeList.cpp \
dom/StyleElement.cpp \
dom/StyledElement.cpp \
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 012ff3c..8d6a7e6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,37 @@
+2009-12-09 Nate Chapin <japhet at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Rename dom/ClassNames to SpaceSplitString and update build files.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32250
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * WebCoreSources.bkl:
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::matchRules):
+ * dom/ClassNames.cpp: Removed.
+ * dom/ClassNames.h: Removed.
+ * dom/ClassNodeList.h:
+ * dom/NamedMappedAttrMap.h:
+ (WebCore::NamedMappedAttrMap::classNames):
+ * dom/SpaceSplitString.cpp: Copied from WebCore/dom/ClassNames.cpp.
+ (WebCore::SpaceSplitStringData::createVector):
+ (WebCore::SpaceSplitStringData::containsAll):
+ * dom/SpaceSplitString.h: Copied from WebCore/dom/ClassNames.h.
+ (WebCore::SpaceSplitStringData::SpaceSplitStringData):
+ (WebCore::SpaceSplitString::SpaceSplitString):
+ (WebCore::SpaceSplitString::set):
+ (WebCore::SpaceSplitString::containsAll):
+ * dom/StyledElement.h:
+ (WebCore::StyledElement::classNames):
+ * html/HTMLAnchorElement.cpp:
+ (WebCore::HTMLAnchorElement::setRel):
+
2009-12-09 Stephen White <senorblanco at chromium.org>
Reviewed by Darin Fisher.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 6278e35..f8fa302 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -668,8 +668,6 @@ webcore_sources += \
WebCore/dom/CheckedRadioButtons.h \
WebCore/dom/ChildNodeList.cpp \
WebCore/dom/ChildNodeList.h \
- WebCore/dom/ClassNames.cpp \
- WebCore/dom/ClassNames.h \
WebCore/dom/ClassNodeList.cpp \
WebCore/dom/ClassNodeList.h \
WebCore/dom/ClientRect.cpp \
@@ -799,6 +797,8 @@ webcore_sources += \
WebCore/dom/SelectElement.h \
WebCore/dom/SelectorNodeList.cpp \
WebCore/dom/SelectorNodeList.h \
+ WebCore/dom/SpaceSplitString.cpp \
+ WebCore/dom/SpaceSplitString.h \
WebCore/dom/StaticNodeList.cpp \
WebCore/dom/StaticNodeList.h \
WebCore/dom/StyleElement.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index f21ce5c..a9d4bb3 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -998,8 +998,6 @@
'dom/CheckedRadioButtons.h',
'dom/ChildNodeList.cpp',
'dom/ChildNodeList.h',
- 'dom/ClassNames.cpp',
- 'dom/ClassNames.h',
'dom/ClassNodeList.cpp',
'dom/ClassNodeList.h',
'dom/ClientRect.cpp',
@@ -1129,6 +1127,8 @@
'dom/SelectElement.h',
'dom/SelectorNodeList.cpp',
'dom/SelectorNodeList.h',
+ 'dom/SpaceSplitString.cpp',
+ 'dom/SpaceSplitString.h',
'dom/StaticNodeList.cpp',
'dom/StaticNodeList.h',
'dom/StaticStringList.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index a0b7c02..6a59035 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -851,7 +851,6 @@ SOURCES += \
dom/CharacterData.cpp \
dom/CheckedRadioButtons.cpp \
dom/ChildNodeList.cpp \
- dom/ClassNames.cpp \
dom/ClassNodeList.cpp \
dom/ClientRect.cpp \
dom/ClientRectList.cpp \
@@ -910,6 +909,7 @@ SOURCES += \
dom/ScriptExecutionContext.cpp \
dom/SelectElement.cpp \
dom/SelectorNodeList.cpp \
+ dom/SpaceSplitString.cpp \
dom/StaticNodeList.cpp \
dom/StyledElement.cpp \
dom/StyleElement.cpp \
@@ -1537,7 +1537,6 @@ HEADERS += \
dom/CharacterData.h \
dom/CheckedRadioButtons.h \
dom/ChildNodeList.h \
- dom/ClassNames.h \
dom/ClassNodeList.h \
dom/ClientRect.h \
dom/ClientRectList.h \
@@ -1594,6 +1593,7 @@ HEADERS += \
dom/ScriptExecutionContext.h \
dom/SelectElement.h \
dom/SelectorNodeList.h \
+ dom/SpaceSplitString.h \
dom/StaticNodeList.h \
dom/StyledElement.h \
dom/StyleElement.h \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 16898ac..09945f5 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -28443,14 +28443,6 @@
>
</File>
<File
- RelativePath="..\dom\ClassNames.cpp"
- >
- </File>
- <File
- RelativePath="..\dom\ClassNames.h"
- >
- </File>
- <File
RelativePath="..\dom\ClassNodeList.cpp"
>
</File>
@@ -28959,6 +28951,14 @@
>
</File>
<File
+ RelativePath="..\dom\SpaceSplitString.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\dom\SpaceSplitString.h"
+ >
+ </File>
+ <File
RelativePath="..\dom\StaticNodeList.cpp"
>
</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 20a769d..2d0b804 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -4177,8 +4177,6 @@
BC4918C90BFEA050009D6316 /* JSHTMLIFrameElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4918C30BFEA050009D6316 /* JSHTMLIFrameElement.h */; };
BC491B780C023EFD009D6316 /* JSHTMLMarqueeElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC491B760C023EFD009D6316 /* JSHTMLMarqueeElement.cpp */; };
BC491B790C023EFD009D6316 /* JSHTMLMarqueeElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC491B770C023EFD009D6316 /* JSHTMLMarqueeElement.h */; };
- BC4BF9E40D11E133007D247F /* ClassNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4BF9E20D11E133007D247F /* ClassNames.cpp */; };
- BC4BF9E50D11E133007D247F /* ClassNames.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4BF9E30D11E133007D247F /* ClassNames.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC4EDEF40C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */; };
BC5156E80C03B741008BB0EE /* DOMHTMLMarqueeElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = BC5156E50C03B741008BB0EE /* DOMHTMLMarqueeElement.h */; };
BC5156E90C03B741008BB0EE /* DOMHTMLMarqueeElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC5156E60C03B741008BB0EE /* DOMHTMLMarqueeElement.mm */; };
@@ -4592,6 +4590,8 @@
C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */ = {isa = PBXBuildFile; fileRef = C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */; };
C6D74AE409AA290A000B0A52 /* ModifySelectionListLevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D74AE309AA290A000B0A52 /* ModifySelectionListLevel.cpp */; };
CE54FD381016D9A6008B44C8 /* ScriptSourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = CE54FD371016D9A6008B44C8 /* ScriptSourceProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ D01A27AD10C9BFD800026A42 /* SpaceSplitString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */; };
+ D01A27AE10C9BFD800026A42 /* SpaceSplitString.h in Headers */ = {isa = PBXBuildFile; fileRef = D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */; settings = {ATTRIBUTES = (Private, ); }; };
D05CED290A40BB2C00C5AF38 /* FormatBlockCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */; };
D05CED2A0A40BB2C00C5AF38 /* FormatBlockCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */; };
D06C0D8F0CFD11460065F43F /* RemoveFormatCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D06C0D8D0CFD11460065F43F /* RemoveFormatCommand.h */; };
@@ -9346,8 +9346,6 @@
BC491B4E0C023E2D009D6316 /* HTMLMarqueeElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLMarqueeElement.idl; sourceTree = "<group>"; };
BC491B760C023EFD009D6316 /* JSHTMLMarqueeElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLMarqueeElement.cpp; sourceTree = "<group>"; };
BC491B770C023EFD009D6316 /* JSHTMLMarqueeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLMarqueeElement.h; sourceTree = "<group>"; };
- BC4BF9E20D11E133007D247F /* ClassNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClassNames.cpp; sourceTree = "<group>"; };
- BC4BF9E30D11E133007D247F /* ClassNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClassNames.h; sourceTree = "<group>"; };
BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLAppletElementCustom.cpp; sourceTree = "<group>"; };
BC5156E50C03B741008BB0EE /* DOMHTMLMarqueeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLMarqueeElement.h; sourceTree = "<group>"; };
BC5156E60C03B741008BB0EE /* DOMHTMLMarqueeElement.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLMarqueeElement.mm; sourceTree = "<group>"; };
@@ -9792,6 +9790,8 @@
C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModifySelectionListLevel.h; sourceTree = "<group>"; };
C6D74AE309AA290A000B0A52 /* ModifySelectionListLevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModifySelectionListLevel.cpp; sourceTree = "<group>"; };
CE54FD371016D9A6008B44C8 /* ScriptSourceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptSourceProvider.h; sourceTree = "<group>"; };
+ D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceSplitString.cpp; sourceTree = "<group>"; };
+ D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceSplitString.h; sourceTree = "<group>"; };
D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FormatBlockCommand.cpp; sourceTree = "<group>"; };
D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FormatBlockCommand.h; sourceTree = "<group>"; };
D06C0D8D0CFD11460065F43F /* RemoveFormatCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoveFormatCommand.h; sourceTree = "<group>"; };
@@ -15587,8 +15587,6 @@
93F925410F7EF5B8007E37C9 /* CheckedRadioButtons.h */,
A818721A0977D3C0005826D9 /* ChildNodeList.cpp */,
A81872150977D3C0005826D9 /* ChildNodeList.h */,
- BC4BF9E20D11E133007D247F /* ClassNames.cpp */,
- BC4BF9E30D11E133007D247F /* ClassNames.h */,
BC904B720D10998F00680D32 /* ClassNodeList.cpp */,
BC904B730D10998F00680D32 /* ClassNodeList.h */,
BCC065770F3CE1B700CD2D87 /* ClientRect.cpp */,
@@ -15758,6 +15756,8 @@
084AEBE30FB505FA0038483E /* SelectElement.h */,
BC7FA6800D1F167900DB22A9 /* SelectorNodeList.cpp */,
BC7FA67F0D1F167900DB22A9 /* SelectorNodeList.h */,
+ D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */,
+ D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */,
BC7FA62C0D1F0EFF00DB22A9 /* StaticNodeList.cpp */,
BC7FA62B0D1F0EFF00DB22A9 /* StaticNodeList.h */,
A8C4A7EC09D563270003AC8D /* StyledElement.cpp */,
@@ -15942,7 +15942,6 @@
A81872200977D3C0005826D9 /* ChildNodeList.h in Headers */,
14D823520AF92A790004F057 /* Chrome.h in Headers */,
14D824080AF93AEB0004F057 /* ChromeClient.h in Headers */,
- BC4BF9E50D11E133007D247F /* ClassNames.h in Headers */,
BC904B770D10998F00680D32 /* ClassNodeList.h in Headers */,
BCC0657E0F3CE1B700CD2D87 /* ClientRect.h in Headers */,
BCC065810F3CE1B700CD2D87 /* ClientRectList.h in Headers */,
@@ -17789,6 +17788,7 @@
4B3043C70AE0370300A82647 /* Sound.h in Headers */,
84A81F3E0FC7DFF000955300 /* SourceAlpha.h in Headers */,
84A81F420FC7E02700955300 /* SourceGraphic.h in Headers */,
+ D01A27AE10C9BFD800026A42 /* SpaceSplitString.h in Headers */,
93309E12099E64920056E581 /* SplitElementCommand.h in Headers */,
93309E14099E64920056E581 /* SplitTextNodeCommand.h in Headers */,
93309E16099E64920056E581 /* SplitTextNodeContainingElementCommand.h in Headers */,
@@ -18588,7 +18588,6 @@
A81872250977D3C0005826D9 /* ChildNodeList.cpp in Sources */,
14D8238B0AF92DF60004F057 /* Chrome.cpp in Sources */,
ABAF22080C03B1C700B0BCF0 /* ChromeMac.mm in Sources */,
- BC4BF9E40D11E133007D247F /* ClassNames.cpp in Sources */,
BC904B760D10998F00680D32 /* ClassNodeList.cpp in Sources */,
BCC0657D0F3CE1B700CD2D87 /* ClientRect.cpp in Sources */,
BCC065800F3CE1B700CD2D87 /* ClientRectList.cpp in Sources */,
@@ -20400,6 +20399,7 @@
7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */,
7A0E771E10C00DB100A0276E /* JSInspectorFrontendHost.cpp in Sources */,
F4EAF4AE10C742B1009100D3 /* OpenTypeSanitizer.cpp in Sources */,
+ D01A27AD10C9BFD800026A42 /* SpaceSplitString.cpp in Sources */,
599D1E3210C97D6E00E0EF12 /* jni_utility_private.cpp in Sources */,
0C3F1F5A10C8871200D72CE1 /* WebGLUniformLocation.cpp in Sources */,
0C45342710CDBBFA00869157 /* JSWebGLUniformLocation.cpp in Sources */,
diff --git a/WebCore/WebCoreSources.bkl b/WebCore/WebCoreSources.bkl
index 8a0b349..cd94ae6 100644
--- a/WebCore/WebCoreSources.bkl
+++ b/WebCore/WebCoreSources.bkl
@@ -450,7 +450,6 @@ This file contains the list of files needed to build WebCore.
dom/CharacterData.cpp
dom/CheckedRadioButtons.cpp
dom/ChildNodeList.cpp
- dom/ClassNames.cpp
dom/ClassNodeList.cpp
dom/ClientRect.cpp
dom/ClientRectList.cpp
@@ -506,6 +505,7 @@ This file contains the list of files needed to build WebCore.
dom/ScriptExecutionContext.cpp
dom/SelectElement.cpp
dom/SelectorNodeList.cpp
+ dom/SpaceSplitString.cpp
dom/StaticNodeList.cpp
dom/StyleElement.cpp
dom/StyledElement.cpp
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index c402226..0adf9c4 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -660,7 +660,7 @@ void CSSStyleSelector::matchRules(CSSRuleSet* rules, int& firstRuleIndex, int& l
matchRulesForList(rules->getIDRules(m_element->getIDAttribute().impl()), firstRuleIndex, lastRuleIndex);
if (m_element->hasClass()) {
ASSERT(m_styledElement);
- const ClassNames& classNames = m_styledElement->classNames();
+ const SpaceSplitString& classNames = m_styledElement->classNames();
size_t size = classNames.size();
for (size_t i = 0; i < size; ++i)
matchRulesForList(rules->getClassRules(classNames[i].impl()), firstRuleIndex, lastRuleIndex);
diff --git a/WebCore/dom/ClassNames.cpp b/WebCore/dom/ClassNames.cpp
deleted file mode 100644
index 1c5ff47..0000000
--- a/WebCore/dom/ClassNames.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2007 David Smith (catfish.man at gmail.com)
- * Copyright (C) 2007, 2008 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-#include "ClassNames.h"
-
-#include <wtf/ASCIICType.h>
-
-using namespace WTF;
-
-namespace WebCore {
-
-static bool hasNonASCIIOrUpper(const String& string)
-{
- const UChar* characters = string.characters();
- unsigned length = string.length();
- bool hasUpper = false;
- UChar ored = 0;
- for (unsigned i = 0; i < length; i++) {
- UChar c = characters[i];
- hasUpper |= isASCIIUpper(c);
- ored |= c;
- }
- return hasUpper || (ored & ~0x7F);
-}
-
-void ClassNamesData::createVector()
-{
- ASSERT(!m_createdVector);
- ASSERT(m_vector.isEmpty());
-
- if (m_shouldFoldCase && hasNonASCIIOrUpper(m_string))
- m_string = m_string.foldCase();
-
- const UChar* characters = m_string.characters();
- unsigned length = m_string.length();
- unsigned start = 0;
- while (true) {
- while (start < length && isClassWhitespace(characters[start]))
- ++start;
- if (start >= length)
- break;
- unsigned end = start + 1;
- while (end < length && !isClassWhitespace(characters[end]))
- ++end;
-
- m_vector.append(AtomicString(characters + start, end - start));
-
- start = end + 1;
- }
-
- m_string = String();
- m_createdVector = true;
-}
-
-bool ClassNamesData::containsAll(ClassNamesData& other)
-{
- ensureVector();
- other.ensureVector();
- size_t thisSize = m_vector.size();
- size_t otherSize = other.m_vector.size();
- for (size_t i = 0; i < otherSize; ++i) {
- const AtomicString& name = other.m_vector[i];
- size_t j;
- for (j = 0; j < thisSize; ++j) {
- if (m_vector[j] == name)
- break;
- }
- if (j == thisSize)
- return false;
- }
- return true;
-}
-
-} // namespace WebCore
diff --git a/WebCore/dom/ClassNames.h b/WebCore/dom/ClassNames.h
deleted file mode 100644
index a836606..0000000
--- a/WebCore/dom/ClassNames.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ClassNames_h
-#define ClassNames_h
-
-#include "AtomicString.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
- class ClassNamesData : public Noncopyable {
- public:
- ClassNamesData(const String& string, bool shouldFoldCase)
- : m_string(string), m_shouldFoldCase(shouldFoldCase), m_createdVector(false)
- {
- }
-
- bool contains(const AtomicString& string)
- {
- ensureVector();
- size_t size = m_vector.size();
- for (size_t i = 0; i < size; ++i) {
- if (m_vector[i] == string)
- return true;
- }
- return false;
- }
-
- bool containsAll(ClassNamesData&);
-
- size_t size() { ensureVector(); return m_vector.size(); }
- const AtomicString& operator[](size_t i) { ensureVector(); ASSERT(i < size()); return m_vector[i]; }
-
- private:
- void ensureVector() { if (!m_createdVector) createVector(); }
- void createVector();
-
- typedef Vector<AtomicString, 8> ClassNameVector;
- String m_string;
- ClassNameVector m_vector;
- bool m_shouldFoldCase;
- bool m_createdVector;
- };
-
- class ClassNames {
- public:
- ClassNames() { }
- ClassNames(const String& string, bool shouldFoldCase) : m_data(new ClassNamesData(string, shouldFoldCase)) { }
-
- void set(const String& string, bool shouldFoldCase) { m_data.set(new ClassNamesData(string, shouldFoldCase)); }
- void clear() { m_data.clear(); }
-
- bool contains(const AtomicString& string) const { return m_data && m_data->contains(string); }
- bool containsAll(const ClassNames& names) const { return !names.m_data || (m_data && m_data->containsAll(*names.m_data)); }
-
- size_t size() const { return m_data ? m_data->size() : 0; }
- const AtomicString& operator[](size_t i) const { ASSERT(i < size()); return (*m_data)[i]; }
-
- private:
- OwnPtr<ClassNamesData> m_data;
- };
-
- inline bool isClassWhitespace(UChar c)
- {
- return c == ' ' || c == '\r' || c == '\n' || c == '\t' || c == '\f';
- }
-
-} // namespace WebCore
-
-#endif // ClassNames_h
diff --git a/WebCore/dom/ClassNodeList.h b/WebCore/dom/ClassNodeList.h
index d40ee19..c519b3e 100644
--- a/WebCore/dom/ClassNodeList.h
+++ b/WebCore/dom/ClassNodeList.h
@@ -30,8 +30,8 @@
#ifndef ClassNodeList_h
#define ClassNodeList_h
-#include "ClassNames.h"
#include "DynamicNodeList.h"
+#include "SpaceSplitString.h"
namespace WebCore {
@@ -47,7 +47,7 @@ namespace WebCore {
virtual bool nodeMatches(Element*) const;
- ClassNames m_classNames;
+ SpaceSplitString m_classNames;
};
} // namespace WebCore
diff --git a/WebCore/dom/NamedMappedAttrMap.h b/WebCore/dom/NamedMappedAttrMap.h
index 0afa278..a288685 100644
--- a/WebCore/dom/NamedMappedAttrMap.h
+++ b/WebCore/dom/NamedMappedAttrMap.h
@@ -26,8 +26,8 @@
#ifndef NamedMappedAttrMap_h
#define NamedMappedAttrMap_h
-#include "ClassNames.h"
#include "NamedNodeMap.h"
+#include "SpaceSplitString.h"
namespace WebCore {
@@ -37,7 +37,7 @@ public:
void clearClass() { m_classNames.clear(); }
void setClass(const String&);
- const ClassNames& classNames() const { return m_classNames; }
+ const SpaceSplitString& classNames() const { return m_classNames; }
bool hasMappedAttributes() const { return m_mappedAttributeCount > 0; }
void declRemoved() { m_mappedAttributeCount--; }
@@ -53,7 +53,7 @@ private:
int declCount() const;
- ClassNames m_classNames;
+ SpaceSplitString m_classNames;
int m_mappedAttributeCount;
};
diff --git a/WebCore/dom/SpaceSplitString.cpp b/WebCore/dom/SpaceSplitString.cpp
new file mode 100644
index 0000000..b062dbf
--- /dev/null
+++ b/WebCore/dom/SpaceSplitString.cpp
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2007 David Smith (catfish.man at gmail.com)
+ * Copyright (C) 2007, 2008 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "SpaceSplitString.h"
+
+#include <wtf/ASCIICType.h>
+
+using namespace WTF;
+
+namespace WebCore {
+
+static bool hasNonASCIIOrUpper(const String& string)
+{
+ const UChar* characters = string.characters();
+ unsigned length = string.length();
+ bool hasUpper = false;
+ UChar ored = 0;
+ for (unsigned i = 0; i < length; i++) {
+ UChar c = characters[i];
+ hasUpper |= isASCIIUpper(c);
+ ored |= c;
+ }
+ return hasUpper || (ored & ~0x7F);
+}
+
+void SpaceSplitStringData::createVector()
+{
+ ASSERT(!m_createdVector);
+ ASSERT(m_vector.isEmpty());
+
+ if (m_shouldFoldCase && hasNonASCIIOrUpper(m_string))
+ m_string = m_string.foldCase();
+
+ const UChar* characters = m_string.characters();
+ unsigned length = m_string.length();
+ unsigned start = 0;
+ while (true) {
+ while (start < length && isClassWhitespace(characters[start]))
+ ++start;
+ if (start >= length)
+ break;
+ unsigned end = start + 1;
+ while (end < length && !isClassWhitespace(characters[end]))
+ ++end;
+
+ m_vector.append(AtomicString(characters + start, end - start));
+
+ start = end + 1;
+ }
+
+ m_string = String();
+ m_createdVector = true;
+}
+
+bool SpaceSplitStringData::containsAll(SpaceSplitStringData& other)
+{
+ ensureVector();
+ other.ensureVector();
+ size_t thisSize = m_vector.size();
+ size_t otherSize = other.m_vector.size();
+ for (size_t i = 0; i < otherSize; ++i) {
+ const AtomicString& name = other.m_vector[i];
+ size_t j;
+ for (j = 0; j < thisSize; ++j) {
+ if (m_vector[j] == name)
+ break;
+ }
+ if (j == thisSize)
+ return false;
+ }
+ return true;
+}
+
+} // namespace WebCore
diff --git a/WebCore/dom/SpaceSplitString.h b/WebCore/dom/SpaceSplitString.h
new file mode 100644
index 0000000..2ef3fc4
--- /dev/null
+++ b/WebCore/dom/SpaceSplitString.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2007, 2008 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef SpaceSplitString_h
+#define SpaceSplitString_h
+
+#include "AtomicString.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+ class SpaceSplitStringData : public Noncopyable {
+ public:
+ SpaceSplitStringData(const String& string, bool shouldFoldCase)
+ : m_string(string), m_shouldFoldCase(shouldFoldCase), m_createdVector(false)
+ {
+ }
+
+ bool contains(const AtomicString& string)
+ {
+ ensureVector();
+ size_t size = m_vector.size();
+ for (size_t i = 0; i < size; ++i) {
+ if (m_vector[i] == string)
+ return true;
+ }
+ return false;
+ }
+
+ bool containsAll(SpaceSplitStringData&);
+
+ size_t size() { ensureVector(); return m_vector.size(); }
+ const AtomicString& operator[](size_t i) { ensureVector(); ASSERT(i < size()); return m_vector[i]; }
+
+ private:
+ void ensureVector() { if (!m_createdVector) createVector(); }
+ void createVector();
+
+ typedef Vector<AtomicString, 8> StringVector;
+ String m_string;
+ StringVector m_vector;
+ bool m_shouldFoldCase;
+ bool m_createdVector;
+ };
+
+ class SpaceSplitString {
+ public:
+ SpaceSplitString() { }
+ SpaceSplitString(const String& string, bool shouldFoldCase) : m_data(new SpaceSplitStringData(string, shouldFoldCase)) { }
+
+ void set(const String& string, bool shouldFoldCase) { m_data.set(new SpaceSplitStringData(string, shouldFoldCase)); }
+ void clear() { m_data.clear(); }
+
+ bool contains(const AtomicString& string) const { return m_data && m_data->contains(string); }
+ bool containsAll(const SpaceSplitString& names) const { return !names.m_data || (m_data && m_data->containsAll(*names.m_data)); }
+
+ size_t size() const { return m_data ? m_data->size() : 0; }
+ const AtomicString& operator[](size_t i) const { ASSERT(i < size()); return (*m_data)[i]; }
+
+ private:
+ OwnPtr<SpaceSplitStringData> m_data;
+ };
+
+ inline bool isClassWhitespace(UChar c)
+ {
+ return c == ' ' || c == '\r' || c == '\n' || c == '\t' || c == '\f';
+ }
+
+} // namespace WebCore
+
+#endif // SpaceSplitString_h
diff --git a/WebCore/dom/StyledElement.h b/WebCore/dom/StyledElement.h
index 85fa7a7..52bffd3 100644
--- a/WebCore/dom/StyledElement.h
+++ b/WebCore/dom/StyledElement.h
@@ -66,7 +66,7 @@ public:
CSSStyleDeclaration* style();
void invalidateStyleAttribute();
- const ClassNames& classNames() const { ASSERT(hasClass()); ASSERT(mappedAttributes()); return mappedAttributes()->classNames(); }
+ const SpaceSplitString& classNames() const { ASSERT(hasClass()); ASSERT(mappedAttributes()); return mappedAttributes()->classNames(); }
virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const;
diff --git a/WebCore/html/HTMLAnchorElement.cpp b/WebCore/html/HTMLAnchorElement.cpp
index 58d39c1..1d5d569 100644
--- a/WebCore/html/HTMLAnchorElement.cpp
+++ b/WebCore/html/HTMLAnchorElement.cpp
@@ -343,7 +343,7 @@ bool HTMLAnchorElement::hasRel(uint32_t relation) const
void HTMLAnchorElement::setRel(const String& value)
{
m_linkRelations = 0;
- ClassNames newLinkRelations(value, true);
+ SpaceSplitString newLinkRelations(value, true);
// FIXME: Add link relations as they are implemented
if (newLinkRelations.contains("noreferrer"))
m_linkRelations |= RelationNoReferrer;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list