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