Commit 107c53d2 authored by darin's avatar darin

JavaScriptCore:

        Reviewed by Maciej.

        * JavaScriptCore.pbproj/project.pbxproj: Make dtoa.h visible as an SPI so I can
	use it inside QString.

WebFoundation:

        Reviewed by Maciej.

        * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes.

WebCore:

        Reviewed by Maciej and Dave.

	- optimizations that improve speed; total is 13.8% on cached cvs-base on my machine

        * khtml/css/css_valueimpl.h: Add isKonqBody() and genericFamilyType() to find out if
	a font is a standard one. This is much faster than doing string comparisons all the time.
        * khtml/css/css_valueimpl.cpp: (FontFamilyValueImpl::FontFamilyValueImpl):
	Check the font names against the standard ones on time when the FontFamilyValueImpl
	object is constructed rather than every time the stuff is matched.
        * khtml/css/cssparser.h: Add pseudoType() and extractPseudoType() to CSSSelector so we
	don't have to do string compares all the time.
        * khtml/css/cssparser.cpp:
        (StyleBaseImpl::parseValue): Use QConstString in a way that's effective (with an
	object that has a long enough lifetime), or don't use it at all.
        (StyleBaseImpl::parseContent): Ditto.
        (StyleBaseImpl::preprocess): Preprocess into a buffer, usually on the stack, rather than
	using QString += QChar over and over again.
        (CSSSelector::extractPseudoType): Convert the value string into a type, and get rid of it.
	Saves memory because the string goes away. And doing it once is much faster than string
	comparing each time.
        * khtml/css/cssstyleselector.cpp:
	(cleanPath): Restructure to save one find() in the common case.
	(checkPseudoState): Restructure to avoid some DOMString creation/destruction in the case
	where the tag is not an <A>. Also use QConstString correctly.
	(CSSStyleSelector::checkOneSelector): Use the new pseudoType() instead of string compares.
	(CSSStyleSelector::applyRule): Use isKonqBody() and genericFamilyType() instead of string
	comparisons.

        * khtml/dom/dom_string.h: Make the destructor non-virtual. This was a big win, and a mistake
	the way it was before. Also make the DOMString constructor with no parameters inline.
        * khtml/dom/dom_string.cpp:
        (DOMString::string): Don't use QConstString here, since it does no good.
        (DOM::operator==): Rewrite to do things faster and avoid calling strlen.

        * khtml/html/html_objectimpl.h: Don't use QConstString in places where it does harm and no good.
        * khtml/html/html_objectimpl.cpp: (HTMLEmbedElementImpl::parseAttribute): Use QConstString properly.

        * khtml/html/htmltokenizer.cpp:
        (tagMatch): Added.
        (HTMLTokenizer::parseSpecial): Change tokenizing so it doesn't construct temporary strings (with
	QConstString) just to compare small substrings.

        * khtml/khtml_part.cpp: (KHTMLPart::write): Don't use a decoder object when source is all ASCII.

        * kwq/KWQColor.mm:
        (hex2int): Don't bother with uppercase hex since we always lowercase anyway.
        (QColor::setNamedColor): Use a new gperf-based table instead of an NSDictionary to look up colors.
        * kwq/KWQColorData.c: Added this autogenerated file.
        * kwq/KWQColorData.gperf: Added. Source file with list of colors and color values.
        * kwq/Makefile.am: Build KWQColorData.c from KWQColorData.gperf.
        * WebCore.pbproj/project.pbxproj: Added KWQColorData.gperf.

        * khtml/misc/helper.cpp: (khtml::setNamedColor): Don't call setNamedColor again with the lowercased
	color name, since our QColor::setNamedColor already has to lowercase the name (because it has to check
	all names before checking any hex values).

        * khtml/rendering/font.h: Don't initialize the QFontMetrics since in every case we end up changing
	the font later anyway. Also remove unused field.
        * khtml/rendering/font.cpp: (Font::update): Use the new QFontMetrics::setFont for speed.

        * khtml/rendering/render_object.cpp: (RenderObject::enclosingLayer): Change it so it doesn't get
	the layer twice. This function showed up on the sample so we know it's hot.

        * khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::containsOnlyWhitespace): Did a faster implementation
	that doesn't call QChar::direction() except for non-ASCII characters.

        * kwq/KWQFontMetrics.h: Add empty constructor for use in font.cpp. Add accessor and setter for the
	font too. Made baselineOffset() inline since it's trivial.
        * kwq/KWQFontMetrics.mm:
	(QFontMetricsPrivate::QFontMetricsPrivate): Don't make the renderer until we use it.
	(QFontMetricsPrivate::getRenderer): Make it here.
	(QFontMetricsPrivate::font): Added.
	(QFontMetricsPrivate::setFont): Added. Dumps the renderer if the font is different.
        (QFontMetrics::QFontMetrics): Added empty constructor.
        (QFontMetrics::setFont): Added.

        * kwq/KWQKURL.mm: (KURL::parse): Avoid function call overhead calling strncasecmp and strncmp.
	Also made the check for localhost case insensitive.

        * kwq/KWQString.h: Remove _isUnicodeInternal and _isAsciiInternal, since they are trivially
	computed, and it saves time to not have that extra field to manipulate. Removed private
	data() function since it's the same as *dataHandle and not really more clear. Made ascii()
	and unicode() simpler and inline. Also made latin1() and getCFString() inline. Renamed
	QStringData to KWQStringData.
        * kwq/KWQString.mm:
        (QStringData::QStringData): Remove initializers for the xxxInternal.
        (QStringData::initialize): Removed some unnecessary if statements, and made a slight improvement
	in the case of a 0-length string that comes with a pointer for Unicode (can't do it in the
        char * case because it's a feature that's used).
        (QString::makeSharedNull): No need to set _isUnicodeInternal.
        (QStringData::~QStringData): Use the new functions instead of the old bits.
        (QStringData::increaseAsciiSize): Grow faster when we get to larger sizes where the "good size"
	call doesn't have as much of an effect. Simplified by removing unneeded code.
        (QStringData::increaseUnicodeSize): Ditto.
        (QStringData::makeAscii): Update for removal of _isAsciiInternal.
        (QStringData::makeUnicode): Update for removal of _isUnicodeInternal.
        (QString::detachIfInternal): Add this new inline to speed things up for the common case where
	there's no detaching needed.
        (QString::at): Simplify, there were excess if branches here.
        (QString::toDouble): Use kjs_strtod and don't copy the string using QCString for additional speed.
        (QString::lower): Don't detach if the string is already all lowercase. Added a FIXME about the
	code that assumes all "ASCII" bytes are truly ASCII. This code blurs the distinction between Latin-1
	and ASCII in a way that will not work right for Latin-1 characters in an 8-byte character QString.
        (QString::detachInternal): Update for removal of _isUnicodeInternal.
        (QString::detach): Removed a special case for shared_null that was dead code since shared_null has
	the _isUnicodeValid flag set.
        (operator==): Rewrote the comparison with char * to avoid the costly call to strlen.

        * Makefile.am: Updated the rules here so the force clean timestamp works right.
        * force-clean-timestamp: Touched this since the header dependencies don't seem right
	for the DOMString constructor change, at least.
	* WebCore-tests.exp: Exported a symbol now needed by tests since QString does more inlining.
	* WebCore-combined.exp: Re-generated.

