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