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