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