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