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