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