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