WebBrowser:

        Reviewed by Maciej.

        * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5e9ad452
2002-12-14 Darin Adler <darin@apple.com>
Reviewed by Maciej.
* JavaScriptCore.pbproj/project.pbxproj: Make dtoa.h visible as an SPI so I can
use it inside QString.
2002-12-14 Maciej Stachowiak <mjs@apple.com>
Reviewed by Ken.
......
2002-12-14 Darin Adler <darin@apple.com>
Reviewed by Maciej.
* JavaScriptCore.pbproj/project.pbxproj: Make dtoa.h visible as an SPI so I can
use it inside QString.
2002-12-14 Maciej Stachowiak <mjs@apple.com>
Reviewed by Ken.
......
......@@ -473,6 +473,9 @@
fileRef = 651F6413039D5B5F0078395C;
isa = PBXBuildFile;
settings = {
ATTRIBUTES = (
Private,
);
};
};
65417200039E01BA0058BFEB = {
......
2002-12-14 Darin Adler <darin@apple.com>
Reviewed by Maciej and Dave.
- optimizations that improve speed; total is 13.8% on cached cvs-base on my machine
* khtml/css/css_valueimpl.h: Add isKonqBody() and genericFamilyType() to find out if
a font is a standard one. This is much faster than doing string comparisons all the time.
* khtml/css/css_valueimpl.cpp: (FontFamilyValueImpl::FontFamilyValueImpl):
Check the font names against the standard ones on time when the FontFamilyValueImpl
object is constructed rather than every time the stuff is matched.
* khtml/css/cssparser.h: Add pseudoType() and extractPseudoType() to CSSSelector so we
don't have to do string compares all the time.
* khtml/css/cssparser.cpp:
(StyleBaseImpl::parseValue): Use QConstString in a way that's effective (with an
object that has a long enough lifetime), or don't use it at all.
(StyleBaseImpl::parseContent): Ditto.
(StyleBaseImpl::preprocess): Preprocess into a buffer, usually on the stack, rather than
using QString += QChar over and over again.
(CSSSelector::extractPseudoType): Convert the value string into a type, and get rid of it.
Saves memory because the string goes away. And doing it once is much faster than string
comparing each time.
* khtml/css/cssstyleselector.cpp:
(cleanPath): Restructure to save one find() in the common case.
(checkPseudoState): Restructure to avoid some DOMString creation/destruction in the case
where the tag is not an <A>. Also use QConstString correctly.
(CSSStyleSelector::checkOneSelector): Use the new pseudoType() instead of string compares.
(CSSStyleSelector::applyRule): Use isKonqBody() and genericFamilyType() instead of string
comparisons.
* khtml/dom/dom_string.h: Make the destructor non-virtual. This was a big win, and a mistake
the way it was before. Also make the DOMString constructor with no parameters inline.
* khtml/dom/dom_string.cpp:
(DOMString::string): Don't use QConstString here, since it does no good.
(DOM::operator==): Rewrite to do things faster and avoid calling strlen.
* khtml/html/html_objectimpl.h: Don't use QConstString in places where it does harm and no good.
* khtml/html/html_objectimpl.cpp: (HTMLEmbedElementImpl::parseAttribute): Use QConstString properly.
* khtml/html/htmltokenizer.cpp:
(tagMatch): Added.
(HTMLTokenizer::parseSpecial): Change tokenizing so it doesn't construct temporary strings (with
QConstString) just to compare small substrings.
* khtml/khtml_part.cpp: (KHTMLPart::write): Don't use a decoder object when source is all ASCII.
* kwq/KWQColor.mm:
(hex2int): Don't bother with uppercase hex since we always lowercase anyway.
(QColor::setNamedColor): Use a new gperf-based table instead of an NSDictionary to look up colors.
* kwq/KWQColorData.c: Added this autogenerated file.
* kwq/KWQColorData.gperf: Added. Source file with list of colors and color values.
* kwq/Makefile.am: Build KWQColorData.c from KWQColorData.gperf.
* WebCore.pbproj/project.pbxproj: Added KWQColorData.gperf.
* khtml/misc/helper.cpp: (khtml::setNamedColor): Don't call setNamedColor again with the lowercased
color name, since our QColor::setNamedColor already has to lowercase the name (because it has to check
all names before checking any hex values).
* khtml/rendering/font.h: Don't initialize the QFontMetrics since in every case we end up changing
the font later anyway. Also remove unused field.
* khtml/rendering/font.cpp: (Font::update): Use the new QFontMetrics::setFont for speed.
* khtml/rendering/render_object.cpp: (RenderObject::enclosingLayer): Change it so it doesn't get
the layer twice. This function showed up on the sample so we know it's hot.
* khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::containsOnlyWhitespace): Did a faster implementation
that doesn't call QChar::direction() except for non-ASCII characters.
* kwq/KWQFontMetrics.h: Add empty constructor for use in font.cpp. Add accessor and setter for the
font too. Made baselineOffset() inline since it's trivial.
* kwq/KWQFontMetrics.mm:
(QFontMetricsPrivate::QFontMetricsPrivate): Don't make the renderer until we use it.
(QFontMetricsPrivate::getRenderer): Make it here.
(QFontMetricsPrivate::font): Added.
(QFontMetricsPrivate::setFont): Added. Dumps the renderer if the font is different.
(QFontMetrics::QFontMetrics): Added empty constructor.
(QFontMetrics::setFont): Added.
* kwq/KWQKURL.mm: (KURL::parse): Avoid function call overhead calling strncasecmp and strncmp.
Also made the check for localhost case insensitive.
* kwq/KWQString.h: Remove _isUnicodeInternal and _isAsciiInternal, since they are trivially
computed, and it saves time to not have that extra field to manipulate. Removed private
data() function since it's the same as *dataHandle and not really more clear. Made ascii()
and unicode() simpler and inline. Also made latin1() and getCFString() inline. Renamed
QStringData to KWQStringData.
* kwq/KWQString.mm:
(QStringData::QStringData): Remove initializers for the xxxInternal.
(QStringData::initialize): Removed some unnecessary if statements, and made a slight improvement
in the case of a 0-length string that comes with a pointer for Unicode (can't do it in the
char * case because it's a feature that's used).
(QString::makeSharedNull): No need to set _isUnicodeInternal.
(QStringData::~QStringData): Use the new functions instead of the old bits.
(QStringData::increaseAsciiSize): Grow faster when we get to larger sizes where the "good size"
call doesn't have as much of an effect. Simplified by removing unneeded code.
(QStringData::increaseUnicodeSize): Ditto.
(QStringData::makeAscii): Update for removal of _isAsciiInternal.
(QStringData::makeUnicode): Update for removal of _isUnicodeInternal.
(QString::detachIfInternal): Add this new inline to speed things up for the common case where
there's no detaching needed.
(QString::at): Simplify, there were excess if branches here.
(QString::toDouble): Use kjs_strtod and don't copy the string using QCString for additional speed.
(QString::lower): Don't detach if the string is already all lowercase. Added a FIXME about the
code that assumes all "ASCII" bytes are truly ASCII. This code blurs the distinction between Latin-1
and ASCII in a way that will not work right for Latin-1 characters in an 8-byte character QString.
(QString::detachInternal): Update for removal of _isUnicodeInternal.
(QString::detach): Removed a special case for shared_null that was dead code since shared_null has
the _isUnicodeValid flag set.
(operator==): Rewrote the comparison with char * to avoid the costly call to strlen.
* Makefile.am: Updated the rules here so the force clean timestamp works right.
* force-clean-timestamp: Touched this since the header dependencies don't seem right
for the DOMString constructor change, at least.
* WebCore-tests.exp: Exported a symbol now needed by tests since QString does more inlining.
* WebCore-combined.exp: Re-generated.
2002-12-14 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
......
2002-12-14 Darin Adler <darin@apple.com>
Reviewed by Maciej and Dave.
- optimizations that improve speed; total is 13.8% on cached cvs-base on my machine
* khtml/css/css_valueimpl.h: Add isKonqBody() and genericFamilyType() to find out if
a font is a standard one. This is much faster than doing string comparisons all the time.
* khtml/css/css_valueimpl.cpp: (FontFamilyValueImpl::FontFamilyValueImpl):
Check the font names against the standard ones on time when the FontFamilyValueImpl
object is constructed rather than every time the stuff is matched.
* khtml/css/cssparser.h: Add pseudoType() and extractPseudoType() to CSSSelector so we
don't have to do string compares all the time.
* khtml/css/cssparser.cpp:
(StyleBaseImpl::parseValue): Use QConstString in a way that's effective (with an
object that has a long enough lifetime), or don't use it at all.
(StyleBaseImpl::parseContent): Ditto.
(StyleBaseImpl::preprocess): Preprocess into a buffer, usually on the stack, rather than
using QString += QChar over and over again.
(CSSSelector::extractPseudoType): Convert the value string into a type, and get rid of it.
Saves memory because the string goes away. And doing it once is much faster than string
comparing each time.
* khtml/css/cssstyleselector.cpp:
(cleanPath): Restructure to save one find() in the common case.
(checkPseudoState): Restructure to avoid some DOMString creation/destruction in the case
where the tag is not an <A>. Also use QConstString correctly.
(CSSStyleSelector::checkOneSelector): Use the new pseudoType() instead of string compares.
(CSSStyleSelector::applyRule): Use isKonqBody() and genericFamilyType() instead of string
comparisons.
* khtml/dom/dom_string.h: Make the destructor non-virtual. This was a big win, and a mistake
the way it was before. Also make the DOMString constructor with no parameters inline.
* khtml/dom/dom_string.cpp:
(DOMString::string): Don't use QConstString here, since it does no good.
(DOM::operator==): Rewrite to do things faster and avoid calling strlen.
* khtml/html/html_objectimpl.h: Don't use QConstString in places where it does harm and no good.
* khtml/html/html_objectimpl.cpp: (HTMLEmbedElementImpl::parseAttribute): Use QConstString properly.
* khtml/html/htmltokenizer.cpp:
(tagMatch): Added.
(HTMLTokenizer::parseSpecial): Change tokenizing so it doesn't construct temporary strings (with
QConstString) just to compare small substrings.
* khtml/khtml_part.cpp: (KHTMLPart::write): Don't use a decoder object when source is all ASCII.
* kwq/KWQColor.mm:
(hex2int): Don't bother with uppercase hex since we always lowercase anyway.
(QColor::setNamedColor): Use a new gperf-based table instead of an NSDictionary to look up colors.
* kwq/KWQColorData.c: Added this autogenerated file.
* kwq/KWQColorData.gperf: Added. Source file with list of colors and color values.
* kwq/Makefile.am: Build KWQColorData.c from KWQColorData.gperf.
* WebCore.pbproj/project.pbxproj: Added KWQColorData.gperf.
* khtml/misc/helper.cpp: (khtml::setNamedColor): Don't call setNamedColor again with the lowercased
color name, since our QColor::setNamedColor already has to lowercase the name (because it has to check
all names before checking any hex values).
* khtml/rendering/font.h: Don't initialize the QFontMetrics since in every case we end up changing
the font later anyway. Also remove unused field.
* khtml/rendering/font.cpp: (Font::update): Use the new QFontMetrics::setFont for speed.
* khtml/rendering/render_object.cpp: (RenderObject::enclosingLayer): Change it so it doesn't get
the layer twice. This function showed up on the sample so we know it's hot.
* khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::containsOnlyWhitespace): Did a faster implementation
that doesn't call QChar::direction() except for non-ASCII characters.
* kwq/KWQFontMetrics.h: Add empty constructor for use in font.cpp. Add accessor and setter for the
font too. Made baselineOffset() inline since it's trivial.
* kwq/KWQFontMetrics.mm:
(QFontMetricsPrivate::QFontMetricsPrivate): Don't make the renderer until we use it.
(QFontMetricsPrivate::getRenderer): Make it here.
(QFontMetricsPrivate::font): Added.
(QFontMetricsPrivate::setFont): Added. Dumps the renderer if the font is different.
(QFontMetrics::QFontMetrics): Added empty constructor.
(QFontMetrics::setFont): Added.
* kwq/KWQKURL.mm: (KURL::parse): Avoid function call overhead calling strncasecmp and strncmp.
Also made the check for localhost case insensitive.
* kwq/KWQString.h: Remove _isUnicodeInternal and _isAsciiInternal, since they are trivially
computed, and it saves time to not have that extra field to manipulate. Removed private
data() function since it's the same as *dataHandle and not really more clear. Made ascii()
and unicode() simpler and inline. Also made latin1() and getCFString() inline. Renamed
QStringData to KWQStringData.
* kwq/KWQString.mm:
(QStringData::QStringData): Remove initializers for the xxxInternal.
(QStringData::initialize): Removed some unnecessary if statements, and made a slight improvement
in the case of a 0-length string that comes with a pointer for Unicode (can't do it in the
char * case because it's a feature that's used).
(QString::makeSharedNull): No need to set _isUnicodeInternal.
(QStringData::~QStringData): Use the new functions instead of the old bits.
(QStringData::increaseAsciiSize): Grow faster when we get to larger sizes where the "good size"
call doesn't have as much of an effect. Simplified by removing unneeded code.
(QStringData::increaseUnicodeSize): Ditto.
(QStringData::makeAscii): Update for removal of _isAsciiInternal.
(QStringData::makeUnicode): Update for removal of _isUnicodeInternal.
(QString::detachIfInternal): Add this new inline to speed things up for the common case where
there's no detaching needed.
(QString::at): Simplify, there were excess if branches here.
(QString::toDouble): Use kjs_strtod and don't copy the string using QCString for additional speed.
(QString::lower): Don't detach if the string is already all lowercase. Added a FIXME about the
code that assumes all "ASCII" bytes are truly ASCII. This code blurs the distinction between Latin-1
and ASCII in a way that will not work right for Latin-1 characters in an 8-byte character QString.
(QString::detachInternal): Update for removal of _isUnicodeInternal.
(QString::detach): Removed a special case for shared_null that was dead code since shared_null has
the _isUnicodeValid flag set.
(operator==): Rewrote the comparison with char * to avoid the costly call to strlen.
* Makefile.am: Updated the rules here so the force clean timestamp works right.
* force-clean-timestamp: Touched this since the header dependencies don't seem right
for the DOMString constructor change, at least.
* WebCore-tests.exp: Exported a symbol now needed by tests since QString does more inlining.
* WebCore-combined.exp: Re-generated.
2002-12-14 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
......
......@@ -8,10 +8,10 @@ clean-am:
rm -rf $(SYMROOTS)/WebCore.framework
rm -rf $(SYMROOTS)/Safari.app/Frameworks/WebCore.framework
WebCore-combined.exp: WebCore.exp WebCore-tests.exp
WebCore-combined.exp: WebCore.exp WebCore-tests.exp previous-clean-timestamp
cat $^ > $@
config.h: ../config.h
config.h: ../config.h previous-clean-timestamp
grep -v NO_LICENSE ../config.h > new-config.h
if cmp -s config.h new-config.h; then \
rm -f new-config.h; \
......
......@@ -62,9 +62,10 @@ __ZN12KWQArrayImplC1ERKS_
__ZN12KWQArrayImplC1Emm
__ZN12KWQArrayImplD1Ev
__ZN12KWQArrayImplaSERKS_
__ZN13KWQStringData9makeAsciiEv
__ZN13KWQVectorImpl5clearEb
__ZN13KWQVectorImpl6removeEjb
__ZN13KWQVectorImpl6insertEjPvb
__ZN13KWQVectorImpl6removeEjb
__ZN13KWQVectorImpl6resizeEjb
__ZN13KWQVectorImplC1EPFvPvE
__ZN13KWQVectorImplC1ERKS_
......@@ -252,6 +253,7 @@ __ZNK5QTime4msecEv
__ZNK6QPoint15manhattanLengthEv
__ZNK7QRegExp5matchERK7QStringiPib
__ZNK7QRegExp7patternEv
__ZNK7QString10startsWithERKS_
__ZNK7QString15stripWhiteSpaceEv
__ZNK7QString18simplifyWhiteSpaceEv
__ZNK7QString3argERKS_i
......@@ -274,6 +276,7 @@ __ZNK7QString6isNullEv
__ZNK7QString6latin1Ev
__ZNK7QString6toLongEPbi
__ZNK7QString6toUIntEPbi
__ZNK7QString7compareERKS_
__ZNK7QString7findRevEPKci
__ZNK7QString7findRevEci
__ZNK7QString8containsEPKcb
......@@ -307,5 +310,3 @@ __ZplPKcRK7QString
__ZplRK5QSizeS1_
__ZplRK6QPointS1_
__ZplcRK7QString
__ZNK7QString7compareERKS_
__ZNK7QString10startsWithERKS_
......@@ -40,9 +40,10 @@ __ZN12KWQArrayImplC1ERKS_
__ZN12KWQArrayImplC1Emm
__ZN12KWQArrayImplD1Ev
__ZN12KWQArrayImplaSERKS_
__ZN13KWQStringData9makeAsciiEv
__ZN13KWQVectorImpl5clearEb
__ZN13KWQVectorImpl6removeEjb
__ZN13KWQVectorImpl6insertEjPvb
__ZN13KWQVectorImpl6removeEjb
__ZN13KWQVectorImpl6resizeEjb
__ZN13KWQVectorImplC1EPFvPvE
__ZN13KWQVectorImplC1ERKS_
......@@ -230,6 +231,7 @@ __ZNK5QTime4msecEv
__ZNK6QPoint15manhattanLengthEv
__ZNK7QRegExp5matchERK7QStringiPib
__ZNK7QRegExp7patternEv
__ZNK7QString10startsWithERKS_
__ZNK7QString15stripWhiteSpaceEv
__ZNK7QString18simplifyWhiteSpaceEv
__ZNK7QString3argERKS_i
......@@ -252,6 +254,7 @@ __ZNK7QString6isNullEv
__ZNK7QString6latin1Ev
__ZNK7QString6toLongEPbi
__ZNK7QString6toUIntEPbi
__ZNK7QString7compareERKS_
__ZNK7QString7findRevEPKci
__ZNK7QString7findRevEci
__ZNK7QString8containsEPKcb
......@@ -285,5 +288,3 @@ __ZplPKcRK7QString
__ZplRK5QSizeS1_
__ZplRK6QPointS1_
__ZplcRK7QString
__ZNK7QString7compareERKS_
__ZNK7QString10startsWithERKS_
......@@ -1050,6 +1050,12 @@
settings = {
};
};
93ECDB7E03ABE65B008635CE = {
fileEncoding = 4;
isa = PBXFileReference;
path = KWQColorData.gperf;
refType = 4;
};
//930
//931
//932
......@@ -7555,6 +7561,7 @@
F58784CF02DE375901EA4122,
F587868102DE3B8601EA4122,
F58784D002DE375901EA4122,
93ECDB7E03ABE65B008635CE,
F587868202DE3B8601EA4122,
F58784D202DE375901EA4122,
F587868302DE3B8601EA4122,
......
loader.h added member to CacheObject 10/07
DOMString constructor 12/13
......@@ -34,6 +34,7 @@
#include "misc/loader.h"
#include "rendering/font.h"
#include "rendering/render_style.h"
#include <kdebug.h>
......@@ -44,6 +45,8 @@
// Hack for debugging purposes
extern DOM::DOMString getPropertyName(unsigned short id);
using khtml::FontDef;
using namespace DOM;
CSSStyleDeclarationImpl::CSSStyleDeclarationImpl(CSSRuleImpl *parent)
......@@ -757,4 +760,44 @@ FontFamilyValueImpl::FontFamilyValueImpl( const QString &string)
}
}
#endif // !APPLE_CHANGES
_genericFamilyType = FontDef::eNone;
_isKonqBody = false;
if (parsedFontName.isEmpty()) {
return;
}
// Check font names here instead of every time through the CSSStyleSelector.
switch (parsedFontName[0]) {
case 'c':
if (parsedFontName == "cursive") {
_genericFamilyType = FontDef::eCursive;
}
break;
case 'f':
if (parsedFontName == "fantasy") {
_genericFamilyType = FontDef::eFantasy;
}
break;
case 'k':
if (parsedFontName == "konq_default") {
_genericFamilyType = FontDef::eStandard;
} else if (parsedFontName == "konq_body") {
_isKonqBody = true;
}
break;
case 'm':
if (parsedFontName == "monospace") {
_genericFamilyType = FontDef::eMonospace;
}
break;
case 's':
if (parsedFontName == "serif") {
_genericFamilyType = FontDef::eSerif;
} else if (parsedFontName == "sans-serif") {
_genericFamilyType = FontDef::eSansSerif;
}
break;
}
}
......@@ -291,8 +291,13 @@ class FontFamilyValueImpl : public CSSPrimitiveValueImpl
public:
FontFamilyValueImpl( const QString &string);
const QString &fontName() const { return parsedFontName; }
int genericFamilyType() const { return _genericFamilyType; }
bool isKonqBody() const { return _isKonqBody; }
protected:
QString parsedFontName;
private:
int _genericFamilyType;
bool _isKonqBody;
};
// ------------------------------------------------------------------------------
......
......@@ -1166,8 +1166,7 @@ bool StyleBaseImpl::parseValue( const QChar *curP, const QChar *endP, int propId
{
if (curP==endP) {return 0; /* e.g.: width="" */}
QString value(curP, endP - curP);
value = value.lower().stripWhiteSpace();
QString value = QConstString(curP, endP - curP).string().lower().stripWhiteSpace();
#ifdef CSS_DEBUG
kdDebug( 6080 ) << "id [" << getPropertyName(propId).string() << "] parseValue [" << value << "]" << endl;
#endif
......@@ -1233,7 +1232,7 @@ bool StyleBaseImpl::parseValue( const QChar *curP, const QChar *endP, int propId
parsedValue = new CSSPrimitiveValueImpl( cssval->id );
else {
// only shape in CSS2 is rect( top right bottom left )
QString str = QConstString( const_cast<QChar*>( curP ), endP - curP ).string();
QString str(curP, endP - curP);
// the CSS specs are not really clear if there should be commas in here or not. We accept both spaces and commas.
QChar *uc = (QChar *)str.unicode();
int len = str.length();
......@@ -2376,7 +2375,8 @@ CSSValueImpl* StyleBaseImpl::parseContent(const QChar *curP, const QChar *endP)
break;
nextP++;
}
QString str = QConstString(curP, nextP-curP).string();
QConstString cstr(curP, nextP-curP);
QString str = cstr.string();
CSSValueImpl* parsedValue=0;
if (str.startsWith("url("))
{
......@@ -2866,7 +2866,13 @@ StyleBaseImpl::parseRule(const QChar *&curP, const QChar *endP)
const QString StyleBaseImpl::preprocess(const QString &str, bool justOneRule)
{
// ### use DOMString here to avoid coversions
QString processed;
char fixedSizeBuffer[8192];
uint size = str.length() * 2 * sizeof(QChar);
char *buffer = fixedSizeBuffer;
if (size > sizeof(fixedSizeBuffer))
buffer = new char [size];
QChar *p = (QChar *)buffer;
bool sq = false; // Within single quote
bool dq = false; // Within double quote
......@@ -2893,33 +2899,33 @@ const QString StyleBaseImpl::preprocess(const QString &str, bool justOneRule)
// QConstString(ch, kMin(last-ch, 10)).string().latin1(), sq, dq, bracket, comment, firstChar, space, curlyBracket, skipgarbage);
if( !comment && !sq && *ch == '"' ) {
dq = !dq;
processed += *ch;
*p++ = *ch;
space = skipgarbage = false;
} else if ( !comment && !dq && *ch == '\'') {
skipgarbage = sq;
sq = !sq;
processed += *ch;
*p++ = *ch;
space = false;
} else if ( !comment && !dq && !sq && *ch == '(') {
bracket = true;
processed += *ch;
*p++ = *ch;
space = true; // Explictly true
skipgarbage = false;
} else if ( !comment && !dq && !sq && *ch == ')') {
bracket = false;
processed += *ch;
processed += QChar(' '); // Adding a space after this token
*p++ = *ch;
*p++ = QChar(' '); // Adding a space after this token
space = true;
skipgarbage = false;
} else if ( !comment && !dq && !sq && *ch == '{') {
++curlyBracket;
processed += *ch;
*p++ = *ch;
space = true; // Explictly true
skipgarbage = true;
} else if ( !comment && !dq && !sq && *ch == '}') {
--curlyBracket;
processed += *ch;
processed += QChar(' '); // Adding a space after this token
*p++ = *ch;
*p++ = QChar(' '); // Adding a space after this token
space = true;
skipgarbage = true;
} else if ( !comment && skipgarbage && !dq && !sq && (*ch == '-') && ((ch+2) < last) /* SGML Comment */
......@@ -2942,11 +2948,11 @@ const QString StyleBaseImpl::preprocess(const QString &str, bool justOneRule)
if ( *ch == '*' ) {
comment = true;
} else {
processed += '/';
*p++ = '/';
if (curlyBracket > 0) {
processed += ch->lower();
*p++ = ch->lower();
} else {
processed += *ch;
*p++ = *ch;
}
space = ch->isSpace();
}
......@@ -2954,8 +2960,8 @@ const QString StyleBaseImpl::preprocess(const QString &str, bool justOneRule)
} else if ( *ch == '/' ) {
firstChar = true; // Slash added only if next is not '*'
} else if ( *ch == ',' || *ch == ';') {
processed += *ch;
processed += QChar(' '); // Adding a space after these tokens
*p++ = *ch;
*p++ = QChar(' '); // Adding a space after these tokens
space = true;
skipgarbage = true;
} else {
......@@ -2970,6 +2976,11 @@ const QString StyleBaseImpl::preprocess(const QString &str, bool justOneRule)
end:
++ch;
}
{
QString processed((QChar *)buffer, p - (QChar *)buffer);
if (buffer != fixedSizeBuffer)
delete [] buffer;
#ifdef CSS_DEBUG
kdDebug(6080) << "---After ---" << endl;
......@@ -2980,24 +2991,25 @@ const QString StyleBaseImpl::preprocess(const QString &str, bool justOneRule)
kdDebug(6080) << "------------" << endl;
#endif
return processed;
return processed;
}
addChar:
if ( !sq && !dq && !bracket ) {
if (!(space && ch->isSpace())) { // Don't add more than one space
if (ch->isSpace()) {
processed += QChar(' '); // Normalize whitespace
*p++ = QChar(' '); // Normalize whitespace
} else {
if (curlyBracket > 0 || justOneRule) {
processed += ch->lower();
*p++ = ch->lower();
} else {
processed += *ch;
*p++ = *ch;
}
}
}
space = ch->isSpace();
} else {
processed += *ch; // We're within quotes or brackets, leave untouched
*p++ = *ch; // We're within quotes or brackets, leave untouched
}
goto end;
}
......@@ -3058,6 +3070,54 @@ unsigned int CSSSelector::specificity()
return s & 0xffffff;
}
void CSSSelector::extractPseudoType() const
{
_pseudoType = PseudoOther;
if (!value.isEmpty()) {
switch (value[0]) {
case 'a':
if (value == "active")
_pseudoType = PseudoActive;
else if (value == "after")
_pseudoType = PseudoAfter;
break;
case 'b':
if (value == "before")
_pseudoType = PseudoBefore;
break;
case 'e':
if (value == "empty")
_pseudoType = PseudoEmpty;
break;
case 'f':
if (value == "first-child")
_pseudoType = PseudoFirstChild;
else if (value == "first-letter")