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