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