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