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