Reviewed by Chris and Darin.
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 2004-11-15  David Harrison  <harrison@apple.com>
2
3         Reviewed by Chris and Darin.
4         
5         <rdar://problem/3880304> Non-linear performance hit for style changes
6
7         * khtml/xml/dom_nodeimpl.cpp:
8         (NodeImpl::traverseNextNode):
9         (NodeImpl::traverseNextSibling):
10         (NodeImpl::traversePreviousNodePostOrder):
11         Return 0 rather than traversing beyond stayWithin when this == stayWithin.
12         Add asserts that stayWithin is an ancestor of the returned node.
13
14 2004-11-15  Darin Adler  <darin@apple.com>
15
16         Reviewed by Ken.
17
18         - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
19
20         * khtml/css/css_computedstyle.cpp:
21         (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
22         since there's no guarantee it's already ref'd.
23         * khtml/css/css_valueimpl.cpp:
24         (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
25         (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
26         (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
27         (CSSStyleDeclarationImpl::merge): Ditto.
28         (CSSStyleDeclarationImpl::diff): Ditto.
29         * khtml/editing/htmlediting.cpp:
30         (khtml::StyleChange::currentlyHasStyle): Ditto.
31         (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
32         * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
33         * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
34
35 2004-11-15  Darin Adler  <darin@apple.com>
36
37         Reviewed by Ken.
38
39         Use separate mutable style and computed style types as appropriate.
40         For now this should have no effect, but it prepares us for refactoring later.
41         Also remove some unnecessary "DOM::" prefixes and in one case factor out
42         some shared code.
43
44         * khtml/khtml_part.cpp:
45         (KHTMLPart::typingStyle):
46         (KHTMLPart::setTypingStyle):
47         (updateState):
48         (KHTMLPart::selectionHasStyle):
49         (KHTMLPart::selectionStartHasStyle):
50         (KHTMLPart::selectionComputedStyle):
51         * khtml/khtml_part.h:
52         * khtml/khtmlpart_p.h:
53
54         * khtml/css/css_base.h:
55         * khtml/css/css_ruleimpl.cpp:
56         (CSSStyleRuleImpl::setDeclaration):
57         * khtml/css/css_ruleimpl.h:
58         (DOM::CSSFontFaceRuleImpl::style):
59         (DOM::CSSPageRuleImpl::style):
60         (DOM::CSSStyleRuleImpl::style):
61         (DOM::CSSStyleRuleImpl::declaration):
62         * khtml/css/css_valueimpl.h:
63         (DOM::CSSPrimitiveValueImpl::):
64         * khtml/css/cssparser.cpp:
65         (CSSParser::parseValue):
66         (CSSParser::parseColor):
67         (CSSParser::parseDeclaration):
68         (CSSParser::createStyleDeclaration):
69         * khtml/css/cssparser.h:
70         * khtml/css/cssstyleselector.cpp:
71         (khtml::CSSStyleSelector::addMatchedDeclaration):
72         (khtml::CSSStyleSelector::matchRulesForList):
73         (khtml::CSSStyleSelector::styleForElement):
74         (khtml::CSSStyleSelector::applyDeclarations):
75         * khtml/css/cssstyleselector.h:
76         * khtml/css/parser.cpp:
77         * khtml/css/parser.y:
78         * khtml/dom/css_rule.h:
79         * khtml/dom/css_stylesheet.h:
80         * khtml/dom/css_value.h:
81         * khtml/dom/dom2_views.cpp:
82         * khtml/xml/dom2_viewsimpl.cpp:
83         (DOM::AbstractViewImpl::getComputedStyle):
84         * khtml/xml/dom_docimpl.cpp:
85         (DocumentImpl::importNode):
86         (DocumentImpl::setStyleSheet):
87         * khtml/xml/dom_docimpl.h:
88         * khtml/xml/dom_xmlimpl.cpp:
89         (DOM::ProcessingInstructionImpl::setStyleSheet):
90         * khtml/xml/dom_xmlimpl.h:
91
92         * khtml/dom/css_value.cpp:
93         (DOM::throwException): Added.
94         (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
95         The real thing is coming with the next change to refactor.
96         (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
97         (DOM::CSSPrimitiveValue::setStringValue): Ditto.
98
99 2004-11-15  Darin Adler  <darin@apple.com>
100
101         Reviewed by Ken.
102
103         - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
104
105         * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
106         dispatchSubtreeModifiedEvent, so it can be called in cases where only the
107         node's attributes changed without sending a misleading childrenChanged call,
108         but the childrenChanged call can happen at the exact right moment.
109         * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
110         (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
111         the boolean true is passed in.
112
113         * khtml/xml/dom_elementimpl.cpp:
114         (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
115         (NamedAttrMapImpl::removeAttribute): Ditto.
116
117 2004-11-15  John Sullivan  <sullivan@apple.com>
118
119         Reviewed by Ken.
120         
121         - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet, 
122         seen often in Mail and Blot
123
124         * khtml/css/css_valueimpl.cpp:
125         (CSSStyleDeclarationImpl::copyPropertiesInSet):
126         delete temporary list after we're done using it
127
128 2004-11-15  Richard Williamson   <rjw@apple.com>
129
130         Fixed leak (3879883) that John found.  Early return leaked
131         allocated instance.
132
133         Reviewed by John.
134
135         * khtml/css/css_computedstyle.cpp:
136         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
137
138 2004-11-15  Ken Kocienda  <kocienda@apple.com>
139
140         Reviewed by John
141
142         Fix for this bug:
143         
144         <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
145
146         Fixed a couple of object lifetime issues. The EditCommand class used to hold an
147         EditCommandPtr to its parent, but this caused a a reference cycle in composite 
148         commands as the children held a ref to their parent. Now, the parent variable
149         is a non-retained reference to an EditCommand *. It would be nice to have a 
150         weak reference to the parent or even override deref in composite commands (but I
151         can't since deref() is not virtual). However, this should be OK since any
152         dangling parent pointer is a sign of a bigger object lifetime problem that
153         would need to be addressed anyway.
154
155         * khtml/css/css_valueimpl.cpp:
156         (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a 
157         QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
158         just assigning the list variable passed in to the local list variable, or the list will be 
159         double-deleted.
160         * khtml/editing/htmlediting.cpp:
161         (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
162         (khtml::EditCommand::setEndingSelection): Ditto.
163         (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
164         Unrelated to the change, but saves some ref's and deref's.
165         (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
166         * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
167         EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
168         (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
169
170 2004-11-15  Maciej Stachowiak  <mjs@apple.com>
171
172         Reviewed by Kevin.
173
174         <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
175         
176         * khtml/xml/dom_nodeimpl.cpp:
177         (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
178         isLengthCacheValid.
179         (NodeListImpl::recursiveLength): Adjusted for rename.
180         (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
181         If the same offset is looked up again, just return it, otherwise, if looking up
182         a later offset, start at the last item and proceed from there.
183         (NodeListImpl::itemById): Apply the special document optimization to all
184         nodes that are either a document or in a document - just walk up to make
185         sure the node found by ID has the root node as an ancestor.
186         (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
187         * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
188
189 2004-11-15  John Sullivan  <sullivan@apple.com>
190
191         Reviewed by Ken.
192         
193         - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
194
195         * kwq/KWQKHTMLPart.mm:
196         (KWQKHTMLPart::documentFragmentWithText):
197         release mutable copy of string after we're done using it
198
199 2004-11-14  Kevin Decker  <kdecker@apple.com>
200
201         Reviewed by mjs.
202
203         fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
204
205         * khtml/html/html_elementimpl.cpp:
206         (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
207         (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
208
209 2004-11-13  Maciej Stachowiak  <mjs@apple.com>
210
211         Reviewed by Kevin.
212
213         <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
214
215         * khtml/dom/dom_node.cpp:
216         (NodeList::itemById): New method, just forward to impl.
217         * khtml/dom/dom_node.h: Prototype it.
218         * khtml/ecma/kjs_dom.cpp:
219         (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
220         let the NodeList do it. The NodeList might be able to do it more efficiently.
221         * khtml/xml/dom_nodeimpl.cpp:
222         (NodeListImpl::itemById): Optimize for the case where the NodeList
223         covers the whole document. In this case, just use getElementById,
224         then check that the element satisfies the list criteria.
225         (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
226         (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
227         * khtml/xml/dom_nodeimpl.h:
228
229 2004-11-12  Maciej Stachowiak  <mjs@apple.com>
230
231         Reviewed by Gramps.
232
233         - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
234         sometimes using a huge bogus length value.
235         
236         * khtml/xml/dom_nodeimpl.cpp:
237         (NodeListImpl::NodeListImpl): Initialize isCacheValid.
238
239 2004-11-12  Darin Adler  <darin@apple.com>
240
241         Reviewed by Maciej.
242
243         - fixed an infinite loop in that last check-in
244
245         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
246         Added a ++i to the loop so it won't get stuck on the first element in the list.
247
248 2004-11-12  Maciej Stachowiak  <mjs@apple.com>
249
250         Reviewed by Kevin.
251
252         - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
253         
254         I fixed this by changing NodeLists to cache their length, but
255         invalidate it whenever there is a change in the DOM subtree at
256         which they are rooted. This makes NodeListImpl::recursiveLength()
257         drop completely off the profile, since we were repeatedly getting
258         a length for the same NodeList over and over.
259         
260         * khtml/xml/dom_nodeimpl.cpp:
261         (NodeImpl::NodeImpl):
262         (NodeImpl::~NodeImpl):
263         (NodeImpl::registerNodeList):
264         (NodeImpl::unregisterNodeList):
265         (NodeImpl::notifyLocalNodeListsSubtreeModified):
266         (NodeImpl::notifyNodeListsSubtreeModified):
267         (NodeImpl::dispatchSubtreeModifiedEvent):
268         (NodeListImpl::NodeListImpl):
269         (NodeListImpl::~NodeListImpl):
270         (NodeListImpl::recursiveLength):
271         (NodeListImpl::recursiveItem):
272         (NodeListImpl::rootNodeSubtreeModified):
273         (ChildNodeListImpl::ChildNodeListImpl):
274         (ChildNodeListImpl::length):
275         (ChildNodeListImpl::item):
276         (TagNodeListImpl::TagNodeListImpl):
277         (TagNodeListImpl::length):
278         (TagNodeListImpl::item):
279         (NameNodeListImpl::NameNodeListImpl):
280         (NameNodeListImpl::length):
281         (NameNodeListImpl::item):
282         * khtml/xml/dom_nodeimpl.h:
283
284 2004-11-12  Darin Adler  <darin@apple.com>
285
286         Reviewed by Maciej.
287
288         - various small cleanups
289
290         * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
291         * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
292
293         * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
294         * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
295         * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
296         * khtml/html/htmltokenizer.cpp:
297         (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
298         (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
299
300         * khtml/khtml_part.h: Removed docImpl function.
301         * khtml/khtml_part.cpp: Ditto.
302
303         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
304         the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
305
306         * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
307         * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
308         part of the change last time, which is why the build broke).
309         (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
310         (KWQKHTMLPart::setPolicyBaseURL): Ditto.
311         (KWQKHTMLPart::keyEvent): Ditto.
312         (KWQKHTMLPart::dispatchCPPEvent): Ditto.
313         (KWQKHTMLPart::bodyBackgroundColor): Ditto.
314
315 2004-11-12  Chris Blumenberg  <cblu@apple.com>
316
317         <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
318
319         Reviewed by rjw.
320
321         * kwq/KWQKHTMLPart.mm:
322         (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
323
324 === Safari-171 ===
325
326 2004-11-12  Darin Adler  <darin@apple.com>
327
328         Reviewed by Kevin.
329
330         - fixed a couple places that would not work for XML documents
331
332         * khtml/ecma/kjs_window.cpp:
333         (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
334         is present on the base class.
335         (WindowFunc::tryCall): More of the same.
336
337 2004-11-12  Darin Adler  <darin@apple.com>
338
339         - land versions of these files generated by the newer gperf
340
341         People building on Panther will continue to see these files modified.
342         A workaround would be to install the newer gperf on our Tiger build machines.
343
344         * khtml/css/cssproperties.c: Regenerated.
345         * khtml/css/cssvalues.c: Regenerated.
346         * khtml/html/doctypes.cpp: Regenerated.
347         * khtml/html/kentities.c: Regenerated.
348         * khtml/misc/htmlattrs.c: Regenerated.
349         * khtml/misc/htmltags.c: Regenerated.
350         * kwq/KWQColorData.c: Regenerated.
351
352 2004-11-11  Richard Williamson   <rjw@apple.com>
353         
354         Fix build horkage from previous checkin.
355                 
356         * kwq/KWQKHTMLPart.h:
357
358 2004-11-11  Darin Adler  <darin@apple.com>
359
360         Reviewed by John.
361
362         - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
363
364         * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
365
366         * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
367         * kwq/KWQKHTMLPart.mm:
368         (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
369         method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
370         we started with the NSTextField as first responder, and then took focus away and gave it back, which
371         makes dragging text work again.
372         (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
373
374 2004-11-11  David Hyatt  <hyatt@apple.com>
375
376         Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
377         
378         Reviewed by vicki
379
380         * khtml/html/htmltokenizer.cpp:
381         (khtml::HTMLTokenizer::continueProcessing):
382
383 2004-11-11  Ken Kocienda  <kocienda@apple.com>
384
385         Reviewed by Maciej
386
387         * khtml/editing/htmlediting.cpp:
388         (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
389         of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
390         with the prevailing style for the VisiblePosition class.
391         * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files. 
392         * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
393         (khtml::visiblePositionsInDifferentBlocks): New helper method.
394         (khtml::isLastVisiblePositionInBlock): Ditto.
395         (khtml::isLastVisiblePositionInNode): Ditto.
396         * khtml/editing/visible_position.h: Add declarations for new functions.
397
398 2004-11-11  Ken Kocienda  <kocienda@apple.com>
399
400         Reviewed by Hyatt
401
402         * khtml/editing/htmlediting.cpp:
403         (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
404         (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
405         (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
406         (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
407         (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
408         * khtml/xml/dom2_rangeimpl.cpp:
409         (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
410         * khtml/xml/dom2_rangeimpl.h: Ditto.
411
412 2004-11-11  Ken Kocienda  <kocienda@apple.com>
413
414         Reviewed by Harrison
415
416         Some improvements to deleting when complete lines are selected.
417
418         * khtml/editing/htmlediting.cpp:
419         (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
420         the end of a selection is fully selected. Turn off block merging in this case.
421         (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
422         whether a BR immediately followed a block. The old code could erroneously skip nodes.
423         (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
424         start block is selected. This new code will now delete this block in one call, rather
425         than iterating over each child.
426         * khtml/editing/visible_position.cpp:
427         (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
428         to do the work mentioned above in the comment for that function.
429         (khtml::isFirstVisiblePositionOnLine): Ditto.
430         (khtml::isLastVisiblePositionOnLine): Ditto.
431         * khtml/editing/visible_position.h: Add new functions.
432         * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
433         * layout-tests/editing/deleting/delete-line-001.html: Added.
434         * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
435         * layout-tests/editing/deleting/delete-line-002.html: Added.
436         * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
437         * layout-tests/editing/deleting/delete-line-003.html: Added.
438         * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
439         * layout-tests/editing/deleting/delete-line-004.html: Added.
440         * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
441         * layout-tests/editing/deleting/delete-line-005.html: Added.
442         * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
443         * layout-tests/editing/deleting/delete-line-006.html: Added.
444         * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
445         * layout-tests/editing/deleting/delete-line-007.html: Added.
446         * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
447         * layout-tests/editing/deleting/delete-line-008.html: Added.
448         * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
449         * layout-tests/editing/deleting/delete-line-009.html: Added.
450         * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
451         * layout-tests/editing/deleting/delete-line-010.html: Added.
452         * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
453         * layout-tests/editing/deleting/delete-line-011.html: Added.
454         * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
455         * layout-tests/editing/deleting/delete-line-012.html: Added.
456
457 2004-11-11  Ken Kocienda  <kocienda@apple.com>
458
459         Reviewed by Adele
460
461         * khtml/editing/htmlediting.cpp:
462         (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
463
464 2004-11-11  Ken Kocienda  <kocienda@apple.com>
465
466         Reviewed by John
467
468         Fix for these bugs:
469
470         <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
471         <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
472
473         * khtml/editing/selection.cpp:
474         (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
475         the next line position when necessary.
476         * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
477         * layout-tests/editing/selection/move-3875618-fix.html: Added.
478         * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
479         * layout-tests/editing/selection/move-3875641-fix.html: Added.
480
481 2004-11-11  Ken Kocienda  <kocienda@apple.com>
482
483         Reviewed by John
484
485         Improved some function names, at John's urging. No changes to the
486         functions themselves.
487         
488         canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
489         canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
490         performGeneralDelete() --> handleGeneralDelete()
491
492         * khtml/editing/htmlediting.cpp:
493         (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
494         (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
495         (khtml::DeleteSelectionCommand::handleGeneralDelete)
496         (khtml::DeleteSelectionCommand::doApply)
497         * khtml/editing/htmlediting.h
498
499 2004-11-11  Ken Kocienda  <kocienda@apple.com>
500
501         Reviewed by John
502         
503         Updated some layout test results that changed as a result of my last checking.
504         Added a new test that has been in my tree for a few days.
505
506         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
507         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
508         * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
509         * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
510
511 2004-11-11  Ken Kocienda  <kocienda@apple.com>
512
513         Reviewed by John
514
515         * khtml/editing/htmlediting.cpp:
516         (khtml::debugNode): New debugging helper.
517         (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
518         startPositionForDelete() and endPositionForDelete() functions. Just use the 
519         m_selectionToDelete object to determine start and end positions for the delete.
520         (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
521         function that creates a special case for deleting all the content in a root
522         editable element.
523         (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
524         function before BR special case and the general case delete functions.
525         * khtml/editing/htmlediting.h: Updated for changed functions.
526
527 2004-11-10  Kevin Decker  <kdecker@apple.com>
528
529         Reviewed by mjs.
530         
531         Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.  
532
533         * khtml/ecma/kjs_dom.cpp:
534         (DOMNodeList::tryGet): Got rid of an unnecessary node traversal. 
535
536 2004-11-10  Ken Kocienda  <kocienda@apple.com>
537
538         Reviewed by Chris
539
540         * khtml/editing/htmlediting.cpp:
541         (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
542         smart delete from the two functions below to here. There was an unnecessary double 
543         calculation of the leading and trailing whitespace positions. Also refined the trailing
544         case so it only acts when the leading position is null (which seems to match TextEdit in
545         my tests). Also removed some unnecessary copying of Position objects.
546         (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
547         from here.
548         (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
549
550 2004-11-10  Ken Kocienda  <kocienda@apple.com>
551
552         Reviewed by Harrison
553
554         (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
555         make things more clear.
556         * khtml/editing/selection.cpp:
557         (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the 
558         resulting positions do not cross block boundaries. This was a bug and caused some
559         delete problems when whole blocks were selected. I will be addressing that issue
560         more fully in upcoming changes.
561
562 2004-11-10  Ken Kocienda  <kocienda@apple.com>
563
564         Reviewed by Harrison
565
566         Some cleanups and fixes in upstream and downstream functions. 
567         
568         Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement(). 
569         Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the 
570         block's enclosing block will be returned. 
571         
572         Remove code from upstream that confined the serach to block boundaries outside of
573         the code which runs in the StayInBlock case. This code was redundant, and caused
574         incorrect results to be returned in the DoNotStayInBlock case.
575         
576         In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
577         node, not the the this pointer's node.
578
579         * khtml/xml/dom_position.cpp:
580         (DOM::Position::upstream)
581         (DOM::Position::downstream)
582
583 2004-11-09  David Hyatt  <hyatt@apple.com>
584
585         Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
586         loading large local files.
587         
588         Reviewed by mjs
589
590         * khtml/html/htmltokenizer.cpp:
591         (khtml::HTMLTokenizer::HTMLTokenizer):
592         (khtml::HTMLTokenizer::reset):
593         (khtml::HTMLTokenizer::write):
594         (khtml::HTMLTokenizer::stopped):
595         (khtml::HTMLTokenizer::processingData):
596         (khtml::HTMLTokenizer::continueProcessing):
597         (khtml::HTMLTokenizer::timerEvent):
598         (khtml::HTMLTokenizer::allDataProcessed):
599         (khtml::HTMLTokenizer::end):
600         (khtml::HTMLTokenizer::finish):
601         (khtml::HTMLTokenizer::notifyFinished):
602         * khtml/html/htmltokenizer.h:
603         * khtml/khtml_part.cpp:
604         (KHTMLPart::slotFinished):
605         (KHTMLPart::end):
606         (KHTMLPart::stop):
607         * khtml/khtml_part.h:
608         (KHTMLPart::tokenizerProcessedData):
609         * khtml/khtmlview.cpp:
610         * khtml/xml/dom_docimpl.cpp:
611         * khtml/xml/xml_tokenizer.h:
612         (khtml::Tokenizer::stopped):
613         (khtml::Tokenizer::processingData):
614         * kwq/KWQDateTime.h:
615         * kwq/KWQDateTime.mm:
616         (QDateTime::secsTo):
617         (KWQUIEventTime::uiEventPending):
618         * kwq/KWQKHTMLPart.h:
619         * kwq/KWQKHTMLPart.mm:
620         (KWQKHTMLPart::tokenizerProcessedData):
621         * kwq/WebCoreBridge.h:
622         * kwq/WebCoreBridge.mm:
623         (-[WebCoreBridge stop]):
624         (-[WebCoreBridge numPendingOrLoadingRequests]):
625         (-[WebCoreBridge doneProcessingData]):
626
627 2004-11-09  David Harrison  <harrison@apple.com>
628
629         Reviewed by Ken Kocienda.
630
631                 <rdar://problem/3865837> Wrong text style after delete to start of document
632                 
633         * khtml/editing/htmlediting.cpp:
634         (khtml::DeleteSelectionCommand::saveTypingStyleState):
635         Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
636
637 2004-11-09  Richard Williamson   <rjw@apple.com>
638
639         Fixed <rdar://problem/3872440> NSTimer prematurely released.
640
641         Reviewed by Darin.
642
643         * kwq/KWQTimer.mm:
644         (QTimer::fire):
645         * kwq/KWQWidget.mm:
646         (QWidget::paint):
647
648 2004-11-09  Chris Blumenberg  <cblu@apple.com>
649
650         Reviewed by vicki.
651
652         * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
653
654 2004-11-08  David Harrison  <harrison@apple.com>
655
656         Reviewed by Ken Kocienda.
657
658                 <rdar://problem/3865854> Deleting first line deletes all lines
659                 
660         * khtml/editing/htmlediting.cpp:
661         (khtml::DeleteSelectionCommand::performGeneralDelete):
662         Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
663         of its ancestors, failed to end the loop that deletes all fully selected nodes.  Also,
664         fixed this code to clear m_trailingWhitespaceValid.  Also removed dead m_endingPosition
665         update because it is handled in calculateEndingPosition now.
666         * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
667         * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
668
669 2004-11-08  Ken Kocienda  <kocienda@apple.com>
670
671         Reviewed by Hyatt
672
673         * khtml/html/html_elementimpl.cpp:
674         (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
675         are added to the DOM.
676         * khtml/html/html_elementimpl.h: Ditto.
677         * khtml/html/htmlparser.cpp:
678         (KHTMLParser::KHTMLParser): Ditto.
679         (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
680         * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
681         * khtml/html/htmltokenizer.cpp:
682         (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
683         (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
684         There were a couple of indexing errors that resulted in the comment text containing part of the 
685         comment markers.
686         (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
687         * khtml/html/htmltokenizer.h:  Add flag to constructor so callers can request comment nodes.
688
689 2004-11-08  Chris Blumenberg  <cblu@apple.com>
690
691         Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
692
693         Reviewed by darin.
694
695         * WebCore.pbproj/project.pbxproj: stop unnecessary linking
696         * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
697         * kwq/KWQKHTMLPart.h: ditto
698
699 2004-11-08  Darin Adler  <darin@apple.com>
700
701         Reviewed by John.
702
703         - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
704
705         * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
706         that possibly deletes the QTimer.
707
708 2004-11-08  Chris Blumenberg  <cblu@apple.com>
709
710         Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
711
712         Reviewed by john.
713
714         * kwq/KWQTextField.mm:
715         (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
716         * kwq/WebCoreBridge.h:
717
718 2004-11-08  David Harrison  <harrison@apple.com>
719
720         Reviewed by Darin.
721         
722         Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
723
724         * khtml/editing/htmlediting.cpp:
725         (khtml::DeleteSelectionCommand::moveNodesAfterNode):
726         * khtml/xml/dom_nodeimpl.cpp:
727         (NodeImpl::enclosingInlineElement):
728         * khtml/xml/dom_nodeimpl.h:
729
730 2004-11-05  Chris Blumenberg  <cblu@apple.com>
731
732         Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
733
734         Reviewed by rjw.
735
736         * khtml/editing/htmlediting.cpp:
737         (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
738         * khtml/editing/visible_position.cpp:
739         (khtml::VisiblePosition::character): new, returns the character for the position
740         * khtml/editing/visible_position.h:
741         * kwq/KWQKHTMLPart.h:
742         * kwq/KWQKHTMLPart.mm:
743         (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
744         * kwq/WebCoreBridge.h:
745
746 === Safari-170 ===
747
748 2004-11-05  Adele Amchan  <adele@apple.com>
749
750         Reviewed by Darin
751
752         Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
753         and a workaround for displaying transparent backgrounds for textareas.
754
755         * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
756         * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
757         * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class, 
758           on the contentView, and on the textView.
759
760 2004-11-04  David Hyatt  <hyatt@apple.com>
761
762         Fix for relpositioned inlines.  This was reviewed a long time ago, but I can't recall who reviewed it (either
763         darin or ken).
764         
765         Reviewed by darin or ken
766
767         * khtml/rendering/bidi.cpp:
768         (khtml::appendRunsForObject):
769         (khtml::RenderBlock::skipWhitespace):
770         (khtml::RenderBlock::findNextLineBreak):
771         * khtml/rendering/render_block.cpp:
772         (khtml::RenderBlock::lowestPosition):
773         (khtml::RenderBlock::rightmostPosition):
774         (khtml::RenderBlock::leftmostPosition):
775         * khtml/rendering/render_box.cpp:
776         (RenderBox::position):
777         * khtml/rendering/render_box.h:
778         (khtml::RenderBox::staticX):
779         (khtml::RenderBox::staticY):
780         * khtml/rendering/render_layer.cpp:
781         (RenderLayer::updateLayerPosition):
782         (RenderLayer::convertToLayerCoords):
783         * khtml/rendering/render_line.cpp:
784         (khtml::InlineFlowBox::placeBoxesHorizontally):
785         * khtml/rendering/render_object.h:
786         (khtml::RenderObject::staticX):
787         (khtml::RenderObject::staticY):
788
789         Finish turning on XSLT.  Make sure child stylesheets can load.
790         
791         * khtml/xsl/xslt_processorimpl.cpp:
792         (DOM::stylesheetLoadFunc):
793         (DOM::XSLTProcessorImpl::transformDocument):
794
795 2004-11-04  David Hyatt  <hyatt@apple.com>
796
797         Implement CSS3 support for multiple backgrounds.  Also fix a bug with background propagation so that it only
798         happens (from the <body> to the root) for HTML documents.  Fixed background-position to handle a mixture of
799         keyword and length values.
800
801         Reviewed by darin
802
803         * khtml/css/cssparser.cpp:
804         (CSSParser::parseValue):
805         (CSSParser::addBackgroundValue):
806         (CSSParser::parseBackgroundShorthand):
807         (CSSParser::parseBackgroundColor):
808         (CSSParser::parseBackgroundImage):
809         (CSSParser::parseBackgroundPositionXY):
810         (CSSParser::parseBackgroundPosition):
811         (CSSParser::parseBackgroundProperty):
812         (CSSParser::parseColorFromValue):
813         * khtml/css/cssparser.h:
814         * khtml/css/cssstyleselector.cpp:
815         (khtml::CSSStyleSelector::adjustRenderStyle):
816         (khtml::CSSStyleSelector::applyProperty):
817         (khtml::CSSStyleSelector::mapBackgroundAttachment):
818         (khtml::CSSStyleSelector::mapBackgroundImage):
819         (khtml::CSSStyleSelector::mapBackgroundRepeat):
820         (khtml::CSSStyleSelector::mapBackgroundXPosition):
821         (khtml::CSSStyleSelector::mapBackgroundYPosition):
822         * khtml/css/cssstyleselector.h:
823         * khtml/rendering/render_box.cpp:
824         (RenderBox::paintRootBoxDecorations):
825         (RenderBox::paintBoxDecorations):
826         (RenderBox::paintBackgrounds):
827         (RenderBox::paintBackground):
828         (RenderBox::paintBackgroundExtended):
829         * khtml/rendering/render_box.h:
830         * khtml/rendering/render_form.cpp:
831         (RenderFieldset::paintBoxDecorations):
832         * khtml/rendering/render_line.cpp:
833         (khtml::InlineFlowBox::paintBackgrounds):
834         (khtml::InlineFlowBox::paintBackground):
835         (khtml::InlineFlowBox::paintBackgroundAndBorder):
836         * khtml/rendering/render_line.h:
837         * khtml/rendering/render_object.cpp:
838         (RenderObject::setStyle):
839         (RenderObject::updateBackgroundImages):
840         (RenderObject::getVerticalPosition):
841         * khtml/rendering/render_object.h:
842         (khtml::RenderObject::paintBackgroundExtended):
843         * khtml/rendering/render_style.cpp:
844         (m_next):
845         (BackgroundLayer::BackgroundLayer):
846         (BackgroundLayer::~BackgroundLayer):
847         (BackgroundLayer::operator=):
848         (BackgroundLayer::operator==):
849         (BackgroundLayer::fillUnsetProperties):
850         (BackgroundLayer::cullEmptyLayers):
851         (StyleBackgroundData::StyleBackgroundData):
852         (StyleBackgroundData::operator==):
853         (RenderStyle::diff):
854         (RenderStyle::adjustBackgroundLayers):
855         * khtml/rendering/render_style.h:
856         (khtml::OutlineValue::operator==):
857         (khtml::OutlineValue::operator!=):
858         (khtml::BackgroundLayer::backgroundImage):
859         (khtml::BackgroundLayer::backgroundXPosition):
860         (khtml::BackgroundLayer::backgroundYPosition):
861         (khtml::BackgroundLayer::backgroundAttachment):
862         (khtml::BackgroundLayer::backgroundRepeat):
863         (khtml::BackgroundLayer::next):
864         (khtml::BackgroundLayer::isBackgroundImageSet):
865         (khtml::BackgroundLayer::isBackgroundXPositionSet):
866         (khtml::BackgroundLayer::isBackgroundYPositionSet):
867         (khtml::BackgroundLayer::isBackgroundAttachmentSet):
868         (khtml::BackgroundLayer::isBackgroundRepeatSet):
869         (khtml::BackgroundLayer::setBackgroundImage):
870         (khtml::BackgroundLayer::setBackgroundXPosition):
871         (khtml::BackgroundLayer::setBackgroundYPosition):
872         (khtml::BackgroundLayer::setBackgroundAttachment):
873         (khtml::BackgroundLayer::setBackgroundRepeat):
874         (khtml::BackgroundLayer::clearBackgroundImage):
875         (khtml::BackgroundLayer::clearBackgroundXPosition):
876         (khtml::BackgroundLayer::clearBackgroundYPosition):
877         (khtml::BackgroundLayer::clearBackgroundAttachment):
878         (khtml::BackgroundLayer::clearBackgroundRepeat):
879         (khtml::BackgroundLayer::setNext):
880         (khtml::BackgroundLayer::operator!=):
881         (khtml::BackgroundLayer::containsImage):
882         (khtml::BackgroundLayer::hasImage):
883         (khtml::BackgroundLayer::hasFixedImage):
884         (khtml::RenderStyle::setBitDefaults):
885         (khtml::RenderStyle::hasBackground):
886         (khtml::RenderStyle::hasFixedBackgroundImage):
887         (khtml::RenderStyle::outlineWidth):
888         (khtml::RenderStyle::outlineStyle):
889         (khtml::RenderStyle::outlineStyleIsAuto):
890         (khtml::RenderStyle::outlineColor):
891         (khtml::RenderStyle::backgroundColor):
892         (khtml::RenderStyle::backgroundImage):
893         (khtml::RenderStyle::backgroundRepeat):
894         (khtml::RenderStyle::backgroundAttachment):
895         (khtml::RenderStyle::backgroundXPosition):
896         (khtml::RenderStyle::backgroundYPosition):
897         (khtml::RenderStyle::accessBackgroundLayers):
898         (khtml::RenderStyle::backgroundLayers):
899         (khtml::RenderStyle::outlineOffset):
900         (khtml::RenderStyle::resetOutline):
901         (khtml::RenderStyle::setBackgroundColor):
902         (khtml::RenderStyle::setOutlineWidth):
903         (khtml::RenderStyle::setOutlineStyle):
904         (khtml::RenderStyle::setOutlineColor):
905         (khtml::RenderStyle::clearBackgroundLayers):
906         (khtml::RenderStyle::inheritBackgroundLayers):
907         (khtml::RenderStyle::setOutlineOffset):
908         * khtml/rendering/render_table.cpp:
909         (RenderTable::paintBoxDecorations):
910         (RenderTableCell::paintBoxDecorations):
911
912 2004-11-04  David Hyatt  <hyatt@apple.com>
913
914         Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
915         Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
916
917         Reviewed by darin
918
919         * kwq/KWQTextCodec.mm:
920         (KWQTextDecoder::convertLatin1):
921         (KWQTextDecoder::convertUTF16):
922         (KWQTextDecoder::convertUsingTEC):
923         (KWQTextDecoder::toUnicode):
924
925 2004-11-04  David Hyatt  <hyatt@apple.com>
926
927         Make sure line-height returns the correct value for normal.
928         
929         Reviewed by darin
930
931         * khtml/css/css_computedstyle.cpp:
932         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
933
934 2004-11-04  David Harrison  <harrison@apple.com>
935
936         Reviewed by Ken Kocienda.
937
938                 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
939                 
940         * khtml/editing/htmlediting.cpp:
941         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
942         to, but not including, the enclosingBlockFlowElement) rather than just the source element.
943         Fixed to insert after the destination subtree, rather than the destination element.  Handles
944         edge case of deleting back to the top of the tree, where there is nothing left to insert after.
945         * khtml/xml/dom_nodeimpl.cpp:
946         (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
947         * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
948         * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
949         * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
950
951 2004-11-03  Ken Kocienda  <kocienda@apple.com>
952
953         Reviewed by me
954         
955         More layout tests.
956
957         * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
958         * layout-tests/editing/deleting/delete-br-008.html: Added.
959         * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
960         * layout-tests/editing/deleting/delete-br-009.html: Added.
961         * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
962         * layout-tests/editing/deleting/delete-br-010.html: Added.
963
964 2004-11-03  Maciej Stachowiak  <mjs@apple.com>
965
966         Fix by Yasuo Kida, reviewed by me.
967
968         <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
969         
970         * kwq/KWQKHTMLPart.mm:
971         (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
972         same as a nil range - setting an empty marked range should clear
973         the marked range entirely.
974
975 2004-11-02  Maciej Stachowiak  <mjs@apple.com>
976
977         Reviewed by Dave Hyatt (when I originally coded it).
978
979         WebCore part of fix for:
980
981         <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
982         
983         * kwq/WebCoreBridge.h:
984         * kwq/WebCoreBridge.mm:
985         (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
986         DOMRange, or if the range is split into multiple lines, the rect for the part on
987         the first line only.
988         
989         * khtml/rendering/render_object.cpp:
990         (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
991         for the overrides below.
992         * khtml/rendering/render_object.h:
993         * khtml/rendering/render_box.cpp:
994         (RenderBox::caretRect):
995         * khtml/rendering/render_box.h:
996         * khtml/rendering/render_br.cpp:
997         (RenderBR::caretRect):
998         * khtml/rendering/render_br.h:
999         * khtml/rendering/render_flow.cpp:
1000         (RenderFlow::caretRect):
1001         * khtml/rendering/render_flow.h:
1002         * khtml/rendering/render_text.cpp:
1003         (RenderText::caretRect):
1004
1005 2004-11-02  Ken Kocienda  <kocienda@apple.com>
1006
1007         Reviewed by Hyatt
1008
1009         Implemented command to insert a block in response to typing a return key (even though
1010         I am not turning that on by default with this patch....that will come later). 
1011         
1012         This new command is called InsertParagraphSeparatorCommand.
1013         
1014         Reworked the command and function names associated with inserting content into a 
1015         document. Before this patch, there were inputXXX and insertXXX variants, with the
1016         former used for more high-level actions and the latter used for lower-level stuff.
1017         However, this was confusing as the AppKit uses insertXXX for everything. This resulted
1018         in an insertXXX command going through an inputXXX WebCore step and then finally to an
1019         insertXXX WebCore step. To make this less confusing, I have changes all the names to
1020         be insertXXX, and modified the lower-level operations so that it is clear what they do.
1021         
1022         * khtml/editing/htmlediting.cpp:
1023         (khtml::EditCommandPtr::isInsertTextCommand): Name change.
1024         (khtml::EditCommand::isInsertTextCommand): Ditto.
1025         (khtml::CompositeEditCommand::inputText): Ditto.
1026         (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
1027         (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
1028         (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
1029         (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
1030         (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
1031         (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
1032         (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
1033         (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
1034         (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
1035         (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
1036         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
1037         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
1038         (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
1039         (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
1040         (khtml::InsertIntoTextNode::doApply): Ditto.
1041         (khtml::InsertIntoTextNode::doUnapply): Ditto.
1042         (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
1043         (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
1044         (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
1045         (khtml::InsertLineBreakCommand::doApply):
1046         (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
1047         (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
1048         (khtml::InsertNodeBeforeCommand::doApply): Ditto.
1049         (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
1050         (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
1051         (khtml::InsertParagraphSeparatorCommand::doApply):
1052         (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
1053         Class name change, was InsertNewlineCommandInQuotedContentCommand.
1054         (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
1055         (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
1056         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1057         (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
1058         (khtml::InsertTextCommand::doApply): Ditto.
1059         (khtml::InsertTextCommand::deleteCharacter): Ditto.
1060         (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
1061         (khtml::InsertTextCommand::input): Ditto.
1062         (khtml::InsertTextCommand::insertSpace): Ditto.
1063         (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
1064         (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
1065         (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
1066         (khtml::TypingCommand::insertParagraphSeparator): New function.
1067         (khtml::TypingCommand::doApply): Name changes, as above.
1068         (khtml::TypingCommand::insertText): Ditto.
1069         (khtml::TypingCommand::deleteKeyPressed): Ditto.
1070         (khtml::TypingCommand::preservesTypingStyle): Ditto.
1071         * khtml/editing/htmlediting.h:
1072         (khtml::DeleteFromTextNodeCommand::node): Name change.
1073         (khtml::DeleteFromTextNodeCommand::offset): Ditto.
1074         (khtml::DeleteFromTextNodeCommand::count): Ditto.
1075         (khtml::InsertIntoTextNode::text): Ditto.
1076         (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
1077         (khtml::InsertNodeBeforeCommand::refChild): Ditto.
1078         (khtml::TypingCommand::): Ditto.
1079         * khtml/editing/jsediting.cpp: Name changes, as above.
1080         * kwq/WebCoreBridge.h:
1081         * kwq/WebCoreBridge.mm:
1082         (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
1083         (-[WebCoreBridge insertParagraphSeparator]): New function.
1084         (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
1085
1086 2004-11-01  Kevin Decker  <kdecker@apple.com>
1087
1088         Reviewed by rjw.
1089
1090         fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
1091         once and for all. 
1092
1093         * khtml/ecma/kjs_window.cpp:
1094         (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
1095
1096 2004-11-01  Darin Adler  <darin@apple.com>
1097
1098         Reviewed by Hyatt.
1099
1100         - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
1101
1102         * khtml/css/html4.css: Use color: initial for textarea and related ones.
1103
1104 2004-11-01  Ken Kocienda  <kocienda@apple.com>
1105
1106         Reviewed by John
1107
1108         Fix for this bug:
1109         
1110         <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
1111
1112         * khtml/css/css_computedstyle.cpp:
1113         (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the 
1114         implementation here into new copyPropertiesInSet helper. This now calls the
1115         generalized copyPropertiesInSet function with the arguments needed to make copying
1116         inheritable work.
1117         * khtml/css/css_computedstyle.h:
1118         * khtml/css/css_valueimpl.cpp:
1119         (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
1120         In order to do apply block properties, "regular" style declarations need to do style
1121         diffs as well.
1122         (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
1123         except that it uses a different set of properties that apply only to blocks.
1124         (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
1125         and copies out those properties listed in a pre-defined set.
1126         * khtml/css/css_valueimpl.h:
1127         * khtml/editing/htmlediting.cpp:
1128         (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
1129         block, factoring out some of the special case code that should now only run in the inline case.
1130         (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
1131         (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
1132         special handling for "legacy" HTML styles like <B> and <I>.
1133         (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
1134         style changes into different kinds. CSS specifies certain properties only apply to certain
1135         element types. This set of changes now recognizes two such separate cases: styles that apply
1136         to blocks, and styles that apply to inlines.
1137         (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
1138         (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
1139         (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
1140         with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
1141         done so that the function can be passed a portion of the styles being applied so that block styles
1142         and inline styles can be handled separately.
1143         (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
1144         (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
1145         (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
1146         (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
1147         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
1148         * khtml/editing/htmlediting.h:
1149         (khtml::StyleChange::): Changed as described above.
1150         (khtml::StyleChange::usesLegacyStyles):
1151         (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
1152         it needs to layout, even though it has not changed position in the DOM. For instance, this is needed 
1153         when text align changes.
1154         * khtml/khtml_part.cpp:
1155         (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
1156         the passed-in argument.
1157         (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
1158         is a caret. Formerly, this just set typing style and made no visible changes to the document.
1159
1160         New tests.
1161
1162         * layout-tests/editing/editing.js: Added some glue to change text align.
1163         * layout-tests/editing/style/block-style-001-expected.txt: Added.
1164         * layout-tests/editing/style/block-style-001.html: Added.
1165         * layout-tests/editing/style/block-style-002-expected.txt: Added.
1166         * layout-tests/editing/style/block-style-002.html: Added.
1167         * layout-tests/editing/style/block-style-003-expected.txt: Added.
1168         * layout-tests/editing/style/block-style-003.html: Added.
1169
1170 === Safari-169 ===
1171
1172 2004-10-29  Darin Adler  <darin@apple.com>
1173
1174         Reviewed by Kevin.
1175
1176         - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
1177
1178         * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
1179         before advancing one character; before it did it backwards.
1180
1181 2004-10-29  Chris Blumenberg  <cblu@apple.com>
1182
1183         Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
1184
1185         Reviewed by kocienda, adele.
1186
1187         * khtml/rendering/render_frames.cpp:
1188         (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
1189
1190 2004-10-29  Darin Adler  <darin@apple.com>
1191
1192         Reviewed by Chris.
1193
1194         - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
1195
1196         * khtml/khtmlview.cpp:
1197         (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
1198         deleted before this function finishes running.
1199         (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
1200         (KHTMLView::viewportMouseReleaseEvent): Ditto.
1201         (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
1202         is guaranteed to do ref/deref as needed.
1203
1204         * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
1205
1206 2004-10-28  Chris Blumenberg  <cblu@apple.com>
1207
1208         Enabled XSLT on Panther. See intrigue mail for compiling instructions.
1209
1210         Reviewed by darin.
1211
1212         * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
1213         * WebCorePrefix.h: always use XSLT
1214
1215 2004-10-28  Ken Kocienda  <kocienda@apple.com>
1216
1217         Reviewed by Chris
1218
1219         Fix for these bugs:
1220         
1221         <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
1222         <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
1223         
1224         * khtml/editing/htmlediting.cpp:
1225         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members 
1226         to initialization list, zeroing them out.
1227         (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
1228         handle a delete of content in special cases where the only thing selected is a BR. This
1229         code path is much simpler than the newly-named performGeneralDelete, and detects when no
1230         content merging should be done between blocks. This aspect of the change fixes 3854848.
1231         One of the special cases added fixes 3803832.
1232         (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
1233         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
1234         like the other helpers in this class.
1235         (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
1236         (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
1237         * khtml/editing/htmlediting.h: Added new helper and changed an old one.
1238
1239 2004-10-28  Chris Blumenberg  <cblu@apple.com>
1240
1241         Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
1242
1243         Reviewed by darin.
1244
1245         * kwq/KWQKHTMLPart.mm:
1246         (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
1247
1248 2004-10-28  Ken Kocienda  <kocienda@apple.com>
1249
1250         Reviewed by Harrison
1251
1252         Reorganization of delete command functionality so that doApply is not
1253         several hundred lines long. This is not a squeaky-clean cleanup, but
1254         it is a step in the right direction. No functionality changes.
1255
1256         * khtml/editing/htmlediting.cpp:
1257         (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
1258         (khtml::DeleteSelectionCommand::initializePositionData): New helper.
1259         (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
1260         (khtml::DeleteSelectionCommand::performDelete): Ditto.
1261         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
1262         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
1263         (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
1264         (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
1265         (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
1266         (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
1267         * khtml/editing/htmlediting.h:
1268
1269 2004-10-28  Ken Kocienda  <kocienda@apple.com>
1270
1271         Reviewed by me
1272
1273         * khtml/editing/htmlediting.cpp:
1274         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
1275         new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
1276
1277 2004-10-27  Ken Kocienda  <kocienda@apple.com>
1278
1279         Reviewed by Chris
1280
1281         * khtml/editing/htmlediting.cpp:
1282         (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
1283         whether content not in the block containing the start of the selection is moved to that block
1284         after the selection is deleted.
1285         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
1286         (khtml::DeleteSelectionCommand::doApply): Ditto.
1287         (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
1288         to handle the case of inserting a newline when in quoted content in Mail.
1289         (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
1290         (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
1291         (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
1292         (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
1293         (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
1294         (khtml::TypingCommand::doApply): Ditto.
1295         (khtml::TypingCommand::preservesTypingStyle): Ditto.
1296         * khtml/editing/htmlediting.h: Add new delclarations.
1297         (khtml::TypingCommand::): Ditto.
1298         * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
1299         * kwq/WebCoreBridge.mm:
1300         (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
1301
1302 2004-10-26  Chris Blumenberg  <cblu@apple.com>
1303
1304         Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
1305
1306         Reviewed by dave.
1307
1308         * khtml/ecma/kjs_dom.cpp:
1309         (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
1310         * khtml/ecma/kjs_dom.h:
1311         (KJS::DOMElement::):
1312         * khtml/ecma/kjs_dom.lut.h:
1313         (KJS::):
1314
1315 2004-10-26  David Hyatt  <hyatt@apple.com>
1316
1317         Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
1318         the previous line.
1319         
1320         Reviewed by kocienda
1321
1322         * khtml/rendering/bidi.cpp:
1323         (khtml::RenderBlock::layoutInlineChildren):
1324
1325 2004-10-26  David Hyatt  <hyatt@apple.com>
1326
1327         Convert selectionRect() from using a list to a dict and patch it to be like setSelection.  It was still trying
1328         to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
1329         
1330         Reviewed by kocienda
1331
1332         * khtml/rendering/render_canvas.cpp:
1333         (RenderCanvas::selectionRect):
1334         * khtml/rendering/render_object.h:
1335         (khtml::RenderObject::hasSelectedChildren):
1336
1337 2004-10-26  Ken Kocienda  <kocienda@apple.com>
1338
1339         Reviewed by Hyatt
1340         
1341         Fix for this bug::
1342         
1343         <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
1344
1345         * khtml/editing/htmlediting.cpp:
1346         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
1347         let the caller know if a placeholder was removed.
1348         (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
1349         removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
1350         some cases, the selection was still set on the removed BR, and this was the cause of the
1351         crash.
1352         * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
1353
1354 2004-10-26  Darin Adler  <darin@apple.com>
1355
1356         Reviewed by Chris.
1357
1358         - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
1359
1360         * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
1361
1362 2004-10-26  Ken Kocienda  <kocienda@apple.com>
1363
1364         Reviewed by John
1365
1366         * khtml/editing/htmlediting.cpp:
1367         (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
1368         with a zero-length string. That triggers an assert. Call deleteText instead, 
1369         using the same indices that are passed to replaceText.
1370         
1371         Cleaned up the asserts in these three functions below, making them
1372         more consistent. This is not needed for the fix, but I tripped over
1373         these in the course of debugging.
1374         
1375         (khtml::InsertTextCommand::InsertTextCommand):
1376         (khtml::InsertTextCommand::doApply):
1377         (khtml::InsertTextCommand::doUnapply):
1378
1379 2004-10-25  Adele Amchan <adele@apple.com>
1380
1381         Reviewed by Darin.
1382
1383         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
1384         * khtml/xml/dom_docimpl.h:
1385
1386 2004-10-25  Adele Amchan  <adele@apple.com>
1387
1388         Reviewed by me, code change by Darin.
1389
1390         * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
1391
1392 2004-10-25  Ken Kocienda  <kocienda@apple.com>
1393
1394         Oops. These two test results changed with my last checkin, for the better.
1395
1396         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
1397         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
1398
1399 2004-10-25  Ken Kocienda  <kocienda@apple.com>
1400
1401         Reviewed by Chris
1402
1403         Fix for this bug:
1404         
1405         <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
1406
1407         * khtml/editing/htmlediting.cpp:
1408         (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
1409         expand the selection outwards when the selection is on the visible boundary of a root
1410         editable element. This fixes the bug. Note that this function also contains a little code
1411         I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
1412         (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
1413         (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
1414         * khtml/editing/htmlediting.h: Declare new helpers.
1415         * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
1416         * layout-tests/editing/deleting/delete-select-all-001.html: Added.
1417         * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
1418         * layout-tests/editing/deleting/delete-select-all-002.html: Added.
1419         * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
1420         * layout-tests/editing/deleting/delete-select-all-003.html: Added.
1421
1422 2004-10-25  Ken Kocienda  <kocienda@apple.com>
1423
1424         Added some more editing layout tests.
1425
1426         * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
1427         * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
1428         * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
1429         * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
1430         * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
1431         * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
1432         * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
1433         * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
1434         * layout-tests/editing/inserting/typing-003-expected.txt: Added.
1435         * layout-tests/editing/inserting/typing-003.html: Added.
1436
1437 2004-10-25  Ken Kocienda  <kocienda@apple.com>
1438
1439         Reviewed by John
1440
1441         * khtml/rendering/bidi.cpp:
1442         (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
1443             yesterday quite right: words that should have been placed on the next line were instead
1444         appearing on the line before, beyond the right margin. This was a one-word only error
1445         based on moving the line break object when it should have stayed put. Here is the rule:
1446         The line break object only moves to after the whitespace on the end of a line if that 
1447         whitespace caused line overflow when its width is added in.
1448
1449 2004-10-25  Adele Amchan  <adele@apple.com>
1450
1451         Reviewed by Darin.
1452  
1453         Fix for <rdar://problem/3619890> Feature request: designMode        
1454
1455         This change implements the designMode property of a document.  This is an IE property that is also supported by Mozilla.  
1456         This will enable more JS editing compatibility.
1457
1458         * khtml/ecma/kjs_html.cpp:
1459         (KJS::HTMLDocument::tryGet): added case for designMode
1460         (KJS::HTMLDocument::putValue): added case for designMode
1461         * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
1462         * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
1463         * khtml/xml/dom_docimpl.cpp:
1464         (DocumentImpl::DocumentImpl): initialize m_designMode member variable
1465         (DocumentImpl::setDesignMode): added function to assign m_designMode value
1466         (DocumentImpl::getDesignMode): return m_designMode value
1467         (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value. 
1468             Otherwise, it will just return the m_designMode value.
1469         (DocumentImpl::parentDocument):
1470         * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
1471         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
1472
1473 2004-10-22  Ken Kocienda  <kocienda@apple.com>
1474
1475         Reviewed by Hyatt
1476
1477         Fix for this bug:
1478         
1479         <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
1480
1481         * khtml/editing/htmlediting.cpp:
1482         (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
1483         everything that could be affected.
1484         (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
1485         braces, making it act as a comma operator, with a zero value as the right value!!! This made
1486         an important check always fail!!! It turns out that we do not want the constant at all, since
1487         that constant is only needed when checking a computed style, not an inline style as is being
1488         done here.
1489         (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
1490         (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
1491         RangeImpl::compareBoundaryPoints to perform the required check.
1492         * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
1493
1494 2004-10-22  Ken Kocienda  <kocienda@apple.com>
1495
1496         Reviewed by Hyatt
1497         
1498         Fix for this bugs:
1499         
1500         <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
1501         <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
1502     
1503         * khtml/rendering/bidi.cpp:
1504         (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
1505         it is when we are editing, add in the space of the current character when calculating the width
1506         of committed plus uncommitted characters. If this value exceeds the width of the line, move up
1507         the line break object and call skipWhitespace to move past the end of the whitespace.
1508
1509 === Safari-168 ===
1510
1511 2004-10-22  Ken Kocienda  <kocienda@apple.com>
1512
1513         * WebCore.pbproj/project.pbxproj:
1514          Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
1515
1516 2004-10-21  David Hyatt  <hyatt@apple.com>
1517
1518         Reviewed by darin
1519         
1520         Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
1521         
1522         <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
1523         <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
1524         
1525         * khtml/rendering/render_block.cpp:
1526         (khtml::getInlineRun):
1527         (khtml::RenderBlock::makeChildrenNonInline):
1528
1529 2004-10-21  David Hyatt  <hyatt@apple.com>
1530
1531         Fix for 3810389, crash because of continuation() craziness.  Revert back to the old behavior of
1532         making sure that all line boxes get deleted and recreated when inlines are split because of a block.
1533         
1534         Reviewed darin
1535
1536         * khtml/rendering/render_inline.cpp:
1537         (RenderInline::splitFlow):
1538
1539 2004-10-21  Ken Kocienda  <kocienda@apple.com>
1540
1541         Reviewed by Darin
1542         
1543         Significant improvement to the way that whitespace is handled during editing.
1544
1545         * khtml/editing/htmlediting.cpp:
1546         (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
1547         two being added with this name) that delete "insignificant" unrendered text.
1548         (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
1549         calculates the downstream position to use as the endpoint for the deletion, and
1550         then calls deleteInsignificantText with this start and end.
1551         (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
1552         (khtml::InputNewlineCommand::doApply): Ditto.
1553         (khtml::InputTextCommand::input): Ditto.
1554         * khtml/editing/htmlediting.h: Add new declarations.
1555         
1556         Modified layout test results:
1557         * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
1558         * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
1559         * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
1560         * layout-tests/editing/deleting/delete-selection-001-expected.txt:
1561         * layout-tests/editing/deleting/delete-tab-001-expected.txt:
1562         * layout-tests/editing/deleting/delete-tab-004-expected.txt:
1563         * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
1564         * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
1565         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
1566         * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
1567         * layout-tests/editing/inserting/insert-br-001-expected.txt:
1568         * layout-tests/editing/inserting/insert-br-004-expected.txt:
1569         * layout-tests/editing/inserting/insert-br-005-expected.txt:
1570         * layout-tests/editing/inserting/insert-br-006-expected.txt:
1571         * layout-tests/editing/inserting/insert-tab-001-expected.txt:
1572         * layout-tests/editing/inserting/insert-tab-002-expected.txt:
1573         * layout-tests/editing/inserting/insert-tab-004-expected.txt:
1574         * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
1575         * layout-tests/editing/inserting/typing-001-expected.txt:
1576         * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
1577         * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
1578         * layout-tests/editing/style/typing-style-003-expected.txt:
1579         * layout-tests/editing/undo/redo-typing-001-expected.txt:
1580         * layout-tests/editing/undo/undo-typing-001-expected.txt:
1581
1582 2004-10-21  David Hyatt  <hyatt@apple.com>
1583
1584         Fix for 3847054, assertion failure in RenderText::layout() on news.com page.  Fix getInlineRun so that
1585         it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
1586         
1587         Reviewed by darin
1588
1589         * khtml/rendering/render_block.cpp:
1590         (khtml::getInlineRun):
1591
1592 2004-10-20  David Hyatt  <hyatt@apple.com>
1593
1594         Add better dumping of overflow information for scrolling regions.
1595
1596         Fix for 3726524, crash in updateLayerPosition.  Make sure anonymous elements properly remove themselves
1597         from the render tree so that layers and so forth are cleaned up.
1598         
1599         Reviewed by darin
1600
1601         * khtml/rendering/render_container.cpp:
1602         (RenderContainer::detach):
1603         * khtml/rendering/render_layer.h:
1604         (khtml::RenderLayer::scrollXOffset):
1605         (khtml::RenderLayer::scrollYOffset):
1606         * kwq/KWQRenderTreeDebug.cpp:
1607         (write):
1608
1609 2004-10-20  David Hyatt  <hyatt@apple.com>
1610
1611         Fix for 3791146, make sure all lines are checked when computing overflow.
1612         
1613         Reviewed by kocienda
1614
1615         * khtml/rendering/bidi.cpp:
1616         (khtml::RenderBlock::computeHorizontalPositionsForLine):
1617         (khtml::RenderBlock::layoutInlineChildren):
1618         (khtml::RenderBlock::findNextLineBreak):
1619         (khtml::RenderBlock::checkLinesForOverflow):
1620         * khtml/rendering/render_block.h:
1621
1622 2004-10-20  David Hyatt  <hyatt@apple.com>
1623
1624         Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
1625         
1626         Reviewed by kocienda
1627
1628         * khtml/rendering/break_lines.cpp:
1629         (khtml::isBreakable):
1630
1631 2004-10-20  Darin Adler  <darin@apple.com>
1632
1633         Reviewed by John.
1634
1635         - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
1636
1637         * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
1638         Create a palette with the background and foreground colors in it and set it on the widget.
1639
1640         * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
1641         with APPLE_CHANGES. Removed palette and palette-related function members.
1642         * khtml/rendering/render_style.cpp:
1643         (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
1644         (RenderStyle::diff): No palette to compare.
1645
1646         * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
1647         * kwq/KWQLineEdit.mm:
1648         (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
1649         (QLineEdit::text): Made const.
1650
1651         * kwq/KWQTextEdit.h: Added setPalette override.
1652         * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
1653         based on palette.
1654
1655         * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
1656         per color group, and only a single color group per palette.
1657         * kwq/KWQColorGroup.mm: Removed.
1658         * kwq/KWQPalette.mm: Removed.
1659         * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
1660
1661         * kwq/KWQApplication.h: Removed unused palette function.
1662         * kwq/KWQApplication.mm: Ditto.
1663
1664         * kwq/KWQWidget.h: Removed unsetPalette.
1665         * kwq/KWQWidget.mm: Ditto.
1666
1667         - fixed storage leak
1668
1669         * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
1670         Roll in storage leak fix from KDE guys.
1671
1672 2004-10-19  David Hyatt  <hyatt@apple.com>
1673
1674         Reviewed by kocienda
1675
1676         More cleanup of block layout.  Eliminates the separate step for tables that dont fit on a line with a float
1677         and consolidates it with clearing.
1678
1679         Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
1680         
1681         * khtml/rendering/render_block.cpp:
1682         (khtml::getInlineRun):
1683         (khtml::RenderBlock::layoutBlock):
1684         (khtml::RenderBlock::adjustFloatingBlock):
1685         (khtml::RenderBlock::collapseMargins):
1686         (khtml::RenderBlock::clearFloatsIfNeeded):
1687         (khtml::RenderBlock::estimateVerticalPosition):
1688         (khtml::RenderBlock::layoutBlockChildren):
1689         (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
1690         (khtml::RenderBlock::getClearDelta):
1691         (khtml::RenderBlock::calcBlockMinMaxWidth):
1692         * khtml/rendering/render_block.h:
1693         * khtml/rendering/render_frames.cpp:
1694         (RenderFrameSet::layout):
1695         * khtml/xml/dom_textimpl.cpp:
1696         (TextImpl::rendererIsNeeded):
1697
1698         Fix for 3841060, regression with * in frames.  Reviewed by kocienda.
1699         
1700         * layout-tests/fast/frames/002-expected.txt: Added.
1701         * layout-tests/fast/frames/002.html: Added.
1702
1703  2004-10-19  Darin Adler  <darin@apple.com>
1704
1705         Reviewed by Maciej.
1706
1707         - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
1708
1709         * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
1710         scripts being loaded here. If the current code being run is the external script itself, then we don't want
1711         to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
1712         assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
1713         wrong since there can be a script loading in that case too. Layout tests check for both problems.
1714
1715         * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
1716         * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
1717         * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
1718
1719         * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
1720
1721 2004-10-18  Darin Adler  <darin@apple.com>
1722
1723         Reviewed by Dave Hyatt.
1724
1725         - fixed <rdar://problem/3807234> REGRESSION (152-153): can't get element by ID that was just written with document.write in separate JS file (lacoccinelle.net)
1726
1727         * khtml/html/htmltokenizer.cpp:
1728         (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
1729         (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
1730         we only want to look at loadingExtScript if m_executingScript is 0.
1731
1732 2004-10-18  Ken Kocienda  <kocienda@apple.com>
1733
1734         Reviewed by Hyatt
1735
1736         Fix for this bug:
1737         
1738         <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
1739
1740         * khtml/css/css_valueimpl.cpp:
1741         (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
1742         Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the 
1743         lifecycle issues associated with creating a string to be returned in the ident case.
1744         * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
1745         * khtml/css/cssstyleselector.cpp:
1746         (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
1747
1748 2004-10-18  Chris Blumenberg  <cblu@apple.com>
1749
1750         Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
1751
1752         Reviewed by kocienda.
1753
1754         * khtml/rendering/render_frames.cpp:
1755         (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
1756
1757 2004-10-15  Chris Blumenberg  <cblu@apple.com>
1758
1759         Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
1760
1761         Reviewed by john.
1762
1763         * kwq/DOM-CSS.mm:
1764         (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
1765         * kwq/DOMPrivate.h:
1766
1767 2004-10-15  Ken Kocienda  <kocienda@apple.com>
1768
1769         Reviewed by Hyatt
1770
1771         * khtml/rendering/bidi.cpp:
1772         (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
1773         skipping after a clean line break, in addition to the cases already 
1774         checked for.
1775         * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
1776         * layout-tests/editing/inserting/insert-br-007.html: Added.
1777         * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
1778         * layout-tests/editing/inserting/insert-br-008.html: Added.
1779
1780 === Safari-167 ===
1781
1782 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1783
1784         Reviewed by John
1785
1786         Fix for this bug:
1787         
1788         <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
1789
1790         * khtml/editing/visible_position.cpp:
1791         (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
1792         position code to new-style VisiblePosition code. In retrospect, this code was misguided.
1793         Since we do a good job of insulating external code from the internal workings of 
1794         VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
1795         in the case of this bug, was doing harm. Simply removing this code makes the bug
1796         go away and does not cause any editing layout test regresssions.
1797
1798 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1799
1800         Reviewed by Hyatt
1801
1802         * khtml/rendering/bidi.cpp:
1803         (khtml::skipNonBreakingSpace): New helper.
1804         (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
1805         at the start of a block. This was preventing users from typing spaces in empty
1806         documents.
1807         * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
1808         * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
1809
1810 2004-10-14  Adele Amchan  <adele@apple.com>
1811
1812         Reviewed by Darin and Ken.
1813
1814         fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
1815
1816         This change shifts some code around so that the code that determines what typing style
1817         is in effect is called before deleteUnrenderedText is called.  Two asserts are also added
1818         to ensure that start and end nodes of the selection are in the document.
1819
1820         * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
1821
1822 2004-10-14  Adele Amchan  <adele@apple.com>
1823
1824         Reviewed by Ken
1825         
1826         This change makes these three functions virtual so that the work is being done in KWQHTMLPart 
1827         instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
1828
1829         * khtml/khtml_part.cpp:
1830         (KHTMLPart::shouldBeginEditing):
1831         (KHTMLPart::shouldEndEditing):
1832         (KHTMLPart::isContentEditable):
1833         * khtml/khtml_part.h:
1834         * kwq/KWQKHTMLPart.h:
1835
1836 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1837
1838         Reviewed by John
1839
1840         Final fix for these bugs:
1841         
1842         <rdar://problem/3806306> HTML editing puts spaces at start of line
1843         <rdar://problem/3814252> HTML editing groups space with word causing wrapping
1844
1845         This change sets some new CSS properties that have been added to WebCore to 
1846         enable whitespace-handling and line-breaking features that make WebView work
1847         more like a text editor.
1848
1849         * khtml/css/cssstyleselector.cpp:
1850         (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties 
1851         based on property value.
1852         * khtml/html/html_elementimpl.cpp:
1853         (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties 
1854         based on attribute value.
1855         * khtml/khtml_part.cpp:
1856         (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
1857         body element.
1858         (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
1859         body element.
1860         (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
1861         (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
1862         * khtml/khtml_part.h: Add new declarations.
1863         * kwq/WebCoreBridge.h: Ditto.
1864         * kwq/WebCoreBridge.mm:
1865         (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
1866         (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
1867         (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
1868         (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
1869
1870 2004-10-14  John Sullivan  <sullivan@apple.com>
1871
1872         Reviewed by Ken.
1873         
1874         - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
1875
1876         * khtml/editing/htmlediting.cpp:
1877         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
1878         needed a nil check to handle empty document case
1879
1880 2004-10-13  Maciej Stachowiak  <mjs@apple.com>
1881
1882         Reviewed by Ken.
1883
1884         <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
1885         
1886         - I fixed this by turning off all colormatching for WebKit
1887         content. We might turn it back on later. For now, it's possible to
1888         turn it on temporarily by defining COLORMATCH_EVERYTHING.
1889         
1890         * WebCorePrefix.h:
1891         * khtml/ecma/kjs_html.cpp:
1892         (KJS::Context2DFunction::tryCall):
1893         (Context2D::colorRefFromValue):
1894         (Gradient::getShading):
1895         * khtml/rendering/render_canvasimage.cpp:
1896         (RenderCanvasImage::createDrawingContext):
1897         * kwq/KWQColor.mm:
1898         (QColor::getNSColor):
1899         * kwq/KWQPainter.h:
1900         * kwq/KWQPainter.mm:
1901         (CGColorFromNSColor):
1902         (QPainter::selectedTextBackgroundColor):
1903         (QPainter::rgbColorSpace):
1904         (QPainter::grayColorSpace):
1905         (QPainter::cmykColorSpace):
1906         * kwq/WebCoreGraphicsBridge.h:
1907         * kwq/WebCoreGraphicsBridge.m:
1908         (-[WebCoreGraphicsBridge createRGBColorSpace]):
1909         (-[WebCoreGraphicsBridge createGrayColorSpace]):
1910         (-[WebCoreGraphicsBridge createCMYKColorSpace]):
1911
1912 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1913
1914         Reviewed by Hyatt
1915
1916         * khtml/css/css_valueimpl.cpp:
1917         (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
1918         is non-null before appending.
1919
1920 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1921
1922         Update expected results for improved behavior as a result of fix to 3816768.
1923     
1924         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
1925         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
1926         * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
1927
1928 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1929
1930         Reviewed by Richard
1931
1932         * khtml/css/css_computedstyle.cpp:
1933         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
1934         for getting -khtml-line-break and -khml-nbsp-mode.
1935
1936 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1937
1938         Reviewed by John
1939
1940         Fix for this bug:
1941         
1942         <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly 
1943         moves caret out of block.
1944
1945         The issue here is that an empty block with no explicit height set by style collapses
1946         to zero height, and does so immediately after the last bit of content is removed from
1947         it (as a result of deleting text with the delete key for instance). Since zero-height
1948         blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
1949         
1950         The fix is to detect when a block has not been removed itself, but has had all its 
1951         contents removed. In this case, a BR element is placed in the block, one that is
1952         specially marked as a placeholder. Later, if the block ever receives content, this
1953         placeholder is removed.
1954
1955         * khtml/editing/htmlediting.cpp:
1956         (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
1957         (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
1958         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
1959         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
1960         Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong 
1961         (it's very clear that we needs to be able to move more than just text nodes). This may expose
1962         bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
1963         made the test case in the bug work.
1964         (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
1965         removeBlockPlaceholderIfNeeded.
1966         (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
1967         (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
1968         * khtml/editing/htmlediting.h: Declare new functions.
1969
1970 2004-10-13  Richard Williamson   <rjw@apple.com>
1971
1972         Added support for -apple-dashboard-region:none.  And fixed
1973         a few computed style problems.
1974
1975         Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
1976         Reviewed by Hyatt.
1977
1978         * khtml/css/css_computedstyle.cpp:
1979         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1980         * khtml/css/css_valueimpl.cpp:
1981         (CSSPrimitiveValueImpl::cssText):
1982         * khtml/css/cssparser.cpp:
1983         (CSSParser::parseValue):
1984         (CSSParser::parseDashboardRegions):
1985         * khtml/css/cssstyleselector.cpp:
1986         (khtml::CSSStyleSelector::applyProperty):
1987         * khtml/rendering/render_style.cpp:
1988         (RenderStyle::noneDashboardRegions):
1989         * khtml/rendering/render_style.h:
1990         * kwq/KWQKHTMLPart.mm:
1991         (KWQKHTMLPart::dashboardRegionsDictionary):
1992
1993 2004-10-13  David Hyatt  <hyatt@apple.com>
1994
1995         Rework block layout to clean it up and simplify it (r=kocienda).  
1996
1997         Also fixing the style sharing bug (r=mjs).
1998         
1999         * khtml/rendering/render_block.cpp:
2000         (khtml::RenderBlock::MarginInfo::MarginInfo):
2001         (khtml::RenderBlock::layoutBlock):
2002         (khtml::RenderBlock::adjustPositionedBlock):
2003         (khtml::RenderBlock::adjustFloatingBlock):
2004         (khtml::RenderBlock::handleSpecialChild):
2005         (khtml::RenderBlock::handleFloatingOrPositionedChild):
2006         (khtml::RenderBlock::handleCompactChild):
2007         (khtml::RenderBlock::insertCompactIfNeeded):
2008         (khtml::RenderBlock::handleRunInChild):
2009         (khtml::RenderBlock::collapseMargins):
2010         (khtml::RenderBlock::clearFloatsIfNeeded):
2011         (khtml::RenderBlock::estimateVerticalPosition):
2012         (khtml::RenderBlock::determineHorizontalPosition):
2013         (khtml::RenderBlock::setCollapsedBottomMargin):
2014         (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
2015         (khtml::RenderBlock::handleBottomOfBlock):
2016         (khtml::RenderBlock::layoutBlockChildren):
2017         (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
2018         (khtml::RenderBlock::addOverHangingFloats):
2019         * khtml/rendering/render_block.h:
2020         (khtml::RenderBlock::maxTopMargin):
2021         (khtml::RenderBlock::maxBottomMargin):
2022         (khtml::RenderBlock::CompactInfo::compact):
2023         (khtml::RenderBlock::CompactInfo::block):
2024         (khtml::RenderBlock::CompactInfo::matches):
2025         (khtml::RenderBlock::CompactInfo::clear):
2026         (khtml::RenderBlock::CompactInfo::set):
2027         (khtml::RenderBlock::CompactInfo::CompactInfo):
2028         (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
2029         (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
2030         (khtml::RenderBlock::MarginInfo::clearMargin):
2031         (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
2032         (khtml::RenderBlock::MarginInfo::setTopQuirk):
2033         (khtml::RenderBlock::MarginInfo::setBottomQuirk):
2034         (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
2035         (khtml::RenderBlock::MarginInfo::setPosMargin):
2036         (khtml::RenderBlock::MarginInfo::setNegMargin):
2037         (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
2038         (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
2039         (khtml::RenderBlock::MarginInfo::setMargin):
2040         (khtml::RenderBlock::MarginInfo::atTopOfBlock):
2041         (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
2042         (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
2043         (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
2044         (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
2045         (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
2046         (khtml::RenderBlock::MarginInfo::quirkContainer):
2047         (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
2048         (khtml::RenderBlock::MarginInfo::topQuirk):
2049         (khtml::RenderBlock::MarginInfo::bottomQuirk):
2050         (khtml::RenderBlock::MarginInfo::posMargin):
2051         (khtml::RenderBlock::MarginInfo::negMargin):
2052         (khtml::RenderBlock::MarginInfo::margin):
2053         * khtml/rendering/render_box.cpp:
2054         (RenderBox::calcAbsoluteVertical):
2055         * khtml/rendering/render_box.h:
2056         (khtml::RenderBox::marginTop):
2057         (khtml::RenderBox::marginBottom):
2058         (khtml::RenderBox::marginLeft):
2059         (khtml::RenderBox::marginRight):
2060         * khtml/rendering/render_image.cpp:
2061         (RenderImage::setImage):
2062         * khtml/rendering/render_object.cpp:
2063         (RenderObject::sizesToMaxWidth):
2064         * khtml/rendering/render_object.h:
2065         (khtml::RenderObject::collapsedMarginTop):
2066         (khtml::RenderObject::collapsedMarginBottom):
2067         (khtml::RenderObject::maxTopMargin):
2068         (khtml::RenderObject::maxBottomMargin):
2069         (khtml::RenderObject::marginTop):
2070         (khtml::RenderObject::marginBottom):
2071         (khtml::RenderObject::marginLeft):
2072         (khtml::RenderObject::marginRight):
2073         * khtml/rendering/render_text.h:
2074         (khtml::RenderText::marginLeft):
2075         (khtml::RenderText::marginRight):
2076         * khtml/xml/dom_elementimpl.cpp:
2077         (ElementImpl::recalcStyle):
2078
2079 2004-10-12  Ken Kocienda  <kocienda@apple.com>
2080
2081         Reviewed by John
2082
2083         Fix for this bug:
2084         
2085         <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line
2086
2087         * khtml/editing/selection.cpp:
2088         (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
2089         This will make it seem like the run ends on the next line.
2090
2091 2004-10-12  Ken Kocienda  <kocienda@apple.com>
2092
2093         Reviewed by Hyatt
2094
2095         Fix for this bug:
2096         
2097         <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages
2098
2099         * khtml/editing/htmlediting.cpp:
2100         (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
2101         row, section, or column.
2102         (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
2103         of table structure when doing deletes, rather than deleting the structure elements themselves.
2104         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
2105         of table structure. We may want to revisit this some day, but this seems like the best behavior
2106         to me now.
2107         (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
2108         where needed.
2109         * khtml/editing/htmlediting.h: Add declarations for new functions.
2110
2111 2004-10-12  Richard Williamson   <rjw@apple.com>
2112
2113         Fixed access to DOM object via WebScriptObject API.
2114         The execution context for DOM objects wasn't being found.       
2115         <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
2116         Reviewed by Chris
2117
2118         Fixed <rdar://problem/3831063> regions use left offset instead of top offset
2119         Reviewed by John
2120
2121         * khtml/khtml_part.h:
2122         * khtml/rendering/render_object.cpp:
2123         (RenderObject::addDashboardRegions):
2124         * kwq/DOM.mm:
2125         (-[DOMNode isContentEditable]):
2126         (-[DOMNode KJS::Bindings::]):
2127         * kwq/KWQKHTMLPart.h:
2128         * kwq/KWQKHTMLPart.mm:
2129         (KWQKHTMLPart::executionContextForDOM):
2130
2131 2004-10-12  Ken Kocienda  <kocienda@apple.com>
2132
2133         Reviewed by Hyatt
2134
2135         Fix for this bug:
2136
2137         <rdar://problem/3834779> Mail crashes when editing HTML message - khtml::Selection::layout()
2138     
2139         * kwq/KWQKHTMLPart.mm:
2140         (KWQKHTMLPart::styleForSelectionStart): Table code seems to be more robust when the call to
2141         insert our style-checking node is done with an appendChild rather than an insertBefore. Note 
2142         that this table-related problem was exposed by fixing Selection::layout(), which I did
2143         yesterday. This change simply improves things even more so that we do not crash in the
2144         scenario described in the bug.
2145
2146 2004-10-11  Ken Kocienda  <kocienda@apple.com>
2147
2148         Reviewed by John
2149
2150         This is a partial fix to this bug:
2151         
2152         <rdar://problem/3832886> increase quote level on new mail document leads to immediate 
2153         crash in caret painting code
2154         
2155         To eliminate the bad behavior for good, I have done some investigations in Mail code,
2156         and I have sent a suggested code change on to Grant. Basically, Mail can't add empty
2157         blocks (like blockquote elements used for quoting) to documents without giving those 
2158         blocks some content (so they have a height).
2159
2160         I added some other crash protections below.
2161
2162         * khtml/editing/selection.cpp:
2163         (khtml::Selection::layout): Check for non-null position after calls to VisiblePosition, since
2164         the VisiblePosition constructors may fail to find a visible spot in the document. Also, add
2165         a couple position-has-renderer assertion checks.
2166         * kwq/KWQKHTMLPart.mm:
2167         (KWQKHTMLPart::styleForSelectionStart): Take out pos.isNotNull() assertion since VisiblePosition
2168         may not yield a position. This assertion is a holdover from before we had VisiblePosition.
2169         (KWQKHTMLPart::fontForSelection): Rearrange the code a little to deal with possible null results from
2170         calls to helpers.
2171
2172 2004-10-11  Darin Adler  <darin@apple.com>
2173
2174         Reviewed by John.
2175
2176         - fixed <rdar://problem/3834230> empty table can result in division by 0
2177
2178         * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows):
2179         Added 0 check; rolled in from KDE.
2180
2181 2004-10-11  Darin Adler  <darin@apple.com>
2182
2183         Reviewed by John.
2184
2185         - fixed <rdar://problem/3818712> form checkbox value property is read only
2186
2187         The underlying problem was that we were storing two separate values for all
2188         form elements; one for the value property (JavaScript) and the other for the
2189         value attribute (DOM). This is a good idea for text input, but not for other types.
2190
2191         * khtml/html/html_formimpl.h: Changed setValue to take a const DOMString reference.
2192         Added private storesValueSeparateFromAttribute function.
2193         * khtml/html/html_formimpl.cpp:
2194         (DOM::HTMLInputElementImpl::setType): Handle type changes, including detaching and re-attaching
2195         if type changed, and moving value from m_value to ATTR_VALUE and vice versa.
2196         (DOM::HTMLInputElementImpl::type): Added a case for ISINDEX and moved the default out of the
2197         switch so that we will get a warning if a type is left out.
2198         (DOM::HTMLInputElementImpl::parseHTMLAttribute): Tweaked comment format.
2199         (DOM::HTMLInputElementImpl::reset): Changed to only nuke the value if the value property is stored
2200         separately from the attribute. Otherwise, we just want to lave it alone
2201         (DOM::HTMLInputElementImpl::value): Changed to always use m_value if it's not null, then fall back
2202         on the attribute, and finally fall back to the "on" for the checkbox only if both are null.
2203         (DOM::HTMLInputElementImpl::setValue): Changed to set the attribute unless the value property is
2204         supposed to be stored separate from the attribute.
2205         (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute): Added. Returns true for text-type
2206         input elements, and false for the others.
2207
2208 2004-10-11  Darin Adler  <darin@apple.com>
2209
2210         Reviewed by John.
2211
2212         - fixed <rdar://problem/3296652> checkbox input type does not respond to onchange
2213
2214         * khtml/rendering/render_form.cpp:
2215         (RenderFormElement::updateFromElement): Some new code, commented out, for form element colors.
2216         (RenderCheckBox::slotStateChanged): Added call to onChange.
2217
2218 2004-10-11  Ken Kocienda  <kocienda@apple.com>
2219
2220         Reviewed by Darin
2221
2222         Finish selection affinity implementation. This includes code to set the
2223         affinity correctly when clicking with the mouse, and clearing the
2224         affinity when altering the selection using any of the Selection object
2225         mutation functions.
2226
2227         Each instance of the positionForCoordinates, inlineBox and caretRect 
2228         functions have been changed to include an EAffinity argument to give results
2229         which take this bit into account.
2230
2231         * khtml/editing/selection.cpp:
2232         (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
2233         (khtml::Selection::modifyAffinity): New function to compute affinity based on
2234         modification constants.
2235         (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
2236         (khtml::Selection::modifyExtendingRightForward): Ditto.
2237         (khtml::Selection::modifyMovingRightForward): Ditto.
2238         (khtml::Selection::modifyExtendingLeftBackward): Ditto.
2239         (khtml::Selection::modifyMovingLeftBackward): Ditto.
2240         (khtml::Selection::modify): Support saving, restoring, and then calculating new
2241         affinity value as needed. 
2242         (khtml::Selection::xPosForVerticalArrowNavigation):
2243         (khtml::Selection::clear): Reset affinity to UPSTREAM.
2244         (khtml::Selection::setBase): Ditto.
2245         (khtml::Selection::setExtent): Ditto.
2246         (khtml::Selection::setBaseAndExtent): Ditto.
2247         (khtml::Selection::layout): Pass affinity to caretRect().
2248         (khtml::Selection::validate): Pass along affinity parameter to new functions that
2249         require it.
2250         (khtml::startOfFirstRunAt): Changed the way that the y-coordinate search is done, to
2251         keep this code working with changes made in selectionForLine().
2252         (khtml::endOfLastRunAt): Ditto.
2253         (khtml::selectionForLine): Make this function work for all renderers, not just text
2254         renderers.
2255         * khtml/editing/selection.h:
2256         (khtml::operator==): Consider affinity in equality check.
2257         * khtml/editing/visible_units.cpp:
2258         (khtml::previousLinePosition): Pass affinity argument to function so it can take this 
2259         information into account while processing.
2260         (khtml::nextLinePosition): Ditto.
2261         (khtml::previousParagraphPosition): Ditto.
2262         (khtml::nextParagraphPosition): Ditto.
2263         * khtml/editing/visible_units.h: Ditto, for each of the functions listed.
2264         * khtml/khtml_events.cpp:
2265         (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
2266         as this function is being removed.
2267         * khtml/khtml_part.cpp:
2268         (KHTMLPart::isPointInsideSelection): Ditto.
2269         (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
2270         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2271         (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
2272         call to positionForCoordinates, and set resulting affinity on the selection.
2273         (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on 
2274         NodeImpl::positionForCoordinates, as this function is being removed.
2275         (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
2276         * khtml/rendering/render_block.cpp:
2277         (khtml::RenderBlock::positionForCoordinates): Now takes an affinity argument.
2278         * khtml/rendering/render_block.h:
2279         * khtml/rendering/render_box.cpp:
2280         (RenderBox::caretRect): Ditto.
2281         * khtml/rendering/render_box.h:
2282         * khtml/rendering/render_br.cpp:
2283         (RenderBR::positionForCoordinates): Ditto.
2284         (RenderBR::caretRect): Ditto.
2285         (RenderBR::inlineBox): Ditto.
2286         * khtml/rendering/render_br.h:
2287         * khtml/rendering/render_container.cpp:
2288         (RenderContainer::positionForCoordinates): Ditto.
2289         * khtml/rendering/render_container.h:
2290         * khtml/rendering/render_flow.cpp:
2291         (RenderFlow::caretRect): Ditto.
2292         * khtml/rendering/render_flow.h:
2293         * khtml/rendering/render_inline.cpp:
2294         (RenderInline::positionForCoordinates): Ditto.
2295         * khtml/rendering/render_inline.h:
2296         * khtml/rendering/render_object.cpp:
2297         (RenderObject::caretRect): Ditto.
2298         (RenderObject::positionForCoordinates): Ditto.
2299         (RenderObject::inlineBox): Ditto.
2300         * khtml/rendering/render_object.h:
2301         * khtml/rendering/render_replaced.cpp:
2302         (RenderReplaced::positionForCoordinates): Ditto.
2303         * khtml/rendering/render_replaced.h:
2304         * khtml/rendering/render_text.cpp:
2305         (RenderText::positionForCoordinates): Ditto.
2306         (firstRendererOnNextLine): New helper used by caretRect().
2307         (RenderText::caretRect): Now takes an affinity argument.
2308         (RenderText::inlineBox): Ditto.
2309         * khtml/rendering/render_text.h:
2310         * khtml/xml/dom_nodeimpl.cpp: Remove positionForCoordinates helper.
2311         * khtml/xml/dom_nodeimpl.h: Ditto.
2312         * khtml/xml/dom_position.cpp:
2313         (DOM::Position::previousLinePosition): Now takes an affinity argument.
2314         (DOM::Position::nextLinePosition): Ditto.
2315         * khtml/xml/dom_position.h:
2316         * kwq/WebCoreBridge.h:
2317         * kwq/WebCoreBridge.mm:
2318         (-[WebCoreBridge caretRectAtNode:offset:affinity:]): Ditto.
2319         (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
2320         (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on 
2321         NodeImpl::positionForCoordinates, as this function is being removed.
2322
2323 2004-10-11  Darin Adler  <darin@apple.com>
2324
2325         Reviewed by Ken.
2326
2327         - fixed <rdar://problem/3670280> scroll position on overflowed textareas resets when leaving the tab
2328
2329         * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView becomeFirstResponder]):
2330         Scroll to reveal the text area, don't scroll to reveal the text view itself.
2331         Scrolling the text view ended up putting it at the top left, regardless of
2332         where the insertion point is.
2333
2334 2004-10-11  Darin Adler  <darin@apple.com>
2335
2336         Reviewed by Ken.
2337
2338         - fixed <rdar://problem/3831546> More text is copied than is visually selected
2339
2340         The bug here is that upstream was moving a position too far.
2341
2342         * khtml/xml/dom_position.cpp:
2343         (DOM::Position::upstream): Use the "deep equivalent" node rather than the original node passed
2344         in for various checks. Also use local variables a bit more for slightly more efficiency.
2345         (DOM::Position::downstream): Ditto.
2346
2347 2004-10-11  Darin Adler  <darin@apple.com>
2348
2349         Reviewed by Ken.
2350
2351         - fixed <rdar://problem/3833841> adding an event listener for keypress events does not work
2352
2353         * khtml/xml/dom2_eventsimpl.h: Added numEventIds and made typeToId take a const DOMString &.
2354         * khtml/xml/dom2_eventsimpl.cpp:
2355         (EventImpl::typeToId): Changed to use table. Added "keypress", otherwise, the same as before.
2356         (EventImpl::idToType): Changed to use table.
2357
2358 2004-10-10  John Sullivan  <sullivan@apple.com>
2359
2360         - fixed <rdar://problem/3664375> repro crash in -[KWQAccObject accessibilityAttributeNames]
2361
2362         (-[KWQAccObject accessibilityActionNames]):
2363         check for nil m_renderer
2364
2365 2004-10-09  Darin Adler  <darin@apple.com>
2366
2367         Reviewed by Kevin.
2368
2369         - fixed <rdar://problem/3828147> REGRESSION: textareas with wrap="off" show their contents in a thin vertical line of text
2370
2371         * kwq/KWQTextArea.h: Added setTextColor and setBackgroundColor methods. This is really for another fix
2372         I'm landing later, but it does no harm to add these now.
2373         * kwq/KWQTextArea.mm:
2374         (-[KWQTextArea _configureTextViewForWordWrapMode]): Set the container size after changing the flag that
2375         determines if the width tracks the text view. Otherwise, we won't successfully set the width in the case
2376         where we don't want it to track the text view. This caused the bug. 
2377         (-[KWQTextArea _createTextView]): Remove unneeded call to setMaxSize. The above method already does that.
2378         (-[KWQTextArea setTextColor:]): Added.
2379         (-[KWQTextArea setBackgroundColor:]): Added.
2380
2381 2004-10-09  Darin Adler  <darin@apple.com>
2382
2383         Reviewed by Adele.
2384
2385         - fixed <rdar://problem/3829452> REGRESSION (156-157): onload handler doesn't run on page with meta refresh of 0 duration (new Apple start page)
2386
2387         The fix for <rdar://problem/3773150> made it so <meta> redirects prevent tokenizing the rest of the page.
2388         This is incorrect; the reason the JavaScript-triggered loads prevent tokenizing is that they take place
2389         "right away" in other browsers, but that is not true of <meta> redirect. We fixed this by using a separate
2390         call for <meta> redirect and not preventing tokenizing when that's in effect.
2391
2392         * khtml/khtml_part.h: Removed userGesture parameter from scheduleRedirection. Renamed
2393         isImmediateRedirectPending to isScheduledLocationChangePending. Added scheduleLocationChange.
2394         * khtml/khtml_part.cpp:
2395         (KHTMLPart::openURL): Updated for new constant name.
2396         (KHTMLPart::scheduleRedirection): Removed now-unneeded userGesture parameter, and removed code that
2397         does the special case for redirection during load; a <meta> refresh can never be one of those special
2398         redirects during a load because it redirects the frame itself, not another frame. Also tightened up
2399         the logic by always stopping the redirect timer even if we aren't restarting it.
2400         (KHTMLPart::scheduleLocationChange): Added. Like scheduleRedirection, but with a different constant
2401         so we can tell it apart and always a delay of 0. The "redirection during load" case was moved in here
2402         and renamed to locationChangeScheduledDuringLoad.
2403         (KHTMLPart::isScheduledLocationChangePending): Renamed from isImmediateRedirectPending. This now
2404         returns true only for location changes and history navigation, not <meta> redirects.
2405         (KHTMLPart::scheduleHistoryNavigation): Tightened up logic to do the stop() outside the if as above,
2406         and got rid of a silly timer delay computation that always resulted in 0.
2407
2408         * khtml/khtmlpart_p.h: Added a new value to the RedirectionScheduled enum for scheduleLocationChange
2409         and also renamed one of the existing values.
2410
2411         * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::write): Changed to use isScheduledLocationChangePending instead
2412         of isImmediateRedirectPending, because we do want to continue tokenizing if it's actually a redirect.
2413
2414         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Changed to call the new scheduleLocationChange
2415         instead of calling scheduleRedirection with delay of 0.
2416         * khtml/ecma/kjs_window.cpp:
2417         (Window::put): Ditto.
2418         (WindowFunc::tryCall): Ditto.
2419         (Location::put): Ditto.
2420         (LocationFunc::tryCall): Ditto.
2421
2422 2004-10-09  Darin Adler  <darin@apple.com>
2423
2424         Reviewed by Kevin.
2425
2426         - fixed <rdar://problem/3658277> REGRESSION (1.1-1.2): form submission should either not simulate a click at all or use (0,0) the way Mozilla does
2427
2428         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::click): Use 0,0 for the coordinates.
2429
2430 2004-10-09  Darin Adler  <darin@apple.com>
2431
2432         Reviewed by Kevin.
2433
2434         - fixed <rdar://problem/3804665> REGRESSION: WebCore framework now has many init routines
2435
2436         * khtml/xml/dom_nodeimpl.h: Changed anyQName declaration to not use the inline function
2437         makeId. Surprisingly, the inline function was not "constant-folded" and we ended up with
2438         a copy of the function in each file as an init routine for the framework.
2439
2440         * khtml/ecma/kjs_html.cpp: (Gradient::colorStops): Get rid of initialized ColorStop
2441         globals; their constructors were showing up as init routines for the framework.
2442
2443         * khtml/rendering/render_style.h: Got rid of inline initialDashboardRegions function.
2444         * khtml/rendering/render_style.cpp: (RenderStyle::initialDashboardRegions): Made this
2445         a normal function. When it was an inline function, the constructors for the per-file
2446         copies of the globals were showing up as init routines for the framework.
2447
2448 2004-10-09  Chris Blumenberg  <cblu@apple.com>
2449
2450         Fixed: 
2451         <rdar://problem/3625352> up and down arrow and page up/down keys don't work to scroll overflow:auto/scroll/overlay areas
2452         <rdar://problem/3397658> scroll wheel does not work to scroll overflow:auto/scroll/overlay areas (RSS)
2453         <rdar://problem/3822027> REGRESSION (Mail): When selection moves out of visible area, should center as NSText does
2454
2455         Reviewed by hyatt, kocienda.
2456
2457         * khtml/rendering/render_layer.cpp:
2458         (RenderLayer::scroll): new
2459         * khtml/rendering/render_layer.h:
2460         * khtml/rendering/render_object.cpp:
2461         (RenderObject::scroll): new
2462         * khtml/rendering/render_object.h:
2463         * kwq/KWQKHTMLPart.h:
2464         * kwq/KWQKHTMLPart.mm:
2465         (KWQKHTMLPart::scrollOverflow): new
2466         (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent): new
2467         (KWQKHTMLPart::khtmlMousePressEvent): store pressed node so we know where the focus is
2468         * kwq/KWQScrollBar.h:
2469         * kwq/KWQScrollBar.mm:
2470         (QScrollBar::setValue): return a bool
2471         (QScrollBar::scrollbarHit): ditto
2472         (QScrollBar::scroll): new
2473         * kwq/WebCoreBridge.h:
2474         * kwq/WebCoreBridge.mm:
2475         (-[WebCoreBridge scrollOverflowInDirection:granularity:]): new
2476         (-[WebCoreBridge scrollOverflowWithScrollWheelEvent:]): new
2477         (-[WebCoreBridge ensureSelectionVisible]): visually center the extent of the selection
2478
2479 2004-10-06  David Hyatt  <hyatt@apple.com>
2480
2481         Back out style sharing perf fix.
2482         
2483         * khtml/css/cssstyleselector.cpp:
2484         (khtml::CSSStyleSelector::locateCousinList):
2485         (khtml::CSSStyleSelector::canShareStyleWithElement):
2486         (khtml::CSSStyleSelector::locateSharedStyle):
2487         * khtml/css/cssstyleselector.h:
2488         * khtml/html/html_elementimpl.h:
2489         (DOM::HTMLElementImpl::inlineStyleDecl):
2490         * khtml/xml/dom_elementimpl.cpp:
2491         (ElementImpl::recalcStyle):
2492         * khtml/xml/dom_elementimpl.h:
2493
2494 === Safari-166 ===
2495
2496 2004-10-05  David Hyatt  <hyatt@apple.com>
2497
2498         Fix a bug in the iteration of locateCousinList and clean up the style sharing stats code.
2499
2500         * khtml/css/cssstyleselector.cpp:
2501         (khtml::CSSStyleSelector::locateCousinList):
2502         (khtml::CSSStyleSelector::elementsCanShareStyle):
2503         (khtml::CSSStyleSelector::locateSharedStyle):
2504         (khtml::CSSStyleSelector::styleForElement):
2505
2506 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2507
2508         Reviewed by Hyatt
2509
2510         * khtml/rendering/bidi.cpp:
2511         (khtml::RenderBlock::computeHorizontalPositionsForLine): Fix coding mistake that
2512         broke layout tests involving compacts.
2513
2514 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2515
2516         Reviewed by Darin
2517
2518         Finish selection affinity implementation. This includes code to set the
2519         affinity correctly when clicking with the mouse, and clearing the
2520         affinity when altering the selection using any of the Selection object
2521         mutation functions.
2522
2523         Each instance of the positionForCoordinates function in the render tree
2524         has been changed to include an EAffinity argument. It is now the job of this
2525         function to set the selection affinity.
2526
2527         * khtml/editing/selection.cpp:
2528         (khtml::Selection::moveTo): Set affinity to DOWNSTREAM.
2529         (khtml::Selection::modify): Ditto.
2530         (khtml::Selection::clear): Ditto.
2531         (khtml::Selection::setBase): Ditto.
2532         (khtml::Selection::setExtent): Ditto.
2533         (khtml::Selection::setBaseAndExtent): Ditto.
2534         * khtml/editing/selection.h:
2535         (khtml::operator==): Consider affinity in equality check.
2536         * khtml/khtml_events.cpp:
2537         (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
2538         as this function is being removed.
2539         * khtml/khtml_part.cpp: 
2540         (KHTMLPart::isPointInsideSelection): Ditto.
2541         (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
2542         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2543         (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
2544         call to positionForCoordinates, and set resulting affinity on the selection.
2545         (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on 
2546         NodeImpl::positionForCoordinates, as this function is being removed.
2547         (KHTMLPart::khtmlMouseReleaseEvent):
2548         * khtml/rendering/render_block.cpp:
2549         (khtml::RenderBlock::positionForCoordinates): Changed, as described above.
2550         * khtml/rendering/render_block.h:
2551         * khtml/rendering/render_br.cpp:
2552         (RenderBR::positionForCoordinates): Ditto.
2553         * khtml/rendering/render_br.h:
2554         * khtml/rendering/render_container.cpp:
2555         (RenderContainer::positionForCoordinates): Ditto.
2556         * khtml/rendering/render_container.h:
2557         * khtml/rendering/render_inline.cpp:
2558         (RenderInline::positionForCoordinates): Ditto.
2559         * khtml/rendering/render_inline.h:
2560         * khtml/rendering/render_object.cpp:
2561         (RenderObject::positionForCoordinates): Ditto.
2562         * khtml/rendering/render_object.h:
2563         * khtml/rendering/render_replaced.cpp:
2564         (RenderReplaced::positionForCoordinates): Ditto.
2565         * khtml/rendering/render_replaced.h:
2566         * khtml/rendering/render_text.cpp:
2567         (RenderText::positionForCoordinates): Ditto.
2568         * khtml/rendering/render_text.h:
2569         * khtml/xml/dom_nodeimpl.cpp: Removed positionForCoordinates convenience.
2570         * khtml/xml/dom_nodeimpl.h: Ditto.
2571         * kwq/WebCoreBridge.mm:
2572         (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on 
2573         NodeImpl::positionForCoordinates, as this function is being removed.
2574
2575 2004-10-05  David Hyatt  <hyatt@apple.com>
2576
2577         Fix style sharing optimization to be fast again.  Go back to using pointer comparisons when looking for
2578         cousins to share.
2579         
2580         Reviewed by darin
2581
2582         * khtml/css/cssstyleselector.cpp:
2583         (khtml::CSSStyleSelector::locateCousinList):
2584         * khtml/rendering/render_object.cpp:
2585         (RenderObject::setStyleInternal):
2586         * khtml/rendering/render_object.h:
2587         * khtml/xml/dom_elementimpl.cpp:
2588         (ElementImpl::recalcStyle):
2589
2590 2004-10-05  David Hyatt  <hyatt@apple.com>
2591
2592         Fix lists so that they properly participate in line layout as though they are text (when text bullets are
2593         used) and as images (when image bullets are used).
2594         
2595         Reviewed by kocienda
2596
2597         * khtml/rendering/render_list.cpp:
2598         (RenderListMarker::createInlineBox):
2599         * khtml/rendering/render_list.h:
2600         (khtml::ListMarkerBox:::InlineBox):
2601         (khtml::ListMarkerBox::isText):
2602
2603 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2604
2605         Reviewed by Darin
2606
2607         Recent checkin adding upstreamDeepEquivalent had it backwards. The helper
2608         we want is downstreamDeepEquivalent, as the deepEquivalent function returns
2609         an upstream position.
2610
2611         * khtml/editing/selection.cpp:
2612         (khtml::Selection::layout): DOWNSTREAM case now uses downstreamDeepEquivalent.
2613         UPSTREAM uses deepEquivalent.
2614         * khtml/editing/visible_position.cpp:
2615         (khtml::VisiblePosition::downstreamDeepEquivalent): New helper, replacing 
2616         upstreamDeepEquivalent.
2617         * khtml/editing/visible_position.h
2618
2619 2004-10-05  David Hyatt  <hyatt@apple.com>
2620
2621         New selection gap-filling architecture.  Makes the gap-filling much more like NSTextView and puts the responsibility
2622         for gap-filling in the block.  Fixes numerous bugs with selection drawing including bidi issues, incorrect old
2623         horizontal gap filling, and selection performance issues.
2624         
2625         Reviewed by kocienda
2626
2627         * khtml/html/html_imageimpl.cpp:
2628         (HTMLImageLoader::notifyFinished):
2629         * khtml/misc/khtmllayout.h:
2630         (khtml::GapRects::left):
2631         (khtml::GapRects::center):
2632         (khtml::GapRects::right):
2633         (khtml::GapRects::uniteLeft):
2634         (khtml::GapRects::uniteCenter):
2635         (khtml::GapRects::uniteRight):
2636         (khtml::GapRects::unite):
2637         (khtml::GapRects::operator QRect):
2638         (khtml::GapRects::operator==):
2639         (khtml::GapRects::operator!=):
2640         * khtml/rendering/font.cpp:
2641         (Font::drawHighlightForText):
2642         * khtml/rendering/font.h:
2643         * khtml/rendering/render_block.cpp:
2644         (khtml:::RenderFlow):
2645         (khtml::RenderBlock::removeChild):
2646         (khtml::RenderBlock::paintObject):
2647         (khtml::RenderBlock::paintEllipsisBoxes):
2648         (khtml::RenderBlock::setSelectionState):
2649         (khtml::RenderBlock::shouldPaintSelectionGaps):
2650         (khtml::RenderBlock::isSelectionRoot):
2651         (khtml::RenderBlock::selectionGapRects):
2652         (khtml::RenderBlock::paintSelection):
2653         (khtml::RenderBlock::fillSelectionGaps):
2654         (khtml::RenderBlock::fillInlineSelectionGaps):
2655         (khtml::RenderBlock::fillBlockSelectionGaps):
2656         (khtml::RenderBlock::fillHorizontalSelectionGap):
2657         (khtml::RenderBlock::fillVerticalSelectionGap):
2658         (khtml::RenderBlock::fillLeftSelectionGap):
2659         (khtml::RenderBlock::fillRightSelectionGap):
2660         (khtml::RenderBlock::getHorizontalSelectionGapInfo):
2661         (khtml::RenderBlock::leftSelectionOffset):
2662         (khtml::RenderBlock::rightSelectionOffset):
2663         * khtml/rendering/render_block.h:
2664         (khtml::RenderBlock::hasSelectedChildren):
2665         (khtml::RenderBlock::selectionState):
2666         (khtml::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
2667         (khtml::RenderBlock::BlockSelectionInfo::rects):
2668         (khtml::RenderBlock::BlockSelectionInfo::state):
2669         (khtml::RenderBlock::BlockSelectionInfo::block):
2670         (khtml::RenderBlock::selectionRect):
2671         * khtml/rendering/render_box.cpp:
2672         (RenderBox::position):
2673         * khtml/rendering/render_br.cpp:
2674         (RenderBR::inlineBox):
2675         * khtml/rendering/render_br.h:
2676         (khtml::RenderBR::selectionRect):
2677         (khtml::RenderBR::paint):
2678         * khtml/rendering/render_canvas.cpp:
2679         (RenderCanvas::selectionRect):
2680         (RenderCanvas::setSelection):
2681         * khtml/rendering/render_canvasimage.cpp:
2682         (RenderCanvasImage::paint):
2683         * khtml/rendering/render_image.cpp:
2684         (RenderImage::paint):
2685         * khtml/rendering/render_image.h:
2686         * khtml/rendering/render_line.cpp:
2687         (khtml::InlineBox::nextLeafChild):
2688         (khtml::InlineBox::prevLeafChild):
2689         (khtml::InlineBox::selectionState):
2690         (khtml::InlineFlowBox::addToLine):
2691         (khtml::InlineFlowBox::firstLeafChild):
2692         (khtml::InlineFlowBox::lastLeafChild):
2693         (khtml::InlineFlowBox::firstLeafChildAfterBox):
2694         (khtml::InlineFlowBox::lastLeafChildBeforeBox):
2695         (khtml::InlineFlowBox::selectionState):
2696         (khtml::RootInlineBox::fillLineSelectionGap):
2697         (khtml::RootInlineBox::setHasSelectedChildren):
2698         (khtml::RootInlineBox::selectionState):
2699         (khtml::RootInlineBox::firstSelectedBox):
2700         (khtml::RootInlineBox::lastSelectedBox):
2701         (khtml::RootInlineBox::selectionTop):
2702         (khtml::RootInlineBox::block):
2703         * khtml/rendering/render_line.h:
2704         (khtml::RootInlineBox::RootInlineBox):
2705         (khtml::RootInlineBox::hasSelectedChildren):
2706         (khtml::RootInlineBox::selectionHeight):
2707         * khtml/rendering/render_object.cpp:
2708         (RenderObject::selectionColor):
2709         * khtml/rendering/render_object.h:
2710         (khtml::RenderObject::):
2711         (khtml::RenderObject::selectionState):
2712         (khtml::RenderObject::setSelectionState):
2713         (khtml::RenderObject::selectionRect):
2714         (khtml::RenderObject::canBeSelectionLeaf):
2715         (khtml::RenderObject::hasSelectedChildren):
2716         (khtml::RenderObject::hasDirtySelectionState):
2717         (khtml::RenderObject::setHasDirtySelectionState):
2718         (khtml::RenderObject::shouldPaintSelectionGaps):
2719         (khtml::RenderObject::SelectionInfo::SelectionInfo):
2720         * khtml/rendering/render_replaced.cpp:
2721         (RenderReplaced::RenderReplaced):
2722         (RenderReplaced::shouldPaint):
2723         (RenderReplaced::selectionRect):
2724         (RenderReplaced::setSelectionState):
2725         (RenderReplaced::selectionColor):
2726         (RenderWidget::paint):
2727         (RenderWidget::setSelectionState):
2728         * khtml/rendering/render_replaced.h:
2729         (khtml::RenderReplaced::canBeSelectionLeaf):
2730         (khtml::RenderReplaced::selectionState):
2731         * khtml/rendering/render_text.cpp:
2732         (InlineTextBox::checkVerticalPoint):
2733         (InlineTextBox::isSelected):
2734         (InlineTextBox::selectionState):
2735         (InlineTextBox::selectionRect):
2736         (InlineTextBox::paintSelection):
2737         (InlineTextBox::paintMarkedTextBackground):
2738         (RenderText::paint):
2739         (RenderText::setSelectionState):
2740         (RenderText::selectionRect):
2741         * khtml/rendering/render_text.h:
2742         (khtml::RenderText::canBeSelectionLeaf):
2743         * kwq/KWQPainter.h:
2744         * kwq/KWQPainter.mm:
2745         (QPainter::drawHighlightForText):
2746         * kwq/KWQPtrDict.h:
2747         (QPtrDictIterator::toFirst):
2748         * kwq/KWQRect.mm:
2749         (QRect::unite):
2750         * kwq/WebCoreTextRenderer.h:
2751         * kwq/WebCoreTextRendererFactory.mm:
2752         (WebCoreInitializeEmptyTextGeometry):
2753
2754 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2755
2756         Reviewed by Darin
2757         
2758         Use the new CSS properties I added with my previous check-in. Also makes
2759         some changes to caret positioning and drawing to make the proper editing
2760         end-of-line behavior work correctly.
2761
2762         * khtml/editing/selection.cpp:
2763         (khtml::Selection::layout): Caret drawing now takes affinity into account
2764         when deciding where to paint the caret (finally!).
2765         * khtml/editing/visible_position.cpp:
2766         (khtml::VisiblePosition::previousVisiblePosition): Move off Position::rendersInDifferentPosition
2767         to determine the result. Use a simpler test involving comparisons between
2768         downstream positions while iterating. This is cheaper to do and easier to understand.
2769         (khtml::VisiblePosition::nextVisiblePosition): Ditto.
2770         * khtml/rendering/bidi.cpp:
2771         (khtml::BidiIterator::current): Do not return non-breaking spaces for empty
2772         text renderers and for non-text renderers. Return a null Qchar instead. Returning
2773         non-breaking spaces was causing errors when the new -khtml-nbsp-mode was set to "space".
2774         (khtml::RenderBlock::computeHorizontalPositionsForLine): Shrink line boxes that 
2775         contain with more spaces than can fit on the end of a line.
2776         (khtml::RenderBlock::skipWhitespace): Factor this out from findNextLineBreak.
2777         (khtml::RenderBlock::findNextLineBreak): Use new skipWhitespace function. Add
2778         in code to check and use new CSS properties.
2779         * khtml/rendering/break_lines.cpp:
2780         (khtml::isBreakable): Consider a non-breaking space a breakable character based
2781         on setting of new -khtml-nbsp-mode property.
2782         * khtml/rendering/break_lines.h: Ditto.
2783         * khtml/rendering/render_block.h: Declare skipWhitespace function.
2784         * khtml/rendering/render_text.cpp: 
2785         (RenderText::caretRect): Do not draw the caret beyond the right edge of the
2786         window when in white-space normal mode.
2787
2788 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2789
2790         Reviewed by Darin
2791
2792         Fix for these bugs:
2793         
2794         In this patch, I add two new CSS properties and their associated behavior.
2795         This is to support end-of-line and word-wrapping features that match the 
2796         conventions of text editors.
2797
2798         There are also some other small changes here which begin to lay the groundwork
2799         for using these new properties to bring about the desired editing behavior.
2800
2801         * khtml/css/cssparser.cpp:
2802         (CSSParser::parseValue): Add support for new CSS properties.
2803         * khtml/css/cssproperties.c: Generated file.
2804         * khtml/css/cssproperties.h: Ditto.
2805         * khtml/css/cssproperties.in: Add new properties.
2806         * khtml/css/cssstyleselector.cpp:
2807         (khtml::CSSStyleSelector::applyProperty): Add support for new CSS properties.
2808         * khtml/css/cssvalues.c: Generated file.
2809         * khtml/css/cssvalues.h: Ditto.
2810         * khtml/css/cssvalues.in:  Add support for new CSS properties.
2811         * khtml/editing/visible_position.cpp:
2812         (khtml::VisiblePosition::upstreamDeepEquivalent): Added new helper.
2813         * khtml/editing/visible_position.h:
2814         * khtml/rendering/render_box.cpp:
2815         (RenderBox::deleteLineBoxWrapper): Zero out inlineBoxWrapper.
2816         * khtml/rendering/render_replaced.cpp:
2817         (RenderWidget::detach): Zero out inlineBoxWrapper.
2818         * khtml/rendering/render_style.cpp:
2819         (StyleCSS3InheritedData):
2820         (StyleCSS3InheritedData::operator==): Add support for new CSS properties.
2821         (RenderStyle::diff): Ditto.
2822         * khtml/rendering/render_style.h:
2823         (khtml::RenderStyle::nbspMode): Ditto.
2824         (khtml::RenderStyle::khtmlLineBreak): Ditto.
2825         (khtml::RenderStyle::setNBSPMode): Ditto.
2826         (khtml::RenderStyle::setKHTMLLineBreak): Ditto.
2827         (khtml::RenderStyle::initialNBSPMode): Ditto.
2828         (khtml::RenderStyle::initialKHTMLLineBreak): Ditto.
2829
2830 2004-10-05  Darin Adler  <darin@apple.com>
2831
2832         Reviewed by John.
2833
2834         - fixed <rdar://problem/3673150> Pasting string from clipboard that is longer than input box will accept fails rather than truncating
2835
2836         * kwq/KWQTextField.mm:
2837         (-[KWQTextFieldFormatter isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:]):
2838         Wrote a new version of this method that truncates incoming strings rather than rejecting them
2839         out of hand.
2840
2841 2004-10-04  Darin Adler  <darin@apple.com>
2842
2843         Reviewed by Maciej.
2844
2845         - fixed <rdar://problem/3826343> crash in KHTMLParser::setCurrent parsing document fragment (happens in Calendar widget)
2846
2847         * khtml/html/htmlparser.cpp:
2848         (KHTMLParser::KHTMLParser): Initialized currentIsReferenced to false (fixes bug).
2849         (KHTMLParser::reset): Use doc() to make code easier to read.
2850         (KHTMLParser::setCurrent): Ditto.
2851         (KHTMLParser::parseToken): Ditto.
2852         (KHTMLParser::insertNode): Ditto.
2853         (KHTMLParser::getElement): Ditto.
2854         (KHTMLParser::popOneBlock): Ditto.
2855
2856         - fixed <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window
2857
2858         * kwq/KWQKHTMLPart.h: Added fontAttributesForSelectionStart.
2859         * kwq/KWQKHTMLPart.mm:
2860         (KWQKHTMLPart::styleForSelectionStart): Factored out most of fontForSelection.
2861         (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
2862         (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
2863         (KWQKHTMLPart::registerCommandForUndo): Updated for name change (see below).
2864         (KWQKHTMLPart::registerCommandForRedo): Ditto.
2865
2866         * kwq/WebCoreBridge.h: Added fontAttributesForSelectionStart.
2867         * kwq/WebCoreBridge.mm:
2868         (-[WebCoreBridge undoEditing:]): Updated for name change (see below).
2869         (-[WebCoreBridge redoEditing:]): Ditto.
2870         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Got rid of named temporary
2871         EditCommandPtr variable to make things slightly more terse.
2872         (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): Ditto.
2873         (-[WebCoreBridge deleteSelectionWithSmartDelete:]): Ditto.
2874         (-[WebCoreBridge fontAttributesForSelectionStart]): Added.
2875
2876         - fix compile on Panther and other cleanup
2877
2878         * khtml/khtml_part.cpp: Removed unneeded include.
2879         * kwq/KWQEditCommand.h: Got rid of use of "impl" when referring to EditCommand pointers.
2880         * kwq/KWQEditCommand.mm: Added include so we compile on Panther.
2881         (-[KWQEditCommand initWithEditCommand:]): Changed name.
2882         (-[KWQEditCommand dealloc]): Updated for m_impl change to m_command.
2883         (-[KWQEditCommand finalize]): Ditto.
2884         (+[KWQEditCommand commandWithEditCommand:]): Changed name.
2885         (-[KWQEditCommand command]): Changed name.
2886
2887 2004-10-04  Darin Adler  <darin@apple.com>
2888
2889         Reviewed by John.
2890
2891         - did a more-robust version of the fix I just landed
2892
2893         * khtml/html/htmlparser.h: Added currentIsReferenced boolean.
2894         * khtml/html/htmlparser.cpp:
2895         (KHTMLParser::KHTMLParser): Initializes currentIsReferenced.
2896         (KHTMLParser::setCurrent): Changed to respect and set currentIsReferenced.
2897
2898 2004-10-04  Darin Adler  <darin@apple.com>
2899
2900         Reviewed by John.
2901
2902         - fixed <rdar://problem/3824393> REGRESSION (165-TOT): Crash in KHTMLParser::popOneBlock closing window (bose.com)
2903
2904         * khtml/html/htmlparser.cpp:
2905         (KHTMLParser::~KHTMLParser): Move call to setCurrent(0) after the call to freeBlock, since freeBlock doesn't
2906         work well when current is 0, and there's no reason we need to reset the current block first.
2907         (KHTMLParser::setCurrent): Don't ever hold a reference to the document. This prevents a situation where there
2908         would be a reference cycle. In the test case from the bug above, this cycle actually happened and resulted
2909         in a double-delete of the document, tokenizer, and parser.
2910
2911 2004-10-04  Darin Adler  <darin@apple.com>
2912
2913         Reviewed by Maciej.
2914
2915         - fixed <rdar://problem/3825429> onclick handler called when mouse down on another element (affects Dashboard Movies widget, test case enclosed)
2916
2917         * khtml/khtmlview.cpp:
2918         (KHTMLViewPrivate::KHTMLViewPrivate): Initialize the click node to 0.
2919         (KHTMLViewPrivate::~KHTMLViewPrivate): Deref the click node.
2920         (KHTMLViewPrivate::reset): Clear the click node.
2921         (KHTMLView::viewportMousePressEvent): Call invalidateClick when we pass the event to a subframe to
2922         reduce the chance that we'll hold on to an old click node for a long time. Set the click node to
2923         the node we we are clicking on.
2924         (KHTMLView::viewportMouseDoubleClickEvent): Only send a click even if the node is the same one from
2925         the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
2926         old click node for a long time.
2927         (KHTMLView::invalidateClick): Clear the click node.
2928         (KHTMLView::viewportMouseReleaseEvent): Only send a click even if the node is the same one from
2929         the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
2930         old click node for a long time.
2931         (KHTMLView::keyPressEvent): Remove code that sets the originalNode field, which is never used.
2932
2933 2004-10-04  Ken Kocienda  <kocienda@apple.com>
2934
2935         Reviewed by Hyatt
2936
2937         Fix for this bug:
2938         
2939         <rdar://problem/3825289> REGRESSION (Mail): Crash in fontForSelection in empty window
2940
2941         * khtml/editing/visible_position.cpp:
2942         (khtml::VisiblePosition::previousPosition): Switch to node iteration instead "leaf"
2943         iteration. I have been wanting to make this change for a long time, but couldn't
2944         since other code relied on the leaf behavior. That is no longer true. Plus, the
2945         bug fix requires the new behavior.
2946         (khtml::VisiblePosition::nextPosition): Ditto.
2947         (khtml::VisiblePosition::isCandidate): Empty blocks needed a height to be a candidate,
2948         but we make a special case for the body element. This fixes the bug.
2949
2950 2004-10-04  Darin Adler  <darin@apple.com>
2951
2952         Reviewed by Ken.
2953
2954         - fixed <rdar://problem/3800667> REGRESSION (Mail): double-clicking multiple spaces only selects two spaces
2955
2956         * kwq/KWQTextUtilities.mm: (KWQFindWordBoundary): Moved here from the .cpp file. Changed to use the
2957         doubleClickAtIndex: method from NSAttributedString rather than using Unicode Utilities.
2958         * kwq/KWQTextUtilities.cpp: Removed.
2959         * WebCore.pbproj/project.pbxproj: Removed KWQTextUtilities.cpp.
2960
2961         - fixed a problem that would show up using HTML editing under garbage collection
2962
2963         * kwq/KWQEditCommand.mm: (-[KWQEditCommand finalize]): Fixed a [super dealloc] that should have been a
2964         [super finalize].
2965
2966         - another small change
2967
2968         * khtml/editing/visible_units.cpp: (khtml::nextWordBoundary): Tweaked a comment.
2969
2970 2004-10-01  Darin Adler  <darin@apple.com>
2971
2972         Reviewed by Ken (or arguably done by Ken, reviewed by Darin).
2973
2974         - fixed <rdar://problem/3823828> REGRESSION (Mail): Clicking past end of any line puts insertion point at beginning of next line
2975
2976         * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::VisiblePosition):
2977         Check for an offset of 0 and a <br> and use UPSTREAM affinity in that case.
2978         This is a short term fix for something that needs a better longer-term fix.
2979
2980         - fixed <rdar://problem/3823816> REGRESSION (Mail): double-clicking first word on line also selects previous empty line
2981
2982         * khtml/editing/visible_units.cpp: (khtml::previousWordBoundary): Added a special
2983         case for <br>. While I'm not sure why this regressed, I'm sure this fix is good.
2984
2985 2004-10-01  Darin Adler  <darin@apple.com>
2986
2987         Reviewed by John.
2988
2989         - fixed <rdar://problem/3782117> CrashTracer: ..722 crashes at com.apple.WebCore: DOM::HTMLBodyElementImpl::insertedIntoDocument + 0x2c (AOL website)
2990
2991         * khtml/html/html_baseimpl.cpp:
2992         (HTMLBodyElementImpl::insertedIntoDocument): Check for nil document case.
2993         (HTMLFrameElementImpl::isURLAllowed): Ditto.
2994         (HTMLFrameElementImpl::openURL): Ditto.
2995
2996 2004-10-01  Darin Adler  <darin@apple.com>
2997
2998         Reviewed by Maciej.
2999
3000         - fixed <rdar://problem/3822218> REGRESSION (164-165): images don't update on rollover on directv.com page
3001
3002         I introduced a major regression where various JavaScript window properties would not be found when I
3003         fixed bug 3809600.
3004
3005         * khtml/ecma/kjs_window.h: Added hasProperty.
3006         * khtml/ecma/kjs_window.cpp: (Window::hasProperty): Return true in all the cases where get returns something.
3007
3008 2004-09-30  Darin Adler  <darin@apple.com>
3009
3010         Reviewed by Maciej.
3011
3012         - fixed <rdar://problem/3461499> JavaScript function document.open() is buggy with 2nd argument "replace"
3013
3014         Experiments with Firefox indicate that document.open() should not be treated as window.open() unless there
3015         are more than two parameters. Also, Firefox does not implement the "replace" behavior, so we don't have
3016         to worry about it either.
3017
3018         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): Only forward to window if there are more than
3019         two parameters, rather than if there are more than one.
3020
3021         - fixed <rdar://problem/3672933> oninput is firing at page load time for <input type=range>
3022
3023         * kwq/KWQSlider.mm: (QSlider::setValue): Don't emit a signal here. This follows the usual pattern, where
3024         a signal is only emitted for changes that are not explicitly requested by the caller.
3025
3026         - fixed <rdar://problem/3821167> leaks of something allocated by recalcStyle after loading altavista page from cvs-base
3027
3028         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Ref and deref the style we allocate so it's
3029         not left floating if setStyle decides not to ref it.
3030
3031         - fixed <rdar://problem/3821172> leak of HTML attribute string after loading the ESPN page from cvs-base
3032
3033         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Use the DOMString version of
3034         the lower() operation so we don't end up leaving a DOMStringImpl * floating if AtomicString decides not
3035         to ref it.
3036
3037 2004-09-30  Richard Williamson   <rjw@apple.com>
3038
3039         Fixed <rdar://problem/3822330> REGRESSION: crash on launch when homepage is set to about:blank
3040         
3041         Added nil check.
3042         
3043         * kwq/KWQKHTMLPart.mm:
3044         (KWQKHTMLPart::setDisplaysWithFocusAttributes):
3045
3046 2004-09-30  Chris Blumenberg  <cblu@apple.com>
3047         
3048         Fixed: <rdar://problem/3792822> Safari is calling the Cocoa QuickTime plugin twice for the OBJECT and EMBED tags
3049
3050         Reviewed by hyatt.
3051
3052         * khtml/html/html_objectimpl.cpp:
3053         (HTMLObjectElementImpl::attach): call dispatchHTMLEvent after updateWidget instead of every time this method is called
3054         (HTMLObjectElementImpl::recalcStyle): ditto
3055
3056 2004-09-30  Darin Adler  <darin@apple.com>
3057
3058         - rolled out bad image change that caused performance regression
3059
3060         * khtml/rendering/render_image.cpp: (RenderImage::setPixmap):
3061         Don't reference the new image before doing the assignment.
3062         This forced an unwanted.
3063
3064 2004-09-30  Ken Kocienda  <kocienda@apple.com>
3065
3066         Reviewed by me, coded by Darin
3067
3068         - fixed <rdar://problem/3818305> REGRESSION (Mail): Shift + page up has no effect; should modify selection
3069
3070         * khtml/editing/selection.cpp: (khtml::Selection::modify): Fix problem where vertical distance
3071         was used as a distance threshold, but was a negative number. Now make it positive at the start
3072         of the function (and make a couple related changes).
3073
3074 2004-09-29  Richard Williamson   <rjw@apple.com>
3075
3076         Fixed <rdar://problem/3779998> bringing window to front or sending to back does not send focus/blur events to JavaScript window object
3077
3078         The fix has two parts, 1) make onblur and onfocus work for windows, 
3079         and 2), allow the dashboard to override WebKit's special key/non-key
3080         behaviors.
3081
3082         Reviewed by Chris.
3083
3084         * kwq/KWQKHTMLPart.mm:
3085         (KWQKHTMLPart::setDisplaysWithFocusAttributes):
3086
3087 2004-09-29  Ken Kocienda  <kocienda@apple.com>
3088
3089         Reviewed by Hyatt
3090         
3091         Fix for this bug:
3092         
3093         <rdar://problem/3705894> REGRESSION (Mail): if a single word is wider than the window, 
3094         it doesn't break and just runs off the right side
3095
3096         * khtml/css/css_computedstyle.cpp:
3097         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support for CSS_PROP_WORD_WRAP.
3098         * khtml/css/cssparser.cpp:
3099         (CSSParser::parseValue): Ditto.
3100         * khtml/css/cssproperties.c: Generated file.
3101         * khtml/css/cssproperties.h: Ditto.
3102         * khtml/css/cssproperties.in: Add word-wrap property.
3103         * khtml/css/cssstyleselector.cpp:
3104         (khtml::CSSStyleSelector::applyProperty): Add support for CSS_PROP_WORD_WRAP.
3105         * khtml/css/cssvalues.c: Generated file.
3106         * khtml/css/cssvalues.h: Ditto.
3107         * khtml/css/cssvalues.in: Add break-word value.
3108         * khtml/rendering/bidi.cpp:
3109         (khtml::RenderBlock::findNextLineBreak): Add code to implement new word wrapping feature.
3110         * khtml/rendering/render_style.cpp:
3111         (StyleCSS3InheritedData): Add support for new wordWrap property.
3112         (StyleCSS3InheritedData::operator==): Ditto.
3113         (RenderStyle::diff): Ditto.
3114         * khtml/rendering/render_style.h:
3115         (khtml::RenderStyle::wordWrap): Ditto.
3116         (khtml::RenderStyle::setWordWrap): Ditto.
3117         (khtml::RenderStyle::initialWordWrap): Ditto.
3118
3119 2004-09-29  Maciej Stachowiak  <mjs@apple.com>
3120
3121         Reviewed by John.
3122
3123         - consolidated OS version checks into prefix header
3124
3125         * WebCorePrefix.h:
3126         * khtml/rendering/render_canvasimage.cpp:
3127         * kwq/KWQAccObject.mm:
3128         (-[KWQAccObject roleDescription]):
3129         (-[KWQAccObject accessibilityActionDescription:]):
3130         * kwq/KWQComboBox.mm:
3131         (QComboBox::QComboBox):
3132         * kwq/KWQFoundationExtras.h:
3133
3134 2004-09-29  David Hyatt  <hyatt@apple.com>
3135
3136         Make sure <br>s always get line boxes.  Also prevent the creation of RenderTexts for whitespace normal/nowrap nodes
3137         that follow <br>s.
3138         
3139         Reviewed by kocienda
3140
3141         * khtml/editing/visible_position.cpp:
3142         (khtml::VisiblePosition::isCandidate):
3143         * khtml/rendering/render_br.cpp:
3144         (RenderBR::RenderBR):
3145         (RenderBR::createInlineBox):
3146         (RenderBR::baselinePosition):
3147         (RenderBR::lineHeight):
3148         * khtml/rendering/render_br.h:
3149         * khtml/rendering/render_line.cpp:
3150         (khtml::InlineFlowBox::placeBoxesVertically):
3151         * khtml/rendering/render_line.h:
3152         (khtml::InlineBox::isText):
3153         (khtml::InlineFlowBox::addToLine):
3154         * khtml/rendering/render_text.cpp:
3155         (RenderText::detach):
3156         * khtml/rendering/render_text.h:
3157         (khtml::InlineTextBox:::InlineRunBox):
3158         (khtml::InlineTextBox::isInlineTextBox):
3159         (khtml::InlineTextBox::isText):
3160         (khtml::InlineTextBox::setIsText):
3161         * khtml/xml/dom_textimpl.cpp:
3162         (TextImpl::rendererIsNeeded):
3163         * kwq/KWQRenderTreeDebug.cpp:
3164         (operator<<):
3165
3166 2004-09-29  Ken Kocienda  <kocienda@apple.com>
3167
3168         Reviewed by John
3169
3170         Fix for this bug:
3171         
3172         <rdar://problem/3815895> exception inside fontForSelection causes Mail to abort when selection hits bottom
3173
3174         * khtml/editing/selection.cpp:
3175         (khtml::Selection::toRange): Use RangeImpl calls to detect exceptions when creating a Range
3176         from a Selection. Return an empty Range when there is an exception.
3177
3178         Fix for this bug:
3179         
3180         <rdar://problem/3817268> REGRESSION (Mail): Window does not scroll when selecting out of 
3181         visible area of view with arrow keys
3182
3183         * khtml/editing/selection.cpp: Did some name changing. m_needsCaretLayout -> m_needsLayout.
3184         Added m_expectedVisibleRect which supplies the right rectangle to update when scrolling.
3185         (khtml::Selection::Selection): m_needsCaretLayout -> m_needsLayout name change.
3186         (khtml::Selection::init): Handle m_expectedVisibleRect in initialization.
3187         (khtml::Selection::operator=): Handle m_expectedVisibleRect in assignment.
3188         (khtml::Selection::setNeedsLayout): m_needsCaretLayout -> m_needsLayout name change.
3189         (khtml::Selection::layout): Changed name from layoutCaret, since m_expectedVisibleRect
3190         is also calculated here.
3191         (khtml::Selection::caretRect): m_needsCaretLayout -> m_needsLayout name change.
3192         (khtml::Selection::expectedVisibleRect): New. Returns m_expectedVisibleRect, doing a 
3193         layout if needed.
3194         (khtml::Selection::needsCaretRepaint): m_needsCaretLayout -> m_needsLayout name change.
3195         (khtml::Selection::paintCaret): Ditto.
3196         (khtml::Selection::validate): Ditto.
3197         * khtml/editing/selection.h: Add m_expectedVisibleRect member variable and 
3198         expectedVisibleRect accessor.
3199         * kwq/WebCoreBridge.h: Change name of ensureCaretVisible to ensureSelectionVisible, since
3200         this is not only about making the caret visible anymore. Now it can reveal the varying
3201         end of the selection when scrolling with arrow keys.
3202         * kwq/WebCoreBridge.mm:
3203         (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): ensureCaretVisible to 
3204         ensureSelectionVisible name change.
3205         (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto
3206         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Ditto
3207         (-[WebCoreBridge insertNewline]): Ditto
3208         (-[WebCoreBridge insertText:selectInsertedText:]): Ditto
3209         (-[WebCoreBridge deleteKeyPressed]): Ditto
3210         (-[WebCoreBridge ensureSelectionVisible]): Ditto
3211
3212 2004-09-29  Ken Kocienda  <kocienda@apple.com>
3213
3214         Reviewed by Hyatt
3215         
3216         Fix for this bug:
3217         
3218         <rdar://problem/3818296> REGRESSION (Mail): centerSelectionInVisibleArea does not work correctly
3219         
3220         * kwq/KWQKHTMLPart.h:
3221         * kwq/KWQKHTMLPart.mm:
3222         (KWQKHTMLPart::centerSelectionInVisibleArea): New function. Handles both caret
3223         and range selections correctly.
3224         * kwq/KWQNSViewExtras.h: Add forceCentering boolean to some methods in this file.
3225         * kwq/KWQNSViewExtras.m: Ditto. This addition has been done since the AppKit 
3226         method we use to do the centering, -[NSView scrollRectToVisible:],  does not alter 
3227         the view if the rectangle passed to it is already in view. When forceCentering is
3228         true, extra math is done to make scrollRectToVisible center the rectangle we want.
3229         (-[NSView _KWQ_scrollFrameToVisible]): Pass NO for forceCentering in call through to 
3230         _KWQ_scrollRectToVisible:forceCentering:
3231         (-[NSView _KWQ_scrollRectToVisible:forceCentering:]): Add forceCentering argument.
3232         (-[NSView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto.
3233         (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto. Do extra
3234         math to implement the forceCentering effect.
3235         * kwq/KWQScrollView.h: Add forceCentering default argument to ensureRectVisibleCentered.
3236         * kwq/KWQScrollView.mm:
3237         (QScrollView::ensureRectVisibleCentered): Ditto.
3238         * kwq/WebCoreBridge.h:
3239         * kwq/WebCoreBridge.mm:
3240         (-[WebCoreBridge centerSelectionInVisibleArea]): New function. Call through to KWQKHTMLPart. 
3241
3242 2004-09-28  Chris Blumenberg  <cblu@apple.com>
3243
3244         Fixed: WebArchives begin with "<#document/>"
3245
3246         Reviewed by hyatt.
3247
3248         * khtml/xml/dom_nodeimpl.cpp:
3249         (NodeImpl::startMarkup): don't return markup if this is a document node, forgot this when factoring this method out from toHTML
3250
3251 2004-09-28  Chris Blumenberg  <cblu@apple.com>
3252
3253         Removed range parameter from recursive_toHTML and friends since that code path is no longer used.
3254         
3255         Reviewed by mjs.
3256
3257         * khtml/xml/dom2_rangeimpl.cpp:
3258         (DOM::RangeImpl::toHTML):
3259         * khtml/xml/dom_nodeimpl.cpp:
3260         (NodeImpl::recursive_toString):
3261         (NodeImpl::recursive_toHTML):
3262         * khtml/xml/dom_nodeimpl.h:
3263         * kwq/WebCoreBridge.mm:
3264         (-[WebCoreBridge markupStringFromNode:nodes:]):
3265
3266 2004-09-28  Darin Adler  <darin@apple.com>
3267
3268         Reviewed by Ken.
3269
3270         - improve spell checking so it doesn't unmark and remark as you move the cursor with the arrow
3271
3272         * khtml/editing/htmlediting.h: Remove obsolete markMisspellingsInSelection private function.
3273         * khtml/editing/htmlediting.cpp:
3274         (khtml::EditCommand::EditCommand): Blow away the selection when starting an edit command.
3275         (khtml::EditCommand::apply): Remove code to mark misspellings because that's now done as part
3276         of blowing away the selection.
3277         (khtml::EditCommand::unapply): Blow away the selection instead of marking mispellings.
3278         (khtml::EditCommand::reapply): Ditto.
3279         (khtml::ReplaceSelectionCommand::doApply): Removed incorrect code that does spell checking
3280         on inserted text; this doesn't match NSText behavior.
3281         (khtml::TypingCommand::markMisspellingsAfterTyping): Use markMisspellingsInAdjacentWords
3282         function for greater clarity on what this actually does.
3283
3284         * khtml/khtml_part.h: Replaced setSelection's "unmarkOldSelection" boolean parameter with a
3285         "keepTypingStyle" boolean parameter. Removed notifySelectionChanged.
3286         * khtml/khtml_part.cpp:
3287         (KHTMLPart::setSelection): Replaced the "unmarkOldSelection" boolean with a new "keepTypingStyle"
3288         boolean. This is a step on the way to simplifying how this works. Moved the code from the
3289         notifySelectionChanged function here, since there was no clear line between the two functions.
3290         (KHTMLPart::clearSelection): Call setSelection rather that having special case code here for
3291         the case of an empty selection.
3292         (KHTMLPart::appliedEditing): Remove the explicit "false" for "unmarkOldSelection".
3293         (KHTMLPart::unappliedEditing): Ditto.
3294         (KHTMLPart::reappliedEditing): Ditto.
3295
3296         * kwq/KWQKHTMLPart.h: Replaced markMisspellingsInSelection and updateSpellChecking with
3297         markMisspellings and markMisspellingsInAdjacentWords. Added parameters to respondToChangedSelection.
3298         * kwq/KWQKHTMLPart.mm:
3299         (KWQKHTMLPart::markMisspellingsInAdjacentWords): Added.
3300         (KWQKHTMLPart::markMisspellings): New name for markMisspellingsInSelection. Simplified logic a
3301         bit and made it the caller's responsibility to expand the selection passed in to word boundaries.
3302         (KWQKHTMLPart::respondToChangedSelection): Added parameter that identifies the old selection,
3303         and changed logic so it won't mark mispellings in a word if the selection still starts in that word.
3304
3305         - implemented empty-cells property in computed style
3306
3307         * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3308         Added code for CSS_PROP_EMPTY_CELLS. I think the HTML converter in AppKit uses this.
3309
3310 2004-09-28  Chris Blumenberg  <cblu@apple.com>
3311
3312         Fixed n-squared issues with appending to KWQValueListImpl. This fixes the hang in 3794799.
3313
3314         Fixed by Darin, reviewed by me.
3315
3316         * khtml/xml/dom2_rangeimpl.cpp:
3317         (DOM::RangeImpl::toHTML): tweaks
3318         * kwq/KWQValueListImpl.mm:
3319         (KWQValueListImpl::KWQValueListPrivate::KWQValueListPrivate):
3320         (KWQValueListI