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