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