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