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