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