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