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