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