[WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
[WebKit-https.git] / Source / WebCore / ChangeLog-2006-05-10
1 2006-05-10  Matt Gough  <matt@softchaos.com>
2
3         Reviewed, tweaked, and landed by Darin.
4
5         Optimization of [DOMNode _nodeWith:] to look up the obj-c wrapperClass
6         for each HTMLElement using a HashMap instead of by repeated calls to
7         htmlElt->hasLocalName(someTag). 
8
9         * bindings/objc/DOM.mm:
10         (addElementClass): Added.
11         (createHTMLElementClassMap):
12         (elementClass):
13         (+[DOMNode _nodeWith:]): Added code to call elementClass.
14
15 2006-05-09  Mitz Pettel  <opendarwin.org@mitzpettel.com>
16
17         Reviewed by Hyatt.
18
19         - fix http://bugs.webkit.org/show_bug.cgi?id=8760
20           crash (hang?) on subtlegradient.com article page
21
22         * manual-tests/first-line-style-crash.html: Added.
23
24         * css/cssstyleselector.cpp:
25         (WebCore::CSSStyleSelector::createStyleForElement): Changed to not return the
26         shared styleNotYetAvailable if allowSharing is off.
27         * rendering/RenderObject.cpp:
28         (WebCore::RenderObject::getPseudoStyle): In the FIRST_LINE_INHERITED case,
29         set the styleType on the style returned from createStyleForElement().
30         * rendering/render_style.h:
31         (WebCore::RenderStyle::setStyleType): Added. Called from RenderObject::getPseudoStyle().
32
33 2006-05-09  Mitz Pettel  <opendarwin.org@mitzpettel.com>
34
35         Reviewed by Hyatt.
36
37         - fix http://bugs.webkit.org/show_bug.cgi?id=8789
38           RenderStyle::getPseudoStyle() always returns 0
39
40         No test possible (no functionality change).
41
42         * dom/Node.cpp:
43         (WebCore::Node::diff): When checking if :before or :after has changed,
44         return NoInherit unless both pseudoStyles are known and equal.
45         * rendering/render_style.cpp:
46         (WebCore::RenderStyle::getPseudoStyle): Fixed to match the requested
47         type against the pseudoStyle's styleType instead of our own.
48
49 2006-05-09  Darin Adler  <darin@apple.com>
50
51         - another attempt to fix the Windows build
52
53         * bindings/js/kjs_window.cpp: (KJS::isSeparator): Take a UChar, not a KJS::UChar.
54         * bridge/win/FrameWin.cpp:
55         (WebCore::FrameWin::runJavaScriptAlert): Use UChar instead of QChar.
56         (WebCore::FrameWin::runJavaScriptConfirm): Ditto.
57         * editing/TextIterator.h: Include DeprecatedString.h.
58
59 2006-05-09  Darin Adler  <darin@apple.com>
60
61         Reviewed by Hyatt.
62
63         - fix http://bugs.webkit.org/show_bug.cgi?id=8781
64           REGRESSION: image maps with "poly" areas, including one at lisp.geek.nz, don't work
65
66         * html/html_imageimpl.cpp: (WebCore::HTMLAreaElement::getRegion): Remove extra Path
67         definition that was shadowing the real one.
68
69 2006-05-09  Darin Adler  <darin@apple.com>
70
71         - fix build
72
73         * rendering/render_style.cpp: (WebCore::RenderStyle::getPseudoStyle):
74         Fix a typo.
75
76         - attempt to fix Windows build
77
78         * css/maketokenizer: Use UChar instead of unsigned short.
79         * platform/win/FontWin.cpp:
80         (WebCore::getFontData): Removed cast to QChar.
81         (WebCore::hackishExtentForString): Use UChar.
82         (WebCore::Font::floatWidth): Use UChar.
83         (WebCore::Font::drawText): Use UChar.
84         (WebCore::Font::drawHighlightForText): Use UChar.
85         (WebCore::Font::selectionRectForText): Use UChar.
86         (WebCore::Font::checkSelectionPoint): Use UChar.
87         * platform/win/KeyEventWin.cpp:
88         (WebCore::singleCharacterString): Added.
89         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Use above function.
90         * platform/win/TemporaryLinkStubs.cpp:
91         (WebCore::findNextSentenceFromIndex): Use UChar.
92         (WebCore::findSentenceBoundary): Use UChar.
93         (WebCore::findNextWordFromIndex): Use UChar.
94         (WebCore::findWordBoundary): Use UChar.
95         * platform/win/TransferJobWin.cpp:
96         (WebCore::TransferJob::start): Use a different String constructor.
97         * rendering/RenderTable.h: Added an include of DeprecatedArray.h.
98         * rendering/RenderText.cpp: Added an include of DeprecatedString.h.
99         * rendering/render_list.h: Ditto.
100
101 2006-05-09  Darin Adler  <darin@apple.com>
102
103         Rubber stamped by Hyatt.
104
105         - http://bugs.webkit.org/show_bug.cgi?id=8782
106           use ICU and UChar more, QChar less
107
108         - fix http://bugs.webkit.org/show_bug.cgi?id=6310
109           text-transform: uppercase/lowercase don't handle cases one character becomes two
110
111         Test: fast/css/case-transform.html
112
113         By using ICU more, this fixes some bugs in a few places.
114
115         * bindings/js/JSXMLSerializer.cpp:
116         * css/css_valueimpl.h:
117         * kwq/KWQTextStream.cpp:
118         * loader/CachedObject.h:
119         * platform/Color.cpp:
120         Add includes of DeprecatedString.h as needed, now that StringImpl.h no longer
121         includes it.
122
123         * bindings/js/kjs_css.cpp: (KJS::cssPropertyName):
124         Eliminate use of QChar::latin1() in a case where it's not helpful.
125
126         * bindings/js/kjs_proxy.cpp: (WebCore::KJSProxy::evaluate):
127         Use characters() function instead of the old unicode() function.
128
129         * bindings/js/kjs_window.cpp: (KJS::isSeparator):
130         Use UChar instead of QChar.
131
132         * bindings/objc/DOMInternal.mm:
133         (StringImpl::operator NSString*): Remove typecast that's no longer needed.
134         (String::String): Ditto. Also use Vector for local buffer to make code read simpler.
135
136         * bridge/mac/FrameMac.mm:
137         (WebCore::selectorForKeyEvent): Remove call to unicode() function, no longer needed.
138         (WebCore::FrameMac::setTitle): Remove QChar cast, no longer needed.
139         (WebCore::FrameMac::setStatusBarText): Ditto.
140         (WebCore::FrameMac::advanceToNextMisspelling): Use UChar instead of QChar.
141         (WebCore::FrameMac::runJavaScriptAlert): Remove QChar cast, no longer needed.
142         (WebCore::FrameMac::runJavaScriptConfirm): Ditto.
143         (WebCore::FrameMac::runJavaScriptPrompt): Ditto.
144         (WebCore::FrameMac::attributedString): Replaces calls of QChar::direction() with
145         calls to u_charDirection and use ICU constants instead of QChar ones.
146         (WebCore::FrameMac::markMisspellings): Remove QChar cast, no longer needed. Added a
147         QChar cast so we can call isSpace -- slated to be removed later.
148         (WebCore::FrameMac::shouldClose): Remove QChar cast, no longer needed.
149
150         * bridge/mac/WebCoreFrameBridge.mm:
151         (-[WebCoreFrameBridge selectedString]): Remove QChar cast, no longer needed.
152         (-[WebCoreFrameBridge stringForRange:]): Ditto.
153
154         * css/CSSGrammar.y: Update for field name change from string to characters.
155         Use UChar instead of unsigned short. 
156
157         * css/css_valueimpl.cpp:
158         (WebCore::propertyID): Use UChar instead of unsigned short and get rid of call to
159         unicode() function, no longer needed.
160         (WebCore::quoteStringIfNeeded): Use strings when building up a resulting string,
161         instead of depending on the feature where you can append characters to a string.
162
163         * css/csshelper.cpp: (WebCore::parseURL): Remove calls to unicode() function and
164         rewrite to obviate the need to call lower() just to check for a few constant
165         character values. Also remove a now-unneeded type cast.
166
167         * css/cssparser.h: Changed ParseString field to use UChar and to be named characters
168         instead of string. Changed many other fields to be UChar instead of unsigned short.
169         (WebCore::domString): Update for that.
170         (WebCore::atomicString): Ditto.
171         * css/cssparser.cpp:
172         (WebCore::ParseString::lower): Use u_tolower instead of QChar::lower(). Also change
173         name to characters from string.
174         (WebCore::CSSParser::setupParser): Use UChar instead of unsigned short.
175         (WebCore::CSSParser::lex): Ditto. Also update for characters name change.
176         (WebCore::CSSParser::text): Use UChar instead of unsigned short. Also tweak some
177         of the code a little bit to handle a couple of overflow cases better and reduce
178         type casting.
179         (WebCore::deprecatedString): Moved here so we don't have to include DeprecatedString.h
180         in the header file.
181
182         * css/cssstyleselector.cpp: (WebCore::checkPseudoState): Added a type cast since this
183         code now bridges the world between modern code and QChar/DeprecatedString.
184
185         * dom/CharacterData.cpp: (WebCore::CharacterData::CharacterData): Changed QChar to UChar.
186
187         * dom/Document.h:
188         * dom/Document.cpp:
189         (WebCore::Document::isValidName): Updated for name change from unicode to characters.
190         (WebCore::Document::parseQualifiedName): Ditto.
191         (WebCore::Document::backslashAsCurrencySymbol): Changed return type to UChar.
192
193         * dom/NamedMappedAttrMap.cpp:
194         (WebCore::isClassWhitespace): Changed parameter to UChar from QChar.
195         (WebCore::NamedMappedAttrMap::parseClassAttribute): Changed from UChar to QChar and
196         from unicode to characters.
197
198         * dom/Position.cpp:
199         (WebCore::Position::leadingWhitespacePosition): Changed from QChar to UChar.
200         (WebCore::Position::trailingWhitespacePosition): Ditto.
201
202         * dom/StyledElement.cpp:
203         (WebCore::isClassWhitespace): Changed from QChar to UChar.
204         (WebCore::StyledElement::addCSSLength): Changed from QChar to UChar, and remove one
205         case where latin1() was used and was not helpful.
206         (WebCore::StyledElement::addCSSColor): Removed unicode() function call, no longer needed.
207
208         * dom/dom2_eventsimpl.cpp: (WebCore::KeyboardEvent::charCode):
209         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::constrainValue):
210         Removed unicode() function call, no longer needed.
211
212         * dom/xml_tokenizer.h: Removed default parameter for xmlDocPtrForString so we don't have
213         to include the DeprecatedString.h header in this file (and since no one uses it).
214
215         * editing/HTMLInterchange.cpp: (convertHTMLTextToInterchangeFormat): Added a couple calls
216         to the unicode() function to bridge the gap from QChar/DeprecatedString back to modern
217         code.
218
219         * editing/InsertTextCommand.cpp: Removed unused function.
220
221         * editing/TextIterator.h: Changed from QChar to UChar.
222         * editing/TextIterator.cpp:
223         (WebCore::TextIterator::TextIterator): Initialize m_lastCharacter since it's now a UChar
224         (which is just a typedef) rather than a QChar (which was a class with a default value of 0).
225         (WebCore::TextIterator::handleTextNode): Updated to use characters() instead of unicode().
226         (WebCore::TextIterator::handleTextBox): Removed unicode() call since it's now a UChar instead
227         of a QChar.
228         (WebCore::TextIterator::emitCharacter): More of the same.
229         (WebCore::SimplifiedBackwardsTextIterator::handleTextNode): Ditto.
230         (WebCore::SimplifiedBackwardsTextIterator::emitCharacter): Ditto.
231         (WebCore::CharacterIterator::string): Ditto.
232         (WebCore::WordAwareIterator::advance): Ditto.
233         (WebCore::WordAwareIterator::length): Ditto.
234         (WebCore::WordAwareIterator::characters): Ditto.
235         (WebCore::CircularSearchBuffer::CircularSearchBuffer): Changed to use UChar
236         instead of QChar, but also to use foldCase() instead of lower(), because
237         we want case folding here, not lowercasing.
238         (WebCore::CircularSearchBuffer::append): Ditto, with u_foldCase.
239         (WebCore::CircularSearchBuffer::isMatch): Ditto.
240         (WebCore::plainText): Added type cast since this bridges the gap from the modern stuff
241         to QChar/DeprecatedString.
242
243         * editing/VisiblePosition.h: Changed from QChar to UChar.
244         * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::characterAfter): Ditto.
245
246         * editing/markup.cpp: (WebCore::escapeTextForMarkup): Changed code that used latin1()
247         for no good reason to use unicode() instead.
248  
249         * html/HTMLTokenizer.h: Changed from QChar to UChar.
250         * html/HTMLTokenizer.cpp: Changed from QChar to UChar, including removing the
251         KHTML_ALLOC_QCHAR_VEC and KHTML_DELETE_QCHAR_VEC macros, which weren't being
252         used consistently anyway.
253         (WebCore::fixUpChar): More of the same.
254         (WebCore::tagMatch): Ditto.
255         (WebCore::HTMLTokenizer::reset): Ditto.
256         (WebCore::HTMLTokenizer::begin): Ditto. Also corrected anomaly where buffer
257         size was not the same as the size value -- this was only true in the initial
258         allocation, so I believe there was no value in it.
259         (WebCore::HTMLTokenizer::parseSpecial): Ditto. Also removed a use of latin1()
260         that was unnnecessary extra work.
261         (WebCore::HTMLTokenizer::scriptHandler): More of the same.
262         (WebCore::HTMLTokenizer::parseComment): Ditto.
263         (WebCore::HTMLTokenizer::parseServer): Ditto.
264         (WebCore::HTMLTokenizer::parseProcessingInstruction): Ditto. Another unnecessary
265         use of latin1() removed.
266         (WebCore::HTMLTokenizer::parseText): Ditto.
267         (WebCore::HTMLTokenizer::parseEntity): Ditto. Changed hex-parsing code to handle
268         uppercase hex a more-efficient way than calling QChar::lower() on each character.
269         Also changed surrogate code logic to fix a couple things -- reject character codes
270         > 0x10FFFF as it should and use U16_LEAD and U16_TRAIL instead of writing our
271         own versions of these.
272         (WebCore::HTMLTokenizer::parseTag): Ditto.
273         (WebCore::HTMLTokenizer::write): Ditto.
274         (WebCore::HTMLTokenizer::end): Ditto.
275         (WebCore::HTMLTokenizer::finish): Ditto.
276         (WebCore::HTMLTokenizer::enlargeBuffer): Ditto.
277         (WebCore::HTMLTokenizer::enlargeScriptBuffer): Ditto.
278         (WebCore::HTMLTokenizer::notifyFinished):
279         (WebCore::decodeNamedEntity): Ditto.
280
281         * html/html_inlineimpl.cpp: (WebCore::parseFontSizeNumber): Changed from QChar
282         to UChar, including using u_isdigit and u_charDigitValue instead of QChar::isNumber
283         and QChar::digitValue. Also removed unneeded range checking that's already done
284         by WebCore::String.
285
286         * kwq/KWQLoader.mm: (KWQIsResponseURLEqualToURL): Rewrote to use Vector and UChar,
287         removing all the type casts and making the whole function much shorter.
288
289         * kwq/WebCoreAXObject.mm:
290         (AXAttributedStringAppendText): Use UChar instead of QChar.
291         (-[WebCoreAXObject doAXAttributedStringForTextMarkerRange:]): More of the same.
292
293         * loader/Cache.h: Remove unnecessary default parameters, preventing the need to
294         include the DeprecatedString.h header in this header. Cleaned up the header
295         structure a bit, removing some obsolete and redundant comments and fixing typos.
296         * loader/Cache.cpp: Removed unused preload functions.
297
298         * page/Frame.h:
299         * page/Frame.cpp:
300         (WebCore::UserStyleSheetLoader::UserStyleSheetLoader): Added explicit arguments.
301         This was the only caller anywhere that took advantage of the default parameter
302         values in one of the Cache class request functions.
303         (WebCore::Frame::backslashAsCurrencySymbol): Changed QChar to UChar.
304
305         * platform/AtomicString.h: Changed QChar to UChar. Removed constructor that makes
306         an AtomicString from a single character. Renamed unicode() function to characters().
307         Renamed KHTML_ATOMICSTRING_HIDE_GLOBALS to ATOMICSTRING_HIDE_GLOBALS.
308         * platform/AtomicString.cpp:
309         (WebCore::CStringTranslator::equal): Changed QChar to UChar.
310         (WebCore::operator==): Changed unicode() to characters().
311         (WebCore::UCharBufferTranslator::hash): More of the same.
312         (WebCore::UCharBufferTranslator::equal): Ditto.
313         (WebCore::UCharBufferTranslator::translate): Ditto.
314         (WebCore::AtomicString::add): Ditto.
315         (WebCore::AtomicString::operator Identifier): Ditto.
316         (WebCore::AtomicString::operator UString): Ditto.
317         (WebCore::AtomicString::AtomicString): Moved here so we don't need DeprecatedString.h
318         in the header.
319         (WebCore::AtomicString::deprecatedString): Ditto.
320
321         * platform/DeprecatedString.h: Removed QChar::Direction enum and all the DirXXX values,
322         isDigit, isLetter, isNumber, isLetterOrNumber, isPunct, digitValue, and direction functions.
323         (QChar::isSpace): Changed to use u_charDirection instead of QChar::direction.
324
325         * platform/Font.h: (WebCore::Font::width): Changed QChar to UChar.
326         * platform/Font.cpp: (WebCore::Font::width): Ditto.
327
328         * platform/GraphicsContext.h:
329         * platform/GraphicsContext.cpp:
330         (WebCore::GraphicsContext::drawText): Changed QChar to UChar. Removed horizontalAlignment
331         parameter from simplified string drawing entry point, since it's not used.
332         (WebCore::GraphicsContext::drawHighlightForText): Changed QChar to UChar.
333
334         * platform/PlatformString.h: Changed QChar to UChar. Removed constructor that makes
335         a String from a single character. Renamed unicode() function to characters(). Added
336         an append function and changed += operator to just call that. Added a foldCase() function.
337         Removed the concatenation operators that add individual strings before or after.
338         * platform/String.cpp:
339         (WebCore::String::String): Changed QChar to UChar.
340         (WebCore::String::append): Renamed from operator+= and removed the return value.
341         (WebCore::String::operator[]): Changed QChar to UChar.
342         (WebCore::String::foldCase): Added.
343         (WebCore::String::percentage): More of the same.
344         (WebCore::String::characters): Renamed from unicode().
345         (WebCore::String::deprecatedString): More of the same.
346         (WebCore::String::sprintf): Fixed mistakes in the comments.
347         (WebCore::String::isEmpty): Tweaked a bit.
348         (WebCore::operator==): More of the same.
349         (WebCore::String::operator Identifier): Ditto.
350         (WebCore::String::operator UString): Ditto.
351
352         * platform/SegmentedString.h: Changed from QChar to UChar. Had to initialize
353         data members that are now UChar.
354         * platform/SegmentedString.cpp:
355         (WebCore::SegmentedString::length): Updated for change from QChar to UChar.
356         (WebCore::SegmentedString::append): Ditto.
357         (WebCore::SegmentedString::prepend): Ditto.
358         (WebCore::SegmentedString::toString): Ditto.
359
360         * platform/StringHash.h: Updated to use UChar instead of QChar and for name changes.
361         Also changed to use case folding intead of lowercasing for case insensitive hashing.
362
363         * platform/StringImpl.h:
364         * platform/StringImpl.cpp:
365         (WebCore::newUCharVector): Changed to UChar from QChar.
366         (WebCore::deleteUCharVector): Ditto.
367         (WebCore::StringImpl::StringImpl): Ditto.
368         (WebCore::StringImpl::init): Ditto. Also renamed from initWithChar and initWithQChar.
369         (WebCore::StringImpl::~StringImpl): Ditto.
370         (WebCore::StringImpl::append): Ditto.
371         (WebCore::StringImpl::insert): Ditto.
372         (WebCore::StringImpl::truncate): Ditto.
373         (WebCore::StringImpl::remove): Ditto.
374         (WebCore::StringImpl::split): Ditto.
375         (WebCore::StringImpl::containsOnlyWhitespace): Ditto. Also added comment because this
376         function seems a little broken.
377         (WebCore::parseLength): More of the same.
378         (WebCore::StringImpl::toCoordsArray): Ditto.
379         (WebCore::StringImpl::toLengthArray): Ditto.
380         (WebCore::StringImpl::isLower): Ditto.
381         (WebCore::StringImpl::lower): Rewrote to use u_strToLower.
382         (WebCore::StringImpl::upper): Rewrote to use u_strToUpper.
383         (WebCore::StringImpl::foldCase): Added. Uses u_strFoldCase.
384         (WebCore::getWordBreakIterator): Changed to use U_FAILURE instead of accepting only
385         U_ZERO_ERROR as a success code.
386         (WebCore::StringImpl::capitalize): More QChar to UChar changes.
387         (WebCore::StringImpl::toInt): Ditto.
388         (WebCore::equal): Changed from QChar to UChar and was careful to preserve the old
389         semantics where "high ASCII" is treated as U+0080-U+00FF even though I don't know
390         if this feature is important.
391         (WebCore::equalIgnoringCase): Ditto, but used case folding instead of lowercasing
392         by using the u_foldCase and u_memcasecmp functions. Also renamed from
393         equalCaseInsensitive for more-consistent naming.
394         (WebCore::StringImpl::find): Ditto. Use case folding for the case insensitive branch.
395         (WebCore::StringImpl::replace): More of the same.
396         (WebCore::StringImpl::computeHash): Ditto.
397         (WebCore::StringImpl::ascii): Ditto.
398
399         * platform/TextBoundaries.h: Changed from QChar to UChar.
400         * platform/mac/TextBoundaries.mm:
401         (WebCore::findWordBoundary): Made the change to UChar and removed some type casts.
402         (WebCore::findNextWordFromIndex): Ditto.
403         (WebCore::findSentenceBoundary): Ditto.
404         (WebCore::findNextSentenceFromIndex): Ditto.
405
406         * platform/TextEncoding.h:
407         * platform/TextEncoding.cpp:
408         (WebCore::TextEncoding::backslashAsCurrencySymbol): Changed from QChar to UChar.
409         (WebCore::TextEncoding::fromUnicode): More of the same.
410         * platform/mac/TextEncodingMac.cpp: (WebCore::TextEncoding::fromUnicode): More
411         of the same.
412
413         * platform/mac/FontFamilyMac.mm: (WebCore::FontFamily::getNSFamily): Removed a
414         now-unneeded type cast.
415
416         * platform/mac/FontMac.mm:
417         (WebCore::Font::selectionRectForText):
418         (WebCore::Font::drawText):
419         (WebCore::Font::drawHighlightForText):
420         (WebCore::Font::floatWidth):
421         (WebCore::Font::checkSelectionPoint):
422         Changed QChar to UChar and removed some now-unneeded type casts.
423
424         * editing/RebalanceWhitespaceCommand.cpp: (WebCore::isWhitespace):
425         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply):
426         * editing/visible_units.cpp:
427         (WebCore::previousBoundary):
428         (WebCore::nextBoundary):
429         (WebCore::startWordBoundary):
430         (WebCore::endWordBoundary):
431         (WebCore::previousWordPositionBoundary):
432         (WebCore::nextWordPositionBoundary):
433         (WebCore::startSentenceBoundary):
434         (WebCore::endSentenceBoundary):
435         (WebCore::previousSentencePositionBoundary):
436         (WebCore::nextSentencePositionBoundary):
437         (WebCore::startOfParagraph):
438         (WebCore::endOfParagraph):
439         * html/HTMLParser.cpp: (WebCore::HTMLParser::handleError):
440         * rendering/InlineTextBox.cpp:
441         (WebCore::InlineTextBox::selectionRect):
442         (WebCore::InlineTextBox::paint):
443         (WebCore::InlineTextBox::paintSelection):
444         (WebCore::InlineTextBox::paintMarkedTextBackground):
445         (WebCore::InlineTextBox::paintTextMatchMarker):
446         (WebCore::InlineTextBox::offsetForPosition):
447         (WebCore::InlineTextBox::positionForOffset):
448         * rendering/RenderBlock.cpp:
449         (WebCore::stripTrailingSpace):
450         (WebCore::RenderBlock::updateFirstLetter):
451         * rendering/RenderFlexibleBox.cpp:
452         (WebCore::RenderFlexibleBox::layoutVerticalBox):
453         * rendering/RenderObject.h:
454         * rendering/RenderObject.cpp:
455         (WebCore::RenderObject::backslashAsCurrencySymbol):
456         * rendering/RenderTreeAsText.cpp: (quoteAndEscapeNonPrintables):
457         * rendering/break_lines.cpp: (WebCore::nextBreakablePosition):
458         * rendering/break_lines.h: (WebCore::isBreakable):
459         * rendering/render_style.h: (WebCore::RenderStyle::isCollapsibleWhiteSpace):
460         * xml/XSLStyleSheet.cpp: (WebCore::XSLStyleSheet::parseString):
461         * xml/xmlhttprequest.cpp:
462         (WebCore::getMIMEType):
463         (WebCore::getCharset):
464         Changed QChar to UChar.
465
466         * rendering/RenderImage.cpp:
467         (WebCore::RenderImage::imageChanged): Changed QChar to UChar.
468         (WebCore::RenderImage::paint): Changed callers of drawText to no-longer pass 0
469         for the horizontal alignment, since I removed that parameters.
470
471         * rendering/RenderText.h: Changed QChar to UChar.
472         * rendering/RenderText.cpp:
473         (WebCore::characterBreakIterator): Update for name change.
474         (WebCore::RenderText::RenderText): Ditto.
475         (WebCore::RenderText::allAscii): Remove uneeded unicode() and allow the value
476         U+007F to count as ASCII.
477         (WebCore::RenderText::cacheWidths): Changed QChar to UChar.
478         (WebCore::RenderText::widthFromCache): Changed code that deals with direction to
479         use the ICU direction calls.
480         (WebCore::RenderText::trimmedMinMaxWidth): Changed QChar to UChar.
481         (WebCore::RenderText::calcMinMaxWidth): Ditto.
482         (WebCore::RenderText::containsOnlyWhitespace): Ditto.
483         (WebCore::RenderText::setText): Ditto.
484         (WebCore::RenderText::width): Ditto.
485
486         * rendering/RenderTextField.cpp:
487         (WebCore::RenderTextField::updateFromElement): Removed unneeded QChar cast.
488         (WebCore::RenderTextField::calcMinMaxWidth): Changed from QChar to UChar.
489
490         * rendering/bidi.h:
491         * rendering/bidi.cpp:
492         (WebCore::BidiIterator::BidiIterator):
493         (WebCore::BidiState::BidiState):
494         (WebCore::BidiContext::BidiContext):
495         (WebCore::bidiNext):
496         (WebCore::bidiFirst):
497         (WebCore::BidiIterator::current):
498         (WebCore::BidiIterator::direction):
499         (WebCore::addRun):
500         (WebCore::checkMidpoints):
501         (WebCore::appendRun):
502         (WebCore::embed):
503         (WebCore::RenderBlock::tabWidth):
504         (WebCore::RenderBlock::computeHorizontalPositionsForLine):
505         (WebCore::RenderBlock::bidiReorderLine):
506         (WebCore::RenderBlock::layoutInlineChildren):
507         (WebCore::skipNonBreakingSpace):
508         (WebCore::RenderBlock::skipWhitespace):
509         (WebCore::RenderBlock::findNextLineBreak):
510         (WebCore::RenderBlock::checkLinesForTextOverflow):
511         Changed from QChar to UChar and all direction from QChar constants to the
512         ones from ICU.
513
514         * rendering/render_form.cpp:
515         (WebCore::RenderLineEdit::updateFromElement):
516         (WebCore::RenderSelect::updateFromElement):
517         (WebCore::RenderTextArea::updateFromElement):
518         (WebCore::RenderTextArea::text):
519         (WebCore::RenderTextArea::textWithHardLineBreaks):
520         Got rid of now-unneeded QChar type casts.
521
522         * rendering/render_line.cpp:
523         (WebCore::InlineFlowBox::placeBoxesHorizontally): Updated for change from QChar
524         to UChar.
525         (WebCore::EllipsisBox::paint): Updated for unicode() -> characters() name change.
526
527         * rendering/render_list.cpp:
528         (WebCore::toRoman): Updated from QChar to UChar.
529         (WebCore::toLetterString): Ditto.
530         (WebCore::toHebrew): More of the same, also cleaned up the logic a bit.
531         (WebCore::RenderListMarker::paint): Removed the alignment parameters from the
532         various functions. Also removed all reliance on the width-measuring functions
533         that take a string.
534         (WebCore::RenderListMarker::calcMinMaxWidth): More of the same.
535         (WebCore::RenderListMarker::getRelativeMarkerRect): Ditto.
536
537 2006-05-09  Tim Omernick  <timo@apple.com>
538
539         Reviewed by/co-written by Darin.
540
541         Performance improvement when drawing large numbers of animated images.
542
543         Instead of removing the "first" object from a set on each next(),
544         copy the clients into a vector once and keep track of the current index.
545
546         * loader/CachedObjectClientWalker.h:
547         * loader/CachedObjectClientWalker.cpp:
548         (WebCore::CachedObjectClientWalker::CachedObjectClientWalker):
549         (WebCore::CachedObjectClientWalker::next):
550
551 2006-05-09  Steve Falkenburg  <sfalken@apple.com>
552
553         Fix Windows build.  Added TextDocument.cpp to vcproj.
554         
555         Reviewed by adele.
556
557         * WebCore.vcproj/WebCore/WebCore.vcproj:
558
559 2006-05-09  Steve Falkenburg  <sfalken@apple.com>
560
561         Fix Windows build.
562         Add host calback so caller can determine success/failure of a page load.
563         
564         Reviewed by kevin.
565
566         * WebCore.vcproj/WebCore/WebCore.vcproj: Fix paths, add missing files
567         * loader/CachedResource.h: Fix include path.
568         * loader/CachedResourceClientWalker.h: Fix include path.
569         * platform/FontPlatformData.h: Fix include path.
570         * platform/TransferJobClient.h: Make PlatformData, PlatformResponse an opaque struct.
571         * platform/image-decoders/ImageDecoder.h: Fix include path.
572         * platform/win/SharedTimerWin.cpp: Fix include path.
573         * platform/win/TransferJobWin.cpp: 
574         (WebCore::TransferJobWndProc): Add host callback for success/failure of load.
575         * platform/win/TransferJobWin.h: Added. Windows version of PlatformData/PlatformResponse.
576         * xpath/impl/XPathFunctions.cpp: Work around missing math functions in MSVC.
577         (round): Work around missing math functions in MSVC.
578         * xpath/impl/XPathPredicate.cpp: Work around missing math functions in MSVC.
579         * xpath/impl/XPathValue.cpp: Work around missing math functions in MSVC.
580
581 2006-05-09  David Hyatt  <hyatt@apple.com>
582
583         Revert styleForElement, pseudoStyleForElement, styleForRenderer back to
584         their old names, since the term "create" is not accurate.
585
586         * css/cssstyleselector.cpp:
587         (WebCore::CSSStyleSelector::styleForElement):
588         (WebCore::CSSStyleSelector::pseudoStyleForElement):
589         * css/cssstyleselector.h:
590         * dom/Element.cpp:
591         (WebCore::Element::styleForRenderer):
592         (WebCore::Element::recalcStyle):
593         * dom/Element.h:
594         * dom/Node.cpp:
595         (WebCore::Node::createRendererIfNeeded):
596         (WebCore::Node::styleForRenderer):
597         * dom/Node.h:
598         * ksvg2/svg/SVGClipPathElement.cpp:
599         (SVGClipPathElement::canvasResource):
600         * ksvg2/svg/SVGFEFloodElement.cpp:
601         (SVGFEFloodElement::filterEffect):
602         * ksvg2/svg/SVGGradientElement.cpp:
603         (SVGGradientElement::rebuildStops):
604
605 2006-05-09  Anders Carlsson  <acarlsson@apple.com>
606
607         Reviewed by Darin.
608
609         * loader/TextDocument.cpp:
610         (WebCore::TextTokenizer::write):
611         Use the correct variable to prevent crashes.
612
613 2006-05-09  Anders Carlsson  <acarlsson@apple.com>
614
615         Reviewed by Darin.
616
617         http://bugs.webkit.org/show_bug.cgi?id=8808
618         WebCore should handle text files
619         
620         * WebCore.xcodeproj/project.pbxproj:
621         Add TextDocument.cpp and TextDocument.h
622         
623         * bridge/mac/WebCoreFrameBridge.mm:
624         (+[WebCoreFrameBridge supportedMIMETypes]):
625         Add text types here.
626         
627         * dom/DOMImplementation.cpp:
628         (WebCore::DOMImplementation::createTextDocument):
629         (WebCore::DOMImplementation::isTextMIMEType):
630         * dom/DOMImplementation.h:
631         New functions for creating a TextDocument and determining if a 
632         mime type is a text MIME type.
633         
634         * loader/TextDocument.cpp: Added.
635         (WebCore::TextTokenizer::TextTokenizer):
636         (WebCore::TextTokenizer::write):
637         (WebCore::TextTokenizer::finish):
638         (WebCore::TextTokenizer::isWaitingForScripts):
639         Special tokenizer which will put text inside a <pre> tag
640         in a document.
641         
642         (WebCore::TextDocument::TextDocument):        
643         (WebCore::TextDocument::createTokenizer):
644         Create a TextTokenizer.
645         
646         * loader/TextDocument.h: Added.
647         
648         * page/Frame.cpp:
649         (WebCore::Frame::begin):
650         Create a TextDocument if the MIME type is of type text.
651
652 2006-05-09  Maciej Stachowiak  <mjs@apple.com>
653
654         Rubber stamped by Anders.
655         
656         - renamed kxmlcore to wtf
657         
658         kxmlcore --> wtf
659         KXMLCore --> WTF
660         KXC --> WTF
661
662         * ForwardingHeaders/kxmlcore: Removed.
663         * ForwardingHeaders/kxmlcore/AlwaysInline.h: Removed.
664         * ForwardingHeaders/kxmlcore/Assertions.h: Removed.
665         * ForwardingHeaders/kxmlcore/FastMalloc.h: Removed.
666         * ForwardingHeaders/kxmlcore/Forward.h: Removed.
667         * ForwardingHeaders/kxmlcore/HashCountedSet.h: Removed.
668         * ForwardingHeaders/kxmlcore/HashMap.h: Removed.
669         * ForwardingHeaders/kxmlcore/HashSet.h: Removed.
670         * ForwardingHeaders/kxmlcore/HashTraits.h: Removed.
671         * ForwardingHeaders/kxmlcore/Noncopyable.h: Removed.
672         * ForwardingHeaders/kxmlcore/OwnArrayPtr.h: Removed.
673         * ForwardingHeaders/kxmlcore/OwnPtr.h: Removed.
674         * ForwardingHeaders/kxmlcore/PassRefPtr.h: Removed.
675         * ForwardingHeaders/kxmlcore/Platform.h: Removed.
676         * ForwardingHeaders/kxmlcore/RefPtr.h: Removed.
677         * ForwardingHeaders/kxmlcore/Vector.h: Removed.
678         * ForwardingHeaders/wtf: Added.
679         * bindings/js/JSHTMLElementWrapperFactory.h:
680         * bindings/js/kjs_binding.cpp:
681         * bindings/js/kjs_window.h:
682         * bindings/objc/DOMImplementationFront.h:
683         * bridge/JavaAppletWidget.h:
684         * bridge/mac/WebCoreFrameNamespaces.mm:
685         * bridge/mac/WebCorePageBridge.mm:
686         (initializeLogChannel):
687         * bridge/mac/WebCoreStringTruncator.mm:
688         * bridge/mac/WebCoreViewFactory.m:
689         * config.h:
690         * css/css_base.h:
691         * css/css_valueimpl.h:
692         * css/csshelper.cpp:
693         * css/cssparser.h:
694         * dom/DOMImplementation.h:
695         * dom/Document.h:
696         * dom/NamedNodeMap.h:
697         * dom/Node.h:
698         * dom/NodeList.h:
699         * dom/QualifiedName.cpp:
700         * dom/Range.h:
701         * dom/StyledElement.cpp:
702         * dom/dom2_traversalimpl.h:
703         * dom/xml_tokenizer.h:
704         * editing/RebalanceWhitespaceCommand.cpp:
705         * editing/RemoveCSSPropertyCommand.cpp:
706         * editing/RemoveNodeAttributeCommand.cpp:
707         * editing/RemoveNodeCommand.cpp:
708         * editing/RemoveNodePreservingChildrenCommand.cpp:
709         * editing/ReplaceSelectionCommand.h:
710         * editing/Selection.cpp:
711         * editing/SetNodeAttributeCommand.cpp:
712         * editing/SplitElementCommand.cpp:
713         * editing/SplitTextNodeCommand.cpp:
714         * editing/SplitTextNodeContainingElementCommand.cpp:
715         * editing/TextIterator.h:
716         * editing/htmlediting.h:
717         * editing/markup.h:
718         * html/CanvasGradient.h:
719         * html/CanvasRenderingContext2D.h:
720         * html/CanvasStyle.cpp:
721         * html/HTMLCollection.h:
722         * html/HTMLElementFactory.h:
723         * kcanvas/KCanvasFilters.cpp:
724         * kcanvas/KCanvasPath.h:
725         * kcanvas/RenderPath.cpp:
726         * kcanvas/RenderSVGImage.cpp:
727         * kcanvas/RenderSVGText.cpp:
728         * kcanvas/device/quartz/KCanvasItemQuartz.mm:
729         * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
730         * kcanvas/device/quartz/QuartzSupport.mm:
731         * ksvg2/misc/KSVGTimeScheduler.h:
732         * ksvg2/misc/SVGDocumentExtensions.h:
733         * ksvg2/scripts/make_names.pl:
734         * ksvg2/svg/SVGDOMImplementation.cpp:
735         * ksvg2/svg/SVGExternalResourcesRequired.h:
736         * ksvg2/svg/SVGFilterPrimitiveStandardAttributes.cpp:
737         * ksvg2/svg/SVGForeignObjectElement.cpp:
738         * ksvg2/svg/SVGImageElement.cpp:
739         * ksvg2/svg/SVGMaskElement.cpp:
740         * ksvg2/svg/SVGStyledElement.cpp:
741         * ksvg2/svg/SVGTests.h:
742         * ksvg2/svg/SVGTransform.h:
743         * ksvg2/svg/SVGTransformable.cpp:
744         * kwq/AccessibilityObjectCache.h:
745         * kwq/KWQCString.cpp:
746         * kwq/KWQFormData.mm:
747         * kwq/KWQListBox.mm:
748         * kwq/KWQResourceLoader.mm:
749         * kwq/KWQTextEdit.mm:
750         * loader/Cache.h:
751         * loader/CachedObject.h:
752         * loader/CachedObjectClientWalker.h:
753         * loader/Decoder.h:
754         * loader/DocLoader.h:
755         * loader/loader.cpp:
756         * loader/loader.h:
757         * page/DOMWindow.h:
758         * page/Frame.h:
759         * page/FramePrivate.h:
760         * page/FrameTree.cpp:
761         * page/Page.cpp:
762         * page/Page.h:
763         * page/Plugin.h:
764         * platform/Arena.cpp:
765         * platform/ArrayImpl.h:
766         * platform/AtomicString.cpp:
767         * platform/CharsetNames.cpp:
768         * platform/Color.cpp:
769         * platform/DeprecatedPtrListImpl.cpp:
770         * platform/DeprecatedValueListImpl.h:
771         * platform/FontFallbackList.h:
772         * platform/GraphicsContext.h:
773         * platform/GraphicsTypes.cpp:
774         * platform/Image.h:
775         * platform/KURL.cpp:
776         * platform/Logging.cpp:
777         * platform/Logging.h:
778         * platform/PlatformString.h:
779         * platform/PlugInInfoStore.h:
780         * platform/StreamingTextDecoder.cpp:
781         * platform/StreamingTextDecoder.h:
782         * platform/String.cpp:
783         * platform/StringHash.h:
784         * platform/StringImpl.cpp:
785         * platform/StringImpl.h:
786         * platform/TextEncoding.cpp:
787         * platform/Timer.cpp:
788         * platform/Timer.h:
789         * platform/TransferJob.h:
790         * platform/TransferJobInternal.h:
791         * platform/mac/BlockExceptions.mm:
792         * platform/mac/ColorMac.mm:
793         * platform/mac/FontData.mm:
794         * platform/mac/KURLMac.mm:
795         * platform/mac/QStringMac.mm:
796         * platform/mac/SharedTimerMac.cpp:
797         * platform/mac/TextEncodingMac.cpp:
798         * platform/mac/WebCoreImageRendererFactory.m:
799         * platform/mac/WebCoreKeyGenerator.m:
800         * platform/mac/WebCoreTextArea.mm:
801         * platform/mac/WebCoreTextField.mm:
802         * platform/mac/WebTextRendererFactory.h:
803         * platform/mac/WebTextRendererFactory.mm:
804         * platform/win/TemporaryLinkStubs.cpp:
805         (JavaAppletWidget::JavaAppletWidget):
806         * rendering/InlineTextBox.cpp:
807         * rendering/RenderText.cpp:
808         * rendering/RenderTreeAsText.cpp:
809         * rendering/bidi.cpp:
810         * xml/XSLTProcessor.h:
811         * xpath/impl/XPathExpressionNode.h:
812         * xpath/impl/XPathParser.h:
813         * xpath/impl/XPathPath.h:
814         * xpath/impl/XPathUtil.h:
815
816 2006-05-09  Anders Carlsson  <acarlsson@apple.com>
817
818         Reviewed by Maciej.
819
820         http://bugs.webkit.org/show_bug.cgi?id=8803
821         XPath query for empty attributes crashes in XPath::StringExpression::StringExpression
822         
823         * xpath/impl/XPathParser.cpp:
824         (WebCore::XPath::Parser::lexString):
825         Make sure an empty string is returned instead of a null string.
826         
827         (WebCore::XPath::Parser::lex):
828         Only assign the string if it isn't null.
829
830 2006-05-09  Alexey Proskuryakov  <ap@nypop.com>
831
832         Reviewed by Darin.
833
834         - http://bugs.webkit.org/show_bug.cgi?id=8769
835           TextEncoding::fromUnicode() - support non-BMP characters and convert to NFC
836
837         Fix the ICU code path, too (currently unused on the Mac).
838
839         * platform/TextEncoding.cpp:
840         (WebCore::TextEncoding::fromUnicode): Normalize the string.
841
842 2006-05-08  Maciej Stachowiak  <mjs@apple.com>
843
844         Reviewed by Tim Hatcher.
845         
846         - refactor things so that WebKit doesn't save a WebResource for every loaded URL,
847         but rather retrieves the data from the WebCore cache as needed.
848         http://bugs.webkit.org/show_bug.cgi?id=8802
849
850         * bridge/mac/WebCoreFrameBridge.h:
851         * bridge/mac/WebCoreFrameBridge.mm:
852         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
853         (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
854         * loader/Cache.cpp:
855         (WebCore::Cache::updateCacheStatus):
856         (WebCore::Cache::requestImage):
857         (WebCore::Cache::requestStyleSheet):
858         (WebCore::Cache::requestScript):
859         (WebCore::Cache::requestXSLStyleSheet):
860         (WebCore::Cache::requestXBLDocument):
861         * loader/Cache.h:
862         * loader/CachedResource.cpp: Added.
863         * loader/CachedResource.h: Added.
864         * loader/CachedResourceClient.h: Added.
865         * loader/CachedResourceClientWalker.cpp: Added.
866         * loader/CachedResourceClientWalker.h: Added.
867         * loader/DocLoader.cpp:
868         (WebCore::DocLoader::setAutoloadImages):
869         (WebCore::DocLoader::removeCachedObject):
870         * loader/DocLoader.h:
871         (WebCore::DocLoader::cachedObject):
872         (WebCore::DocLoader::allCachedObjects):
873
874 2006-05-08  Levi Weintraub  <lweintraub@apple.com>
875
876         Reviewed by justin.
877
878         * editing/TextIterator.cpp:
879         (WebCore::shouldEmitSpaceBeforeAndAfterNode):
880         Returns true when the node should have a leading and trailing space. Currently only
881         used for inline tables. The function shouldEmitNewlinesBeforeAndAfterNode has a
882         fallback for nodes with no RenderObject, but the inline property doesn't really
883         have a meaning without one.
884         (WebCore::TextIterator::handleNonTextNode):
885         Checks shouldEmitSpaceBeforeAndAfterNode and inserts a space if necessary.
886         (WebCore::TextIterator::exitNode):
887         Checks shouldEmitSpaceBeforeAndAfterNode and inserts a space if necessary.
888
889 2006-05-08  Anders Carlsson  <acarlsson@apple.com>
890
891         Try fixing the Win32 build
892         
893         * WebCore.vcproj/WebCore/WebCore.vcproj:
894         Add XPath files to project.
895
896 2006-05-08  Anders Carlsson  <acarlsson@apple.com>
897
898         Reviewed by Darin, Eric and Maciej.
899
900         http://bugs.webkit.org/show_bug.cgi?id=6638
901         Support Mozilla's XPathEvaluator object.
902         
903         * DerivedSources.make:
904         Generate XPath grammar, and JavaScript wrappers.
905         
906         * WebCore.xcodeproj/project.pbxproj:
907         Add new files to project
908         
909         * bindings/js/kjs_binding.cpp:
910         (KJS::):
911         (KJS::setDOMException):
912         Handle setting XPath exceptions.
913         
914         * bindings/objc/DOM.mm:
915         Just return nil for now when trying to create a wrapper for 
916         XPath namespace nodes.
917
918         * bindings/scripts/CodeGeneratorJS.pm:
919         Add XPath types. Also add a "CanBeConstructed" extended attribute
920         for interfaces that can be constructed directly.
921         
922         * bridge/mac/WebCorePageBridge.mm:
923         (initializeLoggingChannelsIfNecessary):
924         Initialize LogXPath channel.
925         
926         * dom/DOMImplementation.cpp:
927         (WebCore::DOMImplementation::hasFeature):
928         Support "xpath" version "3.0".
929         
930         * dom/Document.cpp:
931         (WebCore::Document::Document):
932         
933         (WebCore::Document::importNode):
934         Ignore XPath namespace nodes.
935         
936         (WebCore::Document::createExpression):
937         (WebCore::Document::createNSResolver):
938         (WebCore::Document::evaluate):
939         New functions which call down to a lazily created XPathEvaluator.
940
941         * dom/Document.h:
942         Add function declarations.
943         
944         * dom/Document.idl:
945         Add XPath methods.
946         
947         * dom/Node.h:
948         (WebCore::Node::):
949         Add XPATH_NAMESPACE_NODE type.
950         
951         * editing/markup.cpp:
952         (WebCore::startMarkup):
953         Ignore XPath namespace nodes.
954         
955         * page/DOMWindow.idl:
956         Add constructors for XPathEvaluator and XPathResult.
957         
958         * platform/Logging.cpp:
959         * platform/Logging.h:
960         Add XPath log channel
961
962         * xpath: Added.
963         * xpath/XPathEvaluator.cpp: Added.
964         (WebCore::XPathEvaluator::createExpression):
965         (WebCore::XPathEvaluator::createNSResolver):
966         (WebCore::XPathEvaluator::evaluate):
967         * xpath/XPathEvaluator.h: Added.
968         (WebCore::):
969         * xpath/XPathEvaluator.idl: Added.
970         * xpath/XPathExpression.cpp: Added.
971         (WebCore::XPathExpression::createExpression):
972         (WebCore::XPathExpression::~XPathExpression):
973         (WebCore::XPathExpression::evaluate):
974         * xpath/XPathExpression.h: Added.
975         * xpath/XPathExpression.idl: Added.
976         * xpath/XPathNSResolver.cpp: Added.
977         (WebCore::XPathNSResolver::XPathNSResolver):
978         (WebCore::XPathNSResolver::lookupNamespaceURI):
979         * xpath/XPathNSResolver.h: Added.
980         * xpath/XPathNSResolver.idl: Added.
981         * xpath/XPathNamespace.cpp: Added.
982         (WebCore::XPathNamespace::XPathNamespace):
983         (WebCore::XPathNamespace::~XPathNamespace):
984         (WebCore::XPathNamespace::ownerDocument):
985         (WebCore::XPathNamespace::ownerElement):
986         (WebCore::XPathNamespace::prefix):
987         (WebCore::XPathNamespace::nodeName):
988         (WebCore::XPathNamespace::nodeValue):
989         (WebCore::XPathNamespace::namespaceURI):
990         (WebCore::XPathNamespace::nodeType):
991         * xpath/XPathNamespace.h: Added.
992         * xpath/XPathResult.cpp: Added.
993         (WebCore::InvalidatingEventListener::InvalidatingEventListener):
994         (WebCore::InvalidatingEventListener::handleEvent):
995         (WebCore::XPathResult::XPathResult):
996         (WebCore::XPathResult::~XPathResult):
997         (WebCore::XPathResult::convertTo):
998         (WebCore::XPathResult::resultType):
999         (WebCore::XPathResult::numberValue):
1000         (WebCore::XPathResult::stringValue):
1001         (WebCore::XPathResult::booleanValue):
1002         (WebCore::XPathResult::singleNodeValue):
1003         (WebCore::XPathResult::invalidateIteratorState):
1004         (WebCore::XPathResult::invalidIteratorState):
1005         (WebCore::XPathResult::snapshotLength):
1006         (WebCore::XPathResult::iterateNext):
1007         (WebCore::XPathResult::snapshotItem):
1008         * xpath/XPathResult.h: Added.
1009         (WebCore::XPathResult::):
1010         * xpath/XPathResult.idl: Added.
1011         * xpath/impl: Added.
1012         * xpath/impl/XPathExpressionNode.cpp: Added.
1013         (WebCore::XPath::Expression::evaluationContext):
1014         (WebCore::XPath::Expression::Expression):
1015         (WebCore::XPath::Expression::~Expression):
1016         (WebCore::XPath::Expression::evaluate):
1017         (WebCore::XPath::Expression::addSubExpression):
1018         (WebCore::XPath::Expression::optimize):
1019         (WebCore::XPath::Expression::subExprCount):
1020         (WebCore::XPath::Expression::subExpr):
1021         (WebCore::XPath::Expression::isConstant):
1022         * xpath/impl/XPathExpressionNode.h: Added.
1023         (WebCore::XPath::EvaluationContext::EvaluationContext):
1024         * xpath/impl/XPathFunctions.cpp: Added.
1025         (WebCore::XPath::Interval::Interval):
1026         (WebCore::XPath::Interval::contains):
1027         (WebCore::XPath::Interval::asString):
1028         (WebCore::XPath::Function::setArguments):
1029         (WebCore::XPath::Function::setName):
1030         (WebCore::XPath::Function::arg):
1031         (WebCore::XPath::Function::argCount):
1032         (WebCore::XPath::Function::name):
1033         (WebCore::XPath::FunLast::doEvaluate):
1034         (WebCore::XPath::FunLast::isConstant):
1035         (WebCore::XPath::FunPosition::doEvaluate):
1036         (WebCore::XPath::FunPosition::isConstant):
1037         (WebCore::XPath::FunLocalName::isConstant):
1038         (WebCore::XPath::FunLocalName::doEvaluate):
1039         (WebCore::XPath::FunNamespaceURI::isConstant):
1040         (WebCore::XPath::FunNamespaceURI::doEvaluate):
1041         (WebCore::XPath::FunName::isConstant):
1042         (WebCore::XPath::FunName::doEvaluate):
1043         (WebCore::XPath::FunCount::doEvaluate):
1044         (WebCore::XPath::FunCount::isConstant):
1045         (WebCore::XPath::FunString::doEvaluate):
1046         (WebCore::XPath::FunConcat::doEvaluate):
1047         (WebCore::XPath::FunStartsWith::doEvaluate):
1048         (WebCore::XPath::FunContains::doEvaluate):
1049         (WebCore::XPath::FunSubstringBefore::doEvaluate):
1050         (WebCore::XPath::FunSubstringAfter::doEvaluate):
1051         (WebCore::XPath::FunSubstring::doEvaluate):
1052         (WebCore::XPath::FunStringLength::doEvaluate):
1053         (WebCore::XPath::FunNormalizeSpace::doEvaluate):
1054         (WebCore::XPath::FunTranslate::doEvaluate):
1055         (WebCore::XPath::FunBoolean::doEvaluate):
1056         (WebCore::XPath::FunNot::doEvaluate):
1057         (WebCore::XPath::FunTrue::doEvaluate):
1058         (WebCore::XPath::FunTrue::isConstant):
1059         (WebCore::XPath::FunLang::doEvaluate):
1060         (WebCore::XPath::FunLang::isConstant):
1061         (WebCore::XPath::FunFalse::doEvaluate):
1062         (WebCore::XPath::FunFalse::isConstant):
1063         (WebCore::XPath::FunNumber::doEvaluate):
1064         (WebCore::XPath::FunSum::doEvaluate):
1065         (WebCore::XPath::FunFloor::doEvaluate):
1066         (WebCore::XPath::FunCeiling::doEvaluate):
1067         (WebCore::XPath::FunRound::doEvaluate):
1068         (WebCore::XPath::FunctionLibrary::self):
1069         (WebCore::XPath::FunctionLibrary::FunctionLibrary):
1070         (WebCore::XPath::FunctionLibrary::createFunction):
1071         * xpath/impl/XPathFunctions.h: Added.
1072         * xpath/impl/XPathGrammar.y: Added.
1073         * xpath/impl/XPathParser.cpp: Added.
1074         (WebCore::XPath::):
1075         (WebCore::XPath::Parser::charCat):
1076         (WebCore::XPath::Parser::isAxisName):
1077         (WebCore::XPath::Parser::isNodeTypeName):
1078         (WebCore::XPath::Parser::isOperatorContext):
1079         (WebCore::XPath::Parser::skipWS):
1080         (WebCore::XPath::Parser::makeTokenAndAdvance):
1081         (WebCore::XPath::Parser::makeIntTokenAndAdvance):
1082         (WebCore::XPath::Parser::peekAheadHelper):
1083         (WebCore::XPath::Parser::peekCurHelper):
1084         (WebCore::XPath::Parser::lexString):
1085         (WebCore::XPath::Parser::lexNumber):
1086         (WebCore::XPath::Parser::lexNCName):
1087         (WebCore::XPath::Parser::lexQName):
1088         (WebCore::XPath::Parser::nextTokenInternal):
1089         (WebCore::XPath::Parser::nextToken):
1090         (WebCore::XPath::Parser::Parser):
1091         (WebCore::XPath::Parser::reset):
1092         (WebCore::XPath::Parser::lex):
1093         (WebCore::XPath::Parser::parseStatement):
1094         (WebCore::XPath::Parser::registerParseNode):
1095         (WebCore::XPath::Parser::unregisterParseNode):
1096         (WebCore::XPath::Parser::registerPredicateVector):
1097         (WebCore::XPath::Parser::unregisterPredicateVector):
1098         (WebCore::XPath::Parser::registerExpressionVector):
1099         (WebCore::XPath::Parser::unregisterExpressionVector):
1100         (WebCore::XPath::Parser::registerString):
1101         (WebCore::XPath::Parser::unregisterString):
1102         * xpath/impl/XPathParser.h: Added.
1103         (WebCore::XPath::Token::Token):
1104         (WebCore::XPath::Parser::):
1105         (WebCore::XPath::Parser::current):
1106         * xpath/impl/XPathPath.cpp: Added.
1107         (WebCore::XPath::Filter::Filter):
1108         (WebCore::XPath::Filter::~Filter):
1109         (WebCore::XPath::Filter::doEvaluate):
1110         (WebCore::XPath::LocationPath::LocationPath):
1111         (WebCore::XPath::LocationPath::~LocationPath):
1112         (WebCore::XPath::LocationPath::optimize):
1113         (WebCore::XPath::LocationPath::doEvaluate):
1114         (WebCore::XPath::Path::Path):
1115         (WebCore::XPath::Path::~Path):
1116         (WebCore::XPath::Path::doEvaluate):
1117         * xpath/impl/XPathPath.h: Added.
1118         * xpath/impl/XPathPredicate.cpp: Added.
1119         (WebCore::XPath::Number::Number):
1120         (WebCore::XPath::Number::isConstant):
1121         (WebCore::XPath::Number::doEvaluate):
1122         (WebCore::XPath::StringExpression::StringExpression):
1123         (WebCore::XPath::StringExpression::isConstant):
1124         (WebCore::XPath::StringExpression::doEvaluate):
1125         (WebCore::XPath::Negative::doEvaluate):
1126         (WebCore::XPath::NumericOp::NumericOp):
1127         (WebCore::XPath::NumericOp::doEvaluate):
1128         (WebCore::XPath::EqTestOp::EqTestOp):
1129         (WebCore::XPath::EqTestOp::doEvaluate):
1130         (WebCore::XPath::LogicalOp::LogicalOp):
1131         (WebCore::XPath::LogicalOp::shortCircuitOn):
1132         (WebCore::XPath::LogicalOp::isConstant):
1133         (WebCore::XPath::LogicalOp::doEvaluate):
1134         (WebCore::XPath::Union::doEvaluate):
1135         (WebCore::XPath::Predicate::Predicate):
1136         (WebCore::XPath::Predicate::~Predicate):
1137         (WebCore::XPath::Predicate::evaluate):
1138         (WebCore::XPath::Predicate::optimize):
1139         * xpath/impl/XPathPredicate.h: Added.
1140         (WebCore::XPath::NumericOp::):
1141         (WebCore::XPath::EqTestOp::):
1142         (WebCore::XPath::LogicalOp::):
1143         * xpath/impl/XPathStep.cpp: Added.
1144         (WebCore::XPath::Step::axisAsString):
1145         (WebCore::XPath::Step::Step):
1146         (WebCore::XPath::Step::~Step):
1147         (WebCore::XPath::Step::evaluate):
1148         (WebCore::XPath::Step::nodesInAxis):
1149         (WebCore::XPath::Step::nodeTestMatches):
1150         (WebCore::XPath::Step::optimize):
1151         (WebCore::XPath::Step::namespaceFromNodetest):
1152         (WebCore::XPath::Step::primaryNodeType):
1153         * xpath/impl/XPathStep.h: Added.
1154         (WebCore::XPath::Step::):
1155         * xpath/impl/XPathUtil.cpp: Added.
1156         (WebCore::XPath::isRootDomNode):
1157         (WebCore::XPath::stringValue):
1158         (WebCore::XPath::isValidContextNode):
1159         * xpath/impl/XPathUtil.h: Added.
1160         * xpath/impl/XPathValue.cpp: Added.
1161         (WebCore::XPath::Value::Value):
1162         (WebCore::XPath::Value::type):
1163         (WebCore::XPath::Value::isNodeVector):
1164         (WebCore::XPath::Value::isBoolean):
1165         (WebCore::XPath::Value::isNumber):
1166         (WebCore::XPath::Value::isString):
1167         (WebCore::XPath::Value::toNodeVector):
1168         (WebCore::XPath::Value::toBoolean):
1169         (WebCore::XPath::Value::toNumber):
1170         (WebCore::XPath::Value::toString):
1171         * xpath/impl/XPathValue.h: Added.
1172         (WebCore::XPath::Value::):
1173         * xpath/impl/XPathVariableReference.cpp: Added.
1174         (WebCore::XPath::VariableReference::VariableReference):
1175         (WebCore::XPath::VariableReference::isConstant):
1176         (WebCore::XPath::VariableReference::doEvaluate):
1177         * xpath/impl/XPathVariableReference.h: Added.
1178
1179 2006-05-08  David Hyatt  <hyatt@apple.com>
1180
1181         Comprehensive box-sizing fix.  This patch changes all form controls to
1182         have the right box-sizing values (text fields and text areas actually only
1183         use border-box in quirks mode now, and image buttons never use border-box).
1184
1185         Tables are supposed to use border-box box-sizing as well, but that's a scary
1186         enough change that I'm saving it for a separate patch.
1187
1188         Reviewed by mjs
1189
1190         * css/html4.css:
1191         * css/quirks.css:
1192
1193 2006-05-07  Darin Adler  <darin@apple.com>
1194         
1195         Suggested by Mitz. Reviewed and landed by Maciej.
1196         
1197         * dom/Document.cpp: (WebCore::Document::formElementsState): Fixed mistake where the
1198         vector has an initial size and instead should have an initial capacity. Harmless in
1199         a way, but hurts performance.
1200         
1201 2006-05-07  David Hyatt  <hyatt@apple.com>
1202
1203         Fix for bugzilla bug 8060.
1204
1205         Fixed width table cells weren't having their border widths
1206         included in the effective width of the column (and thus could end up being
1207         too small).
1208
1209         Reviewed by darin
1210
1211         Added fast/tables/fixed-cell-growth.html
1212
1213         * rendering/table_layout.cpp:
1214         (WebCore::AutoTableLayout::recalcColumn):
1215
1216 2006-05-07  Alexey Proskuryakov  <ap@nypop.com>
1217
1218         Reviewed by Darin.
1219
1220         - http://bugs.webkit.org/show_bug.cgi?id=8769
1221           TextEncoding::fromUnicode() - support non-BMP characters and convert to NFC
1222
1223         Tests: 
1224         * fast/forms/form-data-encoding.html
1225         * fast/forms/form-data-encoding-2.html
1226
1227         * platform/mac/TextEncodingMac.cpp:
1228         (WebCore::TextEncoding::fromUnicode): Normalize the string; handle surrogate pairs.
1229
1230 2006-05-06  David Hyatt  <hyatt@apple.com>
1231
1232         Rename WebCoreFont to FontPlatformData and WebTextRenderer to FontData.  Merge them into the
1233         headers (uncleanly with ifdefs at the moment, so I can see what I'm working towards).
1234
1235         Reviewed by mjs
1236
1237         * ChangeLog:
1238         * WebCore.vcproj/WebCore/WebCore.vcproj:
1239         * WebCore.xcodeproj/project.pbxproj:
1240         * bridge/mac/WebCoreStringTruncator.mm:
1241         (stringWidth):
1242         (truncateString):
1243         (+[WebCoreStringTruncator widthOfString:font:]):
1244         * kwq/KWQComboBox.mm:
1245         (QComboBox::sizeHint):
1246         * kwq/KWQLineEdit.mm:
1247         (QLineEdit::sizeForCharacterWidth):
1248         * kwq/KWQListBox.mm:
1249         (itemTextRenderer):
1250         (groupLabelTextRenderer):
1251         (QListBox::sizeForNumberOfLines):
1252         (-[KWQTableView drawRow:clipRect:]):
1253         * platform/Font.cpp:
1254         (WebCore::m_wordSpacing):
1255         (WebCore::Font::Font):
1256         (WebCore::Font::operator=):
1257         (WebCore::Font::update):
1258         (WebCore::Font::ascent):
1259         (WebCore::Font::descent):
1260         (WebCore::Font::lineSpacing):
1261         (WebCore::Font::xHeight):
1262         (WebCore::Font::isFixedPitch):
1263         * platform/Font.h:
1264         (WebCore::Font::getNSFont):
1265         * platform/FontData.h:
1266         (WebCore::FontData::ascent):
1267         (WebCore::FontData::descent):
1268         (WebCore::FontData::lineSpacing):
1269         (WebCore::FontData::lineGap):
1270         (WebCore::FontData::misspellingLineThickness):
1271         (WebCore::FontData::misspellingLinePatternWidth):
1272         (WebCore::FontData::misspellingLinePatternGapWidth):
1273         * platform/FontDataSet.h: Removed.
1274         * platform/FontFallbackList.h: Added.
1275         * platform/FontPlatformData.h:
1276         * platform/mac/FontData.mm: Added.
1277         (WebCore::WebCoreInitializeFont):
1278         (WebCore::WebCoreInitializeEmptyTextGeometry):
1279         (WebCore::widthForGlyph):
1280         (WebCore::overrideLayoutOperation):
1281         (WebCore::FontData::~FontData):
1282         (WebCore::FontData::xHeight):
1283         (WebCore::FontData::drawRun):
1284         (WebCore::FontData::floatWidthForRun):
1285         (WebCore::FontData::drawLineForCharacters):
1286         (WebCore::FontData::selectionRectForRun):
1287         (WebCore::FontData::drawHighlightForRun):
1288         (WebCore::FontData::drawLineForMisspelling):
1289         (WebCore::FontData::pointToOffset):
1290         (WebCore::FontData::setAlwaysUseATSU):
1291         (WebCore::getSmallCapsRenderer):
1292         (WebCore::findSubstituteFont):
1293         (WebCore::rendererForAlternateFont):
1294         (WebCore::findSubstituteRenderer):
1295         (WebCore::computeWidthForSpace):
1296         (WebCore::setUpFont):
1297         (WebCore::CG_drawHighlight):
1298         (WebCore::CG_selectionRect):
1299         (WebCore::CG_draw):
1300         (WebCore::CG_floatWidthForRun):
1301         (WebCore::updateGlyphMapEntry):
1302         (WebCore::extendGlyphMap):
1303         (WebCore::extendWidthMap):
1304         (WebCore::initializeATSUStyle):
1305         (WebCore::createATSULayoutParameters):
1306         (WebCore::getTextBounds):
1307         (WebCore::ATSU_floatWidthForRun):
1308         (WebCore::ATSU_drawHighlight):
1309         (WebCore::ATSU_selectionRect):
1310         (WebCore::ATSU_draw):
1311         (WebCore::ATSU_pointToOffset):
1312         (WebCore::advanceWidthIteratorOneCharacter):
1313         (WebCore::CG_pointToOffset):
1314         (WebCore::glyphForCharacter):
1315         (WebCore::initializeWidthIterator):
1316         (WebCore::advanceWidthIterator):
1317         * platform/mac/FontMac.mm:
1318         (WebCore::m_font):
1319         (WebCore::FontFallbackList::~FontFallbackList):
1320         (WebCore::FontFallbackList::platformFont):
1321         (WebCore::FontFallbackList::primaryFont):
1322         (WebCore::FontFallbackList::determinePitch):
1323         (WebCore::FontFallbackList::invalidate):
1324         (WebCore::Font::platformFont):
1325         (WebCore::Font::selectionRectForText):
1326         (WebCore::Font::drawText):
1327         (WebCore::Font::drawHighlightForText):
1328         (WebCore::Font::drawLineForText):
1329         (WebCore::Font::drawLineForMisspelling):
1330         (WebCore::Font::misspellingLineThickness):
1331         (WebCore::Font::floatWidth):
1332         (WebCore::Font::checkSelectionPoint):
1333         * platform/mac/WebCoreTextRenderer.mm:
1334         (WebCoreDrawTextAtPoint):
1335         (WebCoreTextFloatWidth):
1336         (WebCoreSetAlwaysUseATSU):
1337         * platform/mac/WebTextRenderer.h: Removed.
1338         * platform/mac/WebTextRenderer.mm: Removed.
1339         * platform/mac/WebTextRendererFactory.h:
1340         * platform/mac/WebTextRendererFactory.mm:
1341         (-[WebTextRendererFactory isFontFixedPitch:]):
1342         (-[WebTextRendererFactory init]):
1343         (-[WebTextRendererFactory rendererWithFont:]):
1344         (-[WebTextRendererFactory fontWithFamilies:traits:size:]):
1345         * platform/win/FontWin.cpp:
1346         (WebCore::FontFallbackList::~FontFallbackList):
1347         (WebCore::FontFallbackList::determinePitch):
1348         (WebCore::FontFallbackList::invalidate):
1349         (WebCore::FontFallbackList::primaryFont):
1350         (WebCore::Font::floatWidth):
1351         (WebCore::Font::drawText):
1352         (WebCore::Font::drawHighlightForText):
1353         (WebCore::Font::selectionRectForText):
1354         (WebCore::Font::checkSelectionPoint):
1355
1356 2006-05-05  Darin Adler  <darin@apple.com>
1357
1358         - fix the Windows build
1359
1360         * platform/win/FontWin.cpp: (WebCore::getFontData):
1361
1362 2006-05-05  Darin Adler  <darin@apple.com>
1363
1364         * platform/SegmentedString.h: (WebCore::SegmentedString::advance): Oops!
1365         Removed an extra ! that was causing everything to fail.
1366
1367 2006-05-05  Darin Adler  <darin@apple.com>
1368
1369         Reviewed by Tim Hatcher.
1370
1371         - remove a few of the stranger features of QChar on the road to
1372           eventually replacing it with an integer type (probably ICU's UChar)
1373
1374         * platform/DeprecatedString.h: Remove SpecialCharacter, byteOrderMark, null,
1375         cell, row, isNull, mirrored, mirroredChar, operator char, >, >=, <, and <=
1376         from QChar. Also removed the many unneeded friend declarations. Remove findArg
1377         and arg from DeprecatedString.
1378
1379         * dom/Document.cpp: (WebCore::Document::parseQualifiedName): Cast the type of the
1380         buffer before invoking the U16_NEXT function. Turns out this was converting each
1381         QChar to a char and back to a UChar, which means it caused a bug with characters
1382         that are U+0100 or greater.
1383
1384         * css/csshelper.cpp: (WebCore::parseURL):
1385         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::constrainValue):
1386         * platform/StringImpl.cpp: (WebCore::StringImpl::toCoordsArray):
1387         * xml/xmlhttprequest.cpp: (WebCore::getCharset):
1388         Add some calls to unicode() since we don't have comparison operators any more.
1389
1390         * dom/StyledElement.cpp:
1391         (WebCore::toHex): Rewrote to just take a UChar parameter.
1392         (WebCore::StyledElement::addCSSColor): Call toHex on the character code.
1393
1394         * bridge/mac/WebCoreFrameBridge.mm:
1395         (-[WebCoreFrameBridge smartInsertForString:replacingRange:beforeString:afterString:]):
1396         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply):
1397         * editing/TextIterator.cpp: (WebCore::TextIterator::handleTextBox):
1398         * platform/SegmentedString.h:
1399         (WebCore::SegmentedString::push):
1400         (WebCore::SegmentedString::advance):
1401         (WebCore::SegmentedString::escaped):
1402         * platform/SegmentedString.cpp:
1403         (WebCore::SegmentedString::length):
1404         (WebCore::SegmentedString::append):
1405         (WebCore::SegmentedString::prepend):
1406         (WebCore::SegmentedString::toString):
1407         Changed calls to isNull() to instead just use unicode() and check for 0.
1408
1409         * html/HTMLTokenizer.cpp:
1410         (WebCore::HTMLTokenizer::parseEntity): Change callers that used cell and row to
1411         just use unicode() instead.
1412         (WebCore::HTMLTokenizer::parseTag): Ditto.
1413
1414         * loader/Decoder.cpp: (Decoder::decode): Changed code that did a type cast to
1415         unsigned char to instead call unicode().
1416
1417         * platform/DeprecatedString.cpp:
1418         (KWQStringData::makeAscii): Call latin1() instead of relying on the conversion operator.
1419         (DeprecatedString::DeprecatedString): Call unicode() instead of relying on the conversion
1420         operator (the character has been tested and is known to be ASCII).
1421         (DeprecatedString::at): Use 0 instead of QChar::null.
1422         (DeprecatedString::compare): Use unicode() so we can do comparison since we don't have
1423         comparison operators any more.
1424         (DeprecatedString::find): Call unicode() instead of relying on the conversion
1425         operator (the character has been tested and is known to be ASCII).
1426         (DeprecatedString::findRev): Ditto.
1427         (DeprecatedString::copyLatin1): Call latin1() instead of relying on the conversion operator.
1428         (DeprecatedString::lower): Call unicode() instead of relying on the conversion
1429         operator (the character has been tested and is known to be ASCII).
1430         (DeprecatedString::insert): Ditto.
1431         (DeprecatedString::replace): Ditto.
1432         (DeprecatedString::fill): Ditto.
1433         (DeprecatedString::append): Ditto.
1434
1435         * html/html_inlineimpl.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
1436         Eliminate the one use of DeprecatedString::arg.
1437
1438         - other cleanup
1439
1440         * kwq/KWQCString.cpp: Remove unneeded "using" directive.
1441
1442         * html/HTMLElementFactory.cpp:
1443         (WebCore::htmlConstructor):
1444         (WebCore::headConstructor):
1445         (WebCore::bodyConstructor):
1446         (WebCore::baseConstructor):
1447         (WebCore::linkConstructor):
1448         (WebCore::metaConstructor):
1449         (WebCore::styleConstructor):
1450         (WebCore::titleConstructor):
1451         (WebCore::frameConstructor):
1452         (WebCore::framesetConstructor):
1453         (WebCore::iframeConstructor):
1454         (WebCore::formConstructor):
1455         (WebCore::buttonConstructor):
1456         (WebCore::inputConstructor):
1457         (WebCore::isindexConstructor):
1458         (WebCore::fieldsetConstructor):
1459         (WebCore::labelConstructor):
1460         (WebCore::legendConstructor):
1461         (WebCore::optgroupConstructor):
1462         (WebCore::optionConstructor):
1463         (WebCore::selectConstructor):
1464         (WebCore::textareaConstructor):
1465         (WebCore::dlConstructor):
1466         (WebCore::ulConstructor):
1467         (WebCore::olConstructor):
1468         (WebCore::dirConstructor):
1469         (WebCore::menuConstructor):
1470         (WebCore::liConstructor):
1471         (WebCore::blockquoteConstructor):
1472         (WebCore::divConstructor):
1473         (WebCore::headingConstructor):
1474         (WebCore::hrConstructor):
1475         (WebCore::paragraphConstructor):
1476         (WebCore::preConstructor):
1477         (WebCore::basefontConstructor):
1478         (WebCore::fontConstructor):
1479         (WebCore::modConstructor):
1480         (WebCore::anchorConstructor):
1481         (WebCore::imageConstructor):
1482         (WebCore::mapConstructor):
1483         (WebCore::areaConstructor):
1484         (WebCore::canvasConstructor):
1485         (WebCore::appletConstructor):
1486         (WebCore::embedConstructor):
1487         (WebCore::objectConstructor):
1488         (WebCore::paramConstructor):
1489         (WebCore::scriptConstructor):
1490         (WebCore::tableConstructor):
1491         (WebCore::tableCaptionConstructor):
1492         (WebCore::tableColConstructor):
1493         (WebCore::tableRowConstructor):
1494         (WebCore::tableCellConstructor):
1495         (WebCore::tableSectionConstructor):
1496         (WebCore::brConstructor):
1497         (WebCore::quoteConstructor):
1498         (WebCore::marqueeConstructor):
1499         Mark functions static, remove unused parameters, change from docPtr to doc.
1500
1501 2006-05-05  Alexey Proskuryakov  <ap@nypop.com>
1502
1503         Reviewed by Maciej.
1504
1505         - http://bugs.webkit.org/show_bug.cgi?id=8626
1506           Strict mode erroneously triggered by a broken comment
1507
1508         Test: fast/parser/broken-comments-vs-parsing-mode.html
1509
1510         * page/Frame.cpp:
1511         (WebCore::Frame::endIfNotLoading): Call determineParseMode() if needed.
1512
1513 2006-05-05  Darin Adler  <darin@apple.com>
1514
1515         - fix the Windows build (this time for sure)
1516
1517         * platform/win/TemporaryLinkStubs.cpp:
1518         (GraphicsContext::translate): Added.
1519         (GraphicsContext::rotate): Ditto.
1520         (GraphicsContext::scale): Ditto.
1521
1522 2006-05-05  Darin Adler  <darin@apple.com>
1523
1524         - fix the Windows build
1525
1526         * bridge/win/FrameWin.h: Add Element* parameter to createPlugin.
1527         * platform/win/TemporaryLinkStubs.cpp: (FrameWin::createPlugin): Ditto.
1528
1529 2006-05-05  Darin Adler  <darin@apple.com>
1530
1531         - get the Windows build a little closer to building again
1532
1533         * platform/cairo/GraphicsContextCairo.cpp:
1534         (WebCore::GraphicsContext::drawRect): Call alpha to check if the color is transparent.
1535         Call setColor directly instead of setColorFromPen.
1536         (WebCore::GraphicsContext::drawLine): Ditto.
1537         (WebCore::GraphicsContext::drawEllipse): Ditto.
1538         (WebCore::GraphicsContext::drawArc): Ditto.
1539         (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
1540         * platform/win/TemporaryLinkStubs.cpp: (JavaAppletWidget::JavaAppletWidget): Updated parameter types.
1541
1542 2006-05-05  Darin Adler  <darin@apple.com>
1543
1544         Reviewed by Adele.
1545
1546         - fixed data structure used to save/restore form element state to remove the
1547           O(n^2) algorithm and remove anomalies in how it works
1548         - fix http://bugs.webkit.org/show_bug.cgi?id=8683
1549           REGRESSION: imdb search button has "Submit" overload after going back
1550
1551         * manual-tests/form-value-restore.html: Added.
1552
1553         * bridge/mac/WebCoreFrameBridge.mm:
1554         (-[WebCoreFrameBridge saveDocumentState]): Rewrote to call the new formElementsState
1555         function on the document and also to convert null strings to NSNull instead of empty
1556         NSString objects.
1557         (-[WebCoreFrameBridge restoreDocumentState]): Ditto, with the setStateForNewFormElements
1558         function.
1559
1560         * dom/Document.h: Added FormElementKey, FormElementKeyHash, and FormElementKeyHashTraits
1561         for use in the hash map. Made readyState, inputEncoding, defaultCharset, charset,
1562         characterSet, getElementByAccessKey, haveStylesheetsLoaded, usesDescendantRules,
1563         usesSiblingRules, inCompatMode, inAlmostStrictMode, inStrictMode, preferredStylesheetSet,
1564         selectedStylesheetSet, and getCSSTarget all const member functions. Removed the unused
1565         nextState function. Renamed registerMaintainsState and deregisterMaintainsState to
1566         registerFormElementWithState and HTMLGenericFormElement and changed them to use form
1567         elements rather than arbitrary DOM nodes. Replaced docState with formElementsState and
1568         setRestoreState and restoreState with setStateForNewFormElements, hasStateForNewFormElements,
1569         and takeStateForFormElement. Replaced m_maintainsState with m_formElementsWithState,
1570         m_state with m_stateForNewFormElements. Made m_elementsByAccessKey and m_accessKeyMapValid
1571         mutable. Removed unused m_elementNames, m_elementNameAlloc, m_elementNameCount, m_attrNames,
1572         m_attrNameAlloc, m_attrNameCount, m_namespaceURIs, m_namespaceURIAlloc, m_namespaceURICount.
1573
1574         * dom/Document.cpp:
1575         (WebCore::Document::Document): Remove initialization of long-obsolete m_elementNames and
1576         m_attrNames.
1577         (WebCore::Document::~Document): Remove destruction of same.
1578         (WebCore::Document::readyState): Made const.
1579         (WebCore::Document::inputEncoding): Ditto.
1580         (WebCore::Document::defaultCharset): Ditto.
1581         (WebCore::Document::getElementByAccessKey): Ditto.
1582         (WebCore::Document::preferredStylesheetSet): Ditto.
1583         (WebCore::Document::selectedStylesheetSet): Ditto.
1584         (WebCore::Document::getCSSTarget): Ditto.
1585         (WebCore::Document::formElementsState): Added. Replaces the old docState function.
1586         Builds a vector of strings, with 3 strings for each form element containing the
1587         name, type, and state value.
1588         (WebCore::Document::setStateForNewFormElements): Added. Converts the state vector
1589         into a hash map, considering the scheme with 3 strings for form element used above.
1590         (WebCore::Document::hasStateForNewFormElements): Added.
1591         (WebCore::Document::takeStateForFormElement): Added. Given a name and type, looks
1592         up the values in the hash map and "peels off" the last one.
1593         (WebCore::FormElementKey::FormElementKey): Added.
1594         (WebCore::FormElementKey::~FormElementKey): Added.
1595         (WebCore::FormElementKey::operator=): Added.
1596         (WebCore::FormElementKey::ref): Added.
1597         (WebCore::FormElementKey::deref): Added.
1598         (WebCore::FormElementKeyHash::hash): Added.
1599         (WebCore::FormElementKeyHashTraits::deletedValue): Added.
1600
1601         * dom/Element.h: Removed state function.
1602         * dom/Node.h: Removed maintainsState, state, and restoreState functions.
1603         * dom/Node.cpp: Ditto.
1604
1605         * dom/QualifiedName.cpp: Reformatted.
1606         (WebCore::hashComponents): Removed code to handle buffers that are not multiples
1607         of 4 bytes, since a QualifiedName is guaranteed to be; also asserted that fact.
1608
1609         * html/HTMLParser.cpp:
1610         (WebCore::HTMLParser::insertNode): Remove code to restore state; that's now handled
1611         by closeRenderer.
1612         (WebCore::HTMLParser::popOneBlock): Ditto.
1613
1614         * html/HTMLFormElement.cpp: Added include of HTMLInputElement.h.
1615
1616         * html/HTMLGenericFormElement.h: Changed form to be a const member function.
1617         Changed type function to return a const AtomicString& instead of a String.
1618         Added an override of closeRenderer. Removed state and findMatchingState functions.
1619         Added stateValue and restoreState functions. Made m_form, m_disabled, and m_readOnly
1620         be private instead of protected. Removed m_inited. Changed booleans to not use bit
1621         fields since there are only two of them.
1622         * html/HTMLGenericFormElement.cpp: Removed encodedElementName, state, and
1623         findMatchingState functions.
1624         (WebCore::HTMLGenericFormElement::stateValue): Added. No implementation. This will only be
1625         called for subclasses that call registerFormElementWithState, and those will override and
1626         implement it.
1627         (WebCore::HTMLGenericFormElement::restoreState): Ditto.
1628         (WebCore::HTMLGenericFormElement::closeRenderer): Added. Replaces code that was in the
1629         HTML parser. Calls takeStateForFormElement, passing in the name and type, and if a
1630         state is found, calls restoreState.
1631
1632         * html/HTMLButtonElement.h: Changed type to return a const AtomicString& instead
1633         of a String.
1634         * html/HTMLButtonElement.cpp:
1635         (WebCore::HTMLButtonElement::type): Return a const AtomicString& instead of a
1636         String.
1637         (WebCore::HTMLButtonElement::defaultEventHandler): Use form() instead of m_form.
1638         (WebCore::HTMLButtonElement::isSuccessfulSubmitButton): Use disabled() instead of
1639         m_disabled.
1640
1641         * html/HTMLInputElement.h: Changed type to return a const AtomicString& instead
1642         of a String. Removed maintainsState, state, and restoreState functions, and added
1643         new stateValue and restoreState functions. Added m_inited (moved here from the generic
1644         form element base class).
1645         * html/HTMLInputElement.cpp:
1646         (WebCore::HTMLInputElement::init): Call registerFormElementWithState. This was
1647         formerly done by the HTML parser.
1648         (WebCore::HTMLInputElement::~HTMLInputElement): Call deregisterFormElementWithState
1649         by its new name.
1650         (WebCore::HTMLInputElement::isKeyboardFocusable): Use form() instead of m_form.
1651         (WebCore::HTMLInputElement::setType): Ditto.
1652         (WebCore::HTMLInputElement::setInputType): Ditto. Also call inputType() != PASSWORD
1653         instead of maintainsState(), since this is the only function that needs to know
1654         the rule and it's no longer a function in the base class. Also call register and
1655         deregister functions by their new names.
1656         (WebCore::HTMLInputElement::type): Changed to return const AtomicString& instead
1657         of String.
1658         (WebCore::HTMLInputElement::stateValue): Renamed from state and changed to no
1659         longer include the name and type, formerly obtained by calling the base class's
1660         HTMLGenericFormElement::state, and to no longer modify the value() string by
1661         adding a ".", which gets in the way of distinguishing null and empty values
1662         and is slower and unnecessary.
1663         (WebCore::HTMLInputElement::restoreState):  Changed because it takes a single
1664         state and doesn't need to call findMatchingState, and also to no longer remove the last
1665         character from the value when restoring state.
1666         (WebCore::HTMLInputElement::parseMappedAttribute): Use form() instead of m_form.
1667         (WebCore::HTMLInputElement::isSuccessfulSubmitButton): Use disabled() instead of
1668         m_disabled.
1669         (WebCore::HTMLInputElement::setChecked): Use form() instead of m_form.
1670         (WebCore::HTMLInputElement::preDispatchEventHandler): Ditto.
1671         (WebCore::HTMLInputElement::defaultEventHandler): Ditto.
1672
1673         * html/HTMLSelectElement.h: Changed type to return a const AtomicString& instead
1674         of a String.
1675         * html/HTMLSelectElement.cpp:
1676         (WebCore::HTMLSelectElement::HTMLSelectElement): Call registerFormElementWithState.
1677         This was formerly done by the HTML parser.
1678         (WebCore::HTMLSelectElement::~HTMLSelectElement): Call deregisterFormElementWithState
1679         by its new name.
1680         (WebCore::HTMLSelectElement::type): Changed to return const AtomicString& instead
1681         of String.
1682         (WebCore::HTMLSelectElement::stateValue): Renamed from state and changed to no
1683         longer include the name and type, formerly obtained by calling the base class's
1684         HTMLGenericFormElement::state, and to build the string in a Vector<char> instead of
1685         appending characters one at a time to a string.
1686         (WebCore::HTMLSelectElement::restoreState):  Changed because it takes a single
1687         state and doesn't need to call findMatchingState.
1688         (WebCore::HTMLSelectElement::defaultEventHandler): Use form() instead of m_form.
1689
1690         * html/HTMLTextAreaElement.h: Changed type to return a const AtomicString& instead
1691         of a String. Removed maintainsState, state, and restoreState functions, and added
1692         new stateValue and restoreState functions.
1693         * html/HTMLTextAreaElement.cpp:
1694         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Call registerFormElementWithState.
1695         This was formerly done by the HTML parser. Also use member initialization instead of
1696         assignment.
1697         (WebCore::HTMLTextAreaElement::~HTMLTextAreaElement): Call deregisterFormElementWithState
1698         by its new name.
1699         (WebCore::HTMLTextAreaElement::type): Changed to return const AtomicString& instead
1700         of String.
1701         (WebCore::HTMLTextAreaElement::stateValue): Renamed from state and changed to no
1702         longer include the name and type, formerly obtained by calling the base class's
1703         HTMLGenericFormElement::state, and to no longer modify the value() string by
1704         adding a ".", which is unnecessary.
1705         (WebCore::HTMLTextAreaElement::restoreState): Changed because it takes a single
1706         state and doesn't need to call findMatchingState, and also to no longer remove the last
1707         character from the value when restoring state.
1708         (WebCore::HTMLTextAreaElement::updateValue): Changed to const.
1709         (WebCore::HTMLTextAreaElement::value): Ditto.
1710         (WebCore::HTMLTextAreaElement::defaultValue): Ditto.
1711
1712         * html/HTMLFieldSetElement.h: Changed type to return a const AtomicString& instead
1713         of a String.
1714         * html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::type): Ditto.
1715         * html/HTMLKeygenElement.h: Ditto.
1716         * html/HTMLKeygenElement.cpp: (WebCore::HTMLKeygenElement::type): Ditto.
1717         * html/HTMLLegendElement.h: Ditto.
1718         * html/HTMLLegendElement.cpp: (WebCore::HTMLLegendElement::type):
1719         * html/HTMLOptGroupElement.h: Ditto.
1720         * html/HTMLOptGroupElement.cpp: (WebCore::HTMLOptGroupElement::type): Ditto.
1721         * html/HTMLOptionElement.h: Ditto.
1722         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::type): Ditto.
1723
1724         * ksvg2/svg/SVGAnimationElement.cpp: (SVGAnimationElement::closeRenderer):
1725         Added missing call to base class.
1726
1727         * rendering/render_form.h: Removed element() functions that cast to the
1728         appropriate derived element class. They do make some bits of code slightly
1729         more readable, but they also require including too many headers. Removed
1730         the includes of HTMLInputElement.h, HTMLSelectElement.h, HTMLTextAreaElement.h,
1731         and KWQLineEdit.h, and added an include of GraphicsTypes.h.
1732         * rendering/render_form.cpp:
1733         (WebCore::RenderFormElement::updateFromElement): Changed use of element()
1734         to instead use node() and cast.
1735         (WebCore::RenderFormElement::clicked): Ditto.
1736         (WebCore::RenderLineEdit::selectionChanged): Ditto.
1737         (WebCore::RenderLineEdit::returnPressed): Ditto.
1738         (WebCore::RenderLineEdit::performSearch): Ditto.
1739         (WebCore::RenderLineEdit::addSearchResult): Ditto.
1740         (WebCore::RenderLineEdit::calcMinMaxWidth): Ditto.
1741         (WebCore::RenderLineEdit::setStyle): Ditto.
1742         (WebCore::RenderLineEdit::updateFromElement): Ditto.
1743         (WebCore::RenderLineEdit::valueChanged): Ditto.
1744         (WebCore::RenderFileButton::calcMinMaxWidth): Ditto.
1745         (WebCore::RenderFileButton::updateFromElement): Ditto.
1746         (WebCore::RenderFileButton::returnPressed): Ditto.
1747         (WebCore::RenderFileButton::valueChanged): Ditto.
1748         (WebCore::RenderSelect::updateFromElement): Ditto.
1749         (WebCore::RenderSelect::layout): Ditto.
1750         (WebCore::RenderSelect::valueChanged): Ditto.
1751         (WebCore::RenderSelect::selectionChanged): Ditto.
1752         (WebCore::RenderSelect::updateSelection): Ditto.
1753         (WebCore::RenderTextArea::destroy): Ditto.
1754         (WebCore::RenderTextArea::calcMinMaxWidth): Ditto.
1755         (WebCore::RenderTextArea::setStyle): Ditto.
1756         (WebCore::RenderTextArea::updateFromElement): Ditto.
1757         (WebCore::RenderTextArea::valueChanged): Ditto.
1758         (WebCore::RenderTextArea::selectionChanged): Ditto.
1759         (WebCore::RenderSlider::updateFromElement): Ditto.
1760         (WebCore::RenderSlider::valueChanged): Ditto.
1761
1762 2006-05-05  Matt Gough  <matt@softchaos.com>
1763
1764         Reviewed by Darin.
1765
1766         http://bugs.webkit.org/show_bug.cgi?id=8563
1767
1768         Test: fast/doctypes/005-case-preserving.html
1769
1770         The doctype object in the DOM is now usable by client code
1771         as opposed to always being exposed as nil. Now also ensures that
1772         the 'name' of the component preserves the case of the original html source.
1773         (i.e HtMl -> HtMl not HTML)
1774
1775         * dom/Document.h:
1776         Changes comment by docType() to say it may return 0 for html
1777         * html/HTMLDocument.cpp:
1778         (WebCore::parseDocTypeDeclaration):
1779         (WebCore::HTMLDocument::determineParseMode):
1780         Preserves the case of the name component
1781         (WebCore::HTMLDocument::doctype):removed
1782         * html/HTMLDocument.h:
1783         (WebCore::HTMLDocument::doctype):removed
1784
1785 2006-05-05  Rob Buis  <buis@kde.org>
1786
1787         Reviewed by Darin.
1788
1789         Fix for http://bugs.webkit.org/show_bug.cgi?id=8445:
1790         [DOMHTMLSelectElement multiple] returns no when the select element is multiple
1791
1792         Correct the logic errors, which are clearly indicated by the changeset given
1793         in the bug report.
1794
1795         * bindings/objc/DOMHTML.mm:
1796         (-[DOMHTMLLinkElement disabled]):
1797         (-[DOMHTMLSelectElement disabled]):
1798         (-[DOMHTMLSelectElement multiple]):
1799         (-[DOMHTMLOptGroupElement disabled]):
1800         (-[DOMHTMLOptionElement defaultSelected]):
1801         (-[DOMHTMLOptionElement disabled]):
1802
1803 2006-05-04  Darin Adler  <darin@apple.com>
1804
1805         Reviewed by Tim Omernick.
1806
1807         - fix storage leak I introduced yesterday
1808
1809         * platform/cg/GraphicsContextCG.cpp:
1810         (WebCore::setCGFillColor): Added.
1811         (WebCore::setCGStrokeColor): Added.
1812         (WebCore::GraphicsContext::drawRect): Use setCGFillColor to avoid allocating
1813         a CGColorRef object.
1814         (WebCore::GraphicsContext::drawLine): Use setCGStrokeColor and setCGFillColor
1815         to avoid allocating a CGColorRef object.
1816         (WebCore::GraphicsContext::drawEllipse): Ditto.
1817         (WebCore::GraphicsContext::drawArc): Ditto.
1818         (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
1819         (WebCore::GraphicsContext::fillRect): Ditto.
1820
1821 2006-05-04  Justin Garcia  <justin.garcia@apple.com>
1822
1823         Reviewed by harrison
1824
1825         * dom/Node.cpp:
1826         (WebCore::Node::rootEditableElement):
1827         Restored code to stop at the body tag.  Editing shouldn't be allowed to 
1828         happen outside the body, so it needs to be the editable root even if the 
1829         html element is contentEditable.
1830         * editing/ReplaceSelectionCommand.cpp:
1831         (WebCore::ReplaceSelectionCommand::shouldMergeEnd):
1832         Now takes in more information so it can be "the decider".
1833         (WebCore::ReplaceSelectionCommand::doApply):
1834         Merging two paragraphs will destroy the moved one's block styles. Perform 
1835         the end merge backward (from content already in the document to just inserted
1836         content) if moving forward would move the paragraph that contained the start of 
1837         the selection being pasted into, since we always want to preserve that paragraph's 
1838         block style.
1839         Moving backward in this case is also helpful because otherwise it would be
1840         difficult to remember the position where inserted content began (since merging
1841         would remove m_firstNodeInserted).  That position is needed in order to select 
1842         the replacement and to add smart replace whitespace.
1843         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
1844         If [br, 0] is at the end of a block, the br is not necessarily collapsed
1845         in quirks mode.  [br, 0] needs to also not be at the start of a block.
1846          
1847         * editing/ReplaceSelectionCommand.h:
1848
1849 2006-05-04  Tim Omernick  <timo@apple.com>
1850
1851         Reviewed by Darin.
1852
1853         <rdar://problem/4537606> Give Java WebKit plugin access to its own DOM element
1854
1855         * bridge/mac/WebCoreFrameBridge.h:
1856         Added DOMElement parameter to -viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:.
1857
1858         * bridge/JavaAppletWidget.h:
1859         Constructor now takes the applet's element instead of its containing frame.
1860
1861         * bridge/mac/JavaAppletWidget.mm:
1862         (JavaAppletWidget::JavaAppletWidget):
1863         Pass the applet's element to viewForJavaAppletWithFrame:.
1864
1865         * rendering/RenderApplet.cpp:
1866         (WebCore::RenderApplet::createWidgetIfNecessary):
1867         Pass the element along to JavaAppletWidget.
1868
1869 2006-05-04  Tim Omernick  <timo@apple.com>
1870
1871         Reviewed by John Sullivan.
1872
1873         <rdar://problem/4480186> Give WebKit plugins access to their own DOM element
1874
1875         * bridge/mac/WebCoreFrameBridge.h:
1876         Added DOMElement: parameter to -viewForPluginWithURL:attributeNames:attributueValues:MIMEType:
1877
1878         * bridge/mac/FrameMac.h:
1879         * bridge/mac/FrameMac.mm:
1880         (WebCore::FrameMac::createPlugin):
1881         Added "element" parameter; wrap element in DOMElement and pass up to the bridge.
1882
1883         * page/Frame.h:
1884         Added "element" parameter to createPlugin().
1885         * page/Frame.cpp:
1886         (WebCore::Frame::loadPlugin):
1887         Get the plugin's DOM element and pass to createPlugin().
1888
1889 2006-05-04  Eric Seidel  <eseidel@apple.com>
1890
1891         Reviewed by timo.
1892
1893         Add drag & drop support to <input type="file">
1894         http://bugs.webkit.org/show_bug.cgi?id=8733
1895
1896         Test: manual/input-type-file-drag-drop.html
1897
1898         * kwq/KWQFileButton.mm:
1899         (-[WebFileChooserButton initWithWidget::]):
1900         (-[WebCoreFileButton initWithWidget:]):
1901         (-[WebCoreFileButton drawRect:]):
1902         (-[WebCoreFileButton updateLabel]):
1903         (-[WebCoreFileButton setFilename:]):
1904         (-[WebCoreFileButton changeFilename:]):
1905         (-[WebCoreFileButton chooseFilename:]):
1906         (validFilenameFromPasteboard):
1907         (-[WebCoreFileButton draggingEntered:]):
1908         (-[WebCoreFileButton draggingExited:]):
1909         (-[WebCoreFileButton performDragOperation:]):
1910
1911 2006-05-04  Beth Dakin  <bdakin@apple.com>
1912
1913         Reviewed by Hyatt.
1914
1915         Fix for http://bugs.webkit.org/show_bug.cgi?id=8732 
1916         Backgrounds with background-size and background-origin do not 
1917         always lay out correctly
1918
1919         * platform/cairo/ImageCairo.cpp:
1920         (WebCore::Image::drawTiled): We no longer need to scale the source 
1921         point since it will now come in with the scale already taken into 
1922         account.
1923         * platform/mac/ImageMac.mm:
1924         (WebCore::Image::drawTiled): Same as above.
1925         * rendering/RenderBox.cpp:
1926         (WebCore::cacluateBackgroundSize): Now calculate the background 
1927         size in a helper method.
1928         (WebCore::RenderBox::paintBackgroundExtended): Calculate the 
1929         background size before calculating cx, cy, cw, ch, sx, and sy so 
1930         that they can all be calculated with the scaled image size taken 
1931         into account.
1932
1933 2006-05-04  David Hyatt  <hyatt@apple.com>
1934
1935         Fix for 8693, crash when reloading PDF. Make sure to clear the truncator's
1936         cached renderer.
1937
1938         Reviewed by beth
1939
1940         * bridge/mac/WebCoreStringTruncator.h:
1941         * bridge/mac/WebCoreStringTruncator.mm:
1942         (+[WebCoreStringTruncator clear]):
1943         * platform/mac/WebTextRendererFactory.mm:
1944         (-[WebTextRendererFactory clearCaches]):
1945
1946 2006-05-03  Darin Adler  <darin@apple.com>
1947
1948         Reviewed by Eric.
1949
1950         - http://bugs.webkit.org/show_bug.cgi?id=8696
1951           another round of GraphicsContext improvements
1952
1953         * WebCore.xcodeproj/project.pbxproj: Added GraphicsContextCG.cpp.
1954         * html/CanvasRenderingContext2D.cpp:
1955         (WebCore::CanvasRenderingContext2D::scale): Use new GraphicsContext function.
1956         (WebCore::CanvasRenderingContext2D::rotate): Ditto.
1957         (WebCore::CanvasRenderingContext2D::translate): Ditto.
1958         * kwq/KWQComboBox.mm: Added include (not sure if this is needed for this patch,
1959         but it's needed for one of my upcoming ones).
1960
1961         * platform/GraphicsContext.h: Changed fillColor and setFillColor to use Color
1962         instead of RGBA32. Removed setColorFromFillColor and setColorFromPen. Added
1963         scale, rotate, and translate functions.
1964         * platform/GraphicsContext.cpp:
1965         (WebCore::GraphicsContext::setFillColor): Changed to use Color instead of RGBA32.
1966         (WebCore::GraphicsContext::fillColor): Ditto.
1967
1968         * platform/GraphicsTypes.h: Moved HorizontalAlignment here.
1969         * platform/Widget.h: Removed HorizontalAlignment from here.
1970
1971         * platform/cg/GraphicsContextCG.cpp: Added. Started as a copy of GraphicsContextMac.mm.
1972         (WebCore::GraphicsContext::drawRect): Rewrote to not rely on [NSGraphicsContext currentContext].
1973         (WebCore::GraphicsContext::drawLine): Ditto.
1974         (WebCore::GraphicsContext::drawEllipse): Ditto.
1975         (WebCore::GraphicsContext::drawArc): Ditto.
1976         (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
1977         (WebCore::GraphicsContext::fillRect): Ditto.
1978         (WebCore::GraphicsContext::setLineWidth):  Added check of paintingDisabled(). 
1979         (WebCore::GraphicsContext::setMiterLimit): Ditto.
1980         (WebCore::GraphicsContext::setAlpha): Ditto.
1981         (WebCore::GraphicsContext::clearRect): Ditto.
1982         (WebCore::GraphicsContext::strokeRect): Ditto.
1983         (WebCore::GraphicsContext::setLineCap): Ditto.
1984         (WebCore::GraphicsContext::setLineJoin): Ditto.
1985         (WebCore::GraphicsContext::clip): Ditto.
1986         (WebCore::GraphicsContext::scale): Added.
1987         (WebCore::GraphicsContext::rotate): Added.
1988         (WebCore::GraphicsContext::translate): Added.
1989
1990         * platform/mac/GraphicsContextMac.mm: Moved most of this file into GraphicsContextCG.cpp.
1991         (WebCore::GraphicsContext::setCompositeOperation): Added check of paintingDisabled().
1992
1993         * platform/mac/WebCoreSystemInterface.h: Added declarations so this header
1994         stands alone.
1995
1996 2006-05-03  Darin Adler  <darin@apple.com>
1997
1998         Reviewed by Justin.
1999
2000         - fix http://bugs.webkit.org/show_bug.cgi?id=8159
2001           REGRESSION: Clicking outside new text field focuses the field
2002
2003         This bug has always been present for "content editable" HTML, but
2004         now affects <input type=text> as well. The problem is with the editing
2005         concept of a "deep equivalent". When computing the deep equivalent,
2006         the code can move from outside an editable area to inside. To fix this,
2007         I removed all use of the "deep equivalent" concept.
2008
2009         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
2010         Changed argument names from _x and _y to just x and y. When the element
2011         is the editable root, changed things so that clicks that are not within
2012         the element at all return positions before or after the element, rather than
2013         always choosing the closest point within the element. This gets us off on
2014         the right foot, by not choosing a position inside an editable root when you
2015         click outside that editable root. This code handles shadowParentNode as well,
2016         and also calls positionForCoordinates on children rather than calling
2017         positionForRenderer (which I believe is now a function that can be removed).
2018
2019         * editing/VisiblePosition.h: Removed the deepEquivalent function.
2020         * editing/VisiblePosition.cpp:
2021         (WebCore::VisiblePosition::previousVisiblePosition): Removed use of the
2022         deepEquivalent function. Also, to make this function easier to understand
2023         I separated out the case where the start point is "in rendered content"
2024         and the case where it's not into two separate loops.
2025         (WebCore::VisiblePosition::nextVisiblePosition): Ditto.
2026         (WebCore::VisiblePosition::initDeepPosition): Removed use of the deepEquivalent
2027         function. Also added code to make sure that this work never turns a position
2028         outside an editable element into a position inside that editable element, or
2029         vice versa. Reorganized the code a bit.
2030
2031         * dom/Position.cpp:
2032         (WebCore::Position::upstream): Removed use of the deepEquivalent function.
2033         (WebCore::Position::downstream): Ditto.
2034
2035         * editing/htmlediting.cpp:
2036         (WebCore::editingIgnoresContent): Changed to use isReplaced instead of isWidget
2037         and isImage to determine if editing should ignore content.
2038         (WebCore::firstInSpecialElement): Rewrote isFirstVisiblePositionInSpecialElement
2039         to have code to share with positionBeforeContainingSpecialElement. And changed
2040         to allow both the position just before a table and the position just inside a
2041         table to qualify. While this is slightly sloppy, the old code worked because
2042         of the "deep equivalent" technique. This change is needed to get the desired
2043         results even without that technique.
2044         (WebCore::lastInSpecialElement): Ditto.
2045         (WebCore::isFirstVisiblePositionInSpecialElement): Changed to use the new function.
2046         (WebCore::positionBeforeContainingSpecialElement): Ditto.
2047         (WebCore::isLastVisiblePositionInSpecialElement): Ditto.
2048         (WebCore::positionAfterContainingSpecialElement): Ditto.
2049
2050         * dom/Node.cpp: (WebCore::Node::rootEditableElement): Rewrote to remove
2051         special case for body tag.
2052
2053         - other changes
2054
2055         * html/HTMLElement.cpp:
2056         (WebCore::HTMLElement::setOuterHTML): Added a FIXME about the fact
2057         that this won't merge neighboring text nodes the way setOuterText does.
2058         (WebCore::HTMLElement::setInnerText): Added a FIXME about the fact that
2059         this creates a text node even when setting to empty text.
2060         (WebCore::HTMLElement::setOuterText): Ditto.
2061
2062         * editing/DeleteSelectionCommand.cpp: Removed some #if 1 and #if 0.
2063         * editing/ReplaceSelectionCommand.cpp: A little reformatting.
2064         * rendering/render_button.h: Tiny formatting tweak.
2065
2066 2006-05-02  Adele Peterson  <adele@apple.com>
2067
2068         Reviewed by Beth.
2069
2070         Fix for <rdar://problem/4523671> 
2071         REGRESSION (NativeTextField): Auto-complete popup list doesn't appear at the correct location after scrolling page.
2072
2073         * bindings/objc/DOMHTML.mm: (-[DOMHTMLInputElement _rectOnScreen]):
2074         Use the documentView to compute the correct rect for the element when the view is scrolled.
2075
2076 2006-05-02  Justin Garcia  <justin.garcia@apple.com>
2077
2078         Reviewed by harrison
2079         
2080         <http://bugs.webkit.org/show_bug.cgi?id=8704>
2081         Fix a few end merge bugs
2082         <rdar://problem/4424044>
2083         REGRESSION: Extra line appears when typing
2084
2085         * bridge/mac/WebCoreFrameBridge.mm:
2086         (-[WebCoreFrameBridge smartInsertForString:replacingRange:beforeString:afterString:]): 
2087         Use renamed characterAfter.
2088         * editing/InsertParagraphSeparatorCommand.cpp:
2089         (WebCore::InsertParagraphSeparatorCommand::doApply):
2090         Regenerate a VisiblePosition that became stale during a text node split.
2091         Don't rebalance whitespace after the operation, 1) it has a bug that turns preserved
2092         newlines into nbsps, 2) I think it should only be done during serialization, not after 
2093         every command (since editable regions now always have -webkit-nbsp-mode:space on them).
2094         Use a regular br for the placeholder as I think we can move away from -webkit-block-placeholders.
2095         
2096         * editing/RebalanceWhitespaceCommand.cpp: Added FIXMEs.
2097         * editing/ReplaceSelectionCommand.cpp:
2098         (WebCore::ReplaceSelectionCommand::shouldMergeStart): Removed FIXME.
2099         (WebCore::ReplaceSelectionCommand::shouldMergeEnd): Can now use rendering information.
2100         (WebCore::ReplaceSelectionCommand::doApply):
2101         Call shouldMergeEnd after the insertion so that it can use rendering information.
2102         Don't use positionAfterNode of the last node inserted to mark the position at the end 
2103         of inserted content because canonicalization can send it into content that was already
2104         in the document.
2105         
2106         * editing/ReplaceSelectionCommand.h:
2107         * editing/VisiblePosition.cpp:
2108         (WebCore::VisiblePosition::characterAfter): 
2109         Renamed.  When two candidates are visually equivalent, the rightmost candidate will be 
2110         the one inside the text node where the character will be.
2111         
2112         * editing/VisiblePosition.h:
2113         * editing/htmlediting.cpp:
2114         (WebCore::enclosingTableCell): Added.
2115         (WebCore::enclosingList):
2116         * editing/htmlediting.h:
2117
2118 2006-05-02  David Hyatt  <hyatt@apple.com>
2119
2120         Partial fix for the crash in bugzilla bug 8088.  There's a third crash
2121         even after fixing this though.
2122
2123         Reviewed by darin
2124
2125         * platform/mac/WebTextRenderer.mm:
2126         (WebCore::WidthMap::widths):
2127         (WebCore::extendWidthMap):
2128         * platform/mac/WebTextRendererFactory.mm:
2129         (-[WebTextRendererFactory clearCaches]):
2130
2131 2006-05-02  Steve Falkenburg  <sfalken@apple.com>
2132
2133         Reviewed by eric.
2134
2135         * WebCore.vcproj/WebCore/WebCore.vcproj: defined NDEBUG in release build
2136         * bridge/win/FrameWin.cpp:
2137         (WebCore::FrameWin::FrameWin): turned on javascript.
2138         * kwq/KWQKHTMLSettings.h: 
2139         (KHTMLSettings::KHTMLSettings): initialized settings to 0
2140
2141 2006-05-02  David Hyatt  <hyatt@apple.com>
2142
2143         Make sure to updateLayout on all scrolling functions (in particular when
2144         setting scrollLeft/Top).
2145
2146         Reviewed by eric
2147
2148         fast/overflow/008,html added as a test case.
2149
2150         * dom/Element.cpp:
2151         (WebCore::Element::scrollIntoView):
2152         (WebCore::Element::scrollIntoViewIfNeeded):
2153         (WebCore::Element::setScrollLeft):
2154         (WebCore::Element::setScrollTop):
2155
2156 2006-05-02  Anders Carlsson  <andersca@mac.com>
2157
2158         Reviewed by Dave Hyatt.
2159         
2160         http://bugs.webkit.org/show_bug.cgi?id=8688
2161         file URLs aren't being serialized correctly when using window.location
2162         
2163         * platform/KURL.cpp:
2164         (KURL::prettyURL):
2165         Append "//" for file URLs.
2166         
2167 2006-05-01  David Hyatt  <hyatt@apple.com>
2168
2169         Convert WebTextRenderer to be a C++ class.  Change the factory so
2170         that it uses pointer-based hashmaps instead of NSMutableDictionaries.
2171         Convert uses of malloc/free to new/delete so that they start using
2172         the fastMalloc/fastFree code.
2173
2174         Reviewed by darin
2175
2176         * bridge/mac/WebCoreStringTruncator.mm:
2177         (stringWidth):
2178         (truncateString):
2179         * kwq/KWQComboBox.mm:
2180         (QComboBox::sizeHint):
2181         * kwq/KWQLineEdit.mm:
2182         (QLineEdit::sizeForCharacterWidth):
2183         * kwq/KWQListBox.mm:
2184         (itemTextRenderer):
2185         (groupLabelTextRenderer):
2186         (QListBox::sizeForNumberOfLines):
2187         (QListBox::clearCachedTextRenderers):
2188         (-[KWQTableView drawRow:clipRect:]):
2189         * platform/FontDataSet.h:
2190         * platform/mac/FontMac.mm:
2191         (WebCore::FontDataSet::~FontDataSet):
2192         (WebCore::FontDataSet::getRenderer):
2193         (WebCore::FontDataSet::invalidate):
2194         (WebCore::Font::ascent):
2195         (WebCore::Font::descent):
2196         (WebCore::Font::lineSpacing):
2197         (WebCore::Font::xHeight):
2198         (WebCore::Font::selectionRectForText):
2199         (WebCore::Font::drawText):
2200         (WebCore::Font::drawHighlightForText):
2201         (WebCore::Font::drawLineForText):
2202         (WebCore::Font::drawLineForMisspelling):
2203         (WebCore::Font::misspellingLineThickness):
2204         (WebCore::Font::floatWidth):
2205         (WebCore::Font::checkSelectionPoint):
2206         * platform/mac/WebCoreTextRenderer.mm:
2207         (WebCoreDrawTextAtPoint):
2208         (WebCoreTextFloatWidth):
2209         (WebCoreSetAlwaysUseATSU):
2210         * platform/mac/WebTextRenderer.h:
2211         (WebCore::WebTextRenderer::ascent):
2212         (WebCore::WebTextRenderer::descent):
2213         (WebCore::WebTextRenderer::lineSpacing):
2214         (WebCore::WebTextRenderer::lineGap):
2215         (WebCore::WebTextRenderer::misspellingLineThickness):
2216         (WebCore::WebTextRenderer::misspellingLinePatternWidth):
2217         (WebCore::WebTextRenderer::misspellingLinePatternGapWidth):
2218         * platform/mac/WebTextRenderer.mm:
2219         (WebCore::WebCoreInitializeFont):
2220         (WebCore::WebCoreInitializeTextRun):
2221         (WebCore::WebCoreInitializeEmptyTextStyle):
2222         (WebCore::WebCoreInitializeEmptyTextGeometry):
2223         (WebCore::widthForGlyph):
2224         (WebCore::overrideLayoutOperation):
2225         (WebCore::m_ATSUMirrors):
2226         (WebCore::WebTextRenderer::~WebTextRenderer):
2227         (WebCore::WebTextRenderer::xHeight):
2228         (WebCore::WebTextRenderer::drawRun):
2229         (WebCore::WebTextRenderer::floatWidthForRun):
2230         (WebCore::WebTextRenderer::drawLineForCharacters):
2231         (WebCore::WebTextRenderer::selectionRectForRun):
2232         (WebCore::WebTextRenderer::drawHighlightForRun):
2233         (WebCore::WebTextRenderer::drawLineForMisspelling):
2234         (WebCore::WebTextRenderer::pointToOffset):
2235         (WebCore::WebTextRenderer::setAlwaysUseATSU):
2236         (WebCore::getSmallCapsRenderer):
2237         (WebCore::findSubstituteFont):
2238         (WebCore::rendererForAlternateFont):
2239         (WebCore::computeWidthForSpace):
2240         (WebCore::setUpFont):
2241         (WebCore::CG_selectionRect):
2242         (WebCore::CG_draw):
2243         (WebCore::updateGlyphMapEntry):
2244         (WebCore::extendGlyphMap):
2245         (WebCore::extendWidthMap):
2246         (WebCore::initializeATSUStyle):
2247         (WebCore::createATSULayoutParameters):
2248         (WebCore::disposeATSULayoutParameters):
2249         (WebCore::addDirectionalOverride):
2250         (WebCore::ATSU_selectionRect):
2251         (WebCore::ATSU_draw):
2252         (WebCore::ATSU_pointToOffset):
2253         (WebCore::freeWidthMap):
2254         (WebCore::freeGlyphMap):
2255         (WebCore::glyphForCharacter):
2256         (WebCore::advanceWidthIterator):
2257         * platform/mac/WebTextRendererFactory.h:
2258         * platform/mac/WebTextRendererFactory.mm:
2259         (-[WebTextRendererFactory clearCaches]):
2260         (-[WebTextRendererFactory init]):
2261         (-[WebTextRendererFactory dealloc]):
2262         (-[WebTextRendererFactory rendererWithFont:]):
2263
2264 2006-05-01  Justin Garcia  <justin.garcia@apple.com>
2265
2266         Reviewed by darin
2267         
2268         <http://bugs.webkit.org/show_bug.cgi?id=8653>
2269         Remove a use of hasMoreThanOneBlock, which uses info from the test rendering.
2270
2271         * editing/DeleteSelectionCommand.cpp:
2272         (WebCore::DeleteSelectionCommand::initializePositionData):
2273         Removed code that stopped the merge if the end of the selection to delete
2274         was in a fully selected line, which was nonsense.
2275         
2276         (WebCore::DeleteSelectionCommand::mergeParagraphs):
2277         Deletion does a bad job of updating the endpoints of the selection as it removes 
2278         content.  If the endpoints have been flip flipped, bail.
2279         If deletion has removed everything from the block that contained the
2280         start of the selection to delete, we can't create a visible position inside 
2281         that block to serve as a destination for the merge.  So, we insert a placeholder 
2282         at that position to prop the block open to let content in.
2283         
2284         * editing/ReplaceSelectionCommand.cpp:
2285         (WebCore::ReplaceSelectionCommand::doApply):
2286         Added an assert and two early returns for cases where we'll crash.
2287         Removed a use of !fragment.hasMoreThanOneBlock, which uses test rendering info 
2288         and which was wrong.
2289         If we've already inserted content during the start merge, insertionPos will be 
2290         the position just after that content, so inserting new content before insertionPos 
2291         will reverse its order.
2292
2293 2006-05-01  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2294
2295         Reviewed by Darin.
2296
2297         - manual test for http://bugs.webkit.org/show_bug.cgi?id=8658
2298           Assertion failure in -[WebPluginContainerCheck _isForbiddenFileLoad]
2299           (bridge is null) when clicking QuickTime object with href
2300
2301         * manual-tests/plugin-controller-datasource.html: Added.
2302         * manual-tests/resources/orange.mov: Added.
2303
2304 2006-04-30  Rob Buis  <buis@kde.org>
2305
2306         Reviewed by eseidel.  Landed by eseidel.
2307
2308         Fix for http://bugs.webkit.org/show_bug.cgi?id=8651:
2309         CGContextSetLineDash: invalid dash array: emmited during WebKit tests
2310
2311         Properly discard invalid stroke-dasharray properties like in
2312         invalid-css.svg.  (Tests updated.)
2313
2314         * ksvg2/css/SVGCSSParser.cpp:
2315         (WebCore::CSSParser::parseSVGStrokeDasharray):
2316
2317 2006-04-28  David Hyatt  <hyatt@apple.com>
2318
2319         Make image buffer sizes in the loader more accurate, since we know we store
2320         buffers with 4 bytes per pixel.  Double sizes to account for this.  Also
2321         deal better with animated GIFs that may have thousands of frames by adding
2322         in a heuristic that will use the data size instead of a single frame RGBA32
2323         buffer size if it's larger.
2324
2325         Reviewed by darin
2326
2327         * loader/Cache.cpp:
2328         * loader/CachedImage.cpp:
2329         (WebCore::CachedImage::data):
2330
2331 2006-04-28  Steve Falkenburg  <sfalken@apple.com>
2332
2333         Reviewed by eric.
2334
2335         No test necessary - fixing Win32 build, turned off C++ exceptions, turned off RTTI
2336
2337         * WebCore.vcproj/WebCore/WebCore.vcproj:
2338         * bridge/win/FrameWin.cpp:
2339         (WebCore::FrameWin::~FrameWin):
2340         * bridge/win/PageWin.cpp:
2341         (WebCore::Page::Page):
2342         * page/Page.h:
2343         * platform/win/TemporaryLinkStubs.cpp:
2344         (FrameWin::saveDocumentState):
2345         (Path::contains):
2346         (Path::boundingRect):
2347
2348 2006-04-28  David Hyatt  <hyatt@apple.com>
2349
2350         Merge WebCoreTextRenderer into WebTextRenderer.  Merge WebCoreTextRendererFactory
2351         into WebTextRendererFactory.  Change all callers to refer to the concrete classes
2352         now.  Change WebCoreTextRenderer.h to be the public API that WebKit uses when
2353         it calls in to WebCore.  Clean up the exports to remove things WebKit no longer
2354         needs.
2355
2356         Reviewed by darin
2357
2358         * WebCore.exp:
2359         * WebCore.xcodeproj/project.pbxproj:
2360         * bridge/mac/WebCoreStringTruncator.mm:
2361         (stringWidth):
2362         (truncateString):
2363         (+[WebCoreStringTruncator widthOfString:font:]):
2364         * kwq/KWQComboBox.mm:
2365         (QComboBox::sizeHint):
2366         * kwq/KWQLineEdit.mm:
2367         (QLineEdit::sizeForCharacterWidth):
2368         * kwq/KWQListBox.mm:
2369         (itemTextRenderer):
2370         (groupLabelTextRenderer):
2371         (QListBox::sizeForNumberOfLines):
2372         (-[KWQTableView drawRow:clipRect:]):
2373         * platform/Font.h:
2374         * platform/FontDataSet.h:
2375         * platform/mac/FontMac.mm:
2376         (WebCore::FontDataSet::getWebCoreFont):
2377         (WebCore::FontDataSet::getRenderer):
2378         (WebCore::FontDataSet::determinePitch):
2379         * platform/mac/WebCoreTextRenderer.h:
2380         * platform/mac/WebCoreTextRendererFactory.mm:
2381         (-[WebCoreTextRendererFactory init]):
2382         * platform/mac/WebTextRenderer.h:
2383         * platform/mac/WebTextRenderer.mm:
2384         * platform/mac/WebTextRendererFactory.h:
2385         * platform/mac/WebTextRendererFactory.mm:
2386         (WebCoreInitializeFont):
2387         (WebCoreInitializeTextRun):
2388         (WebCoreInitializeEmptyTextStyle):
2389         (WebCoreInitializeEmptyTextGeometry):
2390         (-[WebTextRendererFactory clearCaches]):
2391         (+[WebTextRendererFactory createSharedFactory]):
2392         (+[WebTextRendererFactory sharedFactory]):
2393         (-[WebTextRendererFactory init]):
2394
2395 2006-04-28  David Hyatt  <hyatt@apple.com>
2396
2397         Fix for 8586, move WebTextRenderer into WebCore.
2398
2399         Reviewed by darin
2400
2401         * WebCore.exp:
2402         * WebCore.xcodeproj/project.pbxproj:
2403         * bridge/mac/WebCoreStringTruncator.mm:
2404         * platform/mac/WebCoreSystemInterface.h:
2405         * platform/mac/WebCoreSystemInterface.mm:
2406         * platform/mac/WebCoreTextRenderer.h:
2407         * platform/mac/WebCoreTextRendererFactory.mm:
2408         (+[WebCoreTextRendererFactory sharedFactory]):
2409         * platform/mac/WebTextRenderer.h: Added.
2410         * platform/mac/WebTextRenderer.mm: Added.
2411         (widthForGlyph):
2412         (-[WebTextRenderer initWithFont:]):
2413         (destroy):
2414         (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]):
2415         (-[WebTextRenderer drawLineForMisspelling:withWidth:]):
2416         (findSubstituteFont):
2417         (setUpFont):
2418         (pathFromFont):
2419         (drawGlyphs):
2420         (CG_draw):
2421         (extendGlyphMap):
2422         (extendWidthMap):
2423         (initializeATSUStyle):
2424         (createATSULayoutParameters):
2425         (getTextBounds):
2426         (addDirectionalOverride):
2427         (ATSU_draw):
2428         (normalizeVoicingMarks):
2429         (advanceWidthIterator):
2430         (fillStyleWithAttributes):
2431         * platform/mac/WebTextRendererFactory.h: Added.
2432         * platform/mac/WebTextRendererFactory.mm: Added.
2433         (getAppDefaultValue):
2434         (getUserDefaultValue):
2435         (getLCDScaleParameters):
2436         (fontsChanged):
2437         (+[WebTextRendererFactory createSharedFactory]):
2438         (-[WebTextRendererFactory isFontFixedPitch:]):
2439         (-[WebTextRendererFactory fontWithFamily:traits:size:]):
2440         (FontCacheKeyCopy):
2441         (-[WebTextRendererFactory cachedFontFromFamily:traits:size:]):
2442
2443 2006-04-28  Eric Seidel  <eseidel@apple.com>
2444
2445         Fix by beth.  Reviewed by darin.  Landed by eseidel.
2446
2447         Make hackish fix to avoid crash in Xcode and Filemaker.
2448         <rdar://problem/4059059> Crash in RenderFlow::detach (XCode Documentation Window)
2449
2450         * bridge/mac/WebCoreFrameBridge.mm:
2451         (-[WebCoreFrameBridge didNotOpenURL:pageCache:]):
2452
2453 2006-04-28  Alexey Proskuryakov  <ap@nypop.com>
2454
2455         Reviewed by hyatt.
2456
2457         - http://bugs.webkit.org/show_bug.cgi?id=5855
2458           REGRESSION: revert SGML comment parsing fix (comment parsing causes most of usbank.com page to be missing)
2459
2460         * html/HTMLTokenizer.cpp:
2461         (WebCore::HTMLTokenizer::parseComment): Revert one change made for acid2, 
2462         <http://weblogs.mozillazine.org/hyatt/acid6.txt>.
2463
2464 2006-04-28  Darin Adler  <darin@apple.com>
2465
2466         Reviewed by Eric.
2467
2468         - http://bugs.webkit.org/show_bug.cgi?id=8608
2469           make GraphicsContext more suitable for cross-platform use, step 2
2470
2471         - Changed GraphicsContext to use NSGraphicsContext as little as possible.
2472         - Removed the printing flag from GraphicsContext.
2473         - Changed GraphicsContext to assume the NSGraphicsContext is always flipped,
2474           and got rid of parameters to pass the flipped boolean around.
2475
2476         * WebCore.vcproj/WebCore/WebCore.vcproj: Add GraphicsTypes.h/cpp and remove
2477         CompositeOperator.h/cpp.
2478         * WebCore.xcodeproj/project.pbxproj: Ditto.
2479
2480         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::setDisplaysWithFocusAttributes):
2481         * bridge/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge drawRect:]):
2482         * html/CanvasPattern.cpp: (WebCore::patternCallback):
2483         * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createDrawingContext):
2484         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
2485         (WebCore::KRenderingDeviceContextQuartz::createGraphicsContext):
2486         * platform/mac/WidgetMac.mm: (WebCore::Widget::lockDrawingFocus):
2487         Update for changes to GraphicsContext constructor (no flipped or printing boolean).
2488
2489         * html/CanvasRenderingContext2D.h: Added a Path to the context state. Changed the
2490         LineCap and LineJoin types to use the new ones in GraphicsTypes.h instead of defining
2491         types here in this class. Changed m_platformContextStrokeStyleIsPattern and
2492         m_platformContextFillStyleIsPattern to be named m_appliedStrokePattern and
2493         m_appliedFillPattern and moved them outside the __APPLE__ ifdefs. Removed the
2494         platformContext() function. Moved applyStrokePattern and applyFillPattern out of
2495         the __APPLE__ ifdef.
2496
2497         * html/CanvasRenderingContext2D.cpp:
2498         (WebCore::CanvasRenderingContext2D::State::State): Moved the stroke pattern
2499         booleans out of Mac-specific ifdef.
2500         (WebCore::CanvasRenderingContext2D::save): Changed to use GraphicsContext instead
2501         of using CGContext directly.
2502         (WebCore::CanvasRenderingContext2D::restore): Ditto.
2503         (WebCore::CanvasRenderingContext2D::setStrokeStyle): Ditto.
2504         (WebCore::CanvasRenderingContext2D::setFillStyle): Ditto.
2505         (WebCore::CanvasRenderingContext2D::setLineWidth): Ditto.
2506         (WebCore::CanvasRenderingContext2D::lineCap): Ditto.
2507         (WebCore::CanvasRenderingContext2D::setLineCap): Ditto.
2508         (WebCore::CanvasRenderingContext2D::lineJoin): Ditto.
2509         (WebCore::CanvasRenderingContext2D::setLineJoin): Ditto.
2510         (WebCore::CanvasRenderingContext2D::setMiterLimit): Ditto.
2511         (WebCore::CanvasRenderingContext2D::shadowColor): Ditto.
2512         (WebCore::CanvasRenderingContext2D::setGlobalAlpha): Ditto.
2513         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation): Ditto.
2514         (WebCore::CanvasRenderingContext2D::scale): Update since platformContext() function
2515         no longer exists.
2516         (WebCore::CanvasRenderingContext2D::rotate): Ditto.
2517         (WebCore::CanvasRenderingContext2D::translate): Ditto.
2518         (WebCore::CanvasRenderingContext2D::beginPath): Changed to use GraphicsContext instead
2519         of using CGContext directly.
2520         (WebCore::CanvasRenderingContext2D::closePath): Ditto.
2521         (WebCore::CanvasRenderingContext2D::moveTo): Ditto.
2522         (WebCore::CanvasRenderingContext2D::lineTo): Ditto.
2523         (WebCore::CanvasRenderingContext2D::quadraticCurveTo): Ditto.
2524         (WebCore::CanvasRenderingContext2D::bezierCurveTo): Ditto.
2525         (WebCore::CanvasRenderingContext2D::arcTo): Ditto.
2526         (WebCore::CanvasRenderingContext2D::arc): Ditto.
2527         (WebCore::CanvasRenderingContext2D::rect): Ditto.
2528         (WebCore::CanvasRenderingContext2D::fill): Changed to use the current path from this class
2529         instead of relying on the CGContext's current path.
2530         (WebCore::CanvasRenderingContext2D::stroke): Ditto.
2531         (WebCore::CanvasRenderingContext2D::clip): Changed to use the current path and use the
2532         GraphicsContext instead of using CGContext directly.
2533         (WebCore::CanvasRenderingContext2D::clearRect): Changed to use GraphicsContext instead
2534         of using CGContext directly.
2535         (WebCore::CanvasRenderingContext2D::fillRect): Update since platformContext() function
2536         no longer exists.
2537         (WebCore::CanvasRenderingContext2D::strokeRect): Ditto.
2538         (WebCore::CanvasRenderingContext2D::setShadow): Ditto.
2539         (WebCore::CanvasRenderingContext2D::applyShadow): Ditto.
2540         (WebCore::CanvasRenderingContext2D::drawImage): Ditto.
2541         (WebCore::CanvasRenderingContext2D::drawImageFromRect): Ditto.
2542         (WebCore::CanvasRenderingContext2D::createPattern): Ditto.
2543         (WebCore::CanvasRenderingContext2D::applyStrokePattern): Made a tiny bit of this function
2544         cross-platform. The bulk is still Mac-specific.
2545         (WebCore::CanvasRenderingContext2D::applyFillPattern): Ditto.
2546
2547         * html/CanvasStyle.h: Changed to use GraphicsContext instead of CGContext. Now the
2548         platform-specific stuff is in the implementation, not the header.
2549         * html/CanvasStyle.cpp:
2550         (WebCore::CanvasStyle::applyStrokeColor): Moved the ifdefs inside the function, getting
2551         us one step closer to platform independence.
2552         (WebCore::CanvasStyle::applyFillColor): Ditto.
2553
2554         * html/html_imageimpl.cpp:
2555         (WebCore::HTMLAreaElement::getRect): Update for changes to the Path class.
2556         (WebCore::HTMLAreaElement::getRegion): Ditto.
2557
2558         * page/Frame.cpp:
2559         (WebCore::Frame::paint): Change to check printing flag on the document, rather than on
2560         the GraphicsContext, since there is no printing flag for GraphicsContext any more.
2561         (WebCore::Frame::adjustPageHeight): Update for change to GraphicsContext constructor.
2562
2563         * platform/GraphicsContext.h: Define a type called PlatformGraphicsContext so the
2564         platform-specific getter and constructor don't have to be ifdef'd. Added clearRect,
2565         strokeRect, setLineWidth, setLineCap, setLineJoin, setMiterLimit, setAlpha, setCompositeOperation,
2566         and clip functions. Removed the isForPrinting parameter from createGraphicsContextPrivate.
2567         * platform/GraphicsContext.cpp:
2568         (WebCore::GraphicsContextPrivate::GraphicsContextPrivate): Removed isForPrinting.
2569         (WebCore::GraphicsContext::createGraphicsContextPrivate): Ditto.
2570         * platform/mac/GraphicsContextMac.mm:
2571         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
2572         Removed NSGraphicsContext.
2573         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
2574         Ditto.
2575         (WebCore::GraphicsContext::GraphicsContext): Removed constructor that
2576         takes an NSGraphicsContext. Removed the flipText and forPrinting parameters
2577         to the other constructor.
2578         (WebCore::GraphicsContext::savePlatformState): Removed NSGraphicsContext code.
2579         (WebCore::GraphicsContext::restorePlatformState): Ditto.
2580         (WebCore::GraphicsContext::drawRect): Updated assertion to more-precisely
2581         reflect the limitation of the current version of this function.
2582         (WebCore::GraphicsContext::setColorFromFillColor): Ditto.
2583         (WebCore::GraphicsContext::setColorFromPen): Ditto.
2584         (WebCore::GraphicsContext::drawLine): Updated assertion to more-precisely
2585         reflect the limitation of the current version of this function.
2586         (WebCore::setCompositeOperation):
2587         (WebCore::GraphicsContext::fillRect): Ditto.
2588         (WebCore::GraphicsContext::setLineWidth): Added.
2589         (WebCore::GraphicsContext::setMiterLimit): Added.
2590         (WebCore::GraphicsContext::setAlpha): Added.
2591         (WebCore::GraphicsContext::setCompositeOperation): Added.
2592         (WebCore::GraphicsContext::clearRect): Added.
2593         (WebCore::GraphicsContext::strokeRect): Added.
2594         (WebCore::GraphicsContext::setLineCap): Added.
2595         (WebCore::GraphicsContext::setLineJoin): Added.
2596         (WebCore::GraphicsContext::clip): Added.
2597
2598         * platform/CompositeOperator.cpp: Removed.
2599         * platform/CompositeOperator.h: Removed.
2600         * platform/GraphicsTypes.cpp: Added. Includes CompositeOperator, LineCap, and LineJoin.
2601         * platform/GraphicsTypes.h: Added.
2602
2603         * platform/Image.h: Changed include to GraphicsTypes.h from CompositeOperator.h.
2604
2605         * platform/Path.h: Removed constructors that take a Rect and an array of points. Made
2606         the Path mutable. Changed the types for contains and boundingRect to be float-based
2607         instead of int-based. Changed translate to take a FloatSize instead of two integers.
2608         Added clear, moveTo, addLineTo, addQuadCurveTo, addBezierCurveTo, addArcTo, closeSubpath,
2609         addArc, addRect, addEllipse, and platformPath functions. Defined a PlatformPath type
2610         so we don't have to ifdef the header so much.
2611         * platform/cg/PathCG.cpp:
2612         (WebCore::Path::Path): Changed class to always have a mutable path.
2613         (WebCore::Path::operator=): Changed to make a mutable copy.
2614         (WebCore::Path::contains): Changed to take a FloatPoint instead of IntPoint.
2615         (WebCore::Path::translate): Changed to use a FloatSize instead of two ints.
2616         (WebCore::Path::boundingRect): Changed to return a FloatRect.
2617         (WebCore::Path::moveTo): Added.
2618         (WebCore::Path::addLineTo): Added.
2619         (WebCore::Path::addQuadCurveTo): Added.
2620         (WebCore::Path::addBezierCurveTo): Added.
2621         (WebCore::Path::addArcTo): Added.
2622         (WebCore::Path::closeSubpath): Added.
2623         (WebCore::Path::addArc): Added.
2624         (WebCore::Path::addRect): Added.
2625         (WebCore::Path::addEllipse): Added.
2626         (WebCore::Path::clear): Added.
2627
2628         * platform/mac/ImageMac.mm:
2629         (WebCore::fillSolidColorInRect): Changed to take a GraphicsContext instead of
2630         a CGContext.
2631         (WebCore::Image::checkForSolidColor): Changed to use the new setCompositeOperation
2632         in GraphicsContex.
2633         (WebCore::Image::draw): Changed to use the new PDF image and fillSolidColorInRect
2634         function that take GraphicsContext instead of CGContext.
2635         (WebCore::Image::drawTiled): Ditto.
2636
2637         * platform/mac/PDFDocumentImage.h: Made most functions private. Changed to
2638         use GraphicsContext and FloatRect instead of CGContext and NSRect. Also
2639         removed the unused alpha and flipped booleans.
2640         * platform/mac/PDFDocumentImage.mm:
2641         (WebCore::PDFDocumentImage::bounds): Update for change in types.
2642         (WebCore::PDFDocumentImage::adjustCTM): Ditto.
2643         (WebCore::PDFDocumentImage::setCurrentPage): Ditto.
2644         (WebCore::PDFDocumentImage::draw): Ditto.
2645
2646         * platform/win/TemporaryLinkStubs.cpp: Added lots of new stubs.
2647
2648         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): Changed to get
2649         printing boolean from document instead graphics context.
2650         * rendering/RenderBlock.cpp:
2651         (WebCore::RenderBlock::paintChildren): Ditto.
2652         (WebCore::RenderBlock::paintObject): Ditto.
2653         * rendering/RenderFlow.cpp: (WebCore::RenderFlow::paintLines): Ditto.
2654         * rendering/RenderHTMLCanvas.cpp: (WebCore::RenderHTMLCanvas::paint): Ditto.
2655         * rendering/RenderImage.cpp: (WebCore::RenderImage::paint): Ditto.
2656         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintButton): Ditto.
2657         * rendering/render_list.cpp: (WebCore::RenderListMarker::paint): Ditto.
2658         * rendering/render_replaced.cpp: (WebCore::RenderWidget::paint): Ditto.
2659
2660 2006-04-28  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2661
2662         Reviewed by hyatt, landed by ap.
2663
2664         - fix http://bugs.webkit.org/show_bug.cgi?id=6769
2665           REGRESSION: Incomplete repaint when a cell's extra bottom margin grows
2666
2667         Test: fast/repaint/table-extra-bottom-grow.html
2668
2669         * rendering/RenderBlock.cpp:
2670         (WebCore::RenderBlock::overflowRect): Changed to not add the top/left overflow twice and
2671         allow the normal overflow height to overlap with the bottom extra height.
2672         * rendering/RenderTableRow.cpp:
2673         (WebCore::RenderTableRow::layout): Removed the code that resets the extra heights.
2674         * rendering/RenderTableSection.cpp:
2675         (WebCore::RenderTableSection::layoutRows): If the top extra height changed or the
2676         bottom extra height increased, just repaint the entire cell.
2677
2678 2006-04-28  Eric Seidel  <eseidel@apple.com>
2679
2680         Reviewed by andersca.
2681
2682         Remove KCanvasContainerQuartz, pushing all logic into KCanvasContainer.
2683         
2684         No tests affected.
2685
2686         * kcanvas/KCanvasContainer.cpp:
2687         (WebCore::KCanvasContainer::canHaveChildren):
2688         (WebCore::KCanvasContainer::requiresLayer):
2689         (WebCore::KCanvasContainer::lineHeight):
2690         (WebCore::KCanvasContainer::baselinePosition):
2691         (WebCore::KCanvasContainer::calcMinMaxWidth):
2692         (WebCore::KCanvasContainer::layout):
2693         (WebCore::KCanvasContainer::paint):
2694         (WebCore::KCanvasContainer::setViewport):
2695         (WebCore::KCanvasContainer::viewport):
2696         (WebCore::KCanvasContainer::setViewBox):
2697         (WebCore::KCanvasContainer::viewBox):
2698         (WebCore::KCanvasContainer::setAlign):
2699         (WebCore::KCanvasContainer::align):
2700         (WebCore::KCanvasContainer::viewportTransform):
2701         (WebCore::KCanvasContainer::getAbsoluteRepaintRect):
2702         (WebCore::KCanvasContainer::absoluteTransform):
2703         (WebCore::KCanvasContainer::getAspectRatio):
2704         * kcanvas/KCanvasContainer.h:
2705         (WebCore::KCanvasContainer::renderName):
2706         * kcanvas/device/KRenderingDevice.h:
2707         * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
2708         * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
2709         * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
2710         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
2711         (WebCore::KRenderingDeviceQuartz::createPaintServer):
2712         * ksvg2/svg/SVGAElement.cpp:
2713         (WebCore::SVGAElement::createRenderer):
2714         * ksvg2/svg/SVGGElement.cpp:
2715         (SVGGElement::createRenderer):
2716         * ksvg2/svg/SVGMarkerElement.cpp:
2717         (WebCore::SVGMarkerElement::createRenderer):
2718         * ksvg2/svg/SVGMaskElement.cpp:
2719         (WebCore::SVGMaskElement::createRenderer):
2720         * ksvg2/svg/SVGPatternElement.cpp:
2721         (WebCore::SVGPatternElement::createRenderer):
2722         * ksvg2/svg/SVGSVGElement.cpp:
2723         (WebCore::SVGSVGElement::createRenderer):
2724         * ksvg2/svg/SVGSwitchElement.cpp:
2725         (WebCore::SVGSwitchElement::createRenderer):
2726         * ksvg2/svg/SVGUseElement.cpp:
2727         (SVGUseElement::createRenderer):
2728
2729 2006-04-27  Eric Seidel  <eseidel@apple.com>
2730
2731         Reviewed by andersca.
2732
2733         Make WebCore accept any */*+xml type as XML.
2734         http://bugs.webkit.org/show_bug.cgi?id=5998
2735         <rdar://problem/4031511> XmlHttpRequest doesn't allow responses with Content-Type: application/soap+xml
2736
2737         Test: http/tests/xmlhttprequest/supported-xml-content-types.html
2738
2739         * dom/DOMImplementation.cpp:
2740         (WebCore::DOMImplementation::isXMLMIMEType):
2741
2742 2006-04-27  Eric Seidel  <eseidel@apple.com>
2743
2744         * WebCore.vcproj/WebCore/WebCore.vcproj: Fix break from last checkin.
2745
2746 2006-04-27  Geoffrey Garen  <ggaren@apple.com>
2747
2748         Reviewed by Maciej.
2749
2750         - Added global constructor autogeneration for the following,
2751         many of which are required by *.live.com: Node, Element, Range,
2752         CSSRule, CSSValue, CSSPrimitiveValue, CSSStyleDeclaration, Event,
2753         MutationEvent, NodeFilter
2754
2755         It works like so:
2756         
2757         - The autogenerator knows about the "Constructor" data type, which
2758         gets special treatment because it exists purely in the
2759         bindings. It also knows about the "GenerateConstructor" interface
2760         attribute, which does just that.
2761
2762         - The window interface has many Constructor attributes
2763
2764         - The hash table generator swizzles empty tables to tables with one
2765         empty bucket, to prevent crashes in Lookup::findEntry. (The old
2766         generator used to work this way, too.)
2767
2768         - Window object property lookup gets special treatment to allow
2769         shadowing of its built-in global constructor properties. We'll
2770         need to expand this mechanism in the future and make it more
2771         flexible, but it works for now.
2772         
2773         * DerivedSources.make:
2774         * WebCore.vcproj/WebCore/WebCore.vcproj:
2775         * WebCore.xcodeproj/project.pbxproj:
2776         * bindings/js/kjs_css.cpp:
2777         (KJS::toJS):
2778         * bindings/js/kjs_css.h:
2779         * bindings/js/kjs_window.cpp: Removed 'namedFrameGetter' and its use
2780         because they were bogus; added FIXME describing what they were
2781         attempting to do.
2782         (KJS::Window::getValueProperty):
2783         (KJS::Window::getOverridePropertySlot):
2784         (KJS::Window::getOwnPropertySlot):
2785         * bindings/js/kjs_window.h:
2786         (KJS::Window::):
2787         * bindings/scripts/CodeGeneratorJS.pm:
2788         * css/CSSPrimitiveValue.idl:
2789         * css/CSSRule.idl:
2790         * css/CSSStyleDeclaration.idl: Added.
2791         * css/CSSValue.idl:
2792         * dom/Document.idl:
2793         * dom/Element.idl:
2794         * dom/Event.idl:
2795         * dom/MutationEvent.idl:
2796         * dom/Node.idl:
2797         * dom/NodeFilter.idl:
2798         * dom/Range.idl:
2799         * page/DOMWindow.idl:
2800
2801 2006-04-27  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2802
2803         Reviewed by darin
2804         
2805         <http://bugs.webkit.org/show_bug.cgi?id=8607>
2806         Automate repaint tests
2807
2808         * manual-tests/backgroundSizeRepaint.html: Removed.
2809         * manual-tests/border-repaint-glitch.html: Removed.
2810         * manual-tests/bugzilla-3509.html: Removed.
2811         * manual-tests/bugzilla-5699.html: Removed.
2812         * manual-tests/bugzilla-6278.html: Removed.
2813         * manual-tests/bugzilla-6388.html: Removed.
2814         * manual-tests/bugzilla-6473.html: Removed.
2815         * manual-tests/bugzilla-7235.html: Removed.
2816         * manual-tests/inline-outline-repaint.html: Removed.
2817         * manual-tests/outline-repaint-glitch.html: Removed.
2818         * manual-tests/repaint-resized-overflow.html: Removed.
2819         * manual-tests/table-cell-move.html: Removed.
2820
2821 2006-04-27  Justin Garcia  <justin.garcia@apple.com>
2822
2823         Reviewed by darin
2824         
2825         <http://bugs.webkit.org/show_bug.cgi?id=8624>
2826         Placeholders aren't always removed during paste
2827         <rdar://problem/4059807>
2828         Seed: Mail: pasting quoted content sometimes adds a phantom newline
2829
2830         * editing/CompositeEditCommand.cpp: Added a FIXME.
2831         * editing/ReplaceSelectionCommand.cpp:
2832         (WebCore::ReplaceSelectionCommand::doApply):
2833         Removed two no-op setEndingSelection calls.
2834         Store away a br at the position where we'll start inserting content in case the 
2835         br a) is made unnecessary by the insertion (it's collapsed away) b) was acting 
2836         as a placeholder and should therefore be displaced by inserted content or c) was
2837         acting as a line break and, as a result of the insertion, is now acting as a 
2838         placeholder.  
2839         Don't only store away brs that have the webkit-block-placeholder class on them.
2840         Any br that does any of the three things just mentioned should be removed.
2841         The linePlaceholder removal was run after the code that makes sure to interpret 
2842         incoming brs strictly, and was negating that work in certain cases.
2843         
2844         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded): Described above.
2845         * editing/ReplaceSelectionCommand.h:
2846         * editing/VisiblePosition.cpp:
2847         (WebCore::isEqualIgnoringAffinity): 
2848         Added a workaround for 8622.  We want this function to return true even if one of 
2849         the two visible positions has been incorrectly canonicalized.
2850
2851 2006-04-26  Tim Omernick  <timo@apple.com>
2852
2853         Reviewed by Hyatt.
2854
2855         <rdar://problem/4068375> Flash inserted via innerHTML Fails to Show when CSS Display
2856         Style is Toggled via Javascript
2857
2858         * html/html_objectimpl.cpp:
2859         (WebCore::HTMLObjectElement::setComplete):
2860         Set needWidgetUpdate when finished parsing, even if the object element is not in
2861         a document.  That way, when the element attaches to a document, it will update its
2862         widget (creating the plug-in view if necessary).  This is important when the object
2863         is being inserted via setInnerHTML, since the parsed nodes are not added to the
2864         document until the whole HTML string is parsed.
2865
2866 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
2867
2868         Reviewed by Hyatt.
2869
2870         - Fixed http://bugs.webkit.org/post_bug.cgi
2871         REGRESSION (r14048): Google calendar not parsing
2872         
2873         * html/HTMLParser.cpp:
2874         (WebCore::HTMLParser::handleError): Rolling out grandparent NULL check
2875         because it caused this regression and there's no test case
2876         justifying it.
2877         
2878 2006-04-26  Justin Garcia  <justin.garcia@apple.com>
2879
2880         Reviewed by hyatt
2881         
2882         <http://bugs.webkit.org/show_bug.cgi?id=8459>
2883         REGRESSION: Content lost during a delete/merge of whitespace:pre text
2884
2885         * editing/CompositeEditCommand.cpp:
2886         (WebCore::CompositeEditCommand::prune): 
2887         The function would prune a rendered leaf because it assumed that the 
2888         first node passed to it would be a container.
2889         The old code ascended using the DOM tree, and would remove the <b> when
2890         pruning the <div> in <b><div></div>foo</b>.  Now ascends using the render tree.
2891
2892 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
2893
2894         This time for sure. Fixed Windows build too.
2895         
2896         * WebCore.vcproj/WebCore/WebCore.vcproj:
2897         * WebCore.xcodeproj/project.pbxproj:
2898
2899 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
2900
2901         Reviewed by TimO.
2902
2903         Build fix.
2904
2905         * bindings/js/kjs_dom.cpp:
2906         * bindings/js/kjs_domnode.h:
2907
2908 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
2909
2910         Reviewed by OMG DETHBAKIN.
2911
2912         - Start autogenerating Node. This fixes many missing attributes in our
2913         DOM by making prototypes hold their relevant constants as properties.
2914
2915         * DerivedSources.make:
2916         * WebCore.xcodeproj/project.pbxproj:
2917         * bindings/js/kjs_dom.cpp:
2918         (KJS::DOMEventTargetNode::DOMEventTargetNode):
2919         (KJS::toJS):
2920         * bindings/js/kjs_dom.h:
2921         (KJS::DOMEventTargetNode::):
2922         * bindings/js/kjs_domnode.h: Had to break DOMNode into a separate
2923         header to avoid circular dependency in header includes. Gave it an
2924         old-school file name to keep distinguishing beteween old school and
2925         news school files easy.
2926         (KJS::DOMNode::impl):
2927         (KJS::DOMNode::classInfo):
2928         (KJS::DOMNode::):
2929         * bindings/js/kjs_window.cpp:
2930         (KJS::Window::getValueProperty):
2931         * bindings/scripts/CodeGeneratorJS.pm:
2932         * dom/DocumentType.idl:
2933         * dom/Entity.idl:
2934         * dom/Node.idl: Added.
2935         * dom/Notation.idl:
2936         * dom/ProcessingInstruction.idl:
2937
2938 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
2939
2940         Reviewed by Darin.
2941
2942         Committing the project file change jhaygood suggesed in
2943         http://bugs.webkit.org/show_bug.cgi?id=8044
2944         WebKit Visual Studio 2005 project shouldn't use the SolutionDir
2945         
2946         Instead of his patch, I used the following commands:
2947
2948         sed -e 's/$(SolutionDir)/$(ProjectDir)\\../g' Image\ Viewer/Image\
2949         Viewer.vcproj > Image\ Viewer/Image\ Viewer.vcproj_ && mv Image\
2950         Viewer/Image\ Viewer.vcproj_ Image\ Viewer/Image\ Viewer.vcproj
2951
2952         sed -e 's/$(SolutionDir)/$(ProjectDir)\\../g'
2953         WebCore/WebCore.vcproj > WebCore/WebCore.vcproj_ && mv
2954         WebCore/WebCore.vcproj_ WebCore/WebCore.vcproj
2955
2956         * Viewer.vcproj:
2957         * WebCore.vcproj/WebCore/WebCore.vcproj:
2958
2959 2006-04-25  Justin Garcia  <justin.garcia@apple.com>
2960
2961         Reviewed by harrison
2962
2963         <http://bugs.webkit.org/show_bug.cgi?id=8583>
2964         Moving paste code around and some small fixes
2965         
2966         Moved code to make it easier to do the start merge after the fact, 
2967         with moveParagraph, instead of in the middle of the paste operation.
2968
2969         * editing/CompositeEditCommand.cpp:
2970         (WebCore::CompositeEditCommand::moveParagraph):
2971         * editing/ReplaceSelectionCommand.cpp:
2972         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
2973         (WebCore::ReplaceSelectionCommand::shouldMergeStart):
2974         Moved code to make this decision to its own function.  Moved special case
2975         checks to the top.  Added m_forceMergeStart to override the special cases 
2976         because moveParagraph uses ReplaceSelectionCommand and expects a merge.
2977         
2978         (WebCore::ReplaceSelectionCommand::shouldMergeEnd): 
2979         No functional changes, just moved code here.
2980         (WebCore::ReplaceSelectionCommand::doApply):
2981         Do the end merge in the opposite direction.  Merging two paragraphs destroys
2982         the moved one's block level styles, and we prefer to use the styles of the 
2983         one that was in the document, not the one that's being pasted.
2984         
2985         * editing/ReplaceSelectionCommand.h:
2986         * editing/Selection.h:
2987         (WebCore::Selection::visibleStart): Added.
2988         (WebCore::Selection::visibleEnd): Added.
2989         * editing/htmlediting.cpp:
2990         (WebCore::enclosingList): Added.
2991         (WebCore::isMailBlockquote): 
2992         Don't require a renderer so that this can be used on nodes in fragments.
2993         
2994         * editing/htmlediting.h:
2995
2996 2006-04-25  Geoffrey Garen  <ggaren@apple.com>
2997
2998         Reviewed by Maciej.
2999
3000         - Removed special handling of attributes in the DOM. To match
3001         WinIE, we used to make all attributes available as properties of
3002         their elements in the DOM, but that has caused us more
3003         compatibility woes than it has solved, so, after talking with Darin
3004         and Maciej, I'm taking it out. (Firefox does not support it.)
3005
3006         A layout test regression caused by this change led me to do the
3007         following as well:
3008         
3009         - Implemented DOM properties missing on EMBED elements: align, height,
3010         name, width, src, type. Since align, height, name, and width are
3011         common to all plugin elements, I factored them and some other common
3012         functionality out into a new abstract base class, HTMLPlugInElement.
3013
3014         - Removed extraneous attribute-to-style mappings on EMBED elements:
3015         valign, border. Why they were there in the first place is a question
3016         for the ages. Neither FF nor IE supports them.
3017
3018         * bindings/js/kjs_dom.cpp:
3019         (KJS::getRuntimeObject):
3020         * bindings/js/kjs_html.cpp:
3021         (KJS::):
3022         (KJS::JSHTMLElement::classInfo):
3023         (KJS::JSHTMLElement::accessors):
3024         (KJS::JSHTMLElement::embedGetter):
3025         (KJS::JSHTMLElement::embedSetter):
3026         * bindings/js/kjs_html.h:
3027         (KJS::JSHTMLElement::):
3028         * bindings/scripts/CodeGeneratorJS.pm:
3029         * dom/Element.idl:
3030         * html/html_objectimpl.cpp:
3031         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
3032         (WebCore::HTMLPlugInElement::align):
3033         (WebCore::HTMLPlugInElement::setAlign):
3034         (WebCore::HTMLPlugInElement::height):
3035         (WebCore::HTMLPlugInElement::setHeight):
3036         (WebCore::HTMLPlugInElement::name):
3037         (WebCore::HTMLPlugInElement::setName):
3038         (WebCore::HTMLPlugInElement::width):
3039         (WebCore::HTMLPlugInElement::setWidth):
3040         (WebCore::HTMLPlugInElement::mapToEntry):
3041         (WebCore::HTMLPlugInElement::parseMappedAttribute):
3042         (WebCore::HTMLPlugInElement::checkDTD):
3043         (WebCore::HTMLAppletElement::HTMLAppletElement):
3044         (WebCore::HTMLAppletElement::~HTMLAppletElement):
3045         (WebCore::HTMLAppletElement::parseMappedAttribute):
3046         (WebCore::HTMLAppletElement::insertedIntoDocument):
3047         (WebCore::HTMLAppletElement::removedFromDocument):
3048         (WebCore::HTMLAppletElement::getInstance):
3049         (WebCore::HTMLAppletElement::closeRenderer):
3050         (WebCore::HTMLAppletElement::detach):
3051         (WebCore::HTMLEmbedElement::HTMLEmbedElement):
3052         (WebCore::HTMLEmbedElement::~HTMLEmbedElement):
3053         (WebCore::HTMLEmbedElement::getInstance):
3054         (WebCore::HTMLEmbedElement::mapToEntry):
3055         (WebCore::HTMLEmbedElement::parseMappedAttribute):
3056         (WebCore::HTMLEmbedElement::attach):
3057         (WebCore::HTMLEmbedElement::detach):
3058         (WebCore::HTMLEmbedElement::insertedIntoDocument):
3059         (WebCore::HTMLEmbedElement::removedFromDocument):
3060         (WebCore::HTMLEmbedElement::src):
3061         (WebCore::HTMLEmbedElement::setSrc):
3062         (WebCore::HTMLEmbedElement::type):
3063         (WebCore::HTMLEmbedElement::setType):
3064         (WebCore::HTMLObjectElement::HTMLObjectElement):
3065         (WebCore::HTMLObjectElement::~HTMLObjectElement):
3066         (WebCore::HTMLObjectElement::getInstance):
3067         (WebCore::HTMLObjectElement::parseMappedAttribute):
3068         (WebCore::HTMLObjectElement::rendererIsNeeded):
3069         (WebCore::HTMLObjectElement::attach):
3070         (WebCore::HTMLObjectElement::closeRenderer):
3071         (WebCore::HTMLObjectElement::detach):
3072         (WebCore::HTMLObjectElement::insertedIntoDocument):
3073         (WebCore::HTMLObjectElement::removedFromDocument):
3074         (WebCore::HTMLObjectElement::recalcStyle):
3075         * html/html_objectimpl.h:
3076         (WebCore::HTMLPlugInElement::endTagRequirement):
3077         (WebCore::HTMLAppletElement::tagPriority):
3078         (WebCore::HTMLEmbedElement::tagPriority):
3079         (WebCore::HTMLObjectElement::tagPriority):
3080
3081 2006-04-25  Beth Dakin  <bdakin@apple.com>
3082
3083         Reviewed by Maciej.
3084
3085         Fix for <rdar://problem/4518632> getComputedStyle returns 'auto' 
3086         for dimensions like 'margin-left'
3087
3088         * css/CSSComputedStyleDeclaration.cpp:
3089         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): For 
3090         margin and padding, to match Firefox we now go to the renderer to 
3091         get the property value instead of calling valueForLength() on the 
3092         style attribute. valueForLength() will return the string 'auto' if 
3093         that was what was specified in the CSS, or a percentage if it was 
3094         specified as a percent. But to match Firefox, we always want to 
3095         return a pixel value for margin and padding.
3096
3097 2006-04-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3098
3099         Reviewed by darin.  Landed by eseidel.
3100
3101         - fix http://bugs.webkit.org/show_bug.cgi?id=8452
3102           mangleme(0x58c22e11): Random crashes
3103
3104         Test: fast/frames/empty-cols-attribute.html
3105
3106         * platform/StringImpl.cpp:
3107         (WebCore::StringImpl::toLengthArray): If the string is empty, return 0
3108         but set len to 1. This gives the same behavior you get if you don't specify
3109         the attribute at all, matching WinIE and Firefox. Previously, the empty
3110         string resulted in len being set to 0 (and a memory smasher in
3111         RenderFrameSet::layout()).
3112         * rendering/render_frames.cpp:
3113         (WebCore::RenderFrameSet::layout): Added an assert.
3114
3115 2006-04-26  Oliver Hunt  <ojh16@student.canterbury.ac.nz>
3116
3117         Reviewed by eseidel.  Landed by eseidel.
3118
3119         * WebCore.xcodeproj/project.pbxproj:
3120         * kcanvas/KCanvasFilters.cpp:
3121         (WebCore::operator<<):
3122         * kcanvas/KCanvasFilters.h:
3123         (WebCore::KCComponentTransferFunction::KCComponentTransferFunction):
3124         * kcanvas/device/quartz/KCanvasFilterQuartz.h:
3125         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
3126         (WebCore::getVectorForChannel):
3127         (WebCore::genImageFromTable):
3128         (WebCore::filterForComponentFunc):
3129         (WebCore::setParametersForComponentFunc):
3130         (WebCore::getFilterForFunc):
3131         (WebCore::KCanvasFEComponentTransferQuartz::getFunctionFilter):
3132         (WebCore::KCanvasFEComponentTransferQuartz::getCIFilter):
3133         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
3134         (WebCore::KRenderingDeviceQuartz::createFilterEffect):
3135         * kcanvas/device/quartz/filters/WKComponentMergeFilter.cikernel: Added.
3136         * kcanvas/device/quartz/filters/WKComponentMergeFilter.h: Added.
3137         * kcanvas/device/quartz/filters/WKComponentMergeFilter.m: Added.
3138         (+[WKComponentMergeFilter initialize]):
3139         (+[WKComponentMergeFilter filterWithName:]):
3140         (-[WKComponentMergeFilter init]):
3141         (-[WKComponentMergeFilter outputImage]):
3142         * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.cikernel: Added.
3143         * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.h: Added.
3144         * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.m: Added.
3145         (+[WKDiscreteTransferFilter initialize]):
3146         (+[WKDiscreteTransferFilter filterWithName:]):
3147         (-[WKDiscreteTransferFilter init]):
3148         (-[WKDiscreteTransferFilter outputImage]):
3149         * kcanvas/device/quartz/filters/WKGammaTransferFilter.cikernel: Added.
3150         * kcanvas/device/quartz/filters/WKGammaTransferFilter.h: Added.
3151         * kcanvas/device/quartz/filters/WKGammaTransferFilter.m: Added.
3152         (+[WKGammaTransferFilter initialize]):
3153         (+[WKGammaTransferFilter filterWithName:]):
3154         (-[WKGammaTransferFilter init]):
3155         (-[WKGammaTransferFilter outputImage]):
3156         * kcanvas/device/quartz/filters/WKIdentityTransferFilter.h: Added.
3157         * kcanvas/device/quartz/filters/WKIdentityTransferFilter.m: Added.
3158         (+[WKIdentityTransferFilter initialize]):
3159         (+[WKIdentityTransferFilter filterWithName:]):
3160         (-[WKIdentityTransferFilter init]):
3161         (-[WKIdentityTransferFilter outputImage]):
3162         * kcanvas/device/quartz/filters/WKLinearTransferFilter.cikernel: Added.
3163         * kcanvas/device/quartz/filters/WKLinearTransferFilter.h: Added.
3164         * kcanvas/device/quartz/filters/WKLinearTransferFilter.m: Added.
3165         (+[WKLinearTransferFilter initialize]):
3166         (+[WKLinearTransferFilter filterWithName:]):
3167         (-[WKLinearTransferFilter init]):
3168         (-[WKLinearTransferFilter outputImage]):
3169         * kcanvas/device/quartz/filters/WKTableTransferFilter.cikernel: Added.
3170         * kcanvas/device/quartz/filters/WKTableTransferFilter.h: Added.
3171         * kcanvas/device/quartz/filters/WKTableTransferFilter.m: Added.
3172         (+[WKTableTransferFilter initialize]):
3173         (+[WKTableTransferFilter filterWithName:]):
3174         (-[WKTableTransferFilter init]):
3175         (-[WKTableTransferFilter outputImage]):
3176         * ksvg2/svg/SVGComponentTransferFunctionElement.cpp:
3177         (SVGComponentTransferFunctionElement::parseMappedAttribute):
3178         (SVGComponentTransferFunctionElement::transferFunction):
3179
3180 2006-04-25  Eric Seidel  <eseidel@apple.com>
3181
3182         Reviewed by ggaren.
3183
3184         Make trunk match the branch.  Now nodes are fully removed
3185         from the tree before calling detach.  There is (thankfully) no
3186         good way to test this, as no one should depend on this behavior.
3187         This change was made are part of fixing:
3188         <rdar://problem/4427024> repro crash on www.formassembly.com in khtml::RenderBlock::addChildToFlow
3189         <rdar://problem/4233435> CrashTracer: 2698 crashes in Safari at com.apple.WebCore: khtml::RenderBlock::addChildToFlow + 156
3190         on the branch.
3191
3192         * dom/ContainerNode.cpp:
3193         (WebCore::ContainerNode::removeChildren):
3194
3195 2006-04-25  Maciej Stachowiak  <mjs@apple.com>
3196
3197         Reviewed by Adele.
3198
3199         - don't have a fini method, since trying to call it will actually call the subclass method
3200         and mess up the bridge count.
3201
3202         * bridge/mac/WebCoreFrameBridge.mm:
3203         (-[WebCoreFrameBridge dealloc]):
3204         (-[WebCoreFrameBridge finalize]):
3205
3206 2006-04-25  Steve Falkenburg  <sfalkenburg@apple.com>
3207
3208         Reviewed by eseidel.
3209
3210         No test case needed
3211
3212         * platform/win/TemporaryLinkStubs.cpp:
3213         (KWQFileButton::setFrameGeometry):
3214
3215 2006-04-25  Eric Seidel  <eseidel@apple.com>
3216
3217         Reviewed by mjs.
3218
3219         Fix reproducible crash in html parser code.
3220         http://bugs.webkit.org/show_bug.cgi?id=7137
3221
3222         Test: fast/parser/remove-current-node-parent.html
3223
3224         * html/HTMLParser.cpp:
3225         (WebCore::HTMLParser::handleError):
3226
3227 2006-04-25  Maciej Stachowiak  <mjs@apple.com>
3228
3229         Reviewed by Eric.
3230
3231         - fixed http://bugs.webkit.org/show_bug.cgi?id=8575
3232         New KWQFileButton leaks reported by buildbot
3233
3234         * kwq/KWQFileButton.mm:
3235         (KWQFileButton::KWQFileButton): Add a missing release
3236
3237 2006-04-24  David Hyatt  <hyatt@apple.com>
3238
3239         Fix for 8336, focus ring redrawing on top of itself.  Make sure
3240         not to include empty rects when doing the focus ring drawing, since
3241         that results in a draw with no clip set.
3242
3243         Reviewed by adele
3244
3245         * platform/mac/GraphicsContextMac.mm:
3246         (WebCore::GraphicsContext::drawFocusRing):
3247
3248 2006-04-24  Eric Seidel  <eseidel@apple.com>
3249
3250         Reviewed by ggaren.
3251
3252         Fix for 5th worst unresolved crasher:
3253         <rdar://problem/4129744> [REGRESSION]CrashTracer: ..400 crashes at com.apple.WebCore: DOM::NodeImpl::createRendererIfNeeded + 44
3254
3255         Test: fast/dom/remove-style-element.html
3256
3257         * dom/ContainerNode.cpp:
3258         (WebCore::ContainerNode::removeChildren):
3259
3260 2006-04-24  Eric Seidel  <eseidel@apple.com>
3261
3262         Reviewed by mjs.
3263
3264         Speculative fix for our 7th worst crasher.
3265         Also added ASSERTs to help us better understand the issue.
3266         <rdar://problem/4153404> CrashTracer: 2412 crashes in Safari at com.apple.WebCore: khtml::RenderStyle::RenderStyle[unified] + 44
3267
3268         * dom/Document.cpp:
3269         (WebCore::Document::recalcStyle):
3270         (WebCore::Document::setInPageCache):
3271         * dom/Document.h:
3272         * dom/Element.cpp:
3273         (WebCore::Element::recalcStyle):
3274
3275 2006-04-24  Adele Peterson  <adele@apple.com>
3276
3277         Reviewed by Hyatt.
3278
3279         Fix for <rdar://problem/4503438> REGRESSION (NativeTextField): Can't insert caret when