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