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