Reviewed by John
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 2004-11-11  Ken Kocienda  <kocienda@apple.com>
2
3         Reviewed by John
4
5         Fix for these bugs:
6
7         <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
8         <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
9
10         * khtml/editing/selection.cpp:
11         (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
12         the next line position when necessary.
13         * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
14         * layout-tests/editing/selection/move-3875618-fix.html: Added.
15         * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
16         * layout-tests/editing/selection/move-3875641-fix.html: Added.
17
18 2004-11-11  Ken Kocienda  <kocienda@apple.com>
19
20         Reviewed by John
21
22         Improved some function names, at John's urging. No changes to the
23         functions themselves.
24         
25         canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
26         canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
27         performGeneralDelete() --> handleGeneralDelete()
28
29         * khtml/editing/htmlediting.cpp:
30         (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
31         (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
32         (khtml::DeleteSelectionCommand::handleGeneralDelete)
33         (khtml::DeleteSelectionCommand::doApply)
34         * khtml/editing/htmlediting.h
35
36 2004-11-11  Ken Kocienda  <kocienda@apple.com>
37
38         Reviewed by John
39         
40         Updated some layout test results that changed as a result of my last checking.
41         Added a new test that has been in my tree for a few days.
42
43         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
44         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
45         * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
46         * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
47
48 2004-11-11  Ken Kocienda  <kocienda@apple.com>
49
50         Reviewed by John
51
52         * khtml/editing/htmlediting.cpp:
53         (khtml::debugNode): New debugging helper.
54         (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
55         startPositionForDelete() and endPositionForDelete() functions. Just use the 
56         m_selectionToDelete object to determine start and end positions for the delete.
57         (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
58         function that creates a special case for deleting all the content in a root
59         editable element.
60         (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
61         function before BR special case and the general case delete functions.
62         * khtml/editing/htmlediting.h: Updated for changed functions.
63
64 2004-11-10  Kevin Decker  <kdecker@apple.com>
65
66         Reviewed by mjs.
67         
68         Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.  
69
70         * khtml/ecma/kjs_dom.cpp:
71         (DOMNodeList::tryGet): Got rid of an unnecessary node traversal. 
72
73 2004-11-10  Ken Kocienda  <kocienda@apple.com>
74
75         Reviewed by Chris
76
77         * khtml/editing/htmlediting.cpp:
78         (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
79         smart delete from the two functions below to here. There was an unnecessary double 
80         calculation of the leading and trailing whitespace positions. Also refined the trailing
81         case so it only acts when the leading position is null (which seems to match TextEdit in
82         my tests). Also removed some unnecessary copying of Position objects.
83         (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
84         from here.
85         (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
86
87 2004-11-10  Ken Kocienda  <kocienda@apple.com>
88
89         Reviewed by Harrison
90
91         (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
92         make things more clear.
93         * khtml/editing/selection.cpp:
94         (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the 
95         resulting positions do not cross block boundaries. This was a bug and caused some
96         delete problems when whole blocks were selected. I will be addressing that issue
97         more fully in upcoming changes.
98
99 2004-11-10  Ken Kocienda  <kocienda@apple.com>
100
101         Reviewed by Harrison
102
103         Some cleanups and fixes in upstream and downstream functions. 
104         
105         Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement(). 
106         Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the 
107         block's enclosing block will be returned. 
108         
109         Remove code from upstream that confined the serach to block boundaries outside of
110         the code which runs in the StayInBlock case. This code was redundant, and caused
111         incorrect results to be returned in the DoNotStayInBlock case.
112         
113         In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
114         node, not the the this pointer's node.
115
116         * khtml/xml/dom_position.cpp:
117         (DOM::Position::upstream)
118         (DOM::Position::downstream)
119
120 2004-11-09  David Hyatt  <hyatt@apple.com>
121
122         Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
123         loading large local files.
124         
125         Reviewed by mjs
126
127         * khtml/html/htmltokenizer.cpp:
128         (khtml::HTMLTokenizer::HTMLTokenizer):
129         (khtml::HTMLTokenizer::reset):
130         (khtml::HTMLTokenizer::write):
131         (khtml::HTMLTokenizer::stopped):
132         (khtml::HTMLTokenizer::processingData):
133         (khtml::HTMLTokenizer::continueProcessing):
134         (khtml::HTMLTokenizer::timerEvent):
135         (khtml::HTMLTokenizer::allDataProcessed):
136         (khtml::HTMLTokenizer::end):
137         (khtml::HTMLTokenizer::finish):
138         (khtml::HTMLTokenizer::notifyFinished):
139         * khtml/html/htmltokenizer.h:
140         * khtml/khtml_part.cpp:
141         (KHTMLPart::slotFinished):
142         (KHTMLPart::end):
143         (KHTMLPart::stop):
144         * khtml/khtml_part.h:
145         (KHTMLPart::tokenizerProcessedData):
146         * khtml/khtmlview.cpp:
147         * khtml/xml/dom_docimpl.cpp:
148         * khtml/xml/xml_tokenizer.h:
149         (khtml::Tokenizer::stopped):
150         (khtml::Tokenizer::processingData):
151         * kwq/KWQDateTime.h:
152         * kwq/KWQDateTime.mm:
153         (QDateTime::secsTo):
154         (KWQUIEventTime::uiEventPending):
155         * kwq/KWQKHTMLPart.h:
156         * kwq/KWQKHTMLPart.mm:
157         (KWQKHTMLPart::tokenizerProcessedData):
158         * kwq/WebCoreBridge.h:
159         * kwq/WebCoreBridge.mm:
160         (-[WebCoreBridge stop]):
161         (-[WebCoreBridge numPendingOrLoadingRequests]):
162         (-[WebCoreBridge doneProcessingData]):
163
164 2004-11-09  David Harrison  <harrison@apple.com>
165
166         Reviewed by Ken Kocienda.
167
168                 <rdar://problem/3865837> Wrong text style after delete to start of document
169                 
170         * khtml/editing/htmlediting.cpp:
171         (khtml::DeleteSelectionCommand::saveTypingStyleState):
172         Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
173
174 2004-11-09  Richard Williamson   <rjw@apple.com>
175
176         Fixed <rdar://problem/3872440> NSTimer prematurely released.
177
178         Reviewed by Darin.
179
180         * kwq/KWQTimer.mm:
181         (QTimer::fire):
182         * kwq/KWQWidget.mm:
183         (QWidget::paint):
184
185 2004-11-09  Chris Blumenberg  <cblu@apple.com>
186
187         Reviewed by vicki.
188
189         * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
190
191 2004-11-08  David Harrison  <harrison@apple.com>
192
193         Reviewed by Ken Kocienda.
194
195                 <rdar://problem/3865854> Deleting first line deletes all lines
196                 
197         * khtml/editing/htmlediting.cpp:
198         (khtml::DeleteSelectionCommand::performGeneralDelete):
199         Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
200         of its ancestors, failed to end the loop that deletes all fully selected nodes.  Also,
201         fixed this code to clear m_trailingWhitespaceValid.  Also removed dead m_endingPosition
202         update because it is handled in calculateEndingPosition now.
203         * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
204         * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
205
206 2004-11-08  Ken Kocienda  <kocienda@apple.com>
207
208         Reviewed by Hyatt
209
210         * khtml/html/html_elementimpl.cpp:
211         (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
212         are added to the DOM.
213         * khtml/html/html_elementimpl.h: Ditto.
214         * khtml/html/htmlparser.cpp:
215         (KHTMLParser::KHTMLParser): Ditto.
216         (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
217         * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
218         * khtml/html/htmltokenizer.cpp:
219         (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
220         (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
221         There were a couple of indexing errors that resulted in the comment text containing part of the 
222         comment markers.
223         (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
224         * khtml/html/htmltokenizer.h:  Add flag to constructor so callers can request comment nodes.
225
226 2004-11-08  Chris Blumenberg  <cblu@apple.com>
227
228         Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
229
230         Reviewed by darin.
231
232         * WebCore.pbproj/project.pbxproj: stop unnecessary linking
233         * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
234         * kwq/KWQKHTMLPart.h: ditto
235
236 2004-11-08  Darin Adler  <darin@apple.com>
237
238         Reviewed by John.
239
240         - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
241
242         * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
243         that possibly deletes the QTimer.
244
245 2004-11-08  Chris Blumenberg  <cblu@apple.com>
246
247         Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
248
249         Reviewed by john.
250
251         * kwq/KWQTextField.mm:
252         (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
253         * kwq/WebCoreBridge.h:
254
255 2004-11-08  David Harrison  <harrison@apple.com>
256
257         Reviewed by Darin.
258         
259         Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
260
261         * khtml/editing/htmlediting.cpp:
262         (khtml::DeleteSelectionCommand::moveNodesAfterNode):
263         * khtml/xml/dom_nodeimpl.cpp:
264         (NodeImpl::enclosingInlineElement):
265         * khtml/xml/dom_nodeimpl.h:
266
267 2004-11-05  Chris Blumenberg  <cblu@apple.com>
268
269         Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
270
271         Reviewed by rjw.
272
273         * khtml/editing/htmlediting.cpp:
274         (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
275         * khtml/editing/visible_position.cpp:
276         (khtml::VisiblePosition::character): new, returns the character for the position
277         * khtml/editing/visible_position.h:
278         * kwq/KWQKHTMLPart.h:
279         * kwq/KWQKHTMLPart.mm:
280         (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
281         * kwq/WebCoreBridge.h:
282
283 === Safari-170 ===
284
285 2004-11-05  Adele Amchan  <adele@apple.com>
286
287         Reviewed by Darin
288
289         Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
290         and a workaround for displaying transparent backgrounds for textareas.
291
292         * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
293         * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
294         * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class, 
295           on the contentView, and on the textView.
296
297 2004-11-04  David Hyatt  <hyatt@apple.com>
298
299         Fix for relpositioned inlines.  This was reviewed a long time ago, but I can't recall who reviewed it (either
300         darin or ken).
301         
302         Reviewed by darin or ken
303
304         * khtml/rendering/bidi.cpp:
305         (khtml::appendRunsForObject):
306         (khtml::RenderBlock::skipWhitespace):
307         (khtml::RenderBlock::findNextLineBreak):
308         * khtml/rendering/render_block.cpp:
309         (khtml::RenderBlock::lowestPosition):
310         (khtml::RenderBlock::rightmostPosition):
311         (khtml::RenderBlock::leftmostPosition):
312         * khtml/rendering/render_box.cpp:
313         (RenderBox::position):
314         * khtml/rendering/render_box.h:
315         (khtml::RenderBox::staticX):
316         (khtml::RenderBox::staticY):
317         * khtml/rendering/render_layer.cpp:
318         (RenderLayer::updateLayerPosition):
319         (RenderLayer::convertToLayerCoords):
320         * khtml/rendering/render_line.cpp:
321         (khtml::InlineFlowBox::placeBoxesHorizontally):
322         * khtml/rendering/render_object.h:
323         (khtml::RenderObject::staticX):
324         (khtml::RenderObject::staticY):
325
326         Finish turning on XSLT.  Make sure child stylesheets can load.
327         
328         * khtml/xsl/xslt_processorimpl.cpp:
329         (DOM::stylesheetLoadFunc):
330         (DOM::XSLTProcessorImpl::transformDocument):
331
332 2004-11-04  David Hyatt  <hyatt@apple.com>
333
334         Implement CSS3 support for multiple backgrounds.  Also fix a bug with background propagation so that it only
335         happens (from the <body> to the root) for HTML documents.  Fixed background-position to handle a mixture of
336         keyword and length values.
337
338         Reviewed by darin
339
340         * khtml/css/cssparser.cpp:
341         (CSSParser::parseValue):
342         (CSSParser::addBackgroundValue):
343         (CSSParser::parseBackgroundShorthand):
344         (CSSParser::parseBackgroundColor):
345         (CSSParser::parseBackgroundImage):
346         (CSSParser::parseBackgroundPositionXY):
347         (CSSParser::parseBackgroundPosition):
348         (CSSParser::parseBackgroundProperty):
349         (CSSParser::parseColorFromValue):
350         * khtml/css/cssparser.h:
351         * khtml/css/cssstyleselector.cpp:
352         (khtml::CSSStyleSelector::adjustRenderStyle):
353         (khtml::CSSStyleSelector::applyProperty):
354         (khtml::CSSStyleSelector::mapBackgroundAttachment):
355         (khtml::CSSStyleSelector::mapBackgroundImage):
356         (khtml::CSSStyleSelector::mapBackgroundRepeat):
357         (khtml::CSSStyleSelector::mapBackgroundXPosition):
358         (khtml::CSSStyleSelector::mapBackgroundYPosition):
359         * khtml/css/cssstyleselector.h:
360         * khtml/rendering/render_box.cpp:
361         (RenderBox::paintRootBoxDecorations):
362         (RenderBox::paintBoxDecorations):
363         (RenderBox::paintBackgrounds):
364         (RenderBox::paintBackground):
365         (RenderBox::paintBackgroundExtended):
366         * khtml/rendering/render_box.h:
367         * khtml/rendering/render_form.cpp:
368         (RenderFieldset::paintBoxDecorations):
369         * khtml/rendering/render_line.cpp:
370         (khtml::InlineFlowBox::paintBackgrounds):
371         (khtml::InlineFlowBox::paintBackground):
372         (khtml::InlineFlowBox::paintBackgroundAndBorder):
373         * khtml/rendering/render_line.h:
374         * khtml/rendering/render_object.cpp:
375         (RenderObject::setStyle):
376         (RenderObject::updateBackgroundImages):
377         (RenderObject::getVerticalPosition):
378         * khtml/rendering/render_object.h:
379         (khtml::RenderObject::paintBackgroundExtended):
380         * khtml/rendering/render_style.cpp:
381         (m_next):
382         (BackgroundLayer::BackgroundLayer):
383         (BackgroundLayer::~BackgroundLayer):
384         (BackgroundLayer::operator=):
385         (BackgroundLayer::operator==):
386         (BackgroundLayer::fillUnsetProperties):
387         (BackgroundLayer::cullEmptyLayers):
388         (StyleBackgroundData::StyleBackgroundData):
389         (StyleBackgroundData::operator==):
390         (RenderStyle::diff):
391         (RenderStyle::adjustBackgroundLayers):
392         * khtml/rendering/render_style.h:
393         (khtml::OutlineValue::operator==):
394         (khtml::OutlineValue::operator!=):
395         (khtml::BackgroundLayer::backgroundImage):
396         (khtml::BackgroundLayer::backgroundXPosition):
397         (khtml::BackgroundLayer::backgroundYPosition):
398         (khtml::BackgroundLayer::backgroundAttachment):
399         (khtml::BackgroundLayer::backgroundRepeat):
400         (khtml::BackgroundLayer::next):
401         (khtml::BackgroundLayer::isBackgroundImageSet):
402         (khtml::BackgroundLayer::isBackgroundXPositionSet):
403         (khtml::BackgroundLayer::isBackgroundYPositionSet):
404         (khtml::BackgroundLayer::isBackgroundAttachmentSet):
405         (khtml::BackgroundLayer::isBackgroundRepeatSet):
406         (khtml::BackgroundLayer::setBackgroundImage):
407         (khtml::BackgroundLayer::setBackgroundXPosition):
408         (khtml::BackgroundLayer::setBackgroundYPosition):
409         (khtml::BackgroundLayer::setBackgroundAttachment):
410         (khtml::BackgroundLayer::setBackgroundRepeat):
411         (khtml::BackgroundLayer::clearBackgroundImage):
412         (khtml::BackgroundLayer::clearBackgroundXPosition):
413         (khtml::BackgroundLayer::clearBackgroundYPosition):
414         (khtml::BackgroundLayer::clearBackgroundAttachment):
415         (khtml::BackgroundLayer::clearBackgroundRepeat):
416         (khtml::BackgroundLayer::setNext):
417         (khtml::BackgroundLayer::operator!=):
418         (khtml::BackgroundLayer::containsImage):
419         (khtml::BackgroundLayer::hasImage):
420         (khtml::BackgroundLayer::hasFixedImage):
421         (khtml::RenderStyle::setBitDefaults):
422         (khtml::RenderStyle::hasBackground):
423         (khtml::RenderStyle::hasFixedBackgroundImage):
424         (khtml::RenderStyle::outlineWidth):
425         (khtml::RenderStyle::outlineStyle):
426         (khtml::RenderStyle::outlineStyleIsAuto):
427         (khtml::RenderStyle::outlineColor):
428         (khtml::RenderStyle::backgroundColor):
429         (khtml::RenderStyle::backgroundImage):
430         (khtml::RenderStyle::backgroundRepeat):
431         (khtml::RenderStyle::backgroundAttachment):
432         (khtml::RenderStyle::backgroundXPosition):
433         (khtml::RenderStyle::backgroundYPosition):
434         (khtml::RenderStyle::accessBackgroundLayers):
435         (khtml::RenderStyle::backgroundLayers):
436         (khtml::RenderStyle::outlineOffset):
437         (khtml::RenderStyle::resetOutline):
438         (khtml::RenderStyle::setBackgroundColor):
439         (khtml::RenderStyle::setOutlineWidth):
440         (khtml::RenderStyle::setOutlineStyle):
441         (khtml::RenderStyle::setOutlineColor):
442         (khtml::RenderStyle::clearBackgroundLayers):
443         (khtml::RenderStyle::inheritBackgroundLayers):
444         (khtml::RenderStyle::setOutlineOffset):
445         * khtml/rendering/render_table.cpp:
446         (RenderTable::paintBoxDecorations):
447         (RenderTableCell::paintBoxDecorations):
448
449 2004-11-04  David Hyatt  <hyatt@apple.com>
450
451         Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
452         Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
453
454         Reviewed by darin
455
456         * kwq/KWQTextCodec.mm:
457         (KWQTextDecoder::convertLatin1):
458         (KWQTextDecoder::convertUTF16):
459         (KWQTextDecoder::convertUsingTEC):
460         (KWQTextDecoder::toUnicode):
461
462 2004-11-04  David Hyatt  <hyatt@apple.com>
463
464         Make sure line-height returns the correct value for normal.
465         
466         Reviewed by darin
467
468         * khtml/css/css_computedstyle.cpp:
469         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
470
471 2004-11-04  David Harrison  <harrison@apple.com>
472
473         Reviewed by Ken Kocienda.
474
475                 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
476                 
477         * khtml/editing/htmlediting.cpp:
478         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
479         to, but not including, the enclosingBlockFlowElement) rather than just the source element.
480         Fixed to insert after the destination subtree, rather than the destination element.  Handles
481         edge case of deleting back to the top of the tree, where there is nothing left to insert after.
482         * khtml/xml/dom_nodeimpl.cpp:
483         (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
484         * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
485         * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
486         * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
487
488 2004-11-03  Ken Kocienda  <kocienda@apple.com>
489
490         Reviewed by me
491         
492         More layout tests.
493
494         * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
495         * layout-tests/editing/deleting/delete-br-008.html: Added.
496         * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
497         * layout-tests/editing/deleting/delete-br-009.html: Added.
498         * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
499         * layout-tests/editing/deleting/delete-br-010.html: Added.
500
501 2004-11-03  Maciej Stachowiak  <mjs@apple.com>
502
503         Fix by Yasuo Kida, reviewed by me.
504
505         <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
506         
507         * kwq/KWQKHTMLPart.mm:
508         (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
509         same as a nil range - setting an empty marked range should clear
510         the marked range entirely.
511
512 2004-11-02  Maciej Stachowiak  <mjs@apple.com>
513
514         Reviewed by Dave Hyatt (when I originally coded it).
515
516         WebCore part of fix for:
517
518         <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
519         
520         * kwq/WebCoreBridge.h:
521         * kwq/WebCoreBridge.mm:
522         (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
523         DOMRange, or if the range is split into multiple lines, the rect for the part on
524         the first line only.
525         
526         * khtml/rendering/render_object.cpp:
527         (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
528         for the overrides below.
529         * khtml/rendering/render_object.h:
530         * khtml/rendering/render_box.cpp:
531         (RenderBox::caretRect):
532         * khtml/rendering/render_box.h:
533         * khtml/rendering/render_br.cpp:
534         (RenderBR::caretRect):
535         * khtml/rendering/render_br.h:
536         * khtml/rendering/render_flow.cpp:
537         (RenderFlow::caretRect):
538         * khtml/rendering/render_flow.h:
539         * khtml/rendering/render_text.cpp:
540         (RenderText::caretRect):
541
542 2004-11-02  Ken Kocienda  <kocienda@apple.com>
543
544         Reviewed by Hyatt
545
546         Implemented command to insert a block in response to typing a return key (even though
547         I am not turning that on by default with this patch....that will come later). 
548         
549         This new command is called InsertParagraphSeparatorCommand.
550         
551         Reworked the command and function names associated with inserting content into a 
552         document. Before this patch, there were inputXXX and insertXXX variants, with the
553         former used for more high-level actions and the latter used for lower-level stuff.
554         However, this was confusing as the AppKit uses insertXXX for everything. This resulted
555         in an insertXXX command going through an inputXXX WebCore step and then finally to an
556         insertXXX WebCore step. To make this less confusing, I have changes all the names to
557         be insertXXX, and modified the lower-level operations so that it is clear what they do.
558         
559         * khtml/editing/htmlediting.cpp:
560         (khtml::EditCommandPtr::isInsertTextCommand): Name change.
561         (khtml::EditCommand::isInsertTextCommand): Ditto.
562         (khtml::CompositeEditCommand::inputText): Ditto.
563         (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
564         (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
565         (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
566         (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
567         (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
568         (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
569         (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
570         (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
571         (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
572         (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
573         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
574         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
575         (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
576         (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
577         (khtml::InsertIntoTextNode::doApply): Ditto.
578         (khtml::InsertIntoTextNode::doUnapply): Ditto.
579         (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
580         (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
581         (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
582         (khtml::InsertLineBreakCommand::doApply):
583         (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
584         (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
585         (khtml::InsertNodeBeforeCommand::doApply): Ditto.
586         (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
587         (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
588         (khtml::InsertParagraphSeparatorCommand::doApply):
589         (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
590         Class name change, was InsertNewlineCommandInQuotedContentCommand.
591         (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
592         (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
593         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
594         (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
595         (khtml::InsertTextCommand::doApply): Ditto.
596         (khtml::InsertTextCommand::deleteCharacter): Ditto.
597         (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
598         (khtml::InsertTextCommand::input): Ditto.
599         (khtml::InsertTextCommand::insertSpace): Ditto.
600         (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
601         (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
602         (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
603         (khtml::TypingCommand::insertParagraphSeparator): New function.
604         (khtml::TypingCommand::doApply): Name changes, as above.
605         (khtml::TypingCommand::insertText): Ditto.
606         (khtml::TypingCommand::deleteKeyPressed): Ditto.
607         (khtml::TypingCommand::preservesTypingStyle): Ditto.
608         * khtml/editing/htmlediting.h:
609         (khtml::DeleteFromTextNodeCommand::node): Name change.
610         (khtml::DeleteFromTextNodeCommand::offset): Ditto.
611         (khtml::DeleteFromTextNodeCommand::count): Ditto.
612         (khtml::InsertIntoTextNode::text): Ditto.
613         (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
614         (khtml::InsertNodeBeforeCommand::refChild): Ditto.
615         (khtml::TypingCommand::): Ditto.
616         * khtml/editing/jsediting.cpp: Name changes, as above.
617         * kwq/WebCoreBridge.h:
618         * kwq/WebCoreBridge.mm:
619         (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
620         (-[WebCoreBridge insertParagraphSeparator]): New function.
621         (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
622
623 2004-11-01  Kevin Decker  <kdecker@apple.com>
624
625         Reviewed by rjw.
626
627         fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
628         once and for all. 
629
630         * khtml/ecma/kjs_window.cpp:
631         (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
632
633 2004-11-01  Darin Adler  <darin@apple.com>
634
635         Reviewed by Hyatt.
636
637         - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
638
639         * khtml/css/html4.css: Use color: initial for textarea and related ones.
640
641 2004-11-01  Ken Kocienda  <kocienda@apple.com>
642
643         Reviewed by John
644
645         Fix for this bug:
646         
647         <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
648
649         * khtml/css/css_computedstyle.cpp:
650         (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the 
651         implementation here into new copyPropertiesInSet helper. This now calls the
652         generalized copyPropertiesInSet function with the arguments needed to make copying
653         inheritable work.
654         * khtml/css/css_computedstyle.h:
655         * khtml/css/css_valueimpl.cpp:
656         (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
657         In order to do apply block properties, "regular" style declarations need to do style
658         diffs as well.
659         (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
660         except that it uses a different set of properties that apply only to blocks.
661         (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
662         and copies out those properties listed in a pre-defined set.
663         * khtml/css/css_valueimpl.h:
664         * khtml/editing/htmlediting.cpp:
665         (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
666         block, factoring out some of the special case code that should now only run in the inline case.
667         (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
668         (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
669         special handling for "legacy" HTML styles like <B> and <I>.
670         (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
671         style changes into different kinds. CSS specifies certain properties only apply to certain
672         element types. This set of changes now recognizes two such separate cases: styles that apply
673         to blocks, and styles that apply to inlines.
674         (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
675         (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
676         (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
677         with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
678         done so that the function can be passed a portion of the styles being applied so that block styles
679         and inline styles can be handled separately.
680         (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
681         (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
682         (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
683         (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
684         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
685         * khtml/editing/htmlediting.h:
686         (khtml::StyleChange::): Changed as described above.
687         (khtml::StyleChange::usesLegacyStyles):
688         (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
689         it needs to layout, even though it has not changed position in the DOM. For instance, this is needed 
690         when text align changes.
691         * khtml/khtml_part.cpp:
692         (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
693         the passed-in argument.
694         (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
695         is a caret. Formerly, this just set typing style and made no visible changes to the document.
696
697         New tests.
698
699         * layout-tests/editing/editing.js: Added some glue to change text align.
700         * layout-tests/editing/style/block-style-001-expected.txt: Added.
701         * layout-tests/editing/style/block-style-001.html: Added.
702         * layout-tests/editing/style/block-style-002-expected.txt: Added.
703         * layout-tests/editing/style/block-style-002.html: Added.
704         * layout-tests/editing/style/block-style-003-expected.txt: Added.
705         * layout-tests/editing/style/block-style-003.html: Added.
706
707 === Safari-169 ===
708
709 2004-10-29  Darin Adler  <darin@apple.com>
710
711         Reviewed by Kevin.
712
713         - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
714
715         * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
716         before advancing one character; before it did it backwards.
717
718 2004-10-29  Chris Blumenberg  <cblu@apple.com>
719
720         Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
721
722         Reviewed by kocienda, adele.
723
724         * khtml/rendering/render_frames.cpp:
725         (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
726
727 2004-10-29  Darin Adler  <darin@apple.com>
728
729         Reviewed by Chris.
730
731         - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
732
733         * khtml/khtmlview.cpp:
734         (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
735         deleted before this function finishes running.
736         (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
737         (KHTMLView::viewportMouseReleaseEvent): Ditto.
738         (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
739         is guaranteed to do ref/deref as needed.
740
741         * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
742
743 2004-10-28  Chris Blumenberg  <cblu@apple.com>
744
745         Enabled XSLT on Panther. See intrigue mail for compiling instructions.
746
747         Reviewed by darin.
748
749         * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
750         * WebCorePrefix.h: always use XSLT
751
752 2004-10-28  Ken Kocienda  <kocienda@apple.com>
753
754         Reviewed by Chris
755
756         Fix for these bugs:
757         
758         <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
759         <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
760         
761         * khtml/editing/htmlediting.cpp:
762         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members 
763         to initialization list, zeroing them out.
764         (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
765         handle a delete of content in special cases where the only thing selected is a BR. This
766         code path is much simpler than the newly-named performGeneralDelete, and detects when no
767         content merging should be done between blocks. This aspect of the change fixes 3854848.
768         One of the special cases added fixes 3803832.
769         (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
770         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
771         like the other helpers in this class.
772         (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
773         (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
774         * khtml/editing/htmlediting.h: Added new helper and changed an old one.
775
776 2004-10-28  Chris Blumenberg  <cblu@apple.com>
777
778         Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
779
780         Reviewed by darin.
781
782         * kwq/KWQKHTMLPart.mm:
783         (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
784
785 2004-10-28  Ken Kocienda  <kocienda@apple.com>
786
787         Reviewed by Harrison
788
789         Reorganization of delete command functionality so that doApply is not
790         several hundred lines long. This is not a squeaky-clean cleanup, but
791         it is a step in the right direction. No functionality changes.
792
793         * khtml/editing/htmlediting.cpp:
794         (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
795         (khtml::DeleteSelectionCommand::initializePositionData): New helper.
796         (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
797         (khtml::DeleteSelectionCommand::performDelete): Ditto.
798         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
799         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
800         (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
801         (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
802         (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
803         (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
804         * khtml/editing/htmlediting.h:
805
806 2004-10-28  Ken Kocienda  <kocienda@apple.com>
807
808         Reviewed by me
809
810         * khtml/editing/htmlediting.cpp:
811         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
812         new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
813
814 2004-10-27  Ken Kocienda  <kocienda@apple.com>
815
816         Reviewed by Chris
817
818         * khtml/editing/htmlediting.cpp:
819         (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
820         whether content not in the block containing the start of the selection is moved to that block
821         after the selection is deleted.
822         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
823         (khtml::DeleteSelectionCommand::doApply): Ditto.
824         (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
825         to handle the case of inserting a newline when in quoted content in Mail.
826         (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
827         (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
828         (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
829         (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
830         (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
831         (khtml::TypingCommand::doApply): Ditto.
832         (khtml::TypingCommand::preservesTypingStyle): Ditto.
833         * khtml/editing/htmlediting.h: Add new delclarations.
834         (khtml::TypingCommand::): Ditto.
835         * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
836         * kwq/WebCoreBridge.mm:
837         (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
838
839 2004-10-26  Chris Blumenberg  <cblu@apple.com>
840
841         Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
842
843         Reviewed by dave.
844
845         * khtml/ecma/kjs_dom.cpp:
846         (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
847         * khtml/ecma/kjs_dom.h:
848         (KJS::DOMElement::):
849         * khtml/ecma/kjs_dom.lut.h:
850         (KJS::):
851
852 2004-10-26  David Hyatt  <hyatt@apple.com>
853
854         Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
855         the previous line.
856         
857         Reviewed by kocienda
858
859         * khtml/rendering/bidi.cpp:
860         (khtml::RenderBlock::layoutInlineChildren):
861
862 2004-10-26  David Hyatt  <hyatt@apple.com>
863
864         Convert selectionRect() from using a list to a dict and patch it to be like setSelection.  It was still trying
865         to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
866         
867         Reviewed by kocienda
868
869         * khtml/rendering/render_canvas.cpp:
870         (RenderCanvas::selectionRect):
871         * khtml/rendering/render_object.h:
872         (khtml::RenderObject::hasSelectedChildren):
873
874 2004-10-26  Ken Kocienda  <kocienda@apple.com>
875
876         Reviewed by Hyatt
877         
878         Fix for this bug::
879         
880         <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
881
882         * khtml/editing/htmlediting.cpp:
883         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
884         let the caller know if a placeholder was removed.
885         (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
886         removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
887         some cases, the selection was still set on the removed BR, and this was the cause of the
888         crash.
889         * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
890
891 2004-10-26  Darin Adler  <darin@apple.com>
892
893         Reviewed by Chris.
894
895         - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
896
897         * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
898
899 2004-10-26  Ken Kocienda  <kocienda@apple.com>
900
901         Reviewed by John
902
903         * khtml/editing/htmlediting.cpp:
904         (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
905         with a zero-length string. That triggers an assert. Call deleteText instead, 
906         using the same indices that are passed to replaceText.
907         
908         Cleaned up the asserts in these three functions below, making them
909         more consistent. This is not needed for the fix, but I tripped over
910         these in the course of debugging.
911         
912         (khtml::InsertTextCommand::InsertTextCommand):
913         (khtml::InsertTextCommand::doApply):
914         (khtml::InsertTextCommand::doUnapply):
915
916 2004-10-25  Adele Amchan <adele@apple.com>
917
918         Reviewed by Darin.
919
920         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
921         * khtml/xml/dom_docimpl.h:
922
923 2004-10-25  Adele Amchan  <adele@apple.com>
924
925         Reviewed by me, code change by Darin.
926
927         * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
928
929 2004-10-25  Ken Kocienda  <kocienda@apple.com>
930
931         Oops. These two test results changed with my last checkin, for the better.
932
933         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
934         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
935
936 2004-10-25  Ken Kocienda  <kocienda@apple.com>
937
938         Reviewed by Chris
939
940         Fix for this bug:
941         
942         <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
943
944         * khtml/editing/htmlediting.cpp:
945         (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
946         expand the selection outwards when the selection is on the visible boundary of a root
947         editable element. This fixes the bug. Note that this function also contains a little code
948         I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
949         (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
950         (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
951         * khtml/editing/htmlediting.h: Declare new helpers.
952         * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
953         * layout-tests/editing/deleting/delete-select-all-001.html: Added.
954         * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
955         * layout-tests/editing/deleting/delete-select-all-002.html: Added.
956         * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
957         * layout-tests/editing/deleting/delete-select-all-003.html: Added.
958
959 2004-10-25  Ken Kocienda  <kocienda@apple.com>
960
961         Added some more editing layout tests.
962
963         * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
964         * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
965         * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
966         * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
967         * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
968         * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
969         * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
970         * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
971         * layout-tests/editing/inserting/typing-003-expected.txt: Added.
972         * layout-tests/editing/inserting/typing-003.html: Added.
973
974 2004-10-25  Ken Kocienda  <kocienda@apple.com>
975
976         Reviewed by John
977
978         * khtml/rendering/bidi.cpp:
979         (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
980             yesterday quite right: words that should have been placed on the next line were instead
981         appearing on the line before, beyond the right margin. This was a one-word only error
982         based on moving the line break object when it should have stayed put. Here is the rule:
983         The line break object only moves to after the whitespace on the end of a line if that 
984         whitespace caused line overflow when its width is added in.
985
986 2004-10-25  Adele Amchan  <adele@apple.com>
987
988         Reviewed by Darin.
989  
990         Fix for <rdar://problem/3619890> Feature request: designMode        
991
992         This change implements the designMode property of a document.  This is an IE property that is also supported by Mozilla.  
993         This will enable more JS editing compatibility.
994
995         * khtml/ecma/kjs_html.cpp:
996         (KJS::HTMLDocument::tryGet): added case for designMode
997         (KJS::HTMLDocument::putValue): added case for designMode
998         * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
999         * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
1000         * khtml/xml/dom_docimpl.cpp:
1001         (DocumentImpl::DocumentImpl): initialize m_designMode member variable
1002         (DocumentImpl::setDesignMode): added function to assign m_designMode value
1003         (DocumentImpl::getDesignMode): return m_designMode value
1004         (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value. 
1005             Otherwise, it will just return the m_designMode value.
1006         (DocumentImpl::parentDocument):
1007         * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
1008         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
1009
1010 2004-10-22  Ken Kocienda  <kocienda@apple.com>
1011
1012         Reviewed by Hyatt
1013
1014         Fix for this bug:
1015         
1016         <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
1017
1018         * khtml/editing/htmlediting.cpp:
1019         (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
1020         everything that could be affected.
1021         (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
1022         braces, making it act as a comma operator, with a zero value as the right value!!! This made
1023         an important check always fail!!! It turns out that we do not want the constant at all, since
1024         that constant is only needed when checking a computed style, not an inline style as is being
1025         done here.
1026         (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
1027         (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
1028         RangeImpl::compareBoundaryPoints to perform the required check.
1029         * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
1030
1031 2004-10-22  Ken Kocienda  <kocienda@apple.com>
1032
1033         Reviewed by Hyatt
1034         
1035         Fix for this bugs:
1036         
1037         <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
1038         <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
1039     
1040         * khtml/rendering/bidi.cpp:
1041         (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
1042         it is when we are editing, add in the space of the current character when calculating the width
1043         of committed plus uncommitted characters. If this value exceeds the width of the line, move up
1044         the line break object and call skipWhitespace to move past the end of the whitespace.
1045
1046 === Safari-168 ===
1047
1048 2004-10-22  Ken Kocienda  <kocienda@apple.com>
1049
1050         * WebCore.pbproj/project.pbxproj:
1051          Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
1052
1053 2004-10-21  David Hyatt  <hyatt@apple.com>
1054
1055         Reviewed by darin
1056         
1057         Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
1058         
1059         <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
1060         <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
1061         
1062         * khtml/rendering/render_block.cpp:
1063         (khtml::getInlineRun):
1064         (khtml::RenderBlock::makeChildrenNonInline):
1065
1066 2004-10-21  David Hyatt  <hyatt@apple.com>
1067
1068         Fix for 3810389, crash because of continuation() craziness.  Revert back to the old behavior of
1069         making sure that all line boxes get deleted and recreated when inlines are split because of a block.
1070         
1071         Reviewed darin
1072
1073         * khtml/rendering/render_inline.cpp:
1074         (RenderInline::splitFlow):
1075
1076 2004-10-21  Ken Kocienda  <kocienda@apple.com>
1077
1078         Reviewed by Darin
1079         
1080         Significant improvement to the way that whitespace is handled during editing.
1081
1082         * khtml/editing/htmlediting.cpp:
1083         (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
1084         two being added with this name) that delete "insignificant" unrendered text.
1085         (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
1086         calculates the downstream position to use as the endpoint for the deletion, and
1087         then calls deleteInsignificantText with this start and end.
1088         (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
1089         (khtml::InputNewlineCommand::doApply): Ditto.
1090         (khtml::InputTextCommand::input): Ditto.
1091         * khtml/editing/htmlediting.h: Add new declarations.
1092         
1093         Modified layout test results:
1094         * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
1095         * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
1096         * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
1097         * layout-tests/editing/deleting/delete-selection-001-expected.txt:
1098         * layout-tests/editing/deleting/delete-tab-001-expected.txt:
1099         * layout-tests/editing/deleting/delete-tab-004-expected.txt:
1100         * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
1101         * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
1102         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
1103         * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
1104         * layout-tests/editing/inserting/insert-br-001-expected.txt:
1105         * layout-tests/editing/inserting/insert-br-004-expected.txt:
1106         * layout-tests/editing/inserting/insert-br-005-expected.txt:
1107         * layout-tests/editing/inserting/insert-br-006-expected.txt:
1108         * layout-tests/editing/inserting/insert-tab-001-expected.txt:
1109         * layout-tests/editing/inserting/insert-tab-002-expected.txt:
1110         * layout-tests/editing/inserting/insert-tab-004-expected.txt:
1111         * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
1112         * layout-tests/editing/inserting/typing-001-expected.txt:
1113         * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
1114         * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
1115         * layout-tests/editing/style/typing-style-003-expected.txt:
1116         * layout-tests/editing/undo/redo-typing-001-expected.txt:
1117         * layout-tests/editing/undo/undo-typing-001-expected.txt:
1118
1119 2004-10-21  David Hyatt  <hyatt@apple.com>
1120
1121         Fix for 3847054, assertion failure in RenderText::layout() on news.com page.  Fix getInlineRun so that
1122         it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
1123         
1124         Reviewed by darin
1125
1126         * khtml/rendering/render_block.cpp:
1127         (khtml::getInlineRun):
1128
1129 2004-10-20  David Hyatt  <hyatt@apple.com>
1130
1131         Add better dumping of overflow information for scrolling regions.
1132
1133         Fix for 3726524, crash in updateLayerPosition.  Make sure anonymous elements properly remove themselves
1134         from the render tree so that layers and so forth are cleaned up.
1135         
1136         Reviewed by darin
1137
1138         * khtml/rendering/render_container.cpp:
1139         (RenderContainer::detach):
1140         * khtml/rendering/render_layer.h:
1141         (khtml::RenderLayer::scrollXOffset):
1142         (khtml::RenderLayer::scrollYOffset):
1143         * kwq/KWQRenderTreeDebug.cpp:
1144         (write):
1145
1146 2004-10-20  David Hyatt  <hyatt@apple.com>
1147
1148         Fix for 3791146, make sure all lines are checked when computing overflow.
1149         
1150         Reviewed by kocienda
1151
1152         * khtml/rendering/bidi.cpp:
1153         (khtml::RenderBlock::computeHorizontalPositionsForLine):
1154         (khtml::RenderBlock::layoutInlineChildren):
1155         (khtml::RenderBlock::findNextLineBreak):
1156         (khtml::RenderBlock::checkLinesForOverflow):
1157         * khtml/rendering/render_block.h:
1158
1159 2004-10-20  David Hyatt  <hyatt@apple.com>
1160
1161         Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
1162         
1163         Reviewed by kocienda
1164
1165         * khtml/rendering/break_lines.cpp:
1166         (khtml::isBreakable):
1167
1168 2004-10-20  Darin Adler  <darin@apple.com>
1169
1170         Reviewed by John.
1171
1172         - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
1173
1174         * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
1175         Create a palette with the background and foreground colors in it and set it on the widget.
1176
1177         * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
1178         with APPLE_CHANGES. Removed palette and palette-related function members.
1179         * khtml/rendering/render_style.cpp:
1180         (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
1181         (RenderStyle::diff): No palette to compare.
1182
1183         * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
1184         * kwq/KWQLineEdit.mm:
1185         (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
1186         (QLineEdit::text): Made const.
1187
1188         * kwq/KWQTextEdit.h: Added setPalette override.
1189         * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
1190         based on palette.
1191
1192         * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
1193         per color group, and only a single color group per palette.
1194         * kwq/KWQColorGroup.mm: Removed.
1195         * kwq/KWQPalette.mm: Removed.
1196         * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
1197
1198         * kwq/KWQApplication.h: Removed unused palette function.
1199         * kwq/KWQApplication.mm: Ditto.
1200
1201         * kwq/KWQWidget.h: Removed unsetPalette.
1202         * kwq/KWQWidget.mm: Ditto.
1203
1204         - fixed storage leak
1205
1206         * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
1207         Roll in storage leak fix from KDE guys.
1208
1209 2004-10-19  David Hyatt  <hyatt@apple.com>
1210
1211         Reviewed by kocienda
1212
1213         More cleanup of block layout.  Eliminates the separate step for tables that dont fit on a line with a float
1214         and consolidates it with clearing.
1215
1216         Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
1217         
1218         * khtml/rendering/render_block.cpp:
1219         (khtml::getInlineRun):
1220         (khtml::RenderBlock::layoutBlock):
1221         (khtml::RenderBlock::adjustFloatingBlock):
1222         (khtml::RenderBlock::collapseMargins):
1223         (khtml::RenderBlock::clearFloatsIfNeeded):
1224         (khtml::RenderBlock::estimateVerticalPosition):
1225         (khtml::RenderBlock::layoutBlockChildren):
1226         (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
1227         (khtml::RenderBlock::getClearDelta):
1228         (khtml::RenderBlock::calcBlockMinMaxWidth):
1229         * khtml/rendering/render_block.h:
1230         * khtml/rendering/render_frames.cpp:
1231         (RenderFrameSet::layout):
1232         * khtml/xml/dom_textimpl.cpp:
1233         (TextImpl::rendererIsNeeded):
1234
1235         Fix for 3841060, regression with * in frames.  Reviewed by kocienda.
1236         
1237         * layout-tests/fast/frames/002-expected.txt: Added.
1238         * layout-tests/fast/frames/002.html: Added.
1239
1240  2004-10-19  Darin Adler  <darin@apple.com>
1241
1242         Reviewed by Maciej.
1243
1244         - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
1245
1246         * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
1247         scripts being loaded here. If the current code being run is the external script itself, then we don't want
1248         to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
1249         assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
1250         wrong since there can be a script loading in that case too. Layout tests check for both problems.
1251
1252         * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
1253         * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
1254         * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
1255
1256         * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
1257
1258 2004-10-18  Darin Adler  <darin@apple.com>
1259
1260         Reviewed by Dave Hyatt.
1261
1262         - fixed <rdar://problem/3807234> REGRESSION (152-153): can't get element by ID that was just written with document.write in separate JS file (lacoccinelle.net)
1263
1264         * khtml/html/htmltokenizer.cpp:
1265         (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
1266         (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
1267         we only want to look at loadingExtScript if m_executingScript is 0.
1268
1269 2004-10-18  Ken Kocienda  <kocienda@apple.com>
1270
1271         Reviewed by Hyatt
1272
1273         Fix for this bug:
1274         
1275         <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
1276
1277         * khtml/css/css_valueimpl.cpp:
1278         (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
1279         Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the 
1280         lifecycle issues associated with creating a string to be returned in the ident case.
1281         * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
1282         * khtml/css/cssstyleselector.cpp:
1283         (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
1284
1285 2004-10-18  Chris Blumenberg  <cblu@apple.com>
1286
1287         Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
1288
1289         Reviewed by kocienda.
1290
1291         * khtml/rendering/render_frames.cpp:
1292         (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
1293
1294 2004-10-15  Chris Blumenberg  <cblu@apple.com>
1295
1296         Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
1297
1298         Reviewed by john.
1299
1300         * kwq/DOM-CSS.mm:
1301         (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
1302         * kwq/DOMPrivate.h:
1303
1304 2004-10-15  Ken Kocienda  <kocienda@apple.com>
1305
1306         Reviewed by Hyatt
1307
1308         * khtml/rendering/bidi.cpp:
1309         (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
1310         skipping after a clean line break, in addition to the cases already 
1311         checked for.
1312         * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
1313         * layout-tests/editing/inserting/insert-br-007.html: Added.
1314         * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
1315         * layout-tests/editing/inserting/insert-br-008.html: Added.
1316
1317 === Safari-167 ===
1318
1319 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1320
1321         Reviewed by John
1322
1323         Fix for this bug:
1324         
1325         <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
1326
1327         * khtml/editing/visible_position.cpp:
1328         (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
1329         position code to new-style VisiblePosition code. In retrospect, this code was misguided.
1330         Since we do a good job of insulating external code from the internal workings of 
1331         VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
1332         in the case of this bug, was doing harm. Simply removing this code makes the bug
1333         go away and does not cause any editing layout test regresssions.
1334
1335 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1336
1337         Reviewed by Hyatt
1338
1339         * khtml/rendering/bidi.cpp:
1340         (khtml::skipNonBreakingSpace): New helper.
1341         (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
1342         at the start of a block. This was preventing users from typing spaces in empty
1343         documents.
1344         * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
1345         * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
1346
1347 2004-10-14  Adele Amchan  <adele@apple.com>
1348
1349         Reviewed by Darin and Ken.
1350
1351         fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
1352
1353         This change shifts some code around so that the code that determines what typing style
1354         is in effect is called before deleteUnrenderedText is called.  Two asserts are also added
1355         to ensure that start and end nodes of the selection are in the document.
1356
1357         * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
1358
1359 2004-10-14  Adele Amchan  <adele@apple.com>
1360
1361         Reviewed by Ken
1362         
1363         This change makes these three functions virtual so that the work is being done in KWQHTMLPart 
1364         instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
1365
1366         * khtml/khtml_part.cpp:
1367         (KHTMLPart::shouldBeginEditing):
1368         (KHTMLPart::shouldEndEditing):
1369         (KHTMLPart::isContentEditable):
1370         * khtml/khtml_part.h:
1371         * kwq/KWQKHTMLPart.h:
1372
1373 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1374
1375         Reviewed by John
1376
1377         Final fix for these bugs:
1378         
1379         <rdar://problem/3806306> HTML editing puts spaces at start of line
1380         <rdar://problem/3814252> HTML editing groups space with word causing wrapping
1381
1382         This change sets some new CSS properties that have been added to WebCore to 
1383         enable whitespace-handling and line-breaking features that make WebView work
1384         more like a text editor.
1385
1386         * khtml/css/cssstyleselector.cpp:
1387         (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties 
1388         based on property value.
1389         * khtml/html/html_elementimpl.cpp:
1390         (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties 
1391         based on attribute value.
1392         * khtml/khtml_part.cpp:
1393         (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
1394         body element.
1395         (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
1396         body element.
1397         (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
1398         (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
1399         * khtml/khtml_part.h: Add new declarations.
1400         * kwq/WebCoreBridge.h: Ditto.
1401         * kwq/WebCoreBridge.mm:
1402         (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
1403         (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
1404         (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
1405         (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
1406
1407 2004-10-14  John Sullivan  <sullivan@apple.com>
1408
1409         Reviewed by Ken.
1410         
1411         - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
1412
1413         * khtml/editing/htmlediting.cpp:
1414         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
1415         needed a nil check to handle empty document case
1416
1417 2004-10-13  Maciej Stachowiak  <mjs@apple.com>
1418
1419         Reviewed by Ken.
1420
1421         <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
1422         
1423         - I fixed this by turning off all colormatching for WebKit
1424         content. We might turn it back on later. For now, it's possible to
1425         turn it on temporarily by defining COLORMATCH_EVERYTHING.
1426         
1427         * WebCorePrefix.h:
1428         * khtml/ecma/kjs_html.cpp:
1429         (KJS::Context2DFunction::tryCall):
1430         (Context2D::colorRefFromValue):
1431         (Gradient::getShading):
1432         * khtml/rendering/render_canvasimage.cpp:
1433         (RenderCanvasImage::createDrawingContext):
1434         * kwq/KWQColor.mm:
1435         (QColor::getNSColor):
1436         * kwq/KWQPainter.h:
1437         * kwq/KWQPainter.mm:
1438         (CGColorFromNSColor):
1439         (QPainter::selectedTextBackgroundColor):
1440         (QPainter::rgbColorSpace):
1441         (QPainter::grayColorSpace):
1442         (QPainter::cmykColorSpace):
1443         * kwq/WebCoreGraphicsBridge.h:
1444         * kwq/WebCoreGraphicsBridge.m:
1445         (-[WebCoreGraphicsBridge createRGBColorSpace]):
1446         (-[WebCoreGraphicsBridge createGrayColorSpace]):
1447         (-[WebCoreGraphicsBridge createCMYKColorSpace]):
1448
1449 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1450
1451         Reviewed by Hyatt
1452
1453         * khtml/css/css_valueimpl.cpp:
1454         (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
1455         is non-null before appending.
1456
1457 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1458
1459         Update expected results for improved behavior as a result of fix to 3816768.
1460     
1461         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
1462         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
1463         * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
1464
1465 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1466
1467         Reviewed by Richard
1468
1469         * khtml/css/css_computedstyle.cpp:
1470         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
1471         for getting -khtml-line-break and -khml-nbsp-mode.
1472
1473 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1474
1475         Reviewed by John
1476
1477         Fix for this bug:
1478         
1479         <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly 
1480         moves caret out of block.
1481
1482         The issue here is that an empty block with no explicit height set by style collapses
1483         to zero height, and does so immediately after the last bit of content is removed from
1484         it (as a result of deleting text with the delete key for instance). Since zero-height
1485         blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
1486         
1487         The fix is to detect when a block has not been removed itself, but has had all its 
1488         contents removed. In this case, a BR element is placed in the block, one that is
1489         specially marked as a placeholder. Later, if the block ever receives content, this
1490         placeholder is removed.
1491
1492         * khtml/editing/htmlediting.cpp:
1493         (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
1494         (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
1495         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
1496         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
1497         Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong 
1498         (it's very clear that we needs to be able to move more than just text nodes). This may expose
1499         bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
1500         made the test case in the bug work.
1501         (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
1502         removeBlockPlaceholderIfNeeded.
1503         (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
1504         (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
1505         * khtml/editing/htmlediting.h: Declare new functions.
1506
1507 2004-10-13  Richard Williamson   <rjw@apple.com>
1508
1509         Added support for -apple-dashboard-region:none.  And fixed
1510         a few computed style problems.
1511
1512         Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
1513         Reviewed by Hyatt.
1514
1515         * khtml/css/css_computedstyle.cpp:
1516         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1517         * khtml/css/css_valueimpl.cpp:
1518         (CSSPrimitiveValueImpl::cssText):
1519         * khtml/css/cssparser.cpp:
1520         (CSSParser::parseValue):
1521         (CSSParser::parseDashboardRegions):
1522         * khtml/css/cssstyleselector.cpp:
1523         (khtml::CSSStyleSelector::applyProperty):
1524         * khtml/rendering/render_style.cpp:
1525         (RenderStyle::noneDashboardRegions):
1526         * khtml/rendering/render_style.h:
1527         * kwq/KWQKHTMLPart.mm:
1528         (KWQKHTMLPart::dashboardRegionsDictionary):
1529
1530 2004-10-13  David Hyatt  <hyatt@apple.com>
1531
1532         Rework block layout to clean it up and simplify it (r=kocienda).  
1533
1534         Also fixing the style sharing bug (r=mjs).
1535         
1536         * khtml/rendering/render_block.cpp:
1537         (khtml::RenderBlock::MarginInfo::MarginInfo):
1538         (khtml::RenderBlock::layoutBlock):
1539         (khtml::RenderBlock::adjustPositionedBlock):
1540         (khtml::RenderBlock::adjustFloatingBlock):
1541         (khtml::RenderBlock::handleSpecialChild):
1542         (khtml::RenderBlock::handleFloatingOrPositionedChild):
1543         (khtml::RenderBlock::handleCompactChild):
1544         (khtml::RenderBlock::insertCompactIfNeeded):
1545         (khtml::RenderBlock::handleRunInChild):
1546         (khtml::RenderBlock::collapseMargins):
1547         (khtml::RenderBlock::clearFloatsIfNeeded):
1548         (khtml::RenderBlock::estimateVerticalPosition):
1549         (khtml::RenderBlock::determineHorizontalPosition):
1550         (khtml::RenderBlock::setCollapsedBottomMargin):
1551         (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
1552         (khtml::RenderBlock::handleBottomOfBlock):
1553         (khtml::RenderBlock::layoutBlockChildren):
1554         (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
1555         (khtml::RenderBlock::addOverHangingFloats):
1556         * khtml/rendering/render_block.h:
1557         (khtml::RenderBlock::maxTopMargin):
1558         (khtml::RenderBlock::maxBottomMargin):
1559         (khtml::RenderBlock::CompactInfo::compact):
1560         (khtml::RenderBlock::CompactInfo::block):
1561         (khtml::RenderBlock::CompactInfo::matches):
1562         (khtml::RenderBlock::CompactInfo::clear):
1563         (khtml::RenderBlock::CompactInfo::set):
1564         (khtml::RenderBlock::CompactInfo::CompactInfo):
1565         (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
1566         (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
1567         (khtml::RenderBlock::MarginInfo::clearMargin):
1568         (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
1569         (khtml::RenderBlock::MarginInfo::setTopQuirk):
1570         (khtml::RenderBlock::MarginInfo::setBottomQuirk):
1571         (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
1572         (khtml::RenderBlock::MarginInfo::setPosMargin):
1573         (khtml::RenderBlock::MarginInfo::setNegMargin):
1574         (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
1575         (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
1576         (khtml::RenderBlock::MarginInfo::setMargin):
1577         (khtml::RenderBlock::MarginInfo::atTopOfBlock):
1578         (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
1579         (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
1580         (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
1581         (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
1582         (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
1583         (khtml::RenderBlock::MarginInfo::quirkContainer):
1584         (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
1585         (khtml::RenderBlock::MarginInfo::topQuirk):
1586         (khtml::RenderBlock::MarginInfo::bottomQuirk):
1587         (khtml::RenderBlock::MarginInfo::posMargin):
1588         (khtml::RenderBlock::MarginInfo::negMargin):
1589         (khtml::RenderBlock::MarginInfo::margin):
1590         * khtml/rendering/render_box.cpp:
1591         (RenderBox::calcAbsoluteVertical):
1592         * khtml/rendering/render_box.h:
1593         (khtml::RenderBox::marginTop):
1594         (khtml::RenderBox::marginBottom):
1595         (khtml::RenderBox::marginLeft):
1596         (khtml::RenderBox::marginRight):
1597         * khtml/rendering/render_image.cpp:
1598         (RenderImage::setImage):
1599         * khtml/rendering/render_object.cpp:
1600         (RenderObject::sizesToMaxWidth):
1601         * khtml/rendering/render_object.h:
1602         (khtml::RenderObject::collapsedMarginTop):
1603         (khtml::RenderObject::collapsedMarginBottom):
1604         (khtml::RenderObject::maxTopMargin):
1605         (khtml::RenderObject::maxBottomMargin):
1606         (khtml::RenderObject::marginTop):
1607         (khtml::RenderObject::marginBottom):
1608         (khtml::RenderObject::marginLeft):
1609         (khtml::RenderObject::marginRight):
1610         * khtml/rendering/render_text.h:
1611         (khtml::RenderText::marginLeft):
1612         (khtml::RenderText::marginRight):
1613         * khtml/xml/dom_elementimpl.cpp:
1614         (ElementImpl::recalcStyle):
1615
1616 2004-10-12  Ken Kocienda  <kocienda@apple.com>
1617
1618         Reviewed by John
1619
1620         Fix for this bug:
1621         
1622         <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line
1623
1624         * khtml/editing/selection.cpp:
1625         (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
1626         This will make it seem like the run ends on the next line.
1627
1628 2004-10-12  Ken Kocienda  <kocienda@apple.com>
1629
1630         Reviewed by Hyatt
1631
1632         Fix for this bug:
1633         
1634         <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages
1635
1636         * khtml/editing/htmlediting.cpp:
1637         (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
1638         row, section, or column.
1639         (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
1640         of table structure when doing deletes, rather than deleting the structure elements themselves.
1641         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
1642         of table structure. We may want to revisit this some day, but this seems like the best behavior
1643         to me now.
1644         (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
1645         where needed.
1646         * khtml/editing/htmlediting.h: Add declarations for new functions.
1647
1648 2004-10-12  Richard Williamson   <rjw@apple.com>
1649
1650         Fixed access to DOM object via WebScriptObject API.
1651         The execution context for DOM objects wasn't being found.       
1652         <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
1653         Reviewed by Chris
1654
1655         Fixed <rdar://problem/3831063> regions use left offset instead of top offset
1656         Reviewed by John
1657
1658         * khtml/khtml_part.h:
1659         * khtml/rendering/render_object.cpp:
1660         (RenderObject::addDashboardRegions):
1661         * kwq/DOM.mm:
1662         (-[DOMNode isContentEditable]):
1663         (-[DOMNode KJS::Bindings::]):
1664         * kwq/KWQKHTMLPart.h:
1665         * kwq/KWQKHTMLPart.mm:
1666         (KWQKHTMLPart::executionContextForDOM):
1667
1668 2004-10-12  Ken Kocienda  <kocienda@apple.com>
1669
1670         Reviewed by Hyatt
1671
1672         Fix for this bug:
1673
1674         <rdar://problem/3834779> Mail crashes when editing HTML message - khtml::Selection::layout()
1675     
1676         * kwq/KWQKHTMLPart.mm:
1677         (KWQKHTMLPart::styleForSelectionStart): Table code seems to be more robust when the call to
1678         insert our style-checking node is done with an appendChild rather than an insertBefore. Note 
1679         that this table-related problem was exposed by fixing Selection::layout(), which I did
1680         yesterday. This change simply improves things even more so that we do not crash in the
1681         scenario described in the bug.
1682
1683 2004-10-11  Ken Kocienda  <kocienda@apple.com>
1684
1685         Reviewed by John
1686
1687         This is a partial fix to this bug:
1688         
1689         <rdar://problem/3832886> increase quote level on new mail document leads to immediate 
1690         crash in caret painting code
1691         
1692         To eliminate the bad behavior for good, I have done some investigations in Mail code,
1693         and I have sent a suggested code change on to Grant. Basically, Mail can't add empty
1694         blocks (like blockquote elements used for quoting) to documents without giving those 
1695         blocks some content (so they have a height).
1696
1697         I added some other crash protections below.
1698
1699         * khtml/editing/selection.cpp:
1700         (khtml::Selection::layout): Check for non-null position after calls to VisiblePosition, since
1701         the VisiblePosition constructors may fail to find a visible spot in the document. Also, add
1702         a couple position-has-renderer assertion checks.
1703         * kwq/KWQKHTMLPart.mm:
1704         (KWQKHTMLPart::styleForSelectionStart): Take out pos.isNotNull() assertion since VisiblePosition
1705         may not yield a position. This assertion is a holdover from before we had VisiblePosition.
1706         (KWQKHTMLPart::fontForSelection): Rearrange the code a little to deal with possible null results from
1707         calls to helpers.
1708
1709 2004-10-11  Darin Adler  <darin@apple.com>
1710
1711         Reviewed by John.
1712
1713         - fixed <rdar://problem/3834230> empty table can result in division by 0
1714
1715         * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows):
1716         Added 0 check; rolled in from KDE.
1717
1718 2004-10-11  Darin Adler  <darin@apple.com>
1719
1720         Reviewed by John.
1721
1722         - fixed <rdar://problem/3818712> form checkbox value property is read only
1723
1724         The underlying problem was that we were storing two separate values for all
1725         form elements; one for the value property (JavaScript) and the other for the
1726         value attribute (DOM). This is a good idea for text input, but not for other types.
1727
1728         * khtml/html/html_formimpl.h: Changed setValue to take a const DOMString reference.
1729         Added private storesValueSeparateFromAttribute function.
1730         * khtml/html/html_formimpl.cpp:
1731         (DOM::HTMLInputElementImpl::setType): Handle type changes, including detaching and re-attaching
1732         if type changed, and moving value from m_value to ATTR_VALUE and vice versa.
1733         (DOM::HTMLInputElementImpl::type): Added a case for ISINDEX and moved the default out of the
1734         switch so that we will get a warning if a type is left out.
1735         (DOM::HTMLInputElementImpl::parseHTMLAttribute): Tweaked comment format.
1736         (DOM::HTMLInputElementImpl::reset): Changed to only nuke the value if the value property is stored
1737         separately from the attribute. Otherwise, we just want to lave it alone
1738         (DOM::HTMLInputElementImpl::value): Changed to always use m_value if it's not null, then fall back
1739         on the attribute, and finally fall back to the "on" for the checkbox only if both are null.
1740         (DOM::HTMLInputElementImpl::setValue): Changed to set the attribute unless the value property is
1741         supposed to be stored separate from the attribute.
1742         (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute): Added. Returns true for text-type
1743         input elements, and false for the others.
1744
1745 2004-10-11  Darin Adler  <darin@apple.com>
1746
1747         Reviewed by John.
1748
1749         - fixed <rdar://problem/3296652> checkbox input type does not respond to onchange
1750
1751         * khtml/rendering/render_form.cpp:
1752         (RenderFormElement::updateFromElement): Some new code, commented out, for form element colors.
1753         (RenderCheckBox::slotStateChanged): Added call to onChange.
1754
1755 2004-10-11  Ken Kocienda  <kocienda@apple.com>
1756
1757         Reviewed by Darin
1758
1759         Finish selection affinity implementation. This includes code to set the
1760         affinity correctly when clicking with the mouse, and clearing the
1761         affinity when altering the selection using any of the Selection object
1762         mutation functions.
1763
1764         Each instance of the positionForCoordinates, inlineBox and caretRect 
1765         functions have been changed to include an EAffinity argument to give results
1766         which take this bit into account.
1767
1768         * khtml/editing/selection.cpp:
1769         (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
1770         (khtml::Selection::modifyAffinity): New function to compute affinity based on
1771         modification constants.
1772         (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
1773         (khtml::Selection::modifyExtendingRightForward): Ditto.
1774         (khtml::Selection::modifyMovingRightForward): Ditto.
1775         (khtml::Selection::modifyExtendingLeftBackward): Ditto.
1776         (khtml::Selection::modifyMovingLeftBackward): Ditto.
1777         (khtml::Selection::modify): Support saving, restoring, and then calculating new
1778         affinity value as needed. 
1779         (khtml::Selection::xPosForVerticalArrowNavigation):
1780         (khtml::Selection::clear): Reset affinity to UPSTREAM.
1781         (khtml::Selection::setBase): Ditto.
1782         (khtml::Selection::setExtent): Ditto.
1783         (khtml::Selection::setBaseAndExtent): Ditto.
1784         (khtml::Selection::layout): Pass affinity to caretRect().
1785         (khtml::Selection::validate): Pass along affinity parameter to new functions that
1786         require it.
1787         (khtml::startOfFirstRunAt): Changed the way that the y-coordinate search is done, to
1788         keep this code working with changes made in selectionForLine().
1789         (khtml::endOfLastRunAt): Ditto.
1790         (khtml::selectionForLine): Make this function work for all renderers, not just text
1791         renderers.
1792         * khtml/editing/selection.h:
1793         (khtml::operator==): Consider affinity in equality check.
1794         * khtml/editing/visible_units.cpp:
1795         (khtml::previousLinePosition): Pass affinity argument to function so it can take this 
1796         information into account while processing.
1797         (khtml::nextLinePosition): Ditto.
1798         (khtml::previousParagraphPosition): Ditto.
1799         (khtml::nextParagraphPosition): Ditto.
1800         * khtml/editing/visible_units.h: Ditto, for each of the functions listed.
1801         * khtml/khtml_events.cpp:
1802         (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
1803         as this function is being removed.
1804         * khtml/khtml_part.cpp:
1805         (KHTMLPart::isPointInsideSelection): Ditto.
1806         (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
1807         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1808         (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
1809         call to positionForCoordinates, and set resulting affinity on the selection.
1810         (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on 
1811         NodeImpl::positionForCoordinates, as this function is being removed.
1812         (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
1813         * khtml/rendering/render_block.cpp:
1814         (khtml::RenderBlock::positionForCoordinates): Now takes an affinity argument.
1815         * khtml/rendering/render_block.h:
1816         * khtml/rendering/render_box.cpp:
1817         (RenderBox::caretRect): Ditto.
1818         * khtml/rendering/render_box.h:
1819         * khtml/rendering/render_br.cpp:
1820         (RenderBR::positionForCoordinates): Ditto.
1821         (RenderBR::caretRect): Ditto.
1822         (RenderBR::inlineBox): Ditto.
1823         * khtml/rendering/render_br.h:
1824         * khtml/rendering/render_container.cpp:
1825         (RenderContainer::positionForCoordinates): Ditto.
1826         * khtml/rendering/render_container.h:
1827         * khtml/rendering/render_flow.cpp:
1828         (RenderFlow::caretRect): Ditto.
1829         * khtml/rendering/render_flow.h:
1830         * khtml/rendering/render_inline.cpp:
1831         (RenderInline::positionForCoordinates): Ditto.
1832         * khtml/rendering/render_inline.h:
1833         * khtml/rendering/render_object.cpp:
1834         (RenderObject::caretRect): Ditto.
1835         (RenderObject::positionForCoordinates): Ditto.
1836         (RenderObject::inlineBox): Ditto.
1837         * khtml/rendering/render_object.h:
1838         * khtml/rendering/render_replaced.cpp:
1839         (RenderReplaced::positionForCoordinates): Ditto.
1840         * khtml/rendering/render_replaced.h:
1841         * khtml/rendering/render_text.cpp:
1842         (RenderText::positionForCoordinates): Ditto.
1843         (firstRendererOnNextLine): New helper used by caretRect().
1844         (RenderText::caretRect): Now takes an affinity argument.
1845         (RenderText::inlineBox): Ditto.
1846         * khtml/rendering/render_text.h:
1847         * khtml/xml/dom_nodeimpl.cpp: Remove positionForCoordinates helper.
1848         * khtml/xml/dom_nodeimpl.h: Ditto.
1849         * khtml/xml/dom_position.cpp:
1850         (DOM::Position::previousLinePosition): Now takes an affinity argument.
1851         (DOM::Position::nextLinePosition): Ditto.
1852         * khtml/xml/dom_position.h:
1853         * kwq/WebCoreBridge.h:
1854         * kwq/WebCoreBridge.mm:
1855         (-[WebCoreBridge caretRectAtNode:offset:affinity:]): Ditto.
1856         (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
1857         (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on 
1858         NodeImpl::positionForCoordinates, as this function is being removed.
1859
1860 2004-10-11  Darin Adler  <darin@apple.com>
1861
1862         Reviewed by Ken.
1863
1864         - fixed <rdar://problem/3670280> scroll position on overflowed textareas resets when leaving the tab
1865
1866         * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView becomeFirstResponder]):
1867         Scroll to reveal the text area, don't scroll to reveal the text view itself.
1868         Scrolling the text view ended up putting it at the top left, regardless of
1869         where the insertion point is.
1870
1871 2004-10-11  Darin Adler  <darin@apple.com>
1872
1873         Reviewed by Ken.
1874
1875         - fixed <rdar://problem/3831546> More text is copied than is visually selected
1876
1877         The bug here is that upstream was moving a position too far.
1878
1879         * khtml/xml/dom_position.cpp:
1880         (DOM::Position::upstream): Use the "deep equivalent" node rather than the original node passed
1881         in for various checks. Also use local variables a bit more for slightly more efficiency.
1882         (DOM::Position::downstream): Ditto.
1883
1884 2004-10-11  Darin Adler  <darin@apple.com>
1885
1886         Reviewed by Ken.
1887
1888         - fixed <rdar://problem/3833841> adding an event listener for keypress events does not work
1889
1890         * khtml/xml/dom2_eventsimpl.h: Added numEventIds and made typeToId take a const DOMString &.
1891         * khtml/xml/dom2_eventsimpl.cpp:
1892         (EventImpl::typeToId): Changed to use table. Added "keypress", otherwise, the same as before.
1893         (EventImpl::idToType): Changed to use table.
1894
1895 2004-10-10  John Sullivan  <sullivan@apple.com>
1896
1897         - fixed <rdar://problem/3664375> repro crash in -[KWQAccObject accessibilityAttributeNames]
1898
1899         (-[KWQAccObject accessibilityActionNames]):
1900         check for nil m_renderer
1901
1902 2004-10-09  Darin Adler  <darin@apple.com>
1903
1904         Reviewed by Kevin.
1905
1906         - fixed <rdar://problem/3828147> REGRESSION: textareas with wrap="off" show their contents in a thin vertical line of text
1907
1908         * kwq/KWQTextArea.h: Added setTextColor and setBackgroundColor methods. This is really for another fix
1909         I'm landing later, but it does no harm to add these now.
1910         * kwq/KWQTextArea.mm:
1911         (-[KWQTextArea _configureTextViewForWordWrapMode]): Set the container size after changing the flag that
1912         determines if the width tracks the text view. Otherwise, we won't successfully set the width in the case
1913         where we don't want it to track the text view. This caused the bug. 
1914         (-[KWQTextArea _createTextView]): Remove unneeded call to setMaxSize. The above method already does that.
1915         (-[KWQTextArea setTextColor:]): Added.
1916         (-[KWQTextArea setBackgroundColor:]): Added.
1917
1918 2004-10-09  Darin Adler  <darin@apple.com>
1919
1920         Reviewed by Adele.
1921
1922         - fixed <rdar://problem/3829452> REGRESSION (156-157): onload handler doesn't run on page with meta refresh of 0 duration (new Apple start page)
1923
1924         The fix for <rdar://problem/3773150> made it so <meta> redirects prevent tokenizing the rest of the page.
1925         This is incorrect; the reason the JavaScript-triggered loads prevent tokenizing is that they take place
1926         "right away" in other browsers, but that is not true of <meta> redirect. We fixed this by using a separate
1927         call for <meta> redirect and not preventing tokenizing when that's in effect.
1928
1929         * khtml/khtml_part.h: Removed userGesture parameter from scheduleRedirection. Renamed
1930         isImmediateRedirectPending to isScheduledLocationChangePending. Added scheduleLocationChange.
1931         * khtml/khtml_part.cpp:
1932         (KHTMLPart::openURL): Updated for new constant name.
1933         (KHTMLPart::scheduleRedirection): Removed now-unneeded userGesture parameter, and removed code that
1934         does the special case for redirection during load; a <meta> refresh can never be one of those special
1935         redirects during a load because it redirects the frame itself, not another frame. Also tightened up
1936         the logic by always stopping the redirect timer even if we aren't restarting it.
1937         (KHTMLPart::scheduleLocationChange): Added. Like scheduleRedirection, but with a different constant
1938         so we can tell it apart and always a delay of 0. The "redirection during load" case was moved in here
1939         and renamed to locationChangeScheduledDuringLoad.
1940         (KHTMLPart::isScheduledLocationChangePending): Renamed from isImmediateRedirectPending. This now
1941         returns true only for location changes and history navigation, not <meta> redirects.
1942         (KHTMLPart::scheduleHistoryNavigation): Tightened up logic to do the stop() outside the if as above,
1943         and got rid of a silly timer delay computation that always resulted in 0.
1944
1945         * khtml/khtmlpart_p.h: Added a new value to the RedirectionScheduled enum for scheduleLocationChange
1946         and also renamed one of the existing values.
1947
1948         * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::write): Changed to use isScheduledLocationChangePending instead
1949         of isImmediateRedirectPending, because we do want to continue tokenizing if it's actually a redirect.
1950
1951         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Changed to call the new scheduleLocationChange
1952         instead of calling scheduleRedirection with delay of 0.
1953         * khtml/ecma/kjs_window.cpp:
1954         (Window::put): Ditto.
1955         (WindowFunc::tryCall): Ditto.
1956         (Location::put): Ditto.
1957         (LocationFunc::tryCall): Ditto.
1958
1959 2004-10-09  Darin Adler  <darin@apple.com>
1960
1961         Reviewed by Kevin.
1962
1963         - fixed <rdar://problem/3658277> REGRESSION (1.1-1.2): form submission should either not simulate a click at all or use (0,0) the way Mozilla does
1964
1965         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::click): Use 0,0 for the coordinates.
1966
1967 2004-10-09  Darin Adler  <darin@apple.com>
1968
1969         Reviewed by Kevin.
1970
1971         - fixed <rdar://problem/3804665> REGRESSION: WebCore framework now has many init routines
1972
1973         * khtml/xml/dom_nodeimpl.h: Changed anyQName declaration to not use the inline function
1974         makeId. Surprisingly, the inline function was not "constant-folded" and we ended up with
1975         a copy of the function in each file as an init routine for the framework.
1976
1977         * khtml/ecma/kjs_html.cpp: (Gradient::colorStops): Get rid of initialized ColorStop
1978         globals; their constructors were showing up as init routines for the framework.
1979
1980         * khtml/rendering/render_style.h: Got rid of inline initialDashboardRegions function.
1981         * khtml/rendering/render_style.cpp: (RenderStyle::initialDashboardRegions): Made this
1982         a normal function. When it was an inline function, the constructors for the per-file
1983         copies of the globals were showing up as init routines for the framework.
1984
1985 2004-10-09  Chris Blumenberg  <cblu@apple.com>
1986
1987         Fixed: 
1988         <rdar://problem/3625352> up and down arrow and page up/down keys don't work to scroll overflow:auto/scroll/overlay areas
1989         <rdar://problem/3397658> scroll wheel does not work to scroll overflow:auto/scroll/overlay areas (RSS)
1990         <rdar://problem/3822027> REGRESSION (Mail): When selection moves out of visible area, should center as NSText does
1991
1992         Reviewed by hyatt, kocienda.
1993
1994         * khtml/rendering/render_layer.cpp:
1995         (RenderLayer::scroll): new
1996         * khtml/rendering/render_layer.h:
1997         * khtml/rendering/render_object.cpp:
1998         (RenderObject::scroll): new
1999         * khtml/rendering/render_object.h:
2000         * kwq/KWQKHTMLPart.h:
2001         * kwq/KWQKHTMLPart.mm:
2002         (KWQKHTMLPart::scrollOverflow): new
2003         (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent): new
2004         (KWQKHTMLPart::khtmlMousePressEvent): store pressed node so we know where the focus is
2005         * kwq/KWQScrollBar.h:
2006         * kwq/KWQScrollBar.mm:
2007         (QScrollBar::setValue): return a bool
2008         (QScrollBar::scrollbarHit): ditto
2009         (QScrollBar::scroll): new
2010         * kwq/WebCoreBridge.h:
2011         * kwq/WebCoreBridge.mm:
2012         (-[WebCoreBridge scrollOverflowInDirection:granularity:]): new
2013         (-[WebCoreBridge scrollOverflowWithScrollWheelEvent:]): new
2014         (-[WebCoreBridge ensureSelectionVisible]): visually center the extent of the selection
2015
2016 2004-10-06  David Hyatt  <hyatt@apple.com>
2017
2018         Back out style sharing perf fix.
2019         
2020         * khtml/css/cssstyleselector.cpp:
2021         (khtml::CSSStyleSelector::locateCousinList):
2022         (khtml::CSSStyleSelector::canShareStyleWithElement):
2023         (khtml::CSSStyleSelector::locateSharedStyle):
2024         * khtml/css/cssstyleselector.h:
2025         * khtml/html/html_elementimpl.h:
2026         (DOM::HTMLElementImpl::inlineStyleDecl):
2027         * khtml/xml/dom_elementimpl.cpp:
2028         (ElementImpl::recalcStyle):
2029         * khtml/xml/dom_elementimpl.h:
2030
2031 === Safari-166 ===
2032
2033 2004-10-05  David Hyatt  <hyatt@apple.com>
2034
2035         Fix a bug in the iteration of locateCousinList and clean up the style sharing stats code.
2036
2037         * khtml/css/cssstyleselector.cpp:
2038         (khtml::CSSStyleSelector::locateCousinList):
2039         (khtml::CSSStyleSelector::elementsCanShareStyle):
2040         (khtml::CSSStyleSelector::locateSharedStyle):
2041         (khtml::CSSStyleSelector::styleForElement):
2042
2043 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2044
2045         Reviewed by Hyatt
2046
2047         * khtml/rendering/bidi.cpp:
2048         (khtml::RenderBlock::computeHorizontalPositionsForLine): Fix coding mistake that
2049         broke layout tests involving compacts.
2050
2051 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2052
2053         Reviewed by Darin
2054
2055         Finish selection affinity implementation. This includes code to set the
2056         affinity correctly when clicking with the mouse, and clearing the
2057         affinity when altering the selection using any of the Selection object
2058         mutation functions.
2059
2060         Each instance of the positionForCoordinates function in the render tree
2061         has been changed to include an EAffinity argument. It is now the job of this
2062         function to set the selection affinity.
2063
2064         * khtml/editing/selection.cpp:
2065         (khtml::Selection::moveTo): Set affinity to DOWNSTREAM.
2066         (khtml::Selection::modify): Ditto.
2067         (khtml::Selection::clear): Ditto.
2068         (khtml::Selection::setBase): Ditto.
2069         (khtml::Selection::setExtent): Ditto.
2070         (khtml::Selection::setBaseAndExtent): Ditto.
2071         * khtml/editing/selection.h:
2072         (khtml::operator==): Consider affinity in equality check.
2073         * khtml/khtml_events.cpp:
2074         (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
2075         as this function is being removed.
2076         * khtml/khtml_part.cpp: 
2077         (KHTMLPart::isPointInsideSelection): Ditto.
2078         (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
2079         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2080         (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
2081         call to positionForCoordinates, and set resulting affinity on the selection.
2082         (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on 
2083         NodeImpl::positionForCoordinates, as this function is being removed.
2084         (KHTMLPart::khtmlMouseReleaseEvent):
2085         * khtml/rendering/render_block.cpp:
2086         (khtml::RenderBlock::positionForCoordinates): Changed, as described above.
2087         * khtml/rendering/render_block.h:
2088         * khtml/rendering/render_br.cpp:
2089         (RenderBR::positionForCoordinates): Ditto.
2090         * khtml/rendering/render_br.h:
2091         * khtml/rendering/render_container.cpp:
2092         (RenderContainer::positionForCoordinates): Ditto.
2093         * khtml/rendering/render_container.h:
2094         * khtml/rendering/render_inline.cpp:
2095         (RenderInline::positionForCoordinates): Ditto.
2096         * khtml/rendering/render_inline.h:
2097         * khtml/rendering/render_object.cpp:
2098         (RenderObject::positionForCoordinates): Ditto.
2099         * khtml/rendering/render_object.h:
2100         * khtml/rendering/render_replaced.cpp:
2101         (RenderReplaced::positionForCoordinates): Ditto.
2102         * khtml/rendering/render_replaced.h:
2103         * khtml/rendering/render_text.cpp:
2104         (RenderText::positionForCoordinates): Ditto.
2105         * khtml/rendering/render_text.h:
2106         * khtml/xml/dom_nodeimpl.cpp: Removed positionForCoordinates convenience.
2107         * khtml/xml/dom_nodeimpl.h: Ditto.
2108         * kwq/WebCoreBridge.mm:
2109         (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on 
2110         NodeImpl::positionForCoordinates, as this function is being removed.
2111
2112 2004-10-05  David Hyatt  <hyatt@apple.com>
2113
2114         Fix style sharing optimization to be fast again.  Go back to using pointer comparisons when looking for
2115         cousins to share.
2116         
2117         Reviewed by darin
2118
2119         * khtml/css/cssstyleselector.cpp:
2120         (khtml::CSSStyleSelector::locateCousinList):
2121         * khtml/rendering/render_object.cpp:
2122         (RenderObject::setStyleInternal):
2123         * khtml/rendering/render_object.h:
2124         * khtml/xml/dom_elementimpl.cpp:
2125         (ElementImpl::recalcStyle):
2126
2127 2004-10-05  David Hyatt  <hyatt@apple.com>
2128
2129         Fix lists so that they properly participate in line layout as though they are text (when text bullets are
2130         used) and as images (when image bullets are used).
2131         
2132         Reviewed by kocienda
2133
2134         * khtml/rendering/render_list.cpp:
2135         (RenderListMarker::createInlineBox):
2136         * khtml/rendering/render_list.h:
2137         (khtml::ListMarkerBox:::InlineBox):
2138         (khtml::ListMarkerBox::isText):
2139
2140 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2141
2142         Reviewed by Darin
2143
2144         Recent checkin adding upstreamDeepEquivalent had it backwards. The helper
2145         we want is downstreamDeepEquivalent, as the deepEquivalent function returns
2146         an upstream position.
2147
2148         * khtml/editing/selection.cpp:
2149         (khtml::Selection::layout): DOWNSTREAM case now uses downstreamDeepEquivalent.
2150         UPSTREAM uses deepEquivalent.
2151         * khtml/editing/visible_position.cpp:
2152         (khtml::VisiblePosition::downstreamDeepEquivalent): New helper, replacing 
2153         upstreamDeepEquivalent.
2154         * khtml/editing/visible_position.h
2155
2156 2004-10-05  David Hyatt  <hyatt@apple.com>
2157
2158         New selection gap-filling architecture.  Makes the gap-filling much more like NSTextView and puts the responsibility
2159         for gap-filling in the block.  Fixes numerous bugs with selection drawing including bidi issues, incorrect old
2160         horizontal gap filling, and selection performance issues.
2161         
2162         Reviewed by kocienda
2163
2164         * khtml/html/html_imageimpl.cpp:
2165         (HTMLImageLoader::notifyFinished):
2166         * khtml/misc/khtmllayout.h:
2167         (khtml::GapRects::left):
2168         (khtml::GapRects::center):
2169         (khtml::GapRects::right):
2170         (khtml::GapRects::uniteLeft):
2171         (khtml::GapRects::uniteCenter):
2172         (khtml::GapRects::uniteRight):
2173         (khtml::GapRects::unite):
2174         (khtml::GapRects::operator QRect):
2175         (khtml::GapRects::operator==):
2176         (khtml::GapRects::operator!=):
2177         * khtml/rendering/font.cpp:
2178         (Font::drawHighlightForText):
2179         * khtml/rendering/font.h:
2180         * khtml/rendering/render_block.cpp:
2181         (khtml:::RenderFlow):
2182         (khtml::RenderBlock::removeChild):
2183         (khtml::RenderBlock::paintObject):
2184         (khtml::RenderBlock::paintEllipsisBoxes):
2185         (khtml::RenderBlock::setSelectionState):
2186         (khtml::RenderBlock::shouldPaintSelectionGaps):
2187         (khtml::RenderBlock::isSelectionRoot):
2188         (khtml::RenderBlock::selectionGapRects):
2189         (khtml::RenderBlock::paintSelection):
2190         (khtml::RenderBlock::fillSelectionGaps):
2191         (khtml::RenderBlock::fillInlineSelectionGaps):
2192         (khtml::RenderBlock::fillBlockSelectionGaps):
2193         (khtml::RenderBlock::fillHorizontalSelectionGap):
2194         (khtml::RenderBlock::fillVerticalSelectionGap):
2195         (khtml::RenderBlock::fillLeftSelectionGap):
2196         (khtml::RenderBlock::fillRightSelectionGap):
2197         (khtml::RenderBlock::getHorizontalSelectionGapInfo):
2198         (khtml::RenderBlock::leftSelectionOffset):
2199         (khtml::RenderBlock::rightSelectionOffset):
2200         * khtml/rendering/render_block.h:
2201         (khtml::RenderBlock::hasSelectedChildren):
2202         (khtml::RenderBlock::selectionState):
2203         (khtml::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
2204         (khtml::RenderBlock::BlockSelectionInfo::rects):
2205         (khtml::RenderBlock::BlockSelectionInfo::state):
2206         (khtml::RenderBlock::BlockSelectionInfo::block):
2207         (khtml::RenderBlock::selectionRect):
2208         * khtml/rendering/render_box.cpp:
2209         (RenderBox::position):
2210         * khtml/rendering/render_br.cpp:
2211         (RenderBR::inlineBox):
2212         * khtml/rendering/render_br.h:
2213         (khtml::RenderBR::selectionRect):
2214         (khtml::RenderBR::paint):
2215         * khtml/rendering/render_canvas.cpp:
2216         (RenderCanvas::selectionRect):
2217         (RenderCanvas::setSelection):
2218         * khtml/rendering/render_canvasimage.cpp:
2219         (RenderCanvasImage::paint):
2220         * khtml/rendering/render_image.cpp:
2221         (RenderImage::paint):
2222         * khtml/rendering/render_image.h:
2223         * khtml/rendering/render_line.cpp:
2224         (khtml::InlineBox::nextLeafChild):
2225         (khtml::InlineBox::prevLeafChild):
2226         (khtml::InlineBox::selectionState):
2227         (khtml::InlineFlowBox::addToLine):
2228         (khtml::InlineFlowBox::firstLeafChild):
2229         (khtml::InlineFlowBox::lastLeafChild):
2230         (khtml::InlineFlowBox::firstLeafChildAfterBox):
2231         (khtml::InlineFlowBox::lastLeafChildBeforeBox):
2232         (khtml::InlineFlowBox::selectionState):
2233         (khtml::RootInlineBox::fillLineSelectionGap):
2234         (khtml::RootInlineBox::setHasSelectedChildren):
2235         (khtml::RootInlineBox::selectionState):
2236         (khtml::RootInlineBox::firstSelectedBox):
2237         (khtml::RootInlineBox::lastSelectedBox):
2238         (khtml::RootInlineBox::selectionTop):
2239         (khtml::RootInlineBox::block):
2240         * khtml/rendering/render_line.h:
2241         (khtml::RootInlineBox::RootInlineBox):
2242         (khtml::RootInlineBox::hasSelectedChildren):
2243         (khtml::RootInlineBox::selectionHeight):
2244         * khtml/rendering/render_object.cpp:
2245         (RenderObject::selectionColor):
2246         * khtml/rendering/render_object.h:
2247         (khtml::RenderObject::):
2248         (khtml::RenderObject::selectionState):
2249         (khtml::RenderObject::setSelectionState):
2250         (khtml::RenderObject::selectionRect):
2251         (khtml::RenderObject::canBeSelectionLeaf):
2252         (khtml::RenderObject::hasSelectedChildren):
2253         (khtml::RenderObject::hasDirtySelectionState):
2254         (khtml::RenderObject::setHasDirtySelectionState):
2255         (khtml::RenderObject::shouldPaintSelectionGaps):
2256         (khtml::RenderObject::SelectionInfo::SelectionInfo):
2257         * khtml/rendering/render_replaced.cpp:
2258         (RenderReplaced::RenderReplaced):
2259         (RenderReplaced::shouldPaint):
2260         (RenderReplaced::selectionRect):
2261         (RenderReplaced::setSelectionState):
2262         (RenderReplaced::selectionColor):
2263         (RenderWidget::paint):
2264         (RenderWidget::setSelectionState):
2265         * khtml/rendering/render_replaced.h:
2266         (khtml::RenderReplaced::canBeSelectionLeaf):
2267         (khtml::RenderReplaced::selectionState):
2268         * khtml/rendering/render_text.cpp:
2269         (InlineTextBox::checkVerticalPoint):
2270         (InlineTextBox::isSelected):
2271         (InlineTextBox::selectionState):
2272         (InlineTextBox::selectionRect):
2273         (InlineTextBox::paintSelection):
2274         (InlineTextBox::paintMarkedTextBackground):
2275         (RenderText::paint):
2276         (RenderText::setSelectionState):
2277         (RenderText::selectionRect):
2278         * khtml/rendering/render_text.h:
2279         (khtml::RenderText::canBeSelectionLeaf):
2280         * kwq/KWQPainter.h:
2281         * kwq/KWQPainter.mm:
2282         (QPainter::drawHighlightForText):
2283         * kwq/KWQPtrDict.h:
2284         (QPtrDictIterator::toFirst):
2285         * kwq/KWQRect.mm:
2286         (QRect::unite):
2287         * kwq/WebCoreTextRenderer.h:
2288         * kwq/WebCoreTextRendererFactory.mm:
2289         (WebCoreInitializeEmptyTextGeometry):
2290
2291 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2292
2293         Reviewed by Darin
2294         
2295         Use the new CSS properties I added with my previous check-in. Also makes
2296         some changes to caret positioning and drawing to make the proper editing
2297         end-of-line behavior work correctly.
2298
2299         * khtml/editing/selection.cpp:
2300         (khtml::Selection::layout): Caret drawing now takes affinity into account
2301         when deciding where to paint the caret (finally!).
2302         * khtml/editing/visible_position.cpp:
2303         (khtml::VisiblePosition::previousVisiblePosition): Move off Position::rendersInDifferentPosition
2304         to determine the result. Use a simpler test involving comparisons between
2305         downstream positions while iterating. This is cheaper to do and easier to understand.
2306         (khtml::VisiblePosition::nextVisiblePosition): Ditto.
2307         * khtml/rendering/bidi.cpp:
2308         (khtml::BidiIterator::current): Do not return non-breaking spaces for empty
2309         text renderers and for non-text renderers. Return a null Qchar instead. Returning
2310         non-breaking spaces was causing errors when the new -khtml-nbsp-mode was set to "space".
2311         (khtml::RenderBlock::computeHorizontalPositionsForLine): Shrink line boxes that 
2312         contain with more spaces than can fit on the end of a line.
2313         (khtml::RenderBlock::skipWhitespace): Factor this out from findNextLineBreak.
2314         (khtml::RenderBlock::findNextLineBreak): Use new skipWhitespace function. Add
2315         in code to check and use new CSS properties.
2316         * khtml/rendering/break_lines.cpp:
2317         (khtml::isBreakable): Consider a non-breaking space a breakable character based
2318         on setting of new -khtml-nbsp-mode property.
2319         * khtml/rendering/break_lines.h: Ditto.
2320         * khtml/rendering/render_block.h: Declare skipWhitespace function.
2321         * khtml/rendering/render_text.cpp: 
2322         (RenderText::caretRect): Do not draw the caret beyond the right edge of the
2323         window when in white-space normal mode.
2324
2325 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2326
2327         Reviewed by Darin
2328
2329         Fix for these bugs:
2330         
2331         In this patch, I add two new CSS properties and their associated behavior.
2332         This is to support end-of-line and word-wrapping features that match the 
2333         conventions of text editors.
2334
2335         There are also some other small changes here which begin to lay the groundwork
2336         for using these new properties to bring about the desired editing behavior.
2337
2338         * khtml/css/cssparser.cpp:
2339         (CSSParser::parseValue): Add support for new CSS properties.
2340         * khtml/css/cssproperties.c: Generated file.
2341         * khtml/css/cssproperties.h: Ditto.
2342         * khtml/css/cssproperties.in: Add new properties.
2343         * khtml/css/cssstyleselector.cpp:
2344         (khtml::CSSStyleSelector::applyProperty): Add support for new CSS properties.
2345         * khtml/css/cssvalues.c: Generated file.
2346         * khtml/css/cssvalues.h: Ditto.
2347         * khtml/css/cssvalues.in:  Add support for new CSS properties.
2348         * khtml/editing/visible_position.cpp:
2349         (khtml::VisiblePosition::upstreamDeepEquivalent): Added new helper.
2350         * khtml/editing/visible_position.h:
2351         * khtml/rendering/render_box.cpp:
2352         (RenderBox::deleteLineBoxWrapper): Zero out inlineBoxWrapper.
2353         * khtml/rendering/render_replaced.cpp:
2354         (RenderWidget::detach): Zero out inlineBoxWrapper.
2355         * khtml/rendering/render_style.cpp:
2356         (StyleCSS3InheritedData):
2357         (StyleCSS3InheritedData::operator==): Add support for new CSS properties.
2358         (RenderStyle::diff): Ditto.
2359         * khtml/rendering/render_style.h:
2360         (khtml::RenderStyle::nbspMode): Ditto.
2361         (khtml::RenderStyle::khtmlLineBreak): Ditto.
2362         (khtml::RenderStyle::setNBSPMode): Ditto.
2363         (khtml::RenderStyle::setKHTMLLineBreak): Ditto.
2364         (khtml::RenderStyle::initialNBSPMode): Ditto.
2365         (khtml::RenderStyle::initialKHTMLLineBreak): Ditto.
2366
2367 2004-10-05  Darin Adler  <darin@apple.com>
2368
2369         Reviewed by John.
2370
2371         - fixed <rdar://problem/3673150> Pasting string from clipboard that is longer than input box will accept fails rather than truncating
2372
2373         * kwq/KWQTextField.mm:
2374         (-[KWQTextFieldFormatter isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:]):
2375         Wrote a new version of this method that truncates incoming strings rather than rejecting them
2376         out of hand.
2377
2378 2004-10-04  Darin Adler  <darin@apple.com>
2379
2380         Reviewed by Maciej.
2381
2382         - fixed <rdar://problem/3826343> crash in KHTMLParser::setCurrent parsing document fragment (happens in Calendar widget)
2383
2384         * khtml/html/htmlparser.cpp:
2385         (KHTMLParser::KHTMLParser): Initialized currentIsReferenced to false (fixes bug).
2386         (KHTMLParser::reset): Use doc() to make code easier to read.
2387         (KHTMLParser::setCurrent): Ditto.
2388         (KHTMLParser::parseToken): Ditto.
2389         (KHTMLParser::insertNode): Ditto.
2390         (KHTMLParser::getElement): Ditto.
2391         (KHTMLParser::popOneBlock): Ditto.
2392
2393         - fixed <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window
2394
2395         * kwq/KWQKHTMLPart.h: Added fontAttributesForSelectionStart.
2396         * kwq/KWQKHTMLPart.mm:
2397         (KWQKHTMLPart::styleForSelectionStart): Factored out most of fontForSelection.
2398         (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
2399         (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
2400         (KWQKHTMLPart::registerCommandForUndo): Updated for name change (see below).
2401         (KWQKHTMLPart::registerCommandForRedo): Ditto.
2402
2403         * kwq/WebCoreBridge.h: Added fontAttributesForSelectionStart.
2404         * kwq/WebCoreBridge.mm:
2405         (-[WebCoreBridge undoEditing:]): Updated for name change (see below).
2406         (-[WebCoreBridge redoEditing:]): Ditto.
2407         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Got rid of named temporary
2408         EditCommandPtr variable to make things slightly more terse.
2409         (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): Ditto.
2410         (-[WebCoreBridge deleteSelectionWithSmartDelete:]): Ditto.
2411         (-[WebCoreBridge fontAttributesForSelectionStart]): Added.
2412
2413         - fix compile on Panther and other cleanup
2414
2415         * khtml/khtml_part.cpp: Removed unneeded include.
2416         * kwq/KWQEditCommand.h: Got rid of use of "impl" when referring to EditCommand pointers.
2417         * kwq/KWQEditCommand.mm: Added include so we compile on Panther.
2418         (-[KWQEditCommand initWithEditCommand:]): Changed name.
2419         (-[KWQEditCommand dealloc]): Updated for m_impl change to m_command.
2420         (-[KWQEditCommand finalize]): Ditto.
2421         (+[KWQEditCommand commandWithEditCommand:]): Changed name.
2422         (-[KWQEditCommand command]): Changed name.
2423
2424 2004-10-04  Darin Adler  <darin@apple.com>
2425
2426         Reviewed by John.
2427
2428         - did a more-robust version of the fix I just landed
2429
2430         * khtml/html/htmlparser.h: Added currentIsReferenced boolean.
2431         * khtml/html/htmlparser.cpp:
2432         (KHTMLParser::KHTMLParser): Initializes currentIsReferenced.
2433         (KHTMLParser::setCurrent): Changed to respect and set currentIsReferenced.
2434
2435 2004-10-04  Darin Adler  <darin@apple.com>
2436
2437         Reviewed by John.
2438
2439         - fixed <rdar://problem/3824393> REGRESSION (165-TOT): Crash in KHTMLParser::popOneBlock closing window (bose.com)
2440
2441         * khtml/html/htmlparser.cpp:
2442         (KHTMLParser::~KHTMLParser): Move call to setCurrent(0) after the call to freeBlock, since freeBlock doesn't
2443         work well when current is 0, and there's no reason we need to reset the current block first.
2444         (KHTMLParser::setCurrent): Don't ever hold a reference to the document. This prevents a situation where there
2445         would be a reference cycle. In the test case from the bug above, this cycle actually happened and resulted
2446         in a double-delete of the document, tokenizer, and parser.
2447
2448 2004-10-04  Darin Adler  <darin@apple.com>
2449
2450         Reviewed by Maciej.
2451
2452         - fixed <rdar://problem/3825429> onclick handler called when mouse down on another element (affects Dashboard Movies widget, test case enclosed)
2453
2454         * khtml/khtmlview.cpp:
2455         (KHTMLViewPrivate::KHTMLViewPrivate): Initialize the click node to 0.
2456         (KHTMLViewPrivate::~KHTMLViewPrivate): Deref the click node.
2457         (KHTMLViewPrivate::reset): Clear the click node.
2458         (KHTMLView::viewportMousePressEvent): Call invalidateClick when we pass the event to a subframe to
2459         reduce the chance that we'll hold on to an old click node for a long time. Set the click node to
2460         the node we we are clicking on.
2461         (KHTMLView::viewportMouseDoubleClickEvent): Only send a click even if the node is the same one from
2462         the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
2463         old click node for a long time.
2464         (KHTMLView::invalidateClick): Clear the click node.
2465         (KHTMLView::viewportMouseReleaseEvent): Only send a click even if the node is the same one from
2466         the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
2467         old click node for a long time.
2468         (KHTMLView::keyPressEvent): Remove code that sets the originalNode field, which is never used.
2469
2470 2004-10-04  Ken Kocienda  <kocienda@apple.com>
2471
2472         Reviewed by Hyatt
2473
2474         Fix for this bug:
2475         
2476         <rdar://problem/3825289> REGRESSION (Mail): Crash in fontForSelection in empty window
2477
2478         * khtml/editing/visible_position.cpp:
2479         (khtml::VisiblePosition::previousPosition): Switch to node iteration instead "leaf"
2480         iteration. I have been wanting to make this change for a long time, but couldn't
2481         since other code relied on the leaf behavior. That is no longer true. Plus, the
2482         bug fix requires the new behavior.
2483         (khtml::VisiblePosition::nextPosition): Ditto.
2484         (khtml::VisiblePosition::isCandidate): Empty blocks needed a height to be a candidate,
2485         but we make a special case for the body element. This fixes the bug.
2486
2487 2004-10-04  Darin Adler  <darin@apple.com>
2488
2489         Reviewed by Ken.
2490
2491         - fixed <rdar://problem/3800667> REGRESSION (Mail): double-clicking multiple spaces only selects two spaces
2492
2493         * kwq/KWQTextUtilities.mm: (KWQFindWordBoundary): Moved here from the .cpp file. Changed to use the
2494         doubleClickAtIndex: method from NSAttributedString rather than using Unicode Utilities.
2495         * kwq/KWQTextUtilities.cpp: Removed.
2496         * WebCore.pbproj/project.pbxproj: Removed KWQTextUtilities.cpp.
2497
2498         - fixed a problem that would show up using HTML editing under garbage collection
2499
2500         * kwq/KWQEditCommand.mm: (-[KWQEditCommand finalize]): Fixed a [super dealloc] that should have been a
2501         [super finalize].
2502
2503         - another small change
2504
2505         * khtml/editing/visible_units.cpp: (khtml::nextWordBoundary): Tweaked a comment.
2506
2507 2004-10-01  Darin Adler  <darin@apple.com>
2508
2509         Reviewed by Ken (or arguably done by Ken, reviewed by Darin).
2510
2511         - fixed <rdar://problem/3823828> REGRESSION (Mail): Clicking past end of any line puts insertion point at beginning of next line
2512
2513         * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::VisiblePosition):
2514         Check for an offset of 0 and a <br> and use UPSTREAM affinity in that case.
2515         This is a short term fix for something that needs a better longer-term fix.
2516
2517         - fixed <rdar://problem/3823816> REGRESSION (Mail): double-clicking first word on line also selects previous empty line
2518
2519         * khtml/editing/visible_units.cpp: (khtml::previousWordBoundary): Added a special
2520         case for <br>. While I'm not sure why this regressed, I'm sure this fix is good.
2521
2522 2004-10-01  Darin Adler  <darin@apple.com>
2523
2524         Reviewed by John.
2525
2526         - fixed <rdar://problem/3782117> CrashTracer: ..722 crashes at com.apple.WebCore: DOM::HTMLBodyElementImpl::insertedIntoDocument + 0x2c (AOL website)
2527
2528         * khtml/html/html_baseimpl.cpp:
2529         (HTMLBodyElementImpl::insertedIntoDocument): Check for nil document case.
2530         (HTMLFrameElementImpl::isURLAllowed): Ditto.
2531         (HTMLFrameElementImpl::openURL): Ditto.
2532
2533 2004-10-01  Darin Adler  <darin@apple.com>
2534
2535         Reviewed by Maciej.
2536
2537         - fixed <rdar://problem/3822218> REGRESSION (164-165): images don't update on rollover on directv.com page
2538
2539         I introduced a major regression where various JavaScript window properties would not be found when I
2540         fixed bug 3809600.
2541
2542         * khtml/ecma/kjs_window.h: Added hasProperty.
2543         * khtml/ecma/kjs_window.cpp: (Window::hasProperty): Return true in all the cases where get returns something.
2544
2545 2004-09-30  Darin Adler  <darin@apple.com>
2546
2547         Reviewed by Maciej.
2548
2549         - fixed <rdar://problem/3461499> JavaScript function document.open() is buggy with 2nd argument "replace"
2550
2551         Experiments with Firefox indicate that document.open() should not be treated as window.open() unless there
2552         are more than two parameters. Also, Firefox does not implement the "replace" behavior, so we don't have
2553         to worry about it either.
2554
2555         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): Only forward to window if there are more than
2556         two parameters, rather than if there are more than one.
2557
2558         - fixed <rdar://problem/3672933> oninput is firing at page load time for <input type=range>
2559
2560         * kwq/KWQSlider.mm: (QSlider::setValue): Don't emit a signal here. This follows the usual pattern, where
2561         a signal is only emitted for changes that are not explicitly requested by the caller.
2562
2563         - fixed <rdar://problem/3821167> leaks of something allocated by recalcStyle after loading altavista page from cvs-base
2564
2565         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Ref and deref the style we allocate so it's
2566         not left floating if setStyle decides not to ref it.
2567
2568         - fixed <rdar://problem/3821172> leak of HTML attribute string after loading the ESPN page from cvs-base
2569
2570         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Use the DOMString version of
2571         the lower() operation so we don't end up leaving a DOMStringImpl * floating if AtomicString decides not
2572         to ref it.
2573
2574 2004-09-30  Richard Williamson   <rjw@apple.com>
2575
2576         Fixed <rdar://problem/3822330> REGRESSION: crash on launch when homepage is set to about:blank
2577         
2578         Added nil check.
2579         
2580         * kwq/KWQKHTMLPart.mm:
2581         (KWQKHTMLPart::setDisplaysWithFocusAttributes):
2582
2583 2004-09-30  Chris Blumenberg  <cblu@apple.com>
2584         
2585         Fixed: <rdar://problem/3792822> Safari is calling the Cocoa QuickTime plugin twice for the OBJECT and EMBED tags
2586
2587         Reviewed by hyatt.
2588
2589         * khtml/html/html_objectimpl.cpp:
2590         (HTMLObjectElementImpl::attach): call dispatchHTMLEvent after updateWidget instead of every time this method is called
2591         (HTMLObjectElementImpl::recalcStyle): ditto
2592
2593 2004-09-30  Darin Adler  <darin@apple.com>
2594
2595         - rolled out bad image change that caused performance regression
2596
2597         * khtml/rendering/render_image.cpp: (RenderImage::setPixmap):
2598         Don't reference the new image before doing the assignment.
2599         This forced an unwanted.
2600
2601 2004-09-30  Ken Kocienda  <kocienda@apple.com>
2602
2603         Reviewed by me, coded by Darin
2604
2605         - fixed <rdar://problem/3818305> REGRESSION (Mail): Shift + page up has no effect; should modify selection
2606
2607         * khtml/editing/selection.cpp: (khtml::Selection::modify): Fix problem where vertical distance
2608         was used as a distance threshold, but was a negative number. Now make it positive at the start
2609         of the function (and make a couple related changes).
2610
2611 2004-09-29  Richard Williamson   <rjw@apple.com>
2612
2613         Fixed <rdar://problem/3779998> bringing window to front or sending to back does not send focus/blur events to JavaScript window object
2614
2615         The fix has two parts, 1) make onblur and onfocus work for windows, 
2616         and 2), allow the dashboard to override WebKit's special key/non-key
2617         behaviors.
2618
2619         Reviewed by Chris.
2620
2621         * kwq/KWQKHTMLPart.mm:
2622         (KWQKHTMLPart::setDisplaysWithFocusAttributes):
2623
2624 2004-09-29  Ken Kocienda  <kocienda@apple.com>
2625
2626         Reviewed by Hyatt
2627         
2628         Fix for this bug:
2629         
2630         <rdar://problem/3705894> REGRESSION (Mail): if a single word is wider than the window, 
2631         it doesn't break and just runs off the right side
2632
2633         * khtml/css/css_computedstyle.cpp:
2634         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support for CSS_PROP_WORD_WRAP.
2635         * khtml/css/cssparser.cpp:
2636         (CSSParser::parseValue): Ditto.
2637         * khtml/css/cssproperties.c: Generated file.
2638         * khtml/css/cssproperties.h: Ditto.
2639         * khtml/css/cssproperties.in: Add word-wrap property.
2640         * khtml/css/cssstyleselector.cpp:
2641         (khtml::CSSStyleSelector::applyProperty): Add support for CSS_PROP_WORD_WRAP.
2642         * khtml/css/cssvalues.c: Generated file.
2643         * khtml/css/cssvalues.h: Ditto.
2644         * khtml/css/cssvalues.in: Add break-word value.
2645         * khtml/rendering/bidi.cpp:
2646         (khtml::RenderBlock::findNextLineBreak): Add code to implement new word wrapping feature.
2647         * khtml/rendering/render_style.cpp:
2648         (StyleCSS3InheritedData): Add support for new wordWrap property.
2649         (StyleCSS3InheritedData::operator==): Ditto.
2650         (RenderStyle::diff): Ditto.
2651         * khtml/rendering/render_style.h:
2652         (khtml::RenderStyle::wordWrap): Ditto.
2653         (khtml::RenderStyle::setWordWrap): Ditto.
2654         (khtml::RenderStyle::initialWordWrap): Ditto.
2655
2656 2004-09-29  Maciej Stachowiak  <mjs@apple.com>
2657
2658         Reviewed by John.
2659
2660         - consolidated OS version checks into prefix header
2661
2662         * WebCorePrefix.h:
2663         * khtml/rendering/render_canvasimage.cpp:
2664         * kwq/KWQAccObject.mm:
2665         (-[KWQAccObject roleDescription]):
2666         (-[KWQAccObject accessibilityActionDescription:]):
2667         * kwq/KWQComboBox.mm:
2668         (QComboBox::QComboBox):
2669         * kwq/KWQFoundationExtras.h:
2670
2671 2004-09-29  David Hyatt  <hyatt@apple.com>
2672
2673         Make sure <br>s always get line boxes.  Also prevent the creation of RenderTexts for whitespace normal/nowrap nodes
2674         that follow <br>s.
2675         
2676         Reviewed by kocienda
2677
2678         * khtml/editing/visible_position.cpp:
2679         (khtml::VisiblePosition::isCandidate):
2680         * khtml/rendering/render_br.cpp:
2681         (RenderBR::RenderBR):
2682         (RenderBR::createInlineBox):
2683         (RenderBR::baselinePosition):
2684         (RenderBR::lineHeight):
2685         * khtml/rendering/render_br.h:
2686         * khtml/rendering/render_line.cpp:
2687         (khtml::InlineFlowBox::placeBoxesVertically):
2688         * khtml/rendering/render_line.h:
2689         (khtml::InlineBox::isText):
2690         (khtml::InlineFlowBox::addToLine):
2691         * khtml/rendering/render_text.cpp:
2692         (RenderText::detach):
2693         * khtml/rendering/render_text.h:
2694         (khtml::InlineTextBox:::InlineRunBox):
2695         (khtml::InlineTextBox::isInlineTextBox):
2696         (khtml::InlineTextBox::isText):
2697         (khtml::InlineTextBox::setIsText):
2698         * khtml/xml/dom_textimpl.cpp:
2699         (TextImpl::rendererIsNeeded):
2700         * kwq/KWQRenderTreeDebug.cpp:
2701         (operator<<):
2702
2703 2004-09-29  Ken Kocienda  <kocienda@apple.com>
2704
2705         Reviewed by John
2706
2707         Fix for this bug:
2708         
2709         <rdar://problem/3815895> exception inside fontForSelection causes Mail to abort when selection hits bottom
2710
2711         * khtml/editing/selection.cpp:
2712         (khtml::Selection::toRange): Use RangeImpl calls to detect exceptions when creating a Range
2713         from a Selection. Return an empty Range when there is an exception.
2714
2715         Fix for this bug:
2716         
2717         <rdar://problem/3817268> REGRESSION (Mail): Window does not scroll when selecting out of 
2718         visible area of view with arrow keys
2719
2720         * khtml/editing/selection.cpp: Did some name changing. m_needsCaretLayout -> m_needsLayout.
2721         Added m_expectedVisibleRect which supplies the right rectangle to update when scrolling.
2722         (khtml::Selection::Selection): m_needsCaretLayout -> m_needsLayout name change.
2723         (khtml::Selection::init): Handle m_expectedVisibleRect in initialization.
2724         (khtml::Selection::operator=): Handle m_expectedVisibleRect in assignment.
2725         (khtml::Selection::setNeedsLayout): m_needsCaretLayout -> m_needsLayout name change.
2726         (khtml::Selection::layout): Changed name from layoutCaret, since m_expectedVisibleRect
2727         is also calculated here.
2728         (khtml::Selection::caretRect): m_needsCaretLayout -> m_needsLayout name change.
2729         (khtml::Selection::expectedVisibleRect): New. Returns m_expectedVisibleRect, doing a 
2730         layout if needed.
2731         (khtml::Selection::needsCaretRepaint): m_needsCaretLayout -> m_needsLayout name change.
2732         (khtml::Selection::paintCaret): Ditto.
2733         (khtml::Selection::validate): Ditto.
2734         * khtml/editing/selection.h: Add m_expectedVisibleRect member variable and 
2735         expectedVisibleRect accessor.
2736         * kwq/WebCoreBridge.h: Change name of ensureCaretVisible to ensureSelectionVisible, since
2737         this is not only about making the caret visible anymore. Now it can reveal the varying
2738         end of the selection when scrolling with arrow keys.
2739         * kwq/WebCoreBridge.mm:
2740         (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): ensureCaretVisible to 
2741         ensureSelectionVisible name change.
2742         (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto
2743         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Ditto
2744         (-[WebCoreBridge insertNewline]): Ditto
2745         (-[WebCoreBridge insertText:selectInsertedText:]): Ditto
2746         (-[WebCoreBridge deleteKeyPressed]): Ditto
2747         (-[WebCoreBridge ensureSelectionVisible]): Ditto
2748
2749 2004-09-29  Ken Kocienda  <kocienda@apple.com>
2750
2751         Reviewed by Hyatt
2752         
2753         Fix for this bug:
2754         
2755         <rdar://problem/3818296> REGRESSION (Mail): centerSelectionInVisibleArea does not work correctly
2756         
2757         * kwq/KWQKHTMLPart.h:
2758         * kwq/KWQKHTMLPart.mm:
2759         (KWQKHTMLPart::centerSelectionInVisibleArea): New function. Handles both caret
2760         and range selections correctly.
2761         * kwq/KWQNSViewExtras.h: Add forceCentering boolean to some methods in this file.
2762         * kwq/KWQNSViewExtras.m: Ditto. This addition has been done since the AppKit 
2763         method we use to do the centering, -[NSView scrollRectToVisible:],  does not alter 
2764         the view if the rectangle passed to it is already in view. When forceCentering is
2765         true, extra math is done to make scrollRectToVisible center the rectangle we want.
2766         (-[NSView _KWQ_scrollFrameToVisible]): Pass NO for forceCentering in call through to 
2767         _KWQ_scrollRectToVisible:forceCentering:
2768         (-[NSView _KWQ_scrollRectToVisible:forceCentering:]): Add forceCentering argument.
2769         (-[NSView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto.
2770         (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto. Do extra
2771         math to implement the forceCentering effect.
2772         * kwq/KWQScrollView.h: Add forceCentering default argument to ensureRectVisibleCentered.
2773         * kwq/KWQScrollView.mm:
2774         (QScrollView::ensureRectVisibleCentered): Ditto.
2775         * kwq/WebCoreBridge.h:
2776         * kwq/WebCoreBridge.mm:
2777         (-[WebCoreBridge centerSelectionInVisibleArea]): New function. Call through to KWQKHTMLPart. 
2778
2779 2004-09-28  Chris Blumenberg  <cblu@apple.com>
2780
2781         Fixed: WebArchives begin with "<#document/>"
2782
2783         Reviewed by hyatt.
2784
2785         * khtml/xml/dom_nodeimpl.cpp:
2786         (NodeImpl::startMarkup): don't return markup if this is a document node, forgot this when factoring this method out from toHTML
2787
2788 2004-09-28  Chris Blumenberg  <cblu@apple.com>
2789
2790         Removed range parameter from recursive_toHTML and friends since that code path is no longer used.
2791         
2792         Reviewed by mjs.
2793
2794         * khtml/xml/dom2_rangeimpl.cpp:
2795         (DOM::RangeImpl::toHTML):
2796         * khtml/xml/dom_nodeimpl.cpp:
2797         (NodeImpl::recursive_toString):
2798         (NodeImpl::recursive_toHTML):
2799         * khtml/xml/dom_nodeimpl.h:
2800         * kwq/WebCoreBridge.mm:
2801         (-[WebCoreBridge markupStringFromNode:nodes:]):
2802
2803 2004-09-28  Darin Adler  <darin@apple.com>
2804
2805         Reviewed by Ken.
2806
2807         - improve spell checking so it doesn't unmark and remark as you move the cursor with the arrow
2808
2809         * khtml/editing/htmlediting.h: Remove obsolete markMisspellingsInSelection private function.
2810         * khtml/editing/htmlediting.cpp:
2811         (khtml::EditCommand::EditCommand): Blow away the selection when starting an edit command.
2812         (khtml::EditCommand::apply): Remove code to mark misspellings because that's now done as part
2813         of blowing away the selection.
2814         (khtml::EditCommand::unapply): Blow away the selection instead of marking mispellings.
2815         (khtml::EditCommand::reapply): Ditto.
2816         (khtml::ReplaceSelectionCommand::doApply): Removed incorrect code that does spell checking
2817         on inserted text; this doesn't match NSText behavior.
2818         (khtml::TypingCommand::markMisspellingsAfterTyping): Use markMisspellingsInAdjacentWords
2819         function for greater clarity on what this actually does.
2820
2821         * khtml/khtml_part.h: Replaced setSelection's "unmarkOldSelection" boolean parameter with a
2822         "keepTypingStyle" boolean parameter. Removed notifySelectionChanged.
2823         * khtml/khtml_part.cpp:
2824         (KHTMLPart::setSelection): Replaced the "unmarkOldSelection" boolean with a new "keepTypingStyle"
2825         boolean. This is a step on the way to simplifying how this works. Moved the code from the
2826         notifySelectionChanged function here, since there was no clear line between the two functions.
2827         (KHTMLPart::clearSelection): Call setSelection rather that having special case code here for
2828         the case of an empty selection.
2829         (KHTMLPart::appliedEditing): Remove the explicit "false" for "unmarkOldSelection".
2830         (KHTMLPart::unappliedEditing): Ditto.
2831         (KHTMLPart::reappliedEditing): Ditto.
2832
2833         * kwq/KWQKHTMLPart.h: Replaced markMisspellingsInSelection and updateSpellChecking with
2834         markMisspellings and markMisspellingsInAdjacentWords. Added parameters to respondToChangedSelection.
2835         * kwq/KWQKHTMLPart.mm:
2836         (KWQKHTMLPart::markMisspellingsInAdjacentWords): Added.
2837         (KWQKHTMLPart::markMisspellings): New name for markMisspellingsInSelection. Simplified logic a
2838         bit and made it the caller's responsibility to expand the selection passed in to word boundaries.
2839         (KWQKHTMLPart::respondToChangedSelection): Added parameter that identifies the old selection,
2840         and changed logic so it won't mark mispellings in a word if the selection still starts in that word.
2841
2842         - implemented empty-cells property in computed style
2843
2844         * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2845         Added code for CSS_PROP_EMPTY_CELLS. I think the HTML converter in AppKit uses this.
2846
2847 2004-09-28  Chris Blumenberg  <cblu@apple.com>
2848
2849         Fixed n-squared issues with appending to KWQValueListImpl. This fixes the hang in 3794799.
2850
2851         Fixed by Darin, reviewed by me.
2852
2853         * khtml/xml/dom2_rangeimpl.cpp:
2854         (DOM::RangeImpl::toHTML): tweaks
2855         * kwq/KWQValueListImpl.mm:
2856         (KWQValueListImpl::KWQValueListPrivate::KWQValueListPrivate):
2857         (KWQValueListImpl::KWQValueListPrivate::copyList):
2858         (KWQValueListImpl::clear):
2859         (KWQValueListImpl::appendNode):
2860         (KWQValueListImpl::prependNode):
2861         (KWQValueListImpl::removeEqualNodes):
2862         (KWQValueListImpl::containsEqualNodes):
2863         (KWQValueListImpl::removeIterator):
2864         (KWQValueListImpl::lastNode):
2865         * kwq/WebCoreBridge.mm:
2866         (-[WebCoreBridge nodesFromList:]): use iterator, not at()
2867
2868 2004-09-28  Richard Williamson   <rjw@apple.com>
2869
2870         More dashboard region changes for John.
2871
2872         <rdar://problem/3817421> add getter for dashboard regions (debugging)
2873         
2874         <rdar://problem/3817417> NSScrollView need autoregions for dashboard
2875         
2876         <rdar://problem/3817388> should have short form form control regions
2877         
2878         <rdar://problem/3817477> visibility does not work with dashboard control regions
2879
2880         Reviewed by Hyatt.
2881
2882         * WebCore-combined.exp:
2883         * WebCore.exp:
2884         * khtml/css/cssparser.cpp:
2885         (skipCommaInDashboardRegion):
2886         (CSSParser::parseDashboardRegions):
2887         * khtml/khtmlview.cpp:
2888         (KHTMLView::updateDashboardRegions):
2889         * khtml/rendering/render_object.cpp:
2890         (RenderObject::setStyle):
2891         (RenderObject::addDashboardRegions):
2892         * khtml/xml/dom_docimpl.cpp:
2893         (DocumentImpl::DocumentImpl):
2894         (DocumentImpl::setDashboardRegions):
2895         * khtml/xml/dom_docimpl.h:
2896         (DOM::DocumentImpl::setDashboardRegionsDirty):
2897         (DOM::DocumentImpl::dashboardRegionsDirty):
2898         * kwq/KWQKHTMLPart.h:
2899         * kwq/KWQKHTMLPart.mm:
2900         (KWQKHTMLPart::paint):
2901         (KWQKHTMLPart::dashboardRegionsDictionary):
2902         (KWQKHTMLPart::dashboardRegionsChanged):
2903         * kwq/WebCoreBridge.h:
2904         * kwq/WebCoreBridge.mm:
2905         (-[WebCoreBridge dashboardRegions]):
2906         * kwq/WebDashboardRegion.h:
2907         * kwq/WebDashboardRegion.m:
2908         (-[WebDashboardRegion description]):
2909
2910 2004-09-28  John Sullivan  <sullivan@apple.com>
2911
2912         Reviewed by Chris.
2913
2914         - fixed <rdar://problem/3818558> REGRESSION: "Installed Plug-ins" is blank 
2915         because of <script type="application/x-javascript">
2916
2917         * khtml/html/htmltokenizer.cpp:
2918         (khtml::HTMLTokenizer::parseTag):
2919         add "application/x-javascript" to the list of legal scripting types. Mozilla
2920         accepts this, but WinIE doesn't.
2921         
2922         * layout-tests/fast/tokenizer/004.html:
2923         updated layout test to test some application/xxxx types
2924
2925 2004-09-27  David Hyatt  <hyatt@apple.com>
2926
2927         Reworked lists to work well with RTL text.  Specifically the following bugs have been fixed:
2928
2929         (1) All bullets use the same offset constant now (a padding of 7 pixels).  Before, images used 5 and others used 7.
2930         (2) Line height now works properly, so that list items with no content aren't squished (and missing the line descent).
2931         (3) Punctuation now works correctly with inside and outside style ordered lists in RTL.
2932         (4) RTL lists now properly apply padding and margin to the right side rather than the left.  This was done by adding
2933         -khtml-margin-start and -khtml-padding-start properties that are just mapped to left/right based off the direction.
2934         
2935         Reviewed by darin
2936
2937         * khtml/css/cssparser.cpp:
2938         (CSSParser::parseValue):
2939         * khtml/css/cssproperties.c:
2940         (hash_prop):
2941         (findProp):
2942         * khtml/css/cssproperties.h:
2943         * khtml/css/cssproperties.in:
2944         * khtml/css/cssstyleselector.cpp:
2945         (khtml::CSSStyleSelector::applyDeclarations):
2946         (khtml::CSSStyleSelector::applyProperty):
2947         * khtml/css/html4.css:
2948         * khtml/rendering/bidi.cpp:
2949         (khtml::BidiIterator::direction):
2950         * khtml/rendering/render_list.cpp:
2951         (RenderListItem::getAbsoluteRepaintRect):
2952         (RenderListMarker::paint):
2953         (RenderListMarker::calcMinMaxWidth):
2954         (RenderListMarker::lineHeight):
2955         (RenderListMarker::baselinePosition):
2956
2957 2004-09-28  Ken Kocienda  <kocienda@apple.com>
2958
2959         Reviewed by Darin
2960         
2961         Mark the VisiblePosition taking (Position &, EAffinity=DOWNSTREAM) explicit. Recently, when I added
2962         the EAffinity argument, I left this constructor implicit. Darin pointed out to me that this is
2963         undesirable since implicit use of the the constructor involved making the affinity choice, something
2964         which should be done explicitly.
2965
2966         * khtml/editing/selection.cpp:
2967         (khtml::Selection::modifyExtendingRightForward): Make explicit use of constructor mentioned above.
2968         (khtml::Selection::modifyMovingRightForward): Ditto.
2969         (khtml::Selection::modifyExtendingLeftBackward): Ditto.
2970         (khtml::Selection::modifyMovingLeftBackward): Ditto.
2971         (khtml::Selection::modify): Ditto.
2972         (khtml::Selection::validate): Ditto.
2973         * khtml/editing/visible_position.h: Make constructor taking (Position &, EAffinity) explicit.
2974         * khtml/editing/visible_units.cpp: Ditto.
2975         (khtml::previousWordBoundary): Make explicit use of constructor mentioned above.
2976         (khtml::nextWordBoundary): Ditto.
2977         (khtml::previousLinePosition): Ditto.
2978         (khtml::nextLinePosition): Ditto.
2979         * kwq/KWQKHTMLPart.mm: Ditto.
2980         (KWQKHTMLPart::findString): Ditto.
2981         (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
2982         (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
2983         (KWQKHTMLPart::updateSpellChecking): Ditto.
2984
2985 2004-09-28  Darin Adler  <darin@apple.com>
2986
2987         Reviewed by John.
2988
2989         - fixed a storage leak discovered by code inspection
2990
2991         * khtml/html/htmlparser.cpp: (KHTMLParser::~KHTMLParser): Call setCurrent(0) to deref
2992         the parser's current node in the rare case where it still has one.
2993
2994 2004-09-27  David Hyatt  <hyatt@apple.com>
2995
2996         Don't allow nested headers when only inlines are in between them.  Fixes a hang related to pathological nesting
2997         on magicmethodsonline.com.
2998         
2999         Reviewed by darin
3000
3001         * khtml/html/htmlparser.cpp:
3002         (KHTMLParser::parseToken):
3003         (KHTMLParser::processCloseTag):
3004         (KHTMLParser::isHeaderTag):
3005         (KHTMLParser::popNestedHeaderTag):
3006         * khtml/html/htmlparser.h:
3007
3008 2004-09-27  Kevin Decker  <kdecker@apple.com>
3009
3010         Reviewed by John.
3011
3012         * khtml/css/css_base.cpp:
3013         (CSSSelector::selectorText): changed another ATTR_CLASS case to properly return class selector names. 
3014
3015 2004-09-27  David Hyatt  <hyatt@apple.com>
3016
3017         Fix style sharing so that it doesn't share when it shouldn't.  Partially fixes 3671516, table cells don't update
3018         their color on macosx.apple.com.
3019
3020         Fix 3521639, iframe mispositioned on bidi page.  Make sure that when the width of a line exceeds the available line
3021         width that the spillage out of the block is determined by the direction of the block and not by the text-align value.
3022
3023         Partial fix for 3762962, make sure the image cells with specified widths but percentage heights don't just get a minwidth
3024         of 0.
3025
3026         Fix for 3533878, framesets that use percentages that add up to a value > 100% should normalize those percentages.
3027         
3028         Reviewed by john
3029
3030         * khtml/css/cssstyleselector.cpp:
3031         (khtml::CSSStyleSelector::locateCousinList):
3032         (khtml::CSSStyleSelector::elementsCanShareStyle):
3033         (khtml::CSSStyleSelector::locateSharedStyle):
3034         * khtml/css/cssstyleselector.h:
3035         * khtml/html/html_elementimpl.h:
3036         (DOM::HTMLNamedAttrMapImpl::hasMappedAttributes):
3037         (DOM::HTMLElementImpl::inlineStyleDecl):
3038         * khtml/rendering/bidi.cpp:
3039         (khtml::RenderBlock::computeHorizontalPositionsForLine):
3040         * khtml/rendering/render_frames.cpp:
3041         (RenderFrameSet::layout):
3042         * khtml/rendering/render_replaced.cpp:
3043         (RenderReplaced::calcMinMaxWidth):
3044         * khtml/xml/dom_elementimpl.h:
3045         (DOM::ElementImpl::inlineStyleDecl):
3046         (DOM::ElementImpl::hasMappedAttributes):
3047
3048 2004-09-27  Ken Kocienda  <kocienda@apple.com>
3049
3050         Reviewed by John
3051
3052         Removed closestRenderedPosition function from Position class and gave this work
3053         to VisiblePosition instead. However, in order to make the transfer possible,
3054         VisiblePosition needed upstream and downstream affinities added to its
3055         constructors. Also moved the EAffinity enum into its own file. Also moved it
3056         to the khtml namespace.
3057
3058         Updated several functions which used closestRenderedPosition to use VisiblePosition
3059         instead.
3060         
3061         Also deleted Position::equivalentShallowPosition. This was unused.
3062
3063         * ForwardingHeaders/editing/text_affinity.h: Added.
3064         * ForwardingHeaders/editing/visible_position.h: Added.
3065         * WebCore.pbproj/project.pbxproj: Added new files.
3066         * khtml/editing/selection.cpp:
3067         (khtml::Selection::validate): Use VisiblePosition instead of closestRenderedPosition.
3068         * khtml/editing/selection.h:
3069         * khtml/editing/text_affinity.h: Added.
3070         * khtml/editing/visible_position.cpp:
3071         (khtml::VisiblePosition::VisiblePosition):
3072         (khtml::VisiblePosition::initUpstream): New helper for finding upstream visible position.
3073         (khtml::VisiblePosition::initDownstream): Was old init function that unconditionally did
3074         downstream checks for visible position. Renamed to describe this more clearly.
3075         * khtml/editing/visible_position.h:
3076         * khtml/editing/visible_units.cpp:
3077         (khtml::previousWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
3078         (khtml::nextWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
3079         * khtml/xml/dom_docimpl.cpp:
3080         (DocumentImpl::updateSelection): Use VisiblePosition instead of closestRenderedPosition.
3081         * khtml/xml/dom_position.cpp:
3082         (DOM::Position::closestRenderedPosition): Removed.
3083         * khtml/xml/dom_position.h: Removed two functions mentioned above.
3084         * kwq/KWQKHTMLPart.mm:
3085         (KWQKHTMLPart::fontForSelection) Use VisiblePosition instead of closestRenderedPosition.:
3086         * kwq/WebCoreBridge.mm:
3087         (-[WebCoreBridge setSelectedDOMRange:affinity:]): Use VisiblePosition instead of closestRenderedPosition.
3088         * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Updated expected results.
3089         * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Ditto.
3090         * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
3091         * layout-tests/editing/selection/move-by-character-004-expected.txt: Ditto.
3092
3093 2004-09-27  Ken Kocienda  <kocienda@apple.com>
3094
3095         Reviewed by Darin and Maciej
3096
3097         Removed EditCommand smart pointer wrappers from htmlediting.cpp/.h, save for the one
3098         at the root of the hierarchy, and this one has been renamed EditCommandPtr. Renamed
3099         each of the XXXCommandImpl classes, removing the Impl suffix from each, and rolled
3100         these into the htmlediting.cpp/.h files. The htmlediting_impl.cpp/.h files have
3101         been emptied and are being removed.
3102
3103         For the remainder of files, perform the mechanical changes necessary to make everything
3104         compile and run as before.
3105
3106         * WebCore.pbproj/project.pbxproj
3107         * khtml/editing/htmlediting.cpp
3108         * khtml/editing/htmlediting.h
3109         * khtml/editing/htmlediting_impl.cpp: Removed.
3110         * khtml/editing/htmlediting_impl.h: Removed.
3111         * khtml/editing/jsediting.cpp
3112         * khtml/khtml_part.cpp
3113         (KHTMLPart::openURL)
3114         (KHTMLPart::lastEditCommand)
3115         (KHTMLPart::appliedEditing)
3116         (KHTMLPart::unappliedEditing)
3117         (KHTMLPart::reappliedEditing)
3118         (KHTMLPart::applyStyle):
3119         * khtml/khtml_part.h
3120         * khtml/khtmlpart_p.h
3121         * kwq/KWQEditCommand.h
3122         * kwq/KWQEditCommand.mm
3123         (-[KWQEditCommand initWithEditCommandImpl:])
3124         (+[KWQEditCommand commandWithEditCommandImpl:])
3125         (-[KWQEditCommand impl])
3126         * kwq/KWQKHTMLPart.h
3127         * kwq/KWQKHTMLPart.mm
3128         (KWQKHTMLPart::registerCommandForUndo)
3129         (KWQKHTMLPart::registerCommandForRedo)
3130         * kwq/WebCoreBridge.mm
3131         (-[WebCoreBridge undoEditing:])
3132         (-[WebCoreBridge redoEditing:])
3133         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
3134         (-[WebCoreBridge moveSelectionToDragCaret:smartMove:])
3135         (-[WebCoreBridge deleteSelectionWithSmartDelete:])
3136
3137 2004-09-26  Darin Adler  <darin@apple.com>
3138
3139         Reviewed by Maciej.
3140
3141         - fixed <rdar://problem/3816170> image.width/height not available from Image objects (works in Firefox)
3142
3143         * khtml/ecma/kjs_html.h: Added width and height.
3144         * khtml/ecma/kjs_html.cpp: (Image::getValueProperty): Added width and height.
3145         * khtml/ecma/kjs_html.lut.h: Regenerated.
3146
3147         - unrelated change; changed ordering of use count manipulation just in case we decide some day to do
3148           something when the use count hits 0
3149
3150         * khtml/rendering/render_image.cpp: (RenderImage::setPixmap): Increment use count on new object before
3151         decrementing use count on old object.
3152
3153 2004-09-26  Darin Adler  <darin@apple.com>
3154
3155         Reviewed by Kevin.
3156
3157         - fixed <rdar://problem/3812771> document.implementation.hasFeature returns false for a lot of features we implement
3158
3159         * khtml/xml/dom_docimpl.cpp: (DOMImplementationImpl::hasFeature): Added all the DOM features that we implemented
3160         as part of the HTML editing work.
3161
3162         * khtml/dom/dom_node.cpp: (Node::isSupported): Changed this to call DOMImplementationImpl::hasFeature to share
3163         code. Later this might need to be different per-node, but at the moment that does not seem to be so.
3164
3165         * khtml/ecma/kjs_dom.cpp:
3166         (DOMNodeProtoFunc::tryCall): Pass a null string if the parameter is omitted, undefined, or null. This is better than
3167         having a special case for the string "null" in the DOM implementation.
3168         (DOMDOMImplementationProtoFunc::tryCall): Ditto.
3169
3170         - fixed <rdar://problem/3814605> REGRESSION: fast/table/039 layout test is failing due to extra trailing whitespace in innerText        
3171
3172         * khtml/editing/visible_text.cpp: (khtml::TextIterator::advance): Check for the case where we are at the end of
3173         iteration, and don't call exitNode in that case. This prevents us from getting some unwanted trailing \n characters.
3174
3175         - fixed <rdar://problem/3813253> method cloneNode() does not clone dynamically-set style attributes correctly
3176
3177         * khtml/html/html_elementimpl.h: Added cloneNode override.
3178         * khtml/html/html_elementimpl.cpp:
3179         (HTMLElementImpl::cloneNode): Added. Copies m_inlineStyleDecl.
3180         (HTMLElementImpl::parseHTMLAttribute): Changed to use getInlineStyleDecl().
3181         (HTMLElementImpl::innerText): Changed to do the same thing with fewer lines of code.
3182         (HTMLElementImpl::outerText): Tweaked comment.
3183
3184         - other cleanup
3185
3186         * khtml/xml/dom_elementimpl.cpp:
3187         (ElementImpl::cloneNode): Removed an uneeded type cast.
3188         (XMLElementImpl::cloneNode): Ditto.
3189
3190 2004-09-24  Kevin Decker  <kdecker@apple.com>
3191
3192         Reviewed by Maciej.
3193
3194         <rdar://problem/3799334> DIG: Safari does not properly return style names [DigCSS.htm]
3195
3196         * khtml/css/css_base.cpp:
3197         (CSSSelector::selectorText): Properly returns Class Selector names.  
3198         Before we would get *[CLASS"foo"] instead of .foo
3199
3200 2004-09-24  Ken Kocienda  <kocienda@apple.com>
3201
3202         Reviewed by John
3203
3204         Fix for this bug:
3205         
3206         <rdar://problem/3814660> REGRESSION (8A200-8A259): Select All has no effect on livepage.apple.com
3207
3208         * khtml/xml/dom_docimpl.cpp:
3209         (DocumentImpl::updateSelection): Move the selection start and end to rendered positions
3210         before passing off to the RenderCanvas for drawing.
3211         * layout-tests/editing/selection/select-all-004-expected.txt: Added.
3212         * layout-tests/editing/selection/select-all-004.html: Added.
3213
3214 2004-09-24  John Sullivan  <sullivan@apple.com>
3215
3216         Reviewed by Maciej.
3217         
3218         - fixed <rdar://problem/3528339> Turn on full keyboard access shows 
3219         invisible <input> elements
3220
3221         * khtml/html/html_formimpl.cpp:
3222         (DOM::HTMLGenericFormElementImpl::isFocusable):
3223         reject elements that have zero width or height, even if they aren't hidden
3224
3225 2004-09-24  Maciej Stachowiak  <mjs@apple.com>
3226
3227         - fixed deployment build
3228
3229         Reviewed by Ken.
3230
3231         * khtml/dom/dom_string.cpp: put implementation of ascii() in #ifdef !NDEBUG
3232         to match prototype.
3233
3234 2004-09-24  David Hyatt  <hyatt@apple.com>
3235
3236         Fix for 3800316, test 37 for tables is failing on the layout tests.  Make sure we don't incorrectly match
3237         non-HTML elements with HTML tag selectors in CSS.
3238         
3239         Reviewed by rjw
3240
3241         * khtml/css/cssstyleselector.cpp:
3242         (khtml::CSSStyleSelector::checkOneSelector):
3243
3244 2004-09-23  David Hyatt  <hyatt@apple.com>
3245
3246         Fix for 3601920, CSS "tabs" not switching properly on zen garden design.  Improve the repainting to account
3247         for layer changes of z-index that necessitate an invalidation.
3248         
3249         Reviewed by kocienda
3250
3251         * khtml/rendering/render_object.cpp:
3252         (RenderObject::setStyle):
3253         * khtml/rendering/render_style.cpp:
3254         (RenderStyle::diff):
3255         * khtml/rendering/render_style.h:
3256         (khtml::RenderStyle::):
3257
3258 2004-09-24  Chris Blumenberg  <cblu@apple.com>
3259
3260         Made markup copying 5 times faster. Unfortunately, this still doesn't fix:
3261         <rdar://problem/3794799> Tiger8A252: copying a bunch o' text is so slow it seems like a hang
3262
3263         Reviewed by rjw.
3264
3265         * khtml/dom/dom_string.h:
3266         * khtml/xml/dom2_rangeimpl.cpp:
3267         (DOM::RangeImpl::toHTML): serialize the range by iterating through the range
3268         * khtml/xml/dom_nodeimpl.cpp:
3269         (NodeImpl::startMarkup): new, factored out from recursive_toString
3270         (NodeImpl::endMarkup): ditto
3271         (NodeImpl::recursive_toString): call factored out methods
3272         * khtml/xml/dom_nodeimpl.h:
3273
3274 === Safari-165 ===
3275
3276 2004-09-24  Ken Kocienda  <kocienda@apple.com>
3277
3278         Hyatt made an improvement in the render tree which caused the results
3279         to get a little thinner.
3280
3281         * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt
3282         * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt
3283
3284 2004-09-24  Ken Kocienda  <kocienda@apple.com>
3285
3286         Reviewed by Hyatt
3287         
3288         Fix for this bug:
3289         
3290         <rdar://problem/3812939> REGRESSION: move-between-blocks-no-001 editing layout test fails in DeleteSelectionCommandImpl
3291
3292         * khtml/rendering/render_block.cpp:
3293         (khtml::RenderBlock::removeChild): Hyatt said this regression was caused by a bad merge. 
3294         Found by code inspection.
3295
3296 2004-09-23  John Sullivan  <sullivan@apple.com>
3297
3298         Reviewed by Maciej.
3299         
3300         - fixed <rdar://problem/3551850> hang caused by interpreting bad javascript 
3301         guarded by a deliberately bogus "language" attribute (www.riibe.com)
3302
3303         * khtml/html/htmltokenizer.cpp:
3304         (khtml::HTMLTokenizer::parseTag):
3305         Check for language attribute of <script> tag in a way that matches WinIE.
3306         Previously we were far too permissive.
3307
3308 2004-09-23  David Hyatt  <hyatt@apple.com>
3309
3310         Fix for 3685234 and 3548444, the x-offset for frame borders was off by 1 pixel, causing mojibake to occur when
3311         repainting happened.
3312
3313         * khtml/rendering/render_canvas.cpp:
3314         (RenderCanvas::repaintViewRectangle):
3315
3316 2004-09-23  Richard Williamson   <rjw@apple.com>
3317
3318         Fixed <rdar://problem/3813271> dashboard-region-circle and dashboard-region-rectangle should be collapsed into dashboard-region
3319         Fixed <rdar://problem/3813289> dashboard regions need to correctly account for overflow/scrolling
3320
3321         Reviewed by Chris.
3322
3323         * khtml/css/css_valueimpl.cpp:
3324         (CSSPrimitiveValueImpl::cssText):
3325         * khtml/css/css_valueimpl.h:
3326         * khtml/css/cssparser.cpp:
3327         (CSSParser::parseValue):