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