WebKit:
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 2004-05-18  Richard Williamson   <rjw@apple.com>
2
3         Finished implementing support for windowScriptObject.
4
5         Reviewed by Maciej.
6
7         * khtml/khtml_part.cpp:
8         (KHTMLPart::begin):
9         * kwq/KWQKHTMLPart.h:
10         * kwq/KWQKHTMLPart.mm:
11         (KWQKHTMLPart::KWQKHTMLPart):
12         (KWQKHTMLPart::~KWQKHTMLPart):
13         (KWQKHTMLPart::windowScriptObject):
14         * kwq/WebCoreBridge.mm:
15         (updateRenderingForBindings):
16
17 2004-05-18  Richard Williamson   <rjw@apple.com>
18
19         Added stubs to get the WebScriptObject for the window
20         JS object.
21         
22         Made updateRenderingForBindings more robust when handed a
23         nil root object.  This was causing a crash in DB.  Still need to
24         address root cause of nil root object.
25
26         Reviewed by Maciej.
27
28         * khtml/khtml_part.cpp:
29         (KHTMLPart::begin):
30         * kwq/KWQKHTMLPart.h:
31         * kwq/KWQKHTMLPart.mm:
32         (KWQKHTMLPart::windowScriptObject):
33         (KWQKHTMLPart::partClearedInBegin):
34         * kwq/WebCoreBridge.h:
35         * kwq/WebCoreBridge.mm:
36         (updateRenderingForBindings):
37         (-[WebCoreBridge init]):
38         (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]):
39         (-[WebCoreBridge windowScriptObject]):
40
41 2004-05-17  Maciej Stachowiak  <mjs@apple.com>
42
43         Reviewed by Ken.
44
45         <rdar://problem/3656719>: Implement outerHTML and setOuterHTML DOM extensions
46
47         They were already implemented (by Chris), all that was required
48         was exporting them to JavaScript.
49
50         * khtml/dom/html_element.cpp:
51         (HTMLElement::outerHTML): Call impl.
52         (HTMLElement::setOuterHTML): Ditto.
53         * khtml/dom/html_element.h: Prototype new methods.
54         * khtml/ecma/kjs_html.cpp:
55         (KJS::HTMLElement::getValueProperty): Add OuterHTML.
56         (KJS::HTMLElement::putValue): Add OuterHTML.
57         * khtml/ecma/kjs_html.h: Add new enum values.
58         * khtml/ecma/kjs_html.lut.h: Regenerated.
59
60 2004-05-18  Ken Kocienda  <kocienda@apple.com>
61
62         Reviewed by Hyatt
63
64         Removed support for designMode attribute, which we will not be supporting for Tiger.
65         Removed inEditMode from KHTMLPart. This cached designMode value.
66         Removed KHTMLPart::isEditingAtNode function. Asking a node if it is content-editable
67         is a suitable replacement.
68
69         * khtml/dom/dom_misc.h: Remove TristateFlag enum that was used to track designMode values.
70         * khtml/dom/html_document.cpp: Remove designMode and setDesignMode.
71         * khtml/dom/html_document.h: Ditto.
72         * khtml/ecma/kjs_html.cpp:
73         (KJS::HTMLDocument::tryGet): Remove designMode.
74         (KJS::HTMLDocument::putValue): Ditto.
75         * khtml/ecma/kjs_html.lut.h:
76         (KJS::): Ditto.
77         * khtml/html/html_documentimpl.cpp: Remove designMode and setDesignMode.
78         * khtml/html/html_documentimpl.h: Ditto.
79         * khtml/khtml_part.cpp: Remove setEditMode, editMode, inEditMode, and isEditingAtNode.
80         * khtml/khtml_part.h: Ditto.
81         * khtml/khtmlpart_p.h: Remove m_inEditMode variable.
82         (KHTMLPartPrivate::KHTMLPartPrivate):
83         * khtml/khtmlview.cpp:
84         (KHTMLView::focusNextPrevNode): Change over one use in tree of isEditingAtNode to use
85         isContentEditable instead. isContentEditable will be modified in future patch to handle
86         whether the per-part switch has been thrown to override whether something is editable or not.
87
88 2004-05-17  Richard Williamson   <rjw@apple.com>
89
90         Implemented new API for WebScriptObject.
91         Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
92
93         Reviewed by Hyatt.
94
95         * kwq/WebCoreBridge.mm:
96         (updateRenderingForBindings):
97         (-[WebCoreBridge init]):
98
99 2004-05-14  Vicki Murley  <vicki@apple.com>
100
101         Reviewed by mjs.
102  
103         <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
104
105         * WebCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
106
107 2004-05-14  Darin Adler  <darin@apple.com>
108
109         Reviewed by Darin, coded by Maciej.
110
111         - fixed extra repaints when doing auto-fill checks on all pages that have pop-up buttons
112
113         * kwq/KWQComboBox.mm:
114         (QComboBox::populateMenu): Set the populating-menu flag and clear it when done.
115         (-[KWQPopUpButton setPopulatingMenu:]): Added. Sets flag.
116         (-[KWQPopUpButton setNeedsDisplayInRect:]): Do nothing if the flag is set.
117
118 2004-05-14  Darin Adler  <darin@apple.com>
119
120         Reviewed by Dave.
121
122         - fixed <rdar://problem/3650026>: "background property doesn't work right on webdevtips.com due to background:inherit"
123
124         * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
125         Added CSS_PROP_BACKGROUND to the list of properties that must be applied in the first pass.
126
127 === Safari-140 ===
128
129 2004-05-13  David Hyatt  <hyatt@apple.com>
130
131         Fix image loading for <input type=image> and <object>.  Make sure it works dynamically and make sure
132         the renderer is properly null-checked at attach time.
133         
134         Reviewed by darin
135
136         * khtml/html/html_formimpl.cpp:
137         (HTMLInputElementImpl::HTMLInputElementImpl):
138         (HTMLInputElementImpl::~HTMLInputElementImpl):
139         (HTMLInputElementImpl::parseHTMLAttribute):
140         (HTMLInputElementImpl::attach):
141         * khtml/html/html_formimpl.h:
142         * khtml/html/html_objectimpl.cpp:
143         (HTMLObjectElementImpl::HTMLObjectElementImpl):
144         (HTMLObjectElementImpl::~HTMLObjectElementImpl):
145         (HTMLObjectElementImpl::parseHTMLAttribute):
146         (HTMLObjectElementImpl::attach):
147         * khtml/html/html_objectimpl.h:
148
149 2004-05-14  Chris Blumenberg  <cblu@apple.com>
150
151         - Made DOMEventTarget a formal protocol that is implemented by DOMNode
152         - Made DOMEventListener a formal protocol that any object can implement
153
154         Reviewed by kocienda.
155
156         * kwq/DOMCore.h:
157         * kwq/DOMEvents.h:
158
159 2004-05-13  Richard Williamson   <rjw@apple.com>
160
161         Removed vestigial isSelected method.
162
163         Reviewed by Chris.
164
165         * kwq/KWQWidget.h:
166         * kwq/KWQWidget.mm:
167         (QWidget::setIsSelected):
168         * kwq/WebCoreBridge.h:
169
170 2004-05-13  Chris Blumenberg  <cblu@apple.com>
171
172         Fixed: <rdar://problem/3616555>: (API: Make DOM extensions and WebKit DOM operations public)
173
174         Reviewed by rjw.
175
176         * kwq/DOM.h: added DOMExtensions.h
177         * kwq/DOMHTML.h: renamed frame on DOMHTMLTableElement to frameBorders to avoid NSView conflicts
178         * kwq/DOMHTML.mm:
179         (-[DOMHTMLTableElement frameBorders]):
180         (-[DOMHTMLTableElement setFrameBorders:]):
181
182 2004-05-13  Richard Williamson   <rjw@apple.com>
183
184         Changed imports of all DOM headers.  DOM headers
185         should be imported using the normal #import <WebCore/foo.h>,
186         they import is modified when copied to WebKit.
187
188         Reviewed by Chris.
189
190         * ChangeLog:
191         * kwq/DOM.h:
192         * kwq/DOMCSS.h:
193         * kwq/DOMCore.h:
194         * kwq/DOMEvents.h:
195         * kwq/DOMExtensions.h:
196         * kwq/DOMHTML.h:
197         * kwq/DOMInternal.h:
198         * kwq/DOMRange.h:
199         * kwq/DOMStylesheets.h:
200         * kwq/DOMTraversal.h:
201         * kwq/DOMViews.h:
202
203 2004-05-13  Ken Kocienda  <kocienda@apple.com>
204
205         Reviewed by me
206
207         * khtml/editing/htmlediting_impl.cpp:
208         (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Fix deployment
209         build bustage. Uninitialized variable.
210
211 2004-05-13  Ken Kocienda  <kocienda@apple.com>
212
213         Reviewed by Hyatt
214
215         Implemented first cut at text style change code.
216
217         * khtml/editing/htmlediting.cpp:
218         (khtml::ApplyStyleCommand::ApplyStyleCommand):
219         (khtml::ApplyStyleCommand::~ApplyStyleCommand):
220         (khtml::ApplyStyleCommand::impl):
221         (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand):
222         (khtml::RemoveCSSPropertyCommand::~RemoveCSSPropertyCommand):
223         (khtml::RemoveCSSPropertyCommand::impl):
224         (khtml::RemoveCSSPropertyCommand::styleDeclaration):
225         (khtml::RemoveCSSPropertyCommand::property):
226         (khtml::RemoveNodeAttributeCommand::RemoveNodeAttributeCommand):
227         (khtml::RemoveNodeAttributeCommand::~RemoveNodeAttributeCommand):
228         (khtml::RemoveNodeAttributeCommand::impl):
229         (khtml::RemoveNodeAttributeCommand::element):
230         (khtml::RemoveNodeAttributeCommand::attribute):
231         (khtml::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
232         (khtml::RemoveNodePreservingChildrenCommand::~RemoveNodePreservingChildrenCommand):
233         (khtml::RemoveNodePreservingChildrenCommand::impl):
234         (khtml::RemoveNodePreservingChildrenCommand::node):
235         (khtml::SetNodeAttributeCommand::SetNodeAttributeCommand):
236         (khtml::SetNodeAttributeCommand::~SetNodeAttributeCommand):
237         (khtml::SetNodeAttributeCommand::impl):
238         (khtml::SetNodeAttributeCommand::element):
239         (khtml::SetNodeAttributeCommand::attribute):
240         (khtml::SetNodeAttributeCommand::value):
241         * khtml/editing/htmlediting.h:
242         (khtml::):
243         (khtml::ApplyStyleCommand::):
244         
245         Removed a bunch of unnecessary DOM namespace qualifiers.
246         Fixed calls to parent(), which relied on the TreeShared interface to get a parent,
247         and changed to the parentNode() DOM Node call, which is more suitable given the
248         intention.
249         
250         * khtml/editing/htmlediting_impl.cpp:
251         (khtml::CompositeEditCommandImpl::insertNodeBefore):
252         (khtml::CompositeEditCommandImpl::insertNodeAfter):
253         (khtml::CompositeEditCommandImpl::appendNode):
254         (khtml::CompositeEditCommandImpl::removeNode):
255         (khtml::CompositeEditCommandImpl::removeNodeAndPrune):
256         (khtml::CompositeEditCommandImpl::removeNodePreservingChildren):
257         (khtml::CompositeEditCommandImpl::splitTextNode):
258         (khtml::CompositeEditCommandImpl::joinTextNodes):
259         (khtml::CompositeEditCommandImpl::insertText):
260         (khtml::CompositeEditCommandImpl::deleteText):
261         (khtml::CompositeEditCommandImpl::replaceText):
262         (khtml::CompositeEditCommandImpl::removeCSSProperty):
263         (khtml::CompositeEditCommandImpl::removeNodeAttribute):
264         (khtml::CompositeEditCommandImpl::setNodeAttribute):
265         
266         
267         Text style change command implementations.
268         There are a couple more parent() -> parentNode() changes in here as well.
269         
270         (khtml::ApplyStyleCommandImpl::ApplyStyleCommandImpl):
271         (khtml::ApplyStyleCommandImpl::~ApplyStyleCommandImpl):
272         (khtml::ApplyStyleCommandImpl::commandID):
273         (khtml::ApplyStyleCommandImpl::doApply):
274         (khtml::ApplyStyleCommandImpl::isHTMLStyleNode):
275         (khtml::ApplyStyleCommandImpl::removeHTMLStyleNode):
276         (khtml::ApplyStyleCommandImpl::removeCSSStyle):
277         (khtml::ApplyStyleCommandImpl::removeCSSProperty):
278         (khtml::ApplyStyleCommandImpl::setNodeAttribute):
279         (khtml::ApplyStyleCommandImpl::removeNodeAttribute):
280         (khtml::ApplyStyleCommandImpl::removeNodePreservingChildren):
281         (khtml::ApplyStyleCommandImpl::mustExlicitlyApplyStyle):
282         (khtml::ApplyStyleCommandImpl::createExplicitApplyStyleNode):
283         (khtml::ApplyStyleCommandImpl::currentlyHasStyle):
284         (khtml::ApplyStyleCommandImpl::cssProperty):
285         (khtml::ApplyStyleCommandImpl::matchesTargetStyle):
286         (khtml::ApplyStyleCommandImpl::positionInsertionPoint):
287         (khtml::ApplyStyleCommandImpl::splitTextAtStartIfNeeded):
288         (khtml::ApplyStyleCommandImpl::splitTextAtEndIfNeeded):
289         (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded):
290         (khtml::ApplyStyleCommandImpl::removeStyle):
291         (khtml::ApplyStyleCommandImpl::cloneSelection):
292         (khtml::ApplyStyleCommandImpl::insertFragment):
293         (khtml::ApplyStyleCommandImpl::applyInPlace):
294         (khtml::ApplyStyleCommandImpl::applyUsingFragment):
295         (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
296         (khtml::InsertNodeBeforeCommandImpl::doApply):
297         (khtml::InsertNodeBeforeCommandImpl::doUnapply):
298         (khtml::JoinTextNodesCommandImpl::doApply):
299         (khtml::PasteMarkupCommandImpl::PasteMarkupCommandImpl):
300         (khtml::RemoveCSSPropertyCommandImpl::RemoveCSSPropertyCommandImpl):
301         (khtml::RemoveCSSPropertyCommandImpl::~RemoveCSSPropertyCommandImpl):
302         (khtml::RemoveCSSPropertyCommandImpl::commandID):
303         (khtml::RemoveCSSPropertyCommandImpl::doApply):
304         (khtml::RemoveCSSPropertyCommandImpl::doUnapply):
305         (khtml::RemoveNodeAttributeCommandImpl::RemoveNodeAttributeCommandImpl):
306         (khtml::RemoveNodeAttributeCommandImpl::~RemoveNodeAttributeCommandImpl):
307         (khtml::RemoveNodeAttributeCommandImpl::commandID):
308         (khtml::RemoveNodeAttributeCommandImpl::doApply):
309         (khtml::RemoveNodeAttributeCommandImpl::doUnapply):
310         (khtml::RemoveNodePreservingChildrenCommandImpl::RemoveNodePreservingChildrenCommandImpl):
311         (khtml::RemoveNodePreservingChildrenCommandImpl::~RemoveNodePreservingChildrenCommandImpl):
312         (khtml::RemoveNodePreservingChildrenCommandImpl::commandID):
313         (khtml::RemoveNodePreservingChildrenCommandImpl::doApply):
314         (khtml::SetNodeAttributeCommandImpl::SetNodeAttributeCommandImpl):
315         (khtml::SetNodeAttributeCommandImpl::~SetNodeAttributeCommandImpl):
316         (khtml::SetNodeAttributeCommandImpl::commandID):
317         (khtml::SetNodeAttributeCommandImpl::doApply):
318         (khtml::SetNodeAttributeCommandImpl::doUnapply):
319         (khtml::SplitTextNodeCommandImpl::doUnapply):
320         (khtml::TypingCommandImpl::insertText):
321
322
323         Text style change command implementations.
324
325         * khtml/editing/htmlediting_impl.h:
326         (khtml::ApplyStyleCommandImpl::):
327         (khtml::ApplyStyleCommandImpl::removingStyle):
328         (khtml::RemoveCSSPropertyCommandImpl::styleDeclaration):
329         (khtml::RemoveCSSPropertyCommandImpl::property):
330         (khtml::RemoveNodeAttributeCommandImpl::element):
331         (khtml::RemoveNodeAttributeCommandImpl::attribute):
332         (khtml::RemoveNodePreservingChildrenCommandImpl::node):
333         (khtml::SetNodeAttributeCommandImpl::element):
334         (khtml::SetNodeAttributeCommandImpl::attribute):
335         (khtml::SetNodeAttributeCommandImpl::value):
336         
337         
338         Fixed a bug where the TreeWalker returned the current node instead
339         of null when an attempt was made to use the iterator to go to a
340         non-existent location.
341         
342         * khtml/xml/dom2_traversalimpl.cpp:
343         (DOM::TreeWalkerImpl::parentNode):
344         (DOM::TreeWalkerImpl::firstChild):
345         (DOM::TreeWalkerImpl::lastChild):
346         (DOM::TreeWalkerImpl::previousSibling):
347         (DOM::TreeWalkerImpl::nextSibling):
348         (DOM::TreeWalkerImpl::previousNode):
349         (DOM::TreeWalkerImpl::nextNode):
350         
351         
352         A convenience.
353         
354         * khtml/xml/dom_elementimpl.cpp:
355         (ElementImpl::hasAttributes):
356         * khtml/xml/dom_elementimpl.h:
357         
358         
359         New helpers to begin moving us to using DOM Range-compliant positions in our code.
360         
361         * khtml/xml/dom_position.cpp:
362         (DOM::Position::equivalentRangeCompliantPosition):
363         (DOM::Position::equivalentShallowPosition):
364         (DOM::Position::inLastEditableInContainingEditableBlock):
365         
366         
367         (DOM::Position::debugPosition): Debugging aid.
368         * khtml/xml/dom_position.h:
369        
370         * kwq/WebCoreBridge.mm:
371         (-[WebCoreBridge applyStyle:]): First bit of wiring up. Some hard-coded temporary code 
372         in here will need to be improved soon.
373
374 2004-05-12  David Hyatt  <hyatt@apple.com>
375
376         Improve layout scheduling.  Make sure no layouts can be scheduled until over a minimum delay threshold.
377         
378         * khtml/khtmlview.cpp:
379         (KHTMLView::scheduleRelayout):
380         * khtml/rendering/render_frames.cpp:
381         (RenderPart::updateWidgetPositions):
382         * khtml/rendering/render_text.cpp:
383         (RenderText::paint):
384         * khtml/xml/dom_docimpl.cpp:
385         (DocumentImpl::DocumentImpl):
386         (DocumentImpl::close):
387         (DocumentImpl::setParsing):
388         (DocumentImpl::shouldScheduleLayout):
389         (DocumentImpl::minimumLayoutDelay):
390         * khtml/xml/dom_docimpl.h:
391
392 2004-05-11  Chris Blumenberg  <cblu@apple.com>
393
394         Support for: <rdar://problem/3616471>: (API: provide way to get from WebFrame to DOMDocument and vice versa)
395
396         Reviewed by rjw.
397
398         * kwq/DOM.mm:
399         (-[DOMDocument _ownerElement]): new
400         * kwq/DOMInternal.h:
401         * kwq/WebCoreBridge.h:
402         * kwq/WebCoreBridge.mm:
403         (-[WebCoreBridge frameElement]): new
404
405 2004-05-11  David Hyatt  <hyatt@apple.com>
406
407         Fix makeChildrenNonInline so that it does not wrap floats unless an inline is actually found.
408
409         Fix block minmaxwidth to add together contiguous runs of floats.
410
411         Fix the content image loader to not destroy the image when removed from the document.
412
413         Reviewed by darin
414         
415         * ChangeLog:
416         * khtml/html/html_imageimpl.cpp:
417         (HTMLImageLoader::~HTMLImageLoader):
418         (HTMLImageElementImpl::detach):
419         * khtml/html/html_imageimpl.h:
420         (DOM::):
421         * khtml/html/html_objectimpl.cpp:
422         (HTMLObjectElementImpl::createRenderer):
423         * khtml/html/html_objectimpl.h:
424         * khtml/rendering/render_block.cpp:
425         (khtml::getInlineRun):
426         (khtml::RenderBlock::calcInlineMinMaxWidth):
427         (khtml::RenderBlock::calcBlockMinMaxWidth):
428
429 2004-05-06  David Hyatt  <hyatt@apple.com>
430
431         Fix makeChildrenNonInline so that it does not wrap floats unless an inline is actually found.
432
433         Fix block minmaxwidth to add together contiguous runs of floats.
434
435         Fix the content image loader to not destroy the image when removed from the document.
436         
437         Reviewed by darin
438
439         * khtml/rendering/render_block.cpp:
440         (khtml::getInlineRun):
441         (khtml::RenderBlock::calcBlockMinMaxWidth):
442
443 2004-05-11  Vicki Murley  <vicki@apple.com>
444
445         Reviewed by Vicki (fixed by Darin).
446
447         * kwq/KWQKSSLKeyGen.h: fix build failure in B&I due to case sensitivity
448
449 2004-05-09  Maciej Stachowiak  <mjs@apple.com>
450
451         Reviewed by Darin.
452
453         - avoid redecoding animated images that are only used once for
454         ~2.5% iBench speedup (WebCore part of fix)
455
456         * khtml/rendering/render_image.cpp:
457         (RenderImage::setPixmap): Maintain use count for pixmap.
458         (RenderImage::~RenderImage): Likewise.
459         * kwq/KWQPixmap.h:
460         * kwq/KWQPixmap.mm:
461         (QPixmap::increaseUseCount): Call WebCoreImageRenderer
462         (QPixmap::decreaseUseCount): Call WebCoreImageRenderer
463         * kwq/WebCoreImageRenderer.h: Prototype new protocol methods.
464
465 2004-05-10  David Hyatt  <hyatt@apple.com>
466
467         Make sure that when finished parsing if all the right conditions are met, we just go ahead and updateRendering and
468         layout.
469         
470         Reviewed by rjw
471         
472         * khtml/khtmlview.cpp:
473         (KHTMLView::scheduleRelayout):
474
475 2004-05-08  Maciej Stachowiak  <mjs@apple.com>
476
477         Reviewed by Dave.
478
479         - some minor performance tweaks that together give .5% or so on
480         the HTML iBench
481         
482         * khtml/css/css_valueimpl.h: don't use a bitfield for id and important,
483         unpacking the bitfield is too expensive
484         * kwq/KWQArrayImpl.h:
485         * kwq/KWQArrayImpl.mm:
486         (KWQArrayImpl::at): inline this method because it's so hot
487         * kwq/KWQString.mm:
488         (allocateHandle): inline this function because it's so hot
489         (initializeHandleNodes): move this in the file so above can be inlined
490         (allocateNode): ditto
491
492 2004-05-10  David Hyatt  <hyatt@apple.com>
493
494         Move image loading to content.
495         
496         Reviewed by kocienda
497
498         * khtml/html/html_imageimpl.cpp:
499         (m_imageComplete):
500         (HTMLImageLoader::~HTMLImageLoader):
501         (HTMLImageLoader::updateFromElement):
502         (HTMLImageLoader::removedFromDocument):
503         (HTMLImageLoader::dispatchLoadEvent):
504         (HTMLImageLoader::notifyFinished):
505         (HTMLImageElementImpl::HTMLImageElementImpl):
506         (HTMLImageElementImpl::parseHTMLAttribute):
507         (HTMLImageElementImpl::attach):
508         (HTMLImageElementImpl::detach):
509         (HTMLImageElementImpl::removedFromDocument):
510         (HTMLImageElementImpl::currentImage):
511         * khtml/html/html_imageimpl.h:
512         (DOM::):
513         * khtml/html/html_objectimpl.cpp:
514         (HTMLObjectElementImpl::HTMLObjectElementImpl):
515         (HTMLObjectElementImpl::removedFromDocument):
516         (HTMLObjectElementImpl::attach):
517         * khtml/html/html_objectimpl.h:
518         * khtml/misc/loader.cpp:
519         (CachedImage::ref):
520         * khtml/rendering/render_image.cpp:
521         (RenderImage::RenderImage):
522         (RenderImage::setImage):
523         (RenderImage::updateAltText):
524         * khtml/rendering/render_image.h:
525         (khtml::RenderImage::getImage):
526         * khtml/rendering/render_object.cpp:
527         (RenderObject::canvas):
528         * khtml/xml/dom_docimpl.cpp:
529         (DocumentImpl::dispatchImageLoadEventSoon):
530         (DocumentImpl::removeImage):
531         (DocumentImpl::dispatchImageLoadEventsNow):
532         * khtml/xml/dom_docimpl.h:
533
534 2004-05-10  Darin Adler  <darin@apple.com>
535
536         Reviewed by Vicki.
537
538         - fixed build failure seen in B&I log (due to case sensitive file system?)
539
540         * kwq/KWQLoader.h: Include "KWQCString.h" rather than "QCString.h". The latter was
541         failing because the forwarding header is called "qcstring.h" and I guess B&I started
542         building with a case sensitive file system. I could have changed this to "qcstring.h",
543         but it seemed better to use the header's real name since we're inside KWQ here.
544
545 2004-05-07  Maciej Stachowiak  <mjs@apple.com>
546
547         Reviewed by Dave.
548
549         - change things around so extremely hot TokenizerString::current()
550         method doesn't have to do any work. It's cheaper to maintain the
551         relevant state than to always compute it.
552         
553         * khtml/misc/stringit.h:
554         (khtml::TokenizerString::TokenizerString): Initialize m_currentChar
555         (khtml::TokenizerString::push): update m_currentChar
556         (khtml::TokenizerString::advance): ditto
557         (khtml::TokenizerString::current): return m_currentChar
558         * khtml/misc/stringit.cpp:
559         (khtml::TokenizerString::clear): update m_currentChar
560         (khtml::TokenizerString::append): update m_currentChar
561         (khtml::TokenizerString::prepend): update m_currentChar
562
563 2004-05-07  Don Melton  <gramps@apple.com>
564
565         Reviewed by Dave.
566
567         Fixed minor, edge-case regression in KEYGEN RSA logic caused by Dave's
568         "atomic string" patch back in January.
569
570         * khtml/html/html_formimpl.cpp:
571         (HTMLKeygenElementImpl::encoding):
572
573 === Safari-139 ===
574
575 2004-05-06  Maciej Stachowiak  <mjs@apple.com>
576
577         Reviewed by Darin.
578
579         - two trivial changes for a 1% speedup, thanks to Shark
580         
581         * khtml/dom/dom_string.cpp:
582         * khtml/dom/dom_string.h:
583         (DOM::DOMString::~DOMString): inline this method because it's hot and the
584         function call overhead was very costly.
585         * WebCore.pbproj/project.pbxproj: Add -falign-loops=16
586         optimization flag, as suggested by Shark.
587
588 2004-05-06  Chris Blumenberg  <cblu@apple.com>
589
590         Added alpha to DOMRGBColor as an extension.
591
592         Reviewed by dave.
593
594         * kwq/DOM-CSS.mm:
595         (-[DOMRGBColor alpha]): new
596         * kwq/DOMExtensions.h:
597
598 2004-05-05  David Hyatt  <hyatt@apple.com>
599
600         Fix whitespace rendering for brs inside pres. The bug is 3640711.
601         
602         Reviewed by kocienda
603
604         * khtml/rendering/bidi.cpp:
605         (khtml::RenderBlock::layoutInlineChildren):
606         (khtml::RenderBlock::findNextLineBreak):
607
608 2004-04-25  Maciej Stachowiak  <mjs@apple.com>
609
610         Reviewed by Darin.
611
612         * khtml/ecma/kjs_events.cpp:
613         (JSLazyEventListener::parseCode): Make sure to protect the
614         permanent "event" string object.
615
616 2004-05-05  David Hyatt  <hyatt@apple.com>
617
618         Fixes for 3637924, 3643356, and 3558513, all crashes in recalcStyle.  Make sure the tree is always in a
619         sane state when removing children while changing .innerHTML.
620         
621         Reviewed by darin
622
623         * khtml/xml/dom_nodeimpl.cpp:
624
625 2004-05-05  David Hyatt  <hyatt@apple.com>
626
627         A collection of fixes.
628
629         (1) Fix a regression from the style sharing landing that made visited and unvisited links accidentally share.
630         (2) Make sure 100% height divs fill the <body> in quirks mode, even if the body has no height specified.
631         (3) Make sure table cell percentage heights exclude border/padding.
632         (4) Make sure that before flexing auto height is used for the contents of the cells.
633         
634         Reviewed by darin
635
636         * khtml/css/cssstyleselector.cpp:
637         (khtml::CSSStyleSelector::canShareStyleWithElement):
638         (khtml::CSSStyleSelector::locateSharedStyle):
639         * khtml/rendering/render_box.cpp:
640         (RenderBox::calcPercentageHeight):
641         * khtml/rendering/render_table.cpp:
642         (RenderTable::layout):
643         (RenderTableSection::layoutRows):
644
645 2004-05-05  Chris Blumenberg  <cblu@apple.com>
646
647         - DOM Extensions API tweaks
648         - Implemented outerHTML
649
650         Reviewed by kocienda.
651
652         * WebCore-combined.exp:
653         * khtml/html/html_elementimpl.cpp:
654         (HTMLElementImpl::outerHTML): new
655         (HTMLElementImpl::setOuterHTML): mew
656         * khtml/html/html_elementimpl.h:
657         * kwq/DOMExtensions.h: removed background methods on table and table cell since these are unnecessary conveniences
658         * kwq/DOMHTML.mm:
659         (-[DOMHTMLElement outerHTML]): new
660         (-[DOMHTMLElement setOuterHTML:]): mew
661
662 2004-05-04  David Hyatt  <hyatt@apple.com>
663
664         Fix for 3641331, make sure <th> elements don't reset text-align to center if they inherit a specified
665         value.
666
667         Also remove the styles from <abbr> and <acronym>.
668         
669         Reviewed by darin
670
671         * khtml/css/cssstyleselector.cpp:
672         (khtml::CSSStyleSelector::adjustRenderStyle):
673         * khtml/css/html4.css:
674         * khtml/css/quirks.css:
675
676 2004-05-04  Ken Kocienda  <kocienda@apple.com>
677
678         Reviewed by Hyatt
679         
680         Fix for behavior which extends selection drawing to beginning and end of blocks.
681         I added this feature a few days ago, but my checks to see if the extension should
682         be done was naive: Is first or last item in root line box selected? Clearly this 
683         needs to be "selection is *beyond* first or last item in root line box. Done.
684
685         * khtml/rendering/render_image.cpp:
686         (RenderImage::paint): Add selectionState() == SelectionInside check.
687         * khtml/rendering/render_text.cpp:
688         (InlineTextBox::paintSelection): Constrain passed-in offsets to be relative to box.
689         Use passed-in offsets to check whether selection extends beyond this box. Also, now
690         passes in flag to tell whether the whole RenderText has selectionState() == SelectionInside
691         (in which case you always want to extend).
692         (RenderText::paint): Remove box offset constraining from here. Now done in above function.
693         * khtml/rendering/render_text.h: Modify paintSelection interface to add 
694         selectionState() == SelectionInside flag.
695
696 2004-05-04  Ken Kocienda  <kocienda@apple.com>
697
698         Reviewed by me
699         
700         Added layout tests for DOM traversal objects.
701
702         * layout-tests/traversal/node-iterator-001-expected.txt: Added.
703         * layout-tests/traversal/node-iterator-001.html: Added.
704         * layout-tests/traversal/node-iterator-002-expected.txt: Added.
705         * layout-tests/traversal/node-iterator-002.html: Added.
706         * layout-tests/traversal/node-iterator-003-expected.txt: Added.
707         * layout-tests/traversal/node-iterator-003.html: Added.
708         * layout-tests/traversal/node-iterator-004-expected.txt: Added.
709         * layout-tests/traversal/node-iterator-004.html: Added.
710         * layout-tests/traversal/node-iterator-005-expected.txt: Added.
711         * layout-tests/traversal/node-iterator-005.html: Added.
712         * layout-tests/traversal/node-iterator-006-expected.txt: Added.
713         * layout-tests/traversal/node-iterator-006.html: Added.
714         * layout-tests/traversal/node-iterator-007-expected.txt: Added.
715         * layout-tests/traversal/node-iterator-007.html: Added.
716         * layout-tests/traversal/traversal.js: Added.
717         * layout-tests/traversal/tree-walker-001-expected.txt: Added.
718         * layout-tests/traversal/tree-walker-001.html: Added.
719         * layout-tests/traversal/tree-walker-002-expected.txt: Added.
720         * layout-tests/traversal/tree-walker-002.html: Added.
721         * layout-tests/traversal/tree-walker-003-expected.txt: Added.
722         * layout-tests/traversal/tree-walker-003.html: Added.
723         * layout-tests/traversal/tree-walker-004-expected.txt: Added.
724         * layout-tests/traversal/tree-walker-004.html: Added.
725
726 2004-05-04  Ken Kocienda  <kocienda@apple.com>
727
728         Reviewed by Hyatt
729
730         * khtml/xml/dom2_traversalimpl.cpp:
731         (DOM::NodeIteratorImpl::nextNode): Change to make NodeIterators behave like the spec in that
732         reference node is null until you iterate the first time. 
733         (DOM::NodeIteratorImpl::previousNode): Ditto.
734
735 2004-05-04  Ken Kocienda  <kocienda@apple.com>
736
737         Reviewed by me
738
739         * WebCore.pbproj/project.pbxproj: Backed out unintentional
740         change.
741
742 2004-05-04  Ken Kocienda  <kocienda@apple.com>
743
744         Reviewed by Hyatt
745         
746         Implemented DOM traversal objects, NodeIterator and TreeWalker.
747
748         * WebCore-combined.exp: Regenerate
749         * WebCore.exp: Export DOMNodeFilter protocol
750         * khtml/dom/dom2_traversal.cpp: Completed half-done implementation pulled from KDE tree.
751         * khtml/dom/dom2_traversal.h: Ditto.
752         * khtml/dom/dom_doc.cpp:
753         (DOM::Document::createNodeIterator): Ditto.
754         (DOM::Document::createTreeWalker): Ditto.
755         * khtml/dom/dom_doc.h: Ditto.
756         * khtml/ecma/kjs_dom.cpp:
757         (DOMDocumentProtoFunc::tryCall): Fix cases that create traversal objects.
758         * khtml/ecma/kjs_traversal.cpp:
759         (DOMNodeIterator::getValueProperty): Add referenceNode and pointerBeforeReferenceNode
760         properties to node interator.
761         (DOMTreeWalkerProtoFunc::tryCall): Fix typo where DOMTreeWalker::PreviousNode case called previousSibling function.
762         (JSNodeFilterCondition::JSNodeFilterCondition): Implement JS glue class for node filter conditions.
763         (JSNodeFilterCondition::acceptNode): Ditto.
764         * khtml/ecma/kjs_traversal.h:
765         (KJS::DOMNodeIterator::): Add ReferenceNode and PointerBeforeReferenceNode constants.
766         * khtml/ecma/kjs_traversal.lut.h:
767         (KJS::): Regenerated
768         * khtml/xml/dom2_traversalimpl.cpp: Completed half-done implementation pulled from KDE tree.
769         * khtml/xml/dom2_traversalimpl.h: Ditto.
770         * khtml/xml/dom_docimpl.cpp:
771         (DocumentImpl::createNodeIterator): Ditto.
772         (DocumentImpl::createTreeWalker): Ditto.
773         * khtml/xml/dom_docimpl.h: Ditto.
774         * khtml/xml/dom_nodeimpl.cpp:
775         (NodeImpl::checkAddChild): Patched due to change in isAncestor function. This was the one pre-existing caller.
776         (NodeImpl::isAncestor): Changed so that it does not return true for itself: node->isAncestor(node) now returns false.
777         * khtml/xml/dom_nodeimpl.h: Made isAncestor const.
778         * kwq/DOM.mm: Implemented obj-c glue for traversal objects.
779         * kwq/DOMInternal.h: Ditto.
780         * kwq/DOMTraversal.h: Ditto.
781
782 2004-05-04  Darin Adler  <darin@apple.com>
783
784         Reviewed by Ken.
785
786         - fixed <rdar://problem/3642252>: "starting to drag a link and then releasing needs to activate the link if you are still over it"
787
788         * khtml/khtmlview.cpp:
789         (KHTMLView::viewportMouseMoveEvent): Put hysteresis check inside !APPLE_CHANGES because
790         the Web Kit does our hysteresis checks.
791         (KHTMLView::viewportMouseReleaseEvent): Ditto.
792
793         * kwq/KWQApplication.h: Removed startDragDistance and globalStrut; unused.
794         * kwq/KWQApplication.mm: Removed the implementations.
795         * kwq/KWQPointArray.h: Removed manhattanLength; unused.
796         * kwq/KWQPoint.mm:  Removed the implementation.
797
798         * WebCore-tests.exp: Removed manhattanLength.
799         * WebCore-combined.exp: Regenerated.
800
801 2004-05-03  Ken Kocienda  <kocienda@apple.com>
802
803         Reviewed by Hyatt
804
805         Nifty hack to work around problem where BR's inserted at the end of a block do not 
806         render. Since only the *last* BR has this quirk, insert two when at the end of a block.
807         Once done, you can't caret past the last one, so you never insert two again.
808
809         * khtml/editing/htmlediting_impl.cpp:
810         (InputNewlineCommandImpl::doApply)
811
812 2004-05-03  Darin Adler  <darin@apple.com>
813
814         Reviewed by Ken
815
816         - fixed <rdar://problem/3091531>: "should format copied tables with tabs between cells, spreadsheet-style, for pasting to Excel"
817         - fixed <rdar://problem/3110002>: "Find doesn't match across formatting boundaries"
818         - fixed <rdar://problem/3640340>: "REGRESSION (136-137): nil-deref in KHTMLPart::setFocusNodeIfNeeded inside triple click code after repeatedly click/drag selecting text"
819         - fixed <rdar://problem/3640422>: "too many blank lines between paragraphs in copied text"
820
821         * khtml/dom/dom2_range.h: Added == and != operators to DOMRange.
822         * khtml/dom/dom2_range.cpp: (DOM::operator==): Added.
823
824         * khtml/khtml_part.cpp:
825         (KHTMLPart::init): Don't call findTextBegin any more; it's now not used at all
826         in WebCore.
827         (KHTMLPart::clear): Don't call findTextBegin any more. Also don't set up the
828         load statistics variables.
829         (KHTMLPart::findTextNext): Roll out APPLE_CHANGES; this function is no longer
830         used in WebCore any more and instead the entire thing is compiled out.
831         (KHTMLPart::text): Reimplement this by calling one of the new text operations. All the interesting
832         parts were moved into the TextIterator class.
833         (KHTMLPart::setFocusNodeIfNeeded): Add a check for nil; this is the fix for 364030.
834
835         * khtml/khtmlpart_p.h: (KHTMLPartPrivate::KHTMLPartPrivate): Put m_findPos,
836         m_findNode, m_overURL, m_overURLTarget, m_scrollTimer, m_loadedObjects,
837         m_totalObjectCount, and m_jobPercent inside !APPLE_CHANGES.
838
839         * khtml/xml/dom_selection.h: Replaced uses of 4-character tabs with spaces.
840         (DOM::Selection::Selection): Added a constructor that takes a DOM range.
841         (DOM::Selection::operator=): Overloaded operator= for DOM range and position.
842         This is slightly more efficient than letting a second Selection object be constructed.
843         * khtml/xml/dom_selection.cpp: Replaced uses of 4-character tabs with spaces.
844         (DOM::Selection::Selection): Added a constructor that takes a DOM range.
845
846         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::findString): Reimplement find so it uses
847         the new text operations function for finding.
848
849         * khtml/misc/khtml_text_operations.h:
850         * khtml/misc/khtml_text_operations.cpp:
851         * WebCore.pbproj/project.pbxproj:
852         Added new text iterator classes that do the heavy lifting.
853
854 2004-05-03  David Hyatt  <hyatt@apple.com>
855
856         Make sure that XML processing instructions set themselves as the parent node of the stylesheets they load,
857         so that they will get stylesheetLoaded() notifications when @imported stylesheets are contained inside the
858         sheet.
859
860         Reviewed by cblu
861
862         * khtml/xml/dom_xmlimpl.cpp:
863         (ProcessingInstructionImpl::setStyleSheet):
864
865 2004-04-30  Chris Blumenberg  <cblu@apple.com>
866
867         Fixed: <rdar://problem/3543662>: HITLIST-137: REGRESSION: reproducible hang copying all text at Dave's blog, and other pages
868
869         Reviewed by dave.
870
871         * khtml/xml/dom2_rangeimpl.cpp:
872         (RangeImpl::toHTMLWithOptions): when looping with containingBlock, check the value to see if it is the same
873
874 2004-04-30  David Hyatt  <hyatt@apple.com>
875
876         Fix for 3639530, regression on generated content pages.  They crash because I forgot to null-check the style
877         object.
878         
879         Reviewed by kocienda
880
881         * khtml/css/cssstyleselector.cpp:
882         (khtml::CSSStyleSelector::checkOneSelector):
883
884 2004-04-30  John Sullivan  <sullivan@apple.com>
885
886         - added bridge method to get the NSFont used to render a node, to
887         help with supporting the font panel
888
889         Reviewed by Ken.
890
891         * kwq/WebCoreBridge.h:
892         * kwq/WebCoreBridge.mm:
893         (-[WebCoreBridge renderedFontForNode:]):
894         return nil if no renderer, otherwise return NSFont
895
896 2004-04-29  David Hyatt  <hyatt@apple.com>
897
898         Expose summary on tables.
899         
900         Reviewed by darin
901
902         * kwq/KWQAccObject.mm:
903         (-[KWQAccObject helpText]):
904
905 2004-04-29  David Hyatt  <hyatt@apple.com>
906
907         Implement image maps for accessibility.
908         
909         Reviewed by darin
910
911         * khtml/html/html_imageimpl.cpp:
912         (HTMLAreaElementImpl::getRect):
913         * khtml/html/html_imageimpl.h:
914         * khtml/rendering/render_image.cpp:
915         (RenderImage::imageMap):
916         (RenderImage::nodeAtPoint):
917         * khtml/rendering/render_image.h:
918         * kwq/KWQAccObject.h:
919         * kwq/KWQAccObject.mm:
920         (-[KWQAccObject initWithRenderer:]):
921         (-[KWQAccObject anchorElement]):
922         (-[KWQAccObject parentObject]):
923         (-[KWQAccObject parentObjectUnignored]):
924         (-[KWQAccObject addChildrenToArray:]):
925         (-[KWQAccObject role]):
926         (-[KWQAccObject helpText]):
927         (-[KWQAccObject value]):
928         (-[KWQAccObject title]):
929         (-[KWQAccObject position]):
930         (-[KWQAccObject size]):
931         (-[KWQAccObject accessibilityIsIgnored]):
932         (-[KWQAccObject accessibilityAttributeNames]):
933         (-[KWQAccObject accessibilityAttributeValue:]):
934         * kwq/KWQRegion.mm:
935         (QRegion::boundingRect):
936
937 2004-04-29  Chris Blumenberg  <cblu@apple.com>
938
939         Fixed:
940         <rdar://problem/3631431>: web archive of .Mac welcome page renders has gaps in layout
941         <rdar://problem/3631470>: news.google.com web archive has a different font than the live site
942
943         Reviewed by kocienda.
944
945         * khtml/html/html_documentimpl.cpp:
946         (HTMLDocumentImpl::determineParseMode): don't set a name on the doc type when there is no doc type in the source
947         * khtml/xml/dom_docimpl.cpp:
948         (DocumentTypeImpl::toString): don't return "<!DOCTYPE>" when there is no doc type in the source
949         * khtml/xml/dom_nodeimpl.cpp:
950         (NodeImpl::recursive_toHTMLWithOptions): don't escape STYLE text, don't include the end tags for document nodes just as we don't for start tags
951
952 2004-04-29  Darin Adler  <darin@apple.com>
953
954         Reviewed by Dave.
955
956         - some tweaks on image
957
958         * khtml/html/html_imageimpl.h: Remove unused noref bit and unneeded override of isURLAttribute.
959         * khtml/html/html_imageimpl.cpp:
960         (HTMLAreaElementImpl::HTMLAreaElementImpl): Remove unused noref bit.
961         (HTMLAreaElementImpl::parseHTMLAttribute): Remove parsing of noref; no need to store the
962         bit since it has no meaning.
963
964 2004-04-29  David Hyatt  <hyatt@apple.com>
965
966         1. Change the role of links from AXButton to AXLink.
967         2. Add support for list markers using a new role, AXListMarker.
968         
969         Reviewed by kocienda
970
971         * khtml/rendering/render_list.h:
972         (khtml::RenderListMarker::text):
973         * kwq/KWQAccObject.mm:
974         (-[KWQAccObject role]):
975         (-[KWQAccObject roleDescription]):
976         (-[KWQAccObject value]):
977         (-[KWQAccObject accessibilityIsIgnored]):
978
979 2004-04-29  Darin Adler  <darin@apple.com>
980
981         Reviewed by Ken.
982
983         - fixed <rdar://problem/3636566>: "space bar on a form button hits default button instead (autorestore.apple.com)"
984
985         * khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::defaultEventHandler):
986         Remove special handling for space, falling back to default AppKit behavior. Change enter handling to
987         click the form element itself in the case of elements other than text input ones.
988
989 2004-04-29  Darin Adler  <darin@apple.com>
990
991         Reviewed by Ken.
992
993         - fixed <rdar://problem/3636673>: "unrepro nil-deref crash in KHTMLPart::frameDetached() (espn.com)"
994
995         * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Check for nil.
996
997 2004-04-28  Chris Blumenberg  <cblu@apple.com>
998
999         - Implemented DOMHTMLElementExtensions.
1000         - Added stubs for the rest of the DOM API.
1001
1002         Reviewed by dave.
1003
1004         * WebCore.pbproj/project.pbxproj:
1005         * khtml/dom/html_element.cpp:
1006         (HTMLElement::setContentEditable): moved implementation from here to HTMLElementImpl
1007         * khtml/html/html_elementimpl.cpp:
1008         (HTMLElementImpl::setContentEditable): new, moved from HTMLElement
1009         * khtml/html/html_elementimpl.h:
1010         * kwq/DOM-CSS.mm:
1011         (-[DOMObject sheet]):
1012         (-[DOMDocument getComputedStyle::]):
1013         * kwq/DOM.mm:
1014         (-[DOMAbstractView document]):
1015         (-[DOMDocumentView defaultView]):
1016         (-[DOMDocument createNodeIterator::::]):
1017         (-[DOMDocument createTreeWalker::::]):
1018         (-[DOMNodeFilter acceptNode:]):
1019         (-[DOMNodeIterator root]):
1020         (-[DOMNodeIterator whatToShow]):
1021         (-[DOMNodeIterator filter]):
1022         (-[DOMNodeIterator expandEntityReferences]):
1023         (-[DOMNodeIterator nextNode]):
1024         (-[DOMNodeIterator previousNode]):
1025         (-[DOMNodeIterator detach]):
1026         (-[DOMTreeWalker root]):
1027         (-[DOMTreeWalker whatToShow]):
1028         (-[DOMTreeWalker filter]):
1029         (-[DOMTreeWalker expandEntityReferences]):
1030         (-[DOMTreeWalker currentNode]):
1031         (-[DOMTreeWalker setCurrentNode:]):
1032         (-[DOMTreeWalker parentNode]):
1033         (-[DOMTreeWalker firstChild]):
1034         (-[DOMTreeWalker lastChild]):
1035         (-[DOMTreeWalker previousSibling]):
1036         (-[DOMTreeWalker nextSibling]):
1037         (-[DOMTreeWalker previousNode]):
1038         (-[DOMTreeWalker nextNode]):
1039         * kwq/DOMEvents.mm: Added.
1040         (-[DOMEvent type]):
1041         (-[DOMEvent target]):
1042         (-[DOMEvent currentTarget]):
1043         (-[DOMEvent eventPhase]):
1044         (-[DOMEvent bubbles]):
1045         (-[DOMEvent cancelable]):
1046         (-[DOMEvent timeStamp]):
1047         (-[DOMEvent stopPropagation]):
1048         (-[DOMEvent preventDefault]):
1049         (-[DOMEvent initEvent:::]):
1050         (-[DOMEventTarget addEventListener:::]):
1051         (-[DOMEventTarget removeEventListener:::]):
1052         (-[DOMEventTarget dispatchEvent:]):
1053         (-[DOMMouseEvent screenX]):
1054         (-[DOMMouseEvent screenY]):
1055         (-[DOMMouseEvent clientX]):
1056         (-[DOMMouseEvent clientY]):
1057         (-[DOMMouseEvent ctrlKey]):
1058         (-[DOMMouseEvent shiftKey]):
1059         (-[DOMMouseEvent altKey]):
1060         (-[DOMMouseEvent metaKey]):
1061         (-[DOMMouseEvent button]):
1062         (-[DOMMouseEvent relatedTarget]):
1063         (-[DOMMouseEvent initMouseEvent:::::::::::::::]):
1064         (-[DOMMutationEvent relatedNode]):
1065         (-[DOMMutationEvent prevValue]):
1066         (-[DOMMutationEvent newValue]):
1067         (-[DOMMutationEvent attrName]):
1068         (-[DOMMutationEvent attrChange]):
1069         (-[DOMMutationEvent initMutationEvent::::::::]):
1070         (-[DOMUIEvent view]):
1071         (-[DOMUIEvent detail]):
1072         (-[DOMUIEvent initUIEvent:::::]):
1073         (-[DOMDocument createEvent:]):
1074         * kwq/DOMHTML.mm:
1075         (-[DOMHTMLElement innerHTML]): implemented
1076         (-[DOMHTMLElement setInnerHTML:]): implemented
1077         (-[DOMHTMLElement innerText]): implemented
1078         (-[DOMHTMLElement setInnerText:]): implemented
1079         (-[DOMHTMLElement children]): implemented
1080         (-[DOMHTMLElement contentEditable]): implemented
1081         (-[DOMHTMLElement setContentEditable:]): implemented
1082         (-[DOMHTMLElement isContentEditable]): implemented
1083
1084 2004-04-27  David Hyatt  <hyatt@apple.com>
1085
1086         Implement sharing of similar style objects. Cuts the # of style objects allocated on the PLT by more
1087         than half.
1088         
1089         Reviewed by kocienda
1090
1091         * khtml/css/cssstyleselector.cpp:
1092         (khtml::CSSStyleSelector::initElementAndPseudoState):
1093         (khtml::CSSStyleSelector::initForStyleResolve):
1094         (khtml::cleanpath):
1095         (khtml::checkPseudoState):
1096         (khtml::CSSStyleSelector::locateSiblingList):
1097         (khtml::CSSStyleSelector::canShareStyleWithElement):
1098         (khtml::CSSStyleSelector::locateSharedStyle):
1099         (khtml::CSSStyleSelector::styleForElement):
1100         (khtml::CSSStyleSelector::pseudoStyleForElement):
1101         (khtml::CSSStyleSelector::checkOneSelector):
1102         * khtml/css/cssstyleselector.h:
1103         * khtml/css/html4.css:
1104         * khtml/css/parser.cpp:
1105         * khtml/css/parser.y:
1106         * khtml/html/html_baseimpl.cpp:
1107         (HTMLBodyElementImpl::mapToEntry):
1108         (HTMLIFrameElementImpl::mapToEntry):
1109         * khtml/html/html_baseimpl.h:
1110         * khtml/html/html_blockimpl.cpp:
1111         (HTMLDivElementImpl::mapToEntry):
1112         (HTMLHRElementImpl::mapToEntry):
1113         (HTMLParagraphElementImpl::mapToEntry):
1114         (HTMLMarqueeElementImpl::mapToEntry):
1115         * khtml/html/html_blockimpl.h:
1116         * khtml/html/html_elementimpl.cpp:
1117         (HTMLNamedAttrMapImpl::declCount):
1118         (HTMLNamedAttrMapImpl::mapsEquivalent):
1119         (HTMLElementImpl::attributeChanged):
1120         (HTMLElementImpl::mapToEntry):
1121         * khtml/html/html_elementimpl.h:
1122         (DOM::HTMLElementImpl::isMappedAttribute):
1123         * khtml/html/html_formimpl.cpp:
1124         (HTMLInputElementImpl::mapToEntry):
1125         * khtml/html/html_formimpl.h:
1126         * khtml/html/html_imageimpl.cpp:
1127         (HTMLImageElementImpl::mapToEntry):
1128         * khtml/html/html_imageimpl.h:
1129         * khtml/html/html_inlineimpl.cpp:
1130         (HTMLBRElementImpl::mapToEntry):
1131         (HTMLFontElementImpl::mapToEntry):
1132         * khtml/html/html_inlineimpl.h:
1133         * khtml/html/html_listimpl.cpp:
1134         (HTMLUListElementImpl::mapToEntry):
1135         (HTMLOListElementImpl::mapToEntry):
1136         (HTMLLIElementImpl::mapToEntry):
1137         * khtml/html/html_listimpl.h:
1138         * khtml/html/html_objectimpl.cpp:
1139         (HTMLAppletElementImpl::mapToEntry):
1140         (HTMLEmbedElementImpl::mapToEntry):
1141         (HTMLObjectElementImpl::mapToEntry):
1142         * khtml/html/html_objectimpl.h:
1143         * khtml/html/html_tableimpl.cpp:
1144         (HTMLTableElementImpl::mapToEntry):
1145         (HTMLTablePartElementImpl::mapToEntry):
1146         (HTMLTableCellElementImpl::mapToEntry):
1147         (HTMLTableColElementImpl::mapToEntry):
1148         (HTMLTableCaptionElementImpl::mapToEntry):
1149         * khtml/html/html_tableimpl.h:
1150         * khtml/rendering/render_object.cpp:
1151         (RenderObject::setStyle):
1152         * khtml/rendering/render_style.cpp:
1153         (m_affectedByAttributeSelectors):
1154         (RenderStyle::RenderStyle):
1155         * khtml/rendering/render_style.h:
1156         (khtml::):
1157         (khtml::RenderStyle::pseudoState):
1158         (khtml::RenderStyle::setPseudoState):
1159         (khtml::RenderStyle::affectedByAttributeSelectors):
1160         (khtml::RenderStyle::setAffectedByAttributeSelectors):
1161         * khtml/xml/dom_docimpl.cpp:
1162         (DocumentImpl::DocumentImpl):
1163         * khtml/xml/dom_docimpl.h:
1164         (DOM::DocumentImpl::usesSiblingRules):
1165         (DOM::DocumentImpl::setUsesSiblingRules):
1166
1167 2004-04-28  Darin Adler  <darin@apple.com>
1168
1169         Reviewed by Chris.
1170
1171         - another step of refinement on the reinterpret_cast stuff; now it's a compile-time
1172           error if you do it wrong
1173         - fixed a couple of storage leaks
1174
1175         * kwq/DOMInternal.h: Added new DOM_cast template function. Like reinterpret_cast, but a
1176         compile-time error if you use it with the wrong parameters. Also added type-safe versions
1177         of the wrapper functions that do the DOM_cast automatically.
1178         * kwq/DOMInternal.mm:
1179         (getDOMWrapperImpl): Changed name and parameter type as part of above change.
1180         (addDOMWrapperImpl): Ditto.
1181         (removeDOMWrapper): Ditto.
1182
1183         * kwq/DOM.mm: Use the new DOM_cast instead of reinterpret_cast, and the new
1184         DOM wrapper calls that do the cast automatically.
1185         * kwq/DOM-CSS.mm: More of the same.
1186         (-[DOMCSSStyleSheet dealloc]): Added override to deref, fixes leak.
1187         * kwq/DOMHTML.mm: More of the same.
1188         (-[DOMHTMLCollection dealloc]): Added override to deref, fixes leak.
1189         (-[DOMHTMLOptionsCollection dealloc]): Added override to deref, fixes theoretical leak.
1190
1191 2004-04-28  Darin Adler  <darin@apple.com>
1192
1193         Reviewed by Chris.
1194
1195         - fixed reinterpret_cast mistakes and some style issues in DOM implementation
1196
1197         * kwq/DOM-CSS.mm:
1198         (-[DOMCSSStyleRule _styleRuleImpl]): Fix broken reinterpret_cast; you must reinterpret_cast back
1199         to the class you reinterpret_casted from, not to a derived class.
1200         (-[DOMCSSMediaRule _mediaRuleImpl]): Ditto.
1201         (-[DOMCSSFontFaceRule _fontFaceRuleImpl]): Ditto.
1202         (-[DOMCSSPageRule _pageRuleImpl]): Ditto.
1203         (-[DOMCSSImportRule _importRuleImpl]): Ditto.
1204         (-[DOMCSSCharsetRule _importRuleImpl]): Ditto.
1205         * kwq/DOMHTML.mm:
1206         (-[DOMHTMLOptionsCollection length]): Put in an "unimplemented" version instead of leaving out
1207         the class implementation altogether.
1208         (-[DOMHTMLOptionsCollection setLength:]): Ditto.
1209         (-[DOMHTMLOptionsCollection item:]): Ditto.
1210         (-[DOMHTMLOptionsCollection namedItem:]): Ditto.
1211         (+[DOMHTMLElement _elementWithImpl:]): Corrected this implementation. The wrapper must use a
1212         standard node wrapper, since this is a subclass of DOMNode. Also moved into a separate category
1213         so it gets checked against the declarations above.
1214         (-[DOMHTMLElement _HTMLElementImpl]): Fix broken reinterpret_cast.
1215         (-[DOMHTMLHtmlElement _HTMLHtmlElementImpl]): Ditto.
1216         (-[DOMHTMLHeadElement _headElementImpl]): Ditto.
1217         (-[DOMHTMLLinkElement _linkElementImpl]): Ditto.
1218         (-[DOMHTMLTitleElement _titleElementImpl]): Ditto.
1219         (-[DOMHTMLMetaElement _metaElementImpl]): Ditto.
1220         (-[DOMHTMLBaseElement _baseElementImpl]): Ditto.
1221         (-[DOMHTMLStyleElement _styleElementImpl]): Ditto.
1222         (-[DOMHTMLBodyElement _bodyElementImpl]): Ditto.
1223         (-[DOMHTMLFormElement _formElementImpl]): Ditto.
1224         (+[DOMHTMLFormElement _formElementWithImpl:]): Another DOMNode subclass wrapper fix.
1225         (-[DOMHTMLIsIndexElement _isIndexElementImpl]): Fix broken reinterpret_cast.
1226         (-[DOMHTMLSelectElement _selectElementImpl]): Ditto.
1227         (-[DOMHTMLOptGroupElement _optGroupElementImpl]): Ditto.
1228         (-[DOMHTMLOptionElement _optionElementImpl]): Ditto.
1229         (-[DOMHTMLInputElement _inputElementImpl]): Ditto.
1230         (-[DOMHTMLTextAreaElement _textAreaElementImpl]): Ditto.
1231         (-[DOMHTMLButtonElement _buttonElementImpl]): Ditto.
1232         (-[DOMHTMLLabelElement _labelElementImpl]): Ditto.
1233         (-[DOMHTMLFieldSetElement _fieldSetElementImpl]): Ditto.
1234         (-[DOMHTMLLegendElement _legendElementImpl]): Ditto.
1235         (-[DOMHTMLUListElement _uListElementImpl]): Ditto.
1236         (-[DOMHTMLOListElement _oListElementImpl]): Ditto.
1237         (-[DOMHTMLDListElement _dListElementImpl]): Ditto.
1238         (-[DOMHTMLDirectoryElement _directoryListElementImpl]): Ditto.
1239         (-[DOMHTMLMenuElement _menuListElementImpl]): Ditto.
1240         (-[DOMHTMLLIElement _liElementImpl]): Ditto.
1241         (-[DOMHTMLQuoteElement _quoteElementImpl]): Ditto.
1242         (-[DOMHTMLDivElement _divElementImpl]): Ditto.
1243         (-[DOMHTMLParagraphElement _paragraphElementImpl]): Ditto.
1244         (-[DOMHTMLHeadingElement _headingElementImpl]): Ditto.
1245         (-[DOMHTMLPreElement _preElementImpl]): Ditto.
1246         (-[DOMHTMLBRElement _BRElementImpl]): Ditto.
1247         (-[DOMHTMLBaseFontElement _baseFontElementImpl]): Ditto.
1248         (-[DOMHTMLFontElement _fontElementImpl]): Ditto.
1249         (-[DOMHTMLHRElement _HRElementImpl]): Ditto.
1250         (-[DOMHTMLModElement _modElementImpl]): Ditto.
1251         (-[DOMHTMLAnchorElement _anchorElementImpl]): Ditto.
1252         (-[DOMHTMLImageElement _imageElementImpl]): Ditto.
1253         (-[DOMHTMLObjectElement _objectElementImpl]): Ditto.
1254         (-[DOMHTMLParamElement _paramElementImpl]): Ditto.
1255         (-[DOMHTMLAppletElement _appletElementImpl]): Ditto.
1256         (-[DOMHTMLMapElement _mapElementImpl]): Ditto.
1257         (-[DOMHTMLAreaElement _areaElementImpl]): Ditto.
1258         (-[DOMHTMLScriptElement _scriptElementImpl]): Ditto.
1259         (+[DOMHTMLTableCaptionElement _tableCaptionElementWithImpl:]): Another DOMNode subclass wrapper fix.
1260         (-[DOMHTMLTableCaptionElement _tableCaptionElementImpl]): Fix broken reinterpret_cast.
1261         (+[DOMHTMLTableSectionElement _tableSectionElementWithImpl:]): Another DOMNode subclass wrapper fix.
1262         (-[DOMHTMLTableSectionElement _tableSectionElementImpl]): Fix broken reinterpret_cast.
1263         (+[DOMHTMLTableElement _tableElementWithImpl:]): Another DOMNode subclass wrapper fix.
1264         (-[DOMHTMLTableElement _tableElementImpl]): Fix broken reinterpret_cast.
1265         (-[DOMHTMLTableColElement _tableColElementImpl]): Ditto.
1266         (-[DOMHTMLTableRowElement _tableRowElementImpl]): Ditto.
1267         (+[DOMHTMLTableCellElement _tableCellElementWithImpl:]): Another DOMNode subclass wrapper fix.
1268         (-[DOMHTMLTableCellElement _tableCellElementImpl]): Fix broken reinterpret_cast.
1269         (-[DOMHTMLFrameSetElement _frameSetElementImpl]): Ditto.
1270         (-[DOMHTMLFrameElement _frameElementImpl]): Ditto.
1271         (-[DOMHTMLIFrameElement _IFrameElementImpl]): Ditto.
1272         (-[DOMHTMLEmbedElement _embedElementImpl]): Ditto.
1273
1274         * kwq/HTMLDOM.mm: Removed.
1275
1276 2004-04-28  Ken Kocienda  <kocienda@apple.com>
1277
1278         Reviewed by Darin
1279
1280         * khtml/khtml_part.cpp:
1281         (KHTMLPart::notifySelectionChanged): Call new postDidChangeSelectionNotification function
1282         to send Cocoa notification when the selection changes.
1283         (KHTMLPart::appliedEditing): Call postDidChangeNotification to send Cocoa notification when the document changes
1284         due to editing.
1285         (KHTMLPart::unappliedEditing): Ditto.
1286         (KHTMLPart::reappliedEditing): Ditto.
1287         * kwq/DOMHTML.mm:
1288         (-[DOMHTMLDocument _HTMLDocumentImpl]): Fix cast to account for multiple inheritance used by the impl class.
1289         * kwq/KWQKHTMLPart.h:
1290         * kwq/KWQKHTMLPart.mm:
1291         (KWQKHTMLPart::postDidChangeSelectionNotification): New function. Call the bridge to post the notification.
1292         (KWQKHTMLPart::postDidChangeNotification): Ditto.
1293         * kwq/WebCoreBridge.h: Declare new -postDidChangeSelectionNotification and -postDidChangeNotification methods.
1294
1295 2004-04-28  Darin Adler  <darin@apple.com>
1296
1297         Reviewed by Ken.
1298
1299         - fixed <rdar://problem/3636261>: "nil-deref in selectedStylesheetSet iterating through properties in a non-view document"
1300
1301         * khtml/xml/dom_docimpl.cpp:
1302         (DocumentImpl::selectedStylesheetSet): Add nil check.
1303         (DocumentImpl::setSelectedStylesheetSet): Ditto.
1304
1305 2004-04-27  Richard Williamson   <rjw@apple.com>
1306
1307         <rdar://problem/3564519>: API: please add a way to set the media type for a WebView
1308
1309         Reviewed by Chris.
1310
1311         * khtml/khtmlview.cpp:
1312         (KHTMLView::mediaType):
1313         * kwq/KWQKHTMLPart.h:
1314         * kwq/KWQKHTMLPart.mm:
1315         (KWQKHTMLPart::overrideMediaType):
1316         * kwq/WebCoreBridge.h:
1317
1318 2004-04-27  Ken Kocienda  <kocienda@apple.com>
1319
1320         Reviewed by Hyatt
1321         
1322         Make selections draw in a more Cocoa-like way, where
1323         fully-selected lines draw out to the ends of lines, and
1324         spaces between lines are drawn with the selection color as well.
1325
1326         * WebCore-combined.exp: Add _WebCoreInitializeEmptyTextGeometry symbol
1327         * WebCore.exp: Ditto.
1328         * khtml/khtml_part.cpp:
1329         (KHTMLPart::isPointInsideSelection): Marginally-related change. Fix up this function
1330         so that it works right, given my recent changes to positionForCoordinates. This fix
1331         "really" fixes the problem. Unlike my attempt to fix yesterday.
1332         * khtml/rendering/font.cpp:
1333         (Font::drawHighlightForText): New drawHighlightForText interface which includes extra
1334         information to draw the selection.
1335         * khtml/rendering/font.h: Ditto.
1336         * khtml/rendering/render_block.cpp:
1337         (khtml::RenderBlock::positionForCoordinates): Some minor improvements and cleanups to
1338         make this code work correctly in more cases.
1339         * khtml/rendering/render_block.h: Remove spurious semi-colon after namespace block.
1340         * khtml/rendering/render_container.cpp:
1341         (RenderContainer::positionForCoordinates): Fix typo in comment. Also, clean up
1342         one unnecessary call to absolutePosition.
1343         * khtml/rendering/render_image.cpp:
1344         (RenderImage::paint): Many changes to add the new selection drawing behavior.
1345         * khtml/rendering/render_inline.cpp:
1346         (RenderInline::positionForCoordinates): Added to help make selections work right 
1347         with continuations.
1348         * khtml/rendering/render_inline.h: Ditto.
1349         * khtml/rendering/render_object.h: Give zero default argument to inlineBox() helper.
1350         * khtml/rendering/render_text.cpp:
1351         (InlineTextBox::paintSelection): Many changes to add the new selection drawing behavior.
1352         * kwq/KWQListBox.mm:
1353         (-[KWQTableView drawRow:clipRect:]): Use new WebCoreTextGeometry struct.
1354         * kwq/KWQPainter.h: New drawHighlightForText interface which includes extra
1355         information to draw the selection.
1356         * kwq/KWQPainter.mm:
1357         (QPainter::drawText): Use new WebCoreInitializeEmptyTextGeometry struct.
1358         (QPainter::drawHighlightForText): Use new WebCoreTextGeometry struct.
1359         * kwq/WebCoreTextRenderer.h: Declare new WebCoreTextGeometry struct.
1360         * kwq/WebCoreTextRendererFactory.m:
1361         (WebCoreInitializeEmptyTextGeometry): Initializer for WebCoreTextGeometry struct.
1362
1363 2004-04-27  Richard Williamson   <rjw@apple.com>
1364
1365         Don't do unnecessary string comparisons when no composite operator is
1366         specified.  
1367
1368         Reviewed by Hyatt.
1369
1370         * kwq/KWQPainter.mm:
1371         (compositeOperatorFromString):
1372
1373 2004-04-27  Darin Adler  <darin@apple.com>
1374
1375         Reviewed by Ken.
1376
1377         - fixed <rdar://problem/3623694>: "top level <option> and <optgroup> labels look identical in pop-up menus; should not"
1378
1379         * khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
1380         Call appendGroupLabel instead of appendItem for group labels.
1381
1382         * kwq/KWQComboBox.h: Added appendGroupLabel, private setControlSize, labelFont, setTitle, _labelFont,
1383         and make _items a QValueList<KWQListBoxItem> instead of QStringList.
1384         * kwq/KWQComboBox.mm:
1385         (QComboBox::QComboBox): Initializes _labelFont to nil.
1386         (QComboBox::~QComboBox): Release _labelFont.
1387         (QComboBox::setTitle): Added helper function. Uses an attributed string for group labels, and also sets
1388         the action to NULL so they are disabled.
1389         (QComboBox::appendItem): Added isLabel boolean parameter, make KWQListBoxItem, call setTitle.
1390         (QComboBox::sizeHint): Changed to handle group labels with a separate renderer to measure bolded text.
1391         (QComboBox::setCurrentItem): Changed to use setTitle helper.
1392         (QComboBox::setFont): Release _labelFont if control size changed.
1393         (QComboBox::labelFont): Compute label font lazily.
1394         (QComboBox::populateMenu): Changed to use setTitle helper.
1395
1396         * kwq/KWQListBox.h: Removed excess includes, fixed comment.
1397
1398 2004-04-26  Darin Adler  <darin@apple.com>
1399
1400         Reviewed by Maciej.
1401
1402         - follow-on to fix for <rdar://problem/3488892>: "anchor names with non-ASCII characters in them do not work"
1403         This part fixes anchor names with non-ASCII characters in local files.
1404
1405         * kwq/KWQKURL.mm: (KURL::KURL): For file and help URLs, force UTF-8 only for the path part of the URL.
1406         Use the document encoding for the rest of the URL.
1407         * kwq/KWQTextCodec.h: (operator!=): Added.
1408
1409 2004-04-26  David Hyatt  <hyatt@apple.com>
1410
1411         Fix for Emerson truncation problem using apple-line-clamp.  Always dirty positioned objects so that they
1412         will move when the height changes.
1413         
1414         Reviewed by darin
1415
1416         * khtml/rendering/render_block.cpp:
1417         (khtml::RenderBlock::markPositionedObjectsForLayout):
1418         * khtml/rendering/render_block.h:
1419         * khtml/rendering/render_flexbox.cpp:
1420         (khtml::RenderFlexibleBox::layoutVerticalBox):
1421
1422 2004-04-26  Richard Williamson   <rjw@apple.com>
1423
1424         Added support for specifying composite operation on an
1425         image element.  Attribute name is "composite", possible values
1426         are:
1427
1428         clear,
1429         copy
1430         source-over
1431         source-in
1432         source-out
1433         source-atop
1434         destination-over
1435         destination-in
1436         destination-out
1437         destination-atop
1438         xor
1439         darker
1440         highlight
1441         lighter
1442
1443         <img composite="source-over" src="triangle.png">
1444         <img style="position:relative; left:-200px;" composite="destination-in" src="circle.png">
1445
1446         Reviewed by Ken.
1447
1448         * khtml/html/html_imageimpl.cpp:
1449         (HTMLImageElementImpl::parseHTMLAttribute):
1450         * khtml/html/html_imageimpl.h:
1451         (DOM::HTMLImageElementImpl::compositeOperator):
1452         * khtml/misc/htmlattrs.c:
1453         (findAttr):
1454         * khtml/misc/htmlattrs.h:
1455         * khtml/misc/htmlattrs.in:
1456         * khtml/rendering/render_image.cpp:
1457         (RenderImage::paint):
1458         * kwq/KWQPainter.h:
1459         * kwq/KWQPainter.mm:
1460         (compositeOperatorFromString):
1461         (QPainter::drawPixmap):
1462         * kwq/WebCoreImageRenderer.h:
1463
1464 2004-04-26  Darin Adler  <darin@apple.com>
1465
1466         - fixed <rdar://problem/3634145>: "REGRESSION: nil-deref in QTextCodec::toUnicode every time loading page at wiki.wordpress.org"
1467
1468         * kwq/KWQKURL.mm:
1469         (KURL::KURL): Simplify check for nil that defaults to UTF-8.
1470         (KURL::decode_string): Add a similar test here.
1471
1472 2004-04-26  David Hyatt  <hyatt@apple.com>
1473
1474         Implement the quirk that makes the <body> and <html> size to fill the viewport in quirks mode.  This
1475         matches WinIE.
1476         
1477         Reviewed by john
1478
1479         * khtml/rendering/render_box.cpp:
1480         (RenderBox::calcHeight):
1481
1482 2004-04-26  Ken Kocienda  <kocienda@apple.com>
1483
1484         Reviewed by John
1485         
1486         Fix for this bug:
1487         
1488         <rdar://problem/3633458>: "REGRESSION (125-137): Can't drag a selection unless it starts at beginning of line"
1489
1490         * khtml/khtml_part.cpp:
1491         (KHTMLPart::isPointInsideSelection): I flubbed when I converted this
1492         code to use my new positionForCoordinates helper. I failed to add in
1493         the passed in values for x and y to the absolute coordinates for the
1494         clicked node. So, the "unless it starts at beginning of line" behavior 
1495         is exactly as one would expect.
1496
1497 2004-04-25  David Hyatt  <hyatt@apple.com>
1498
1499         Eliminate overhangingContents.  This concept was redundant with the overflowHeight mechanism that I
1500         implemented some time ago, and in fact, it causes us to grovel through much more of the render tree
1501         than we should when painting.  It turns out that none of the places that used this boolean needed
1502         to any longer, and so the entire implementation can now be removed from the tree.
1503         
1504         Reviewed by mjs, darin
1505
1506         * khtml/rendering/render_block.cpp:
1507         (khtml::RenderBlock::addChildToFlow):
1508         (khtml::RenderBlock::layoutBlock):
1509         (khtml::RenderBlock::paint):
1510         (khtml::RenderBlock::insertPositionedObject):
1511         * khtml/rendering/render_box.cpp:
1512         (RenderBox::calcHeight):
1513         * khtml/rendering/render_image.cpp:
1514         (RenderImage::setStyle):
1515         * khtml/rendering/render_inline.cpp:
1516         (RenderInline::addChildToFlow):
1517         * khtml/rendering/render_object.cpp:
1518         (RenderObject::RenderObject):
1519         (RenderObject::containingBlock):
1520         (RenderObject::information):
1521         (RenderObject::dump):
1522         (RenderObject::nodeAtPoint):
1523         * khtml/rendering/render_object.h:
1524         (khtml::RenderObject::minMaxKnown):
1525         * khtml/rendering/render_table.cpp:
1526         (RenderTable::layout):
1527         (RenderTable::paint):
1528         (RenderTableCell::paint):
1529
1530 2004-04-23  David Hyatt  <hyatt@apple.com>
1531
1532         Fix for 3258403, implement support for min-height and max-height on normal flow elements.  With this patch the
1533         only min-height/max-height work that remains to be done is for table cells and positioned elements.
1534         
1535         Reviewed by darin
1536
1537         * khtml/rendering/render_box.cpp:
1538         (RenderBox::calcHeight):
1539         (RenderBox::calcHeightUsing):
1540         (RenderBox::calcPercentageHeight):
1541         * khtml/rendering/render_box.h:
1542         * layout-tests/fast/block/basic/minheight-expected.txt: Added.
1543         * layout-tests/fast/block/basic/minheight.html: Added.
1544
1545 2004-04-25  Darin Adler  <darin@apple.com>
1546
1547         Reviewed by Dave.
1548
1549         - fixed <rdar://problem/3633091>: "add overrideMimeType function to XMLHttpRequest"
1550
1551         * khtml/ecma/xmlhttprequest.cpp:
1552         (KJS::XMLHttpRequest::getValueProperty): Add logic to override MIME type if
1553         OverrideMIMEType was called.
1554         (KJS::XMLHttpRequestProtoFunc::tryCall): Store the MIME type when overrideMimeType is called.
1555         * khtml/ecma/xmlhttprequest.h: Add OverrideMIMEType to the XMLHttpRequest property enum,
1556         and also add a MIMETypeOverride data member to the class.
1557         * khtml/ecma/xmlhttprequest.lut.h: Regenerated.
1558
1559 2004-04-25  Maciej Stachowiak  <mjs@apple.com>
1560
1561         Reviewed by Darin.
1562
1563         <rdar://problem/3628309>: Fedex tracking page so slow it seems like a hang (site change?)
1564         <rdar://problem/3608061>: "ATI Developer site so slow it seems like a hang"
1565         <rdar://problem/3612130>: "Reproducible hang in JavaScript at www.tfl.gov.uk"
1566         <rdar://problem/3626022>: "Safari was consuming > 100% CPU on dual-G5 Mac, sample shows JavaScript"
1567         <rdar://problem/3632348>: "www.whatis.com search for "pivot table" leads to JavaScript hang"
1568         
1569         * khtml/ecma/kjs_html.cpp:
1570         (KJS::HTMLElement::getValueProperty): The "text" property for anchors should be
1571         innerText, not innerHTML.
1572         * khtml/html/html_elementimpl.cpp:
1573         (HTMLElementImpl::innerText): Make sure not to include all the text after an
1574         element if it has no children.
1575         * layout-tests/fast/dom/anchor-text-expected.txt: Added.
1576         * layout-tests/fast/dom/anchor-text.html: Added.
1577         * layout-tests/fast/dom/inner-text-expected.txt: Added.
1578         * layout-tests/fast/dom/inner-text.html: Added.
1579
1580 2004-04-24  Darin Adler  <darin@apple.com>
1581
1582         Reviewed by Dave.
1583
1584         - fixed <rdar://problem/3488892>: "anchor names with non-ASCII characters in them do not work"
1585
1586         * khtml/khtml_part.h: Add new gotoAnchor helper function, private.
1587         * khtml/khtml_part.cpp:
1588         (KHTMLPart::openURL): Call new gotoAnchor helper, since the code is now complex enough
1589         that I don't want to copy and paste.
1590         (KHTMLPart::gotoAnchor): Use the pages own encoding when decoding the string for an
1591         anchor reference when going to an anchor. This matches the behavior of other browsers.
1592         (KHTMLPart::slotFinishedParsing): Call new gotoAnchor helper.
1593         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scrollToAnchor): Call new gotoAnchor helper.
1594
1595         * kwq/KWQKURL.h: Removed htmlRef function, and made encodedHtmlRef an inline.
1596         Removed unused encoding hint parameter from setQuery (it's not a "hint" at all, but we
1597         don't use it). Added a codec parameter to decode_string.
1598         * kwq/KWQKURL.mm:
1599         (hexDigitValue): Added. Helper function.
1600         (KURL::setQuery): Removed unused parameter.
1601         (KURL::decode_string): Implemented this function. It needs to use an encoding specified
1602         by the web page. Also, we wanted to make a version that did not use the
1603         CFURLCreateStringByReplacingPercentEscapes function anyway.
1604
1605         * kwq/KWQString.h: Added parameters to copyLatin1. Now you can copy an arbitrary substring.
1606         * kwq/KWQString.mm: (QString::copyLatin1): Updated implementation to handle the two
1607         new parameters.
1608
1609         * WebCore-tests.exp: Updated for change in signature of setQuery and decode_string.
1610         * WebCore-combined.exp: Regenerated.
1611
1612 2004-04-24  Darin Adler  <darin@apple.com>
1613
1614         - fixed <rdar://problem/3570953>: "Update "Acknowledgements" to remove expat and possibly include libxml"
1615
1616         * WebCore.pbproj/project.pbxproj: Removed the part of the copyright notice that was for expat contributors.
1617
1618 2004-04-23  David Hyatt  <hyatt@apple.com>
1619
1620         Fix the apple-line-clamp values to more closely match what is needed, an even split of the max lines between the possible
1621         values.
1622
1623         * khtml/rendering/render_flexbox.cpp:
1624         (khtml::RenderFlexibleBox::layoutVerticalBox):
1625
1626 2004-04-23  David Hyatt  <hyatt@apple.com>
1627
1628         Fix to make the containing block percentage height calculation actually work according to the CSS2 spec.
1629         Percentages other than 100% are now supported, and flexing percentage height blocks inside table cells
1630         are now supported.
1631
1632         Reviewed by kocienda
1633
1634         * khtml/rendering/render_box.cpp:
1635         (RenderBox::calcHeight):
1636         (RenderBox::calcPercentageHeight):
1637         * khtml/rendering/render_box.h:
1638
1639 2004-04-23  Ken Kocienda  <kocienda@apple.com>
1640
1641         Reviewed by John
1642
1643         Fix for this bug:
1644         <rdar://problem/3632163>: "REGRESSSION: crash on css home page"
1645
1646         * khtml/rendering/render_block.cpp:
1647         (khtml::RenderBlock::positionForRenderer): Add null check.
1648
1649 2004-04-20  David Hyatt  <hyatt@apple.com>
1650
1651         Fix hiermenu opacity bug.  Make sure to save/restore the graphics state before pushing and popping
1652         transparency layers, so that alterations to alpha don't accidentally persist.
1653         
1654         Reviewed by kocienda
1655
1656         * kwq/KWQPainter.mm:
1657         (QPainter::beginTransparencyLayer):
1658         (QPainter::endTransparencyLayer):
1659
1660 2004-04-20  David Hyatt  <hyatt@apple.com>
1661
1662         Fix for 3622818, bad rendering on sabernomics.com.  Just eliminate the priority difference between
1663         4 and 5, and make all of the priority 4 tags the same.  This seems to match other browsers.
1664         
1665         Reviewed by kocienda
1666
1667         * khtml/html/dtd.cpp:
1668
1669 2004-04-23  Ken Kocienda  <kocienda@apple.com>
1670
1671         Reviewed by Darin
1672
1673         Changed inlineBoxForRenderer(RenderObject *, int) helper that was static 
1674         in dom_position.cpp into a virtual method on RenderObjects. Function is
1675         now called inlineBox(int). Functionality unchanged.
1676
1677         * khtml/rendering/render_br.cpp:
1678         (RenderBR::inlineBox)
1679         * khtml/rendering/render_br.h:
1680         * khtml/rendering/render_object.cpp:
1681         (RenderObject::caretMaxRenderedOffset)
1682         (RenderObject::inlineBox)
1683         * khtml/rendering/render_object.h:
1684         * khtml/rendering/render_text.cpp:
1685         (RenderText::inlineBox)
1686         * khtml/rendering/render_text.h:
1687         * khtml/xml/dom_position.cpp:
1688         (DOM::renderersOnDifferentLine):
1689         (DOM::nextRenderedEditable)
1690         (DOM::previousRenderedEditable)
1691         (DOM::Position::previousLinePosition)
1692         (DOM::Position::nextLinePosition)
1693         (DOM::Position::rendersInDifferentPosition)
1694
1695 2004-04-23  Ken Kocienda  <kocienda@apple.com>
1696
1697         Reviewed by Darin
1698
1699         * khtml/editing/htmlediting_impl.cpp:
1700         (DeleteSelectionCommandImpl::doApply): Fix editing test
1701         regression with deleting whitespace at the end of the line.
1702         I just made this "improvement" yesterday, and the concept
1703         of the change is a good one, but instead of short-circuiting
1704         if the selection after deleting collapsible whitespace is a
1705         range (which can be confused by "significant" collapsed 
1706         whitespace at the end of a line), short-circuit if the 
1707         upstream start position equals the downstream end position.
1708
1709 === Safari-138 ===
1710
1711 2004-04-23  Ken Kocienda  <kocienda@apple.com>
1712
1713         Reviewed by John
1714
1715         Added some plumbing for applying styles.
1716
1717         * khtml/xml/dom_docimpl.cpp:
1718         (DocumentImpl::createCSSStyleDeclaration): New factory method.
1719         * khtml/xml/dom_docimpl.h: Declare the above.
1720         * kwq/DOM-CSS.mm:
1721         (-[DOMCSSStyleDeclaration _styleDeclarationImpl]): Expose this in the
1722         WebCoreInternal category, "promoting" it from being private to the 
1723         DOM-CSS.mm file.
1724         * kwq/DOM.mm: Add -(DOMCSSStyleDeclaration *)createCSSStyleDeclaration extension.
1725         * kwq/DOMExtensions.h: Delcare the above.
1726         * kwq/DOMInternal.h: Add _styleDeclarationImpl to WebCoreInternal category.
1727
1728 2004-04-23  John Sullivan  <sullivan@apple.com>
1729
1730         - fixed <rdar://problem/3631541>: "repro crash in KHTMLPart::setFocusNodeIfNeeded"
1731
1732         Reviewed by Maciej.
1733
1734         * khtml/khtml_part.cpp:
1735         (KHTMLPart::setFocusNodeIfNeeded):
1736         added nil check
1737
1738 2004-04-23  Maciej Stachowiak  <mjs@apple.com>
1739
1740         Back out one of the previous changes, it causes a crash. Whoops!
1741         
1742         * kwq/KWQScrollView.mm:
1743         (QScrollView::addChild):
1744
1745 2004-04-23  Maciej Stachowiak  <mjs@apple.com>
1746
1747         Reviewed by Dave.
1748
1749         These two tiny changes (made w/ Dave's help) should get us about
1750         1% or so combined on the HTML iBench.
1751
1752         * khtml/rendering/render_br.cpp:
1753         (RenderBR::setStyle): Don't call superclass setStyle, since
1754         according to Dave we don't need any of the work done in there.
1755         * kwq/KWQScrollView.mm:
1756         (QScrollView::addChild): Don't actually move the widget if the x
1757         coordinate is -500000, since we don't need the initial offscreen
1758         positioning that KHTML does and it is costly to do.
1759
1760 2004-04-22  Ken Kocienda  <kocienda@apple.com>
1761
1762         Reviewed by Hyatt
1763
1764         * khtml/editing/htmlediting_impl.cpp:
1765         (DeleteSelectionCommandImpl::doApply): Short-circuit return if the selection
1766         is not a range after collapsing whitespace.
1767
1768 2004-04-22  Ken Kocienda  <kocienda@apple.com>
1769
1770         Reviewed by Hyatt
1771
1772         More work to bring code up to date with the latest API proposal.
1773
1774         * khtml/xml/dom_selection.h: Fix typo in comment.
1775         * kwq/WebCoreBridge.h: -applyStyle:toElementsInDOMRange: is now applyStyle:
1776         * kwq/WebCoreBridge.mm:
1777         (-[WebCoreBridge applyStyle:]): Ditto.
1778
1779 2004-04-22  Ken Kocienda  <kocienda@apple.com>
1780
1781         Reviewed by John
1782
1783         Adds the notion of selection affinity to the editing API, bringing it up to
1784         date with the latest proposal.
1785
1786         * khtml/xml/dom_selection.cpp:
1787         (DOM::Selection::Selection): Adds support for selection affinity member variable.
1788         (DOM::Selection::init): Ditto.
1789         (DOM::Selection::operator=): Ditto.
1790         (DOM::Selection::setAffinity): New function.
1791         (DOM::Selection::layoutCaret): Added comment to indicate that we need to enhance this
1792         function to handle selection affinity.
1793         * khtml/xml/dom_selection.h: Added EAffinity enum and m_affinity member variable.
1794         (DOM::Selection::): Moved the enums above the constructors. No code change.
1795         (DOM::Selection::affinity): New accessor.
1796         * kwq/WebCoreBridge.h:
1797         * kwq/WebCoreBridge.mm: Add selection affinity to API declarations as needed.
1798         (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
1799         (-[WebCoreBridge selectedDOMRange]): Ditto.
1800         (-[WebCoreBridge selectionAffinity]): Ditto.
1801
1802 2004-04-21  Maciej Stachowiak  <mjs@apple.com>
1803
1804         Reviewed by Darin.
1805
1806         Preliminary change for conservative GC. Use new "protected"
1807         subclasses to GC-protect objects when on heap, since we will soon
1808         remove the built-in refcounting of the normal wrapper classes.
1809         
1810         * ForwardingHeaders/kjs/protect.h: Added.
1811         * khtml/ecma/kjs_binding.h:
1812         * khtml/ecma/kjs_events.h:
1813         * khtml/ecma/kjs_traversal.h:
1814         * khtml/ecma/kjs_window.h:
1815
1816 2004-04-22  Darin Adler  <darin@apple.com>
1817
1818         * khtml/ecma/kjs_window.cpp: (Window::get): Removed code that gets properties from the parent.
1819         This was a mistake we inherited from KHTML, and they have long since fixed it.
1820
1821 2004-04-22  Ken Kocienda  <kocienda@apple.com>
1822
1823         Reviewed by Hyatt
1824
1825         Ensures caret visibility after making an editing action.
1826
1827         * khtml/xml/dom_selection.cpp:
1828         (DOM::Selection::getRepaintRect): Expose this as public.
1829         * khtml/xml/dom_selection.h: Ditto.
1830         * kwq/WebCoreBridge.h: Add ensureCaretVisible method.
1831         * kwq/WebCoreBridge.mm:
1832         (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:]):
1833         Unrelated crash fix. Null-check baseURLString.
1834         (-[WebCoreBridge ensureCaretVisible]): Added.
1835
1836 2004-04-21  David Hyatt  <hyatt@apple.com>
1837
1838         Fix for 3245627, nested tables don't expand vertically.  I actually fixed the basic problem in the
1839         previous checkin, but this exposed another basic math error where |numVariable| was not being
1840         decremented properly.  This meant space was mis-allocated when multiple variable height rows both needed
1841         to expand.
1842
1843         * khtml/rendering/render_table.cpp:
1844         (RenderTableSection::layoutRows):
1845
1846 2004-04-21  David Hyatt  <hyatt@apple.com>
1847
1848         Fix for 3020449, ensure that the paint order of cells with rowspans matches other browsers.
1849         
1850         Reviewed by darin
1851
1852         * khtml/rendering/render_table.cpp:
1853         (RenderTableSection::paint):
1854
1855 2004-04-21  David Hyatt  <hyatt@apple.com>
1856
1857         Remove the (incorrect) restriction on table flexing that required the cell to have a fixed width.  In
1858         reality, the style on the cell is completely irrelevant.
1859         
1860         Reviewed by kocienda
1861
1862         * khtml/rendering/render_table.cpp:
1863         (RenderTable::layout):
1864
1865 2004-04-21  David Hyatt  <hyatt@apple.com>
1866
1867         Make sure cells that get flexed vertically in tables don't check text children when looking for 
1868         percentage height children.
1869         
1870         Reviewed by kocienda
1871
1872         * khtml/rendering/render_table.cpp:
1873         (RenderTableSection::layoutRows):
1874
1875 2004-04-21  David Hyatt  <hyatt@apple.com>
1876
1877         Fix for hiermenus bug.  Absolutely positioned images should not contribute to their containing block's
1878         max width.  Make sure to disregard positioned elements when computing min/max width.
1879         
1880         Reviewed by kocienda
1881
1882         * khtml/rendering/render_block.cpp:
1883         (khtml::InlineMinMaxIterator::next):
1884
1885 2004-04-21  Ken Kocienda  <kocienda@apple.com>
1886
1887         Reviewed by Hyatt
1888
1889         * khtml/editing/htmlediting_impl.cpp:
1890         (DeleteSelectionCommandImpl::doApply): Do not shift ending selection downstream
1891         when at position zero of a BR. That's just wrong. Simplify code that does
1892         "onlyWhitespace" delete. No need to handle multiple characters here; we can
1893         only ever have one thanks to the delete-collapsible-whitespace code.
1894         (TypingCommandImpl::issueCommandForDeleteKey): Don't do anything if at the
1895         start of a root editable block. This is a no-op....not an opportunity to crash.
1896         * khtml/rendering/render_block.cpp:
1897         (khtml::RenderBlock::positionForRenderer): Return this renderer's element position
1898         if the passed-in renderer is nil. This helps to make clicking in empty blocks work.
1899         * khtml/rendering/render_container.cpp:
1900         (RenderContainer::positionForCoordinates): Fixed typo in comment.
1901         * khtml/xml/dom_position.cpp:
1902         (DOM::Position::equivalentLeafPosition): Do not attempt to find a leaf if the
1903         position's node does not have a renderer, if the renderer has no kids.
1904         * layout-tests/editing/deleting/delete-br-001-expected.txt: Update expected results for BR fix.
1905         * layout-tests/editing/deleting/delete-br-003-expected.txt: Ditto.
1906         * layout-tests/editing/deleting/delete-br-006-expected.txt: Ditto.
1907         * layout-tests/editing/deleting/delete-br-007.html: Added. New BR test.
1908         * layout-tests/editing/deleting/delete-br-007-expected.txt: Added.
1909
1910 2004-04-21  Ken Kocienda  <kocienda@apple.com>
1911
1912         Reviewed by Hyatt
1913
1914         * khtml/css/css_computedstyle.cpp:
1915         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Added implementations for
1916         these properties: CSS_PROP_TEXT_DECORATION, CSS_PROP_VERTICAL_ALIGN, CSS_PROP_TEXT_INDENT,
1917         CSS_PROP_LETTER_SPACING, CSS_PROP_WORD_SPACING, CSS_PROP_LINE_HEIGHT
1918
1919 2004-04-21  Ken Kocienda  <kocienda@apple.com>
1920
1921         Reviewed by John
1922
1923         The Selection class now uses the Position class throughout its public and
1924         private interface. This replaces the inconsistent use of the Position
1925         class here and node/offset pairs there. There are no functional changes, only
1926         updates to the new Selection class API.
1927
1928         * khtml/ecma/kjs_window.cpp:
1929         (Selection::get):
1930         (SelectionFunc::tryCall):
1931         * khtml/editing/htmlediting_impl.cpp:
1932         (DeleteCollapsibleWhitespaceCommandImpl::doApply):
1933         (DeleteSelectionCommandImpl::joinTextNodesWithSameStyle):
1934         (DeleteSelectionCommandImpl::doApply):
1935         (InputNewlineCommandImpl::doApply):
1936         (InputTextCommandImpl::deleteCharacter):
1937         (InputTextCommandImpl::prepareForTextInsertion):
1938         (InputTextCommandImpl::execute):
1939         (PasteMarkupCommandImpl::doApply):
1940         (TypingCommandImpl::issueCommandForDeleteKey):
1941         * khtml/khtml_part.cpp:
1942         (KHTMLPart::findTextNext):
1943         (KHTMLPart::setFocusNodeIfNeeded):
1944         (KHTMLPart::notifySelectionChanged):
1945         (KHTMLPart::isPointInsideSelection):
1946         (KHTMLPart::handleMouseMoveEventSelection):
1947         (KHTMLPart::khtmlMouseReleaseEvent):
1948         (KHTMLPart::selectAll):
1949         * khtml/rendering/render_block.cpp:
1950         (khtml::RenderBlock::paintObject):
1951         * khtml/xml/dom_docimpl.cpp:
1952         (DocumentImpl::updateSelection):
1953         * khtml/xml/dom_nodeimpl.cpp:
1954         * khtml/xml/dom_selection.cpp:
1955         (DOM::emptyPosition):
1956         (DOM::Selection::Selection):
1957         (DOM::Selection::init):
1958         (DOM::Selection::operator=):
1959         (DOM::Selection::moveTo):
1960         (DOM::Selection::modify):
1961         (DOM::Selection::xPosForVerticalArrowNavigation):
1962         (DOM::Selection::clear):
1963         (DOM::Selection::setBase):
1964         (DOM::Selection::setExtent):
1965         (DOM::Selection::setBaseAndExtent):
1966         (DOM::Selection::setStart):
1967         (DOM::Selection::setEnd):
1968         (DOM::Selection::setStartAndEnd):
1969         (DOM::Selection::toRange):
1970         (DOM::Selection::layoutCaret):
1971         (DOM::Selection::needsCaretRepaint):
1972         (DOM::Selection::paintCaret):
1973         (DOM::Selection::validate):
1974         (DOM::Selection::moveToRenderedContent):
1975         (DOM::Selection::nodeIsBeforeNode):
1976         (DOM::startAndEndLineNodesIncludingNode):
1977         (DOM::Selection::debugRenderer):
1978         (DOM::Selection::debugPosition):
1979         * khtml/xml/dom_selection.h:
1980         (DOM::Selection::~Selection):
1981         (DOM::Selection::base):
1982         (DOM::Selection::extent):
1983         (DOM::Selection::start):
1984         (DOM::Selection::end):
1985         (DOM::Selection::assignBase):
1986         (DOM::Selection::assignExtent):
1987         (DOM::Selection::assignBaseAndExtent):
1988         (DOM::Selection::assignStart):
1989         (DOM::Selection::assignEnd):
1990         (DOM::Selection::assignStartAndEnd):
1991         (DOM::operator==):
1992         * kwq/KWQKHTMLPart.mm:
1993         (KWQKHTMLPart::jumpToSelection):
1994         (KWQKHTMLPart::selectionStartOffset):
1995         (KWQKHTMLPart::selectionEndOffset):
1996         (KWQKHTMLPart::selectionStart):
1997         (KWQKHTMLPart::selectionEnd):
1998         * kwq/KWQRenderTreeDebug.cpp:
1999         (writeSelection):
2000         * kwq/WebCoreBridge.mm:
2001         (-[WebCoreBridge isSelectionEditable]):
2002         (-[WebCoreBridge setSelectionFrom:startOffset:to:endOffset:]):
2003         (-[WebCoreBridge setSelectedDOMRange:]):
2004
2005 2004-04-20  Ken Kocienda  <kocienda@apple.com>
2006
2007         Reviewed by Hyatt
2008         
2009         Renamed DOMPosition class to Position.
2010         Renamed KHTMLSelection to Selection and moved to DOM namespace.
2011
2012         * ForwardingHeaders/xml/dom_selection.h: Added.
2013         * WebCore.pbproj/project.pbxproj: Go Xcode!
2014         * khtml/khtml_selection.cpp: Removed.
2015         * khtml/khtml_selection.h: Removed.
2016         * khtml/xml/dom_position.cpp: Renamed DOMPosition to Position
2017         * khtml/xml/dom_position.h: Ditto.
2018         * khtml/xml/dom_selection.cpp: New home for renamed Selection object.
2019         * khtml/xml/dom_selection.h: Ditto.
2020
2021 2004-04-20  Ken Kocienda  <kocienda@apple.com>
2022
2023         Reviewed by Hyatt
2024
2025         * WebCore.pbproj/project.pbxproj:
2026         * khtml/khtml_part.cpp:
2027         (KHTMLPart::handleMousePressEventDoubleClick): Improved name of expandToElement. Now is expandUsingGranularity.
2028         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2029         (KHTMLPart::handleMouseMoveEventSelection): Ditto.
2030         * khtml/khtml_selection.cpp:
2031         (KHTMLSelection::modify): Added support for modifying and extending selection right and left by word.
2032         Also added support for extending selection up and down.
2033         (KHTMLSelection::expandUsingGranularity): New name for expandToElement.
2034         (KHTMLSelection::xPosForVerticalArrowNavigation): Made this function handle cases where we know we
2035         want to use a particular position for calculating the right x position. We need this to handle
2036         extending selection up and down, and for setting the caret to the right place when moving up
2037         and down when a range is already selected.
2038         (KHTMLSelection::validate): Name tweak. expandTo variable now granularity.
2039         * khtml/khtml_selection.h: Make declaration changes for changes to cpp file.
2040         * khtml/misc/helper.cpp:
2041         (khtml::findWordBoundary): Added this hook for KDE to do their version of KWQFindWordBoundary
2042         * khtml/misc/helper.h:
2043         * khtml/rendering/render_block.cpp:
2044         (khtml::RenderBlock::positionForCoordinates): Factor out closest box finder code to its own function
2045         * khtml/rendering/render_line.cpp:
2046         (InlineFlowBox::closestChildForXPos): New function. This is the factored code that was taken out of 
2047         render_block.cpp.
2048         (InlineBox::closestLeafChildForXPos): Ditto.
2049         * khtml/rendering/render_line.h: Ditto.
2050         * khtml/rendering/render_replaced.cpp:
2051         (RenderReplaced::positionForCoordinates): I think I am starting to get how the coordinate transforms work.
2052         Made some fixups based on this greater sense of enlightenment.
2053         * khtml/rendering/render_text.cpp:
2054         (RenderText::positionForCoordinates): Ditto. Fix lastTextBox/firstTextBox code mistake.
2055         * khtml/xml/dom_position.cpp:
2056         (DOMPosition::previousWordPosition): Added.
2057         (DOMPosition::nextWordPosition): Added.
2058         (DOMPosition::previousLinePosition): No longer use nodeAtPoint. Use new closestLeafChildForXPos instead.
2059         (DOMPosition::nextLinePosition): Ditto.
2060         (DOMPosition::inLastEditableInContainingEditableBlock):
2061         * khtml/xml/dom_position.h:
2062         * kwq/KWQTextUtilities.cpp: Added.
2063         (KWQFindWordBoundary): Factored out code that was in a static function in khtml_selection.cpp so 
2064         that DOMPosition can use it too.
2065         * kwq/KWQTextUtilities.h: Added.
2066
2067 2004-04-19  Ken Kocienda  <kocienda@apple.com>
2068
2069         Reviewed by Hyatt
2070
2071         * khtml/khtml_part.cpp:
2072         (KHTMLPart::notifySelectionChanged): Clear the value
2073         used for maintaining x position when doing vertical arrow
2074         navigation. WebCoreBridge restores this value when needed. 
2075         (KHTMLPart::setXPosForVerticalArrowNavigation): New accessor.
2076         (KHTMLPart::xPosForVerticalArrowNavigation): New accessor.
2077         * khtml/khtml_part.h:
2078         (KHTMLPart::): Add NoXPosForVerticalArrowNavigation constant.
2079         * khtml/khtml_selection.cpp:
2080         (KHTMLSelection::modify): Add cases for UP and DOWN navigation
2081         (KHTMLSelection::xPosForVerticalArrowNavigation): New helper.
2082         * khtml/khtml_selection.h: Add UP and DOWN constants to EDirection enum.
2083         (KHTMLSelection::):
2084         * khtml/khtmlpart_p.h: Declare storage for m_xPosForVerticalArrowNavigation, 
2085         the value used for maintaining x position when doing vertical arrow
2086         navigation. 
2087         * khtml/rendering/render_block.cpp:
2088         (khtml::RenderBlock::positionForCoordinates): Improved this function to
2089         handle deficiencies exposed when trying to implement new behavior.
2090         * khtml/rendering/render_br.cpp:
2091         (RenderBR::positionForCoordinates): Added implementation of this virtual function.
2092         * khtml/rendering/render_br.h: Declare implementation for positionForCoordinates virtual function.
2093         * khtml/rendering/render_replaced.cpp:
2094         (RenderReplaced::positionForCoordinates): Improved this function to
2095         handle deficiencies exposed when trying to implement new behavior.
2096         * khtml/rendering/render_text.cpp:
2097         (InlineTextBox::offsetForPosition): Remove left/right "bounds" check here.
2098         (RenderText::positionForCoordinates): Improved this function to
2099         handle deficiencies exposed when trying to implement new behavior.
2100         * khtml/xml/dom_position.cpp:
2101         (inlineBoxForRenderer): Moved to top of file so all code in the file can see this static function.
2102         (renderersOnDifferentLine): Ditto.
2103         (nextRenderedEditable): Ditto.
2104         (previousRenderedEditable): Ditto.
2105         (DOMPosition::previousLinePosition): New function. Implements the guts of up/down navigation.
2106         (DOMPosition::nextLinePosition): Ditto.
2107         * khtml/xml/dom_position.h: Added declarations for nextLinePosition and previousLinePosition.
2108         * kwq/WebCoreBridge.h: Add WebSelectUp and WebSelectDown constants.
2109         * kwq/WebCoreBridge.mm:
2110         (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Handles saving and restoring the 
2111         x position used for doing vertical arrow navigation.
2112
2113 2004-04-16  Ken Kocienda  <kocienda@apple.com>
2114
2115         Reviewed by Hyatt
2116
2117         * khtml/css/css_computedstyle.cpp:
2118         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Added implementations for
2119         these four properties: CSS_PROP_WHITE_SPACE, CSS_PROP_DISPLAY, CSS_PROP_FLOAT, and CSS_PROP_COLOR.
2120
2121 2004-04-16  Chris Blumenberg  <cblu@apple.com>
2122
2123         Subresources weren't being archived for LINK tags.
2124
2125         Reviewed by kocienda.
2126
2127         * khtml/xml/dom_nodeimpl.cpp:
2128         (NodeImpl::recursive_toHTMLWithOptions): indent tweak
2129         * kwq/DOMHTML.mm:
2130         (-[DOMHTMLLinkElement _linkElementImpl]): C+casting voodoo to make methods like rel and href work correctly
2131
2132 2004-04-16  Ken Kocienda  <kocienda@apple.com>
2133
2134         Reviewed by Hyatt
2135
2136         * khtml/html/html_elementimpl.cpp:
2137         (HTMLElementImpl::isContentEditable): Call getDocument()->updateRendering() to make sure 
2138         outstanding changes for this attribute are applied.
2139         (HTMLElementImpl::contentEditable): Call getDocument()->updateRendering() to make sure 
2140         outstanding changes for this attribute are applied.
2141         (HTMLElementImpl::setContentEditable): Call enabled.isEmpty() before strcasecmp(enabled, "true").
2142         It's cheaper.
2143
2144 2004-04-16  Ken Kocienda  <kocienda@apple.com>
2145
2146         Reviewed by Hyatt
2147
2148         * khtml/editing/htmlediting_impl.cpp: New helper.
2149         (DeleteSelectionCommandImpl::containsOnlyWhitespace): Fix deleting collapsed whitespace 
2150         at the end of a line where text has flowed to the next line and the caret is at the 
2151         beginning of the next line. 
2152         (DeleteSelectionCommandImpl::doApply): Updated for new helper.
2153         * khtml/editing/htmlediting_impl.h:
2154         * layout-tests/editing/deleting/delete-line-end-ws-001-expected.txt: Added.
2155         * layout-tests/editing/deleting/delete-line-end-ws-001.html: Added.
2156         * layout-tests/editing/deleting/delete-line-end-ws-002-expected.txt: Added.
2157         * layout-tests/editing/deleting/delete-line-end-ws-002.html: Added.
2158
2159 === Safari-137 ===
2160
2161 2004-04-16  Richard Williamson   <rjw@apple.com>
2162
2163         Added an SPI to allow ObjC instances to be easily bound to 
2164         JS.  This is needed by the dashboard guys for their prototyping.
2165         Eventually they will use new API.
2166
2167         Reviewed by Chris.
2168
2169         * kwq/KWQKHTMLPart.h:
2170         * kwq/KWQKHTMLPart.mm:
2171         (KWQKHTMLPart::bindObject):
2172         * kwq/WebCoreBridge.h:
2173         * kwq/WebCoreBridge.mm:
2174         (-[WebCoreBridge bindObject:withName:]):
2175
2176 2004-04-16  Chris Blumenberg  <cblu@apple.com>
2177
2178         Added DOMHTMLEmbedElement as a DOM extension since EMBED is represented in our DOM even though its not part of the spec.
2179         Added all DOMCore and DOMHTML symbols to WebCore's symbols file.
2180         Removed isSubresourceURLAttribute from dom node. This was only used for the WebArchive feature and all that work is now done in WebKit.
2181
2182         Reviewed by kocienda.
2183
2184         * WebCore-combined.exp:
2185         * WebCore.exp:
2186         * khtml/html/html_baseimpl.cpp:
2187         (HTMLBodyElementImpl::isURLAttribute): renamed from isSubresourceURLAttribute. As a convenience to subclasses, dom_elementimpl would call isSubresourceURLAttribute in isURLAttribute, but this is no longer done
2188         (HTMLFrameElementImpl::isURLAttribute): ditto
2189         (HTMLIFrameElementImpl::isURLAttribute): ditto
2190         * khtml/html/html_baseimpl.h:
2191         * khtml/html/html_formimpl.cpp:
2192         (HTMLInputElementImpl::isURLAttribute): ditto
2193         * khtml/html/html_formimpl.h:
2194         * khtml/html/html_headimpl.cpp:
2195         (HTMLScriptElementImpl::isURLAttribute): ditto
2196         * khtml/html/html_headimpl.h:
2197         * khtml/html/html_imageimpl.cpp: 
2198         (HTMLImageElementImpl::isURLAttribute): ditto
2199         * khtml/html/html_imageimpl.h:
2200         * khtml/html/html_objectimpl.cpp:
2201         (HTMLEmbedElementImpl::isURLAttribute): ditto
2202         (HTMLObjectElementImpl::isURLAttribute): ditto
2203         (HTMLParamElementImpl::isURLAttribute): ditto
2204         * khtml/html/html_objectimpl.h:
2205         * khtml/html/html_tableimpl.cpp:
2206         (HTMLTableElementImpl::isURLAttribute): ditto
2207         (HTMLTableCellElementImpl::isURLAttribute): ditto
2208         * khtml/html/html_tableimpl.h:
2209         * khtml/xml/dom2_rangeimpl.cpp:
2210         (RangeImpl::toHTMLWithOptions): take a node list (see below)
2211         * khtml/xml/dom2_rangeimpl.h:
2212         * khtml/xml/dom_elementimpl.cpp:
2213         (ElementImpl::isURLAttribute):
2214         * khtml/xml/dom_elementimpl.h:
2215         * khtml/xml/dom_nodeimpl.cpp:
2216         (NodeImpl::recursive_toHTMLWithOptions): append copied nodes to a list of nodes so that WebKit can operate on them
2217         * khtml/xml/dom_nodeimpl.h:
2218         * kwq/DOM.mm:
2219         (+[DOMNode _nodeWithImpl:]): added support for HTML types
2220         * kwq/DOMExtensions.h:
2221         * kwq/DOMHTML.mm:
2222         (-[DOMHTMLPreElement setWidth:]):
2223         (-[DOMHTMLEmbedElement _embedElementImpl]):
2224         (-[DOMHTMLEmbedElement align]):
2225         (-[DOMHTMLEmbedElement setAlign:]):
2226         (-[DOMHTMLEmbedElement height]):
2227         (-[DOMHTMLEmbedElement setHeight:]):
2228         (-[DOMHTMLEmbedElement name]):
2229         (-[DOMHTMLEmbedElement setName:]):
2230         (-[DOMHTMLEmbedElement src]):
2231         (-[DOMHTMLEmbedElement setSrc:]):
2232         (-[DOMHTMLEmbedElement type]):
2233         (-[DOMHTMLEmbedElement setType:]):
2234         (-[DOMHTMLEmbedElement width]):
2235         (-[DOMHTMLEmbedElement setWidth:]):
2236         (-[DOMHTMLTableElement background]):
2237         (-[DOMHTMLTableElement setBackground:]):
2238         (-[DOMHTMLTableCellElement background]): new extension 
2239         (-[DOMHTMLTableCellElement setBackground:]): ditto
2240         * kwq/WebCoreBridge.h:
2241         * kwq/WebCoreBridge.mm:
2242         (-[WebCoreBridge nodesFromList:]): new
2243         (-[WebCoreBridge markupStringFromNode:nodes:]): return a list of nodes instead of subresource URLs so WebKit can operate on the nodes
2244         (-[WebCoreBridge markupStringFromRange:nodes:]): ditto
2245
2246 2004-04-15  David Hyatt  <hyatt@apple.com>
2247
2248         Fix for 3624335, bugs with overflow and positioned objects.  The scrollbar didn't properly update
2249         as you changed the sizes of positioned objects inside an overflow block.
2250         
2251         Reviewed by rjw
2252
2253         * khtml/rendering/render_block.cpp:
2254         (khtml::RenderBlock::layoutBlock):
2255         * khtml/rendering/render_flexbox.cpp:
2256         (khtml::RenderFlexibleBox::layoutBlock):
2257         * khtml/rendering/render_layer.cpp:
2258         (RenderLayer::updateScrollInfoAfterLayout):
2259
2260 2004-04-15  Ken Kocienda  <kocienda@apple.com>
2261
2262         Reviewed by Dave
2263         
2264         Improved selection behavior. As part of this work, I removed
2265         almost all of the checkSelectionPoint() functions, leaving
2266         only those associated with fonts, and all of the 
2267         checkSelectionPointIgnoringContinuations() functions. Each
2268         of these has been replaced by a new function called
2269         positionForCoordinates(), which returns a DOMPosition.
2270         
2271         * WebCore.pbproj/project.pbxproj:
2272         * khtml/khtml_events.cpp:
2273         (khtml::MouseEvent::offset): Converted to use positionForCoordinates.
2274         * khtml/khtml_part.cpp: Ditto.
2275         (KHTMLPart::isPointInsideSelection):
2276         (KHTMLPart::handleMousePressEventDoubleClick): Ditto.
2277         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2278         (KHTMLPart::handleMousePressEventSingleClick): Ditto.
2279         (KHTMLPart::handleMouseMoveEventSelection): Ditto.
2280         (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
2281         * khtml/khtml_part.h:
2282         * khtml/rendering/render_block.cpp:
2283         (khtml::RenderBlock::positionForBox): New helper.
2284         (khtml::RenderBlock::positionForRenderer): New helper.
2285         (khtml::RenderBlock::positionForCoordinates): New selection-node-offset-finder method.
2286         * khtml/rendering/render_block.h:
2287         * khtml/rendering/render_br.cpp: Removed checkSelectionPointIgnoringContinuations.
2288         No special behavior is needed for this class anymore.
2289         * khtml/rendering/render_br.h: Ditoo.
2290         * khtml/rendering/render_container.cpp:
2291         (RenderContainer::positionForCoordinates): New selection-node-offset-finder method.
2292         * khtml/rendering/render_container.h:
2293         * khtml/rendering/render_line.cpp:
2294         (InlineBox::firstLeafChild): New helper.
2295         (InlineBox::lastLeafChild): New helper.
2296         (InlineFlowBox::firstLeafChild): New helper.
2297         (InlineFlowBox::lastLeafChild): New helper.
2298         * khtml/rendering/render_line.h:
2299         * khtml/rendering/render_object.cpp:
2300         (RenderObject::firstLeafChild): New helper.
2301         (RenderObject::lastLeafChild): New helper.
2302         (RenderObject::positionForCoordinates):
2303         * khtml/rendering/render_object.h:
2304         * khtml/rendering/render_replaced.cpp:
2305         (RenderReplaced::positionForCoordinates): New selection-node-offset-finder method.
2306         * khtml/rendering/render_replaced.h:
2307         * khtml/rendering/render_text.cpp:
2308         (InlineTextBox::offsetForPosition): New helper, replaces checkSelectionPoint()
2309         (RenderText::positionForCoordinates): New selection-node-offset-finder method.
2310         * khtml/rendering/render_text.h:
2311         * khtml/xml/dom_nodeimpl.cpp: Added positionForCoordinates() convenience here. This
2312         checks to see if the node has a renderer before doing the position check.
2313         * khtml/xml/dom_nodeimpl.h: Ditto.
2314         * kwq/DOM.mm:
2315         (-[DOMNode isContentEditable]): Added this unrelated method, since without it, I crash when dragging an image.
2316         * kwq/WebCoreBridge.mm:
2317         (-[WebCoreBridge moveCaretToPoint:]): Converted to use positionForCoordinates.
2318
2319 2004-04-15  David Hyatt  <hyatt@apple.com>
2320
2321         Fix for 3603455, block truncation support.
2322         
2323         Reviewed by kocienda
2324
2325         * khtml/css/cssparser.cpp:
2326         (CSSParser::parseValue):
2327         * khtml/css/cssproperties.c:
2328         (hash_prop):
2329         (findProp):
2330         * khtml/css/cssproperties.h:
2331         * khtml/css/cssproperties.in:
2332         * khtml/css/cssstyleselector.cpp:
2333         (khtml::CSSStyleSelector::applyProperty):
2334         * khtml/ecma/kjs_css.cpp:
2335         (cssPropertyName):
2336         * khtml/rendering/render_block.cpp:
2337         (khtml::RenderBlock::lineCount):
2338         (khtml::RenderBlock::heightForLineCount):
2339         * khtml/rendering/render_block.h:
2340         * khtml/rendering/render_flexbox.cpp:
2341         (khtml::RenderFlexibleBox::layoutHorizontalBox):
2342         (khtml::RenderFlexibleBox::layoutVerticalBox):
2343         * khtml/rendering/render_style.cpp:
2344         (marquee):
2345         (StyleCSS3NonInheritedData::operator==):
2346         (RenderStyle::diff):
2347         * khtml/rendering/render_style.h:
2348         (khtml::RenderStyle::lineClamp):
2349         (khtml::RenderStyle::setLineClamp):
2350         (khtml::RenderStyle::initialLineClamp):
2351
2352 2004-04-13  Chris Blumenberg  <cblu@apple.com>
2353
2354         - Removed WebCoreElementIsEditableKey. This functionality is available via [DOMNode isContentEditable].
2355
2356         Reviewed by rjw.
2357
2358         * WebCore-combined.exp:
2359         * WebCore.exp:
2360         * kwq/WebCoreBridge.h:
2361         * kwq/WebCoreBridge.mm:
2362         (-[WebCoreBridge elementAtPoint:]): removed use of WebCoreElementIsEditableKey
2363         (-[WebCoreBridge URLWithRelativeString:]): new method for WebKit API
2364
2365 2004-04-13  David Hyatt  <hyatt@apple.com>
2366
2367         Fix for 3559764, make sure overflow is applied consistently using a separate bit on render objects, so that
2368         the body scroll quirk can easily disable overflow even when it is present on the style.
2369         
2370         Reviewed by kocienda
2371
2372         * khtml/ecma/kjs_dom.cpp:
2373         (DOMNode::putValue):
2374         * khtml/rendering/bidi.cpp:
2375         (khtml::RenderBlock::layoutInlineChildren):
2376         * khtml/rendering/render_block.cpp:
2377         (khtml::RenderBlock::setStyle):
2378         (khtml::RenderBlock::layoutBlock):
2379         (khtml::RenderBlock::layoutBlockChildren):
2380         (khtml::RenderBlock::paintObject):
2381         (khtml::RenderBlock::rightOffset):
2382         (khtml::RenderBlock::lowestPosition):
2383         (khtml::RenderBlock::rightmostPosition):
2384         (khtml::RenderBlock::leftmostPosition):
2385         (khtml::RenderBlock::isPointInScrollbar):
2386         (khtml::RenderBlock::nodeAtPoint):
2387         (khtml::RenderBlock::inRootBlockContext):
2388         * khtml/rendering/render_block.h:
2389         (khtml::RenderBlock::overflowHeight):
2390         (khtml::RenderBlock::overflowWidth):
2391         * khtml/rendering/render_box.cpp:
2392         (RenderBox::setStyle):
2393         (RenderBox::contentWidth):
2394         (RenderBox::contentHeight):
2395         (RenderBox::absolutePosition):
2396         (RenderBox::computeAbsoluteRepaintRect):
2397         (RenderBox::calcAbsoluteVertical):
2398         * khtml/rendering/render_flexbox.cpp:
2399         (khtml::RenderFlexibleBox::layoutBlock):
2400         * khtml/rendering/render_flow.cpp:
2401         (RenderFlow::lowestPosition):
2402         (RenderFlow::rightmostPosition):
2403         (RenderFlow::leftmostPosition):
2404         * khtml/rendering/render_layer.cpp:
2405         (RenderLayer::updateLayerPosition):
2406         (RenderLayer::updateScrollInfoAfterLayout):
2407         (RenderLayer::intersectsDamageRect):
2408         (RenderLayer::containsPoint):
2409         * khtml/rendering/render_object.cpp:
2410         (RenderObject::RenderObject):
2411         (RenderObject::requiresLayer):
2412         (RenderObject::clientWidth):
2413         (RenderObject::clientHeight):
2414         (RenderObject::scrollWidth):
2415         (RenderObject::scrollHeight):
2416         (RenderObject::setStyle):
2417         (RenderObject::absolutePosition):
2418         (RenderObject::nodeAtPoint):
2419         (RenderObject::avoidsFloats):
2420         * khtml/rendering/render_object.h:
2421         (khtml::RenderObject::hasOverflowClip):
2422         (khtml::RenderObject::hasAutoScrollbars):
2423         (khtml::RenderObject::scrollsOverflow):
2424         (khtml::RenderObject::includeScrollbarSize):
2425         (khtml::RenderObject::setHasOverflowClip):
2426         * khtml/rendering/render_style.h:
2427         (khtml::RenderStyle::overflow):
2428         (khtml::RenderStyle::isDisplayReplacedType):
2429         (khtml::RenderStyle::isDisplayInlineType):
2430         * khtml/rendering/render_table.cpp:
2431         (RenderTable::setStyle):
2432         (RenderTableCell::setStyle):
2433         (RenderTableCell::requiresLayer):
2434         * khtml/rendering/render_table.h:
2435
2436 2004-04-12  David Hyatt  <hyatt@apple.com>
2437
2438         Fix for 3556036, make sure that when the position changes via style that all render layer
2439         descendants simply immediately repaint.
2440         
2441         Reviewed by kocienda
2442         
2443         * khtml/rendering/render_layer.cpp:
2444         (RenderLayer::repaintIncludingDescendants):
2445         * khtml/rendering/render_layer.h:
2446         * khtml/rendering/render_object.cpp:
2447         (RenderObject::setStyle):
2448
2449 2004-04-12  Chris Blumenberg  <cblu@apple.com>
2450
2451         - Fixed build failure by removing references to WebArchive in WebCore.
2452         - For HTML copy/paste, relative URLs are now made absolute at paste time instead of at copy time. This allows relative URLs to be kept relative if the destination page has the same base URL as the source page.
2453
2454         Reviewed by kocienda.
2455
2456         * khtml/editing/htmlediting.cpp:
2457         (PasteMarkupCommand::PasteMarkupCommand): take the base URL of the clipping
2458         * khtml/editing/htmlediting.h:
2459         * khtml/editing/htmlediting_impl.cpp:
2460         (PasteMarkupCommandImpl::PasteMarkupCommandImpl): take the base URL of the clipping
2461         (PasteMarkupCommandImpl::doApply): if we have a base URL and it is different than the base URL of the document, fix the URLs in the new DOM tree
2462         * khtml/editing/htmlediting_impl.h:
2463         * khtml/xml/dom2_rangeimpl.cpp:
2464         (RangeImpl::toHTMLWithOptions): removed completeURLs param
2465         * khtml/xml/dom2_rangeimpl.h:
2466         * khtml/xml/dom_nodeimpl.cpp:
2467         (NodeImpl::recursive_toHTMLWithOptions): removed completeURLs param
2468         (NodeImpl::recursive_toHTML): ditto
2469         (NodeImpl::recursive_completeURLs): new
2470         * khtml/xml/dom_nodeimpl.h:
2471         * kwq/WebCoreBridge.h:
2472         * kwq/WebCoreBridge.mm:
2473         (-[WebCoreBridge markupStringFromNode:subresourceURLStrings:]): call recursive_toHTML with less params
2474         (-[WebCoreBridge markupStringFromRange:subresourceURLStrings:]): ditto
2475         (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:]): take a base URL
2476
2477 2004-04-12  Ken Kocienda  <kocienda@apple.com>
2478
2479         Reviewed by Dave
2480
2481         Added execCommand support for cut/copy/paste.
2482         
2483         * khtml/xml/dom_docimpl.cpp:
2484         (DocumentImpl::execCommand): Added cut/copy/paste atoms and added else if cases
2485         for the commands.
2486         * kwq/KWQKHTMLPart.h:
2487         * kwq/KWQKHTMLPart.mm:
2488         (KWQKHTMLPart::issueCutCommand): Glue for calling from WebCore to do a cut in Cocoa.
2489         (KWQKHTMLPart::issueCopyCommand): Same as above, but for copy.
2490         (KWQKHTMLPart::issuePasteCommand): Same as above, but for paste.
2491         * kwq/WebCoreBridge.h: Declared issueCutCommand, issueCopyCommand, and issuePasteCommand
2492         to be implemented on the WebKit side of the bridge.
2493         * layout-tests/editing/editing.js: Added cut/copy/paste support to js library to support
2494         making layout tests.
2495         * layout-tests/editing/pasteboard/copy-paste-text-001-expected.txt: Added.
2496         * layout-tests/editing/pasteboard/copy-paste-text-001.html: Added.
2497         * layout-tests/editing/pasteboard/cut-paste-text-002-expected.txt: Added.
2498         * layout-tests/editing/pasteboard/cut-paste-text-002.html: Added.
2499         * layout-tests/editing/pasteboard/cut-text-001-expected.txt: Added.
2500         * layout-tests/editing/pasteboard/cut-text-001.html: Added.
2501
2502 2004-04-12  Ken Kocienda  <kocienda@apple.com>
2503
2504         Reviewed by John
2505         
2506         Some delete and insert cleanups.
2507
2508         * khtml/editing/htmlediting_impl.cpp:
2509         (DeleteSelectionCommandImpl::doApply): For ending position case 1,
2510         the caret should be placed before the first child of the containing block, 
2511         not before the containing block itself. Also, add some code to handle
2512         converting nbsp's back to regular spaces. This will need to be improved
2513         some day to convert only nbsp's added by the editor to make rendering come out right.
2514         (InputTextCommandImpl::execute): 
2515         (TypingCommandImpl::issueCommandForDeleteKey): Make deleting collapsible whitespace part 
2516         of the work of deleting a selection, rather than something that needs to be done by a 
2517         user of DeleteSelectionCommandImpl. This makes it impossible to leave out
2518         this essential step.
2519         (TypingCommandImpl::deleteKeyPressed): We can't use a possible optimization here until 
2520         the code to do deletions properly has been factored better. Big FIXME added.
2521         * layout-tests/editing/deleting/delete-block-contents-001-expected.txt: Updated for
2522         ending position case 1 behavior change.
2523         * layout-tests/editing/deleting/delete-block-contents-002-expected.txt: Ditto. 
2524         * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Ditto.
2525
2526 2004-04-09  Ken Kocienda  <kocienda@apple.com>
2527
2528         Reviewed by Darin
2529
2530         Added support for methods added to flesh out the WebKit 
2531         editing API.
2532
2533         * khtml/khtml_part.h: Removed pasteMarkupString and deleteSelection functions.
2534         All this work is now done in WebCoreBridge.
2535         * kwq/WebCoreBridge.h:
2536         * kwq/WebCoreBridge.mm:
2537         (-[WebCoreBridge isSelectionEditable]): Added a FIXME.
2538         (-[WebCoreBridge setDrawsBackground:]): Moved this since CVS merged this in the
2539         middle of editing code.
2540         (-[WebCoreBridge replaceSelectionWithNode:]): New method.
2541         (-[WebCoreBridge replaceSelectionWithText:]): Replaces insertText:
2542         (-[WebCoreBridge replaceSelectionWithMarkupString:]): New method.
2543         (-[WebCoreBridge replaceSelectionWithWebArchive:]): New method.
2544         (-[WebCoreBridge replaceSelectionWithNewline]): Replaces insertNewline:
2545         (-[WebCoreBridge deleteSelection]): New method.
2546         (-[WebCoreBridge applyStyle:toElementsInDOMRange:]): New method.
2547
2548 2004-04-09  Darin Adler  <darin@apple.com>
2549
2550         Reviewed by Ken.
2551
2552         - added "transparent mode"
2553
2554         * khtml/khtmlview.h: Added isTransparent and setTransparent functions.
2555         * khtml/khtmlview.cpp:
2556         (KHTMLViewPrivate::KHTMLViewPrivate): Initialize isTransparent to false.
2557         (KHTMLView::isTransparent): Return isTransparent.
2558         (KHTMLView::setTransparent): Set isTransparent.
2559
2560         * khtml/rendering/render_box.cpp:
2561         (RenderBox::paintRootBoxDecorations): Use slow repaints for the top frame when the view
2562         is transparent; also don't draw a background. This is the same thing we do for subframes.
2563         (RenderBox::paintBackgroundExtended): Don't do the extra draw so we can blend with the
2564         background color for the top frame when the view is transparent.
2565         * khtml/rendering/render_canvas.cpp: (RenderCanvas::paintBoxDecorations): More of the same.
2566
2567         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::paint): Make "fill with red" debug mode work only
2568         when the view is not transparent.
2569
2570         * kwq/WebCoreBridge.h: Added setDrawsBackground: method.
2571         * kwq/WebCoreBridge.mm: (-[WebCoreBridge setDrawsBackground:]): If told NO
2572         (don't draw background), then set isTransparent to true on the KHTMLView.
2573
2574 2004-04-09  Ken Kocienda  <kocienda@apple.com>
2575
2576         Reviewed by me
2577         
2578         Added one more layout test for editing.
2579
2580         * layout-tests/editing/deleting/delete-3608445-fix-expected.txt: Added.
2581         * layout-tests/editing/deleting/delete-3608445-fix.html: Added.
2582
2583 2004-04-08  Maciej Stachowiak  <mjs@apple.com>
2584
2585         Reviewed by John.
2586
2587         Changed things so that newly created objects get a prototype based
2588         on the scope chain of the current function, rather than the
2589         interpreter that started execution. This fixes the following bugs:
2590         
2591         <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2592         <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2593
2594         * khtml/ecma/kjs_binding.h:
2595         (KJS::cacheDOMObject):
2596         (KJS::cacheGlobalObject):
2597         * khtml/ecma/kjs_css.cpp:
2598         (KJS::getDOMStyleSheet):
2599         (KJS::getDOMStyleSheetList):
2600         (KJS::getDOMCSSValue):
2601         * khtml/ecma/kjs_dom.cpp:
2602         (KJS::getDOMDocumentNode):
2603         (KJS::getDOMNode):
2604         * khtml/ecma/kjs_events.cpp:
2605         (KJS::getDOMEvent):
2606         * khtml/ecma/kjs_html.cpp:
2607         (KJS::HTMLDocument::tryGet):
2608         (KJS::HTMLDocument::putValue):
2609         (KJS::getSelectHTMLCollection):
2610         * khtml/ecma/kjs_navigator.cpp:
2611         (Navigator::Navigator):
2612         (PluginBase::PluginBase):
2613         * khtml/ecma/kjs_window.cpp:
2614         (KJS::History::History):
2615         (KJS::FrameArray::FrameArray):
2616         (Screen::Screen):
2617         (Window::retrieveActive):
2618         (Window::put):
2619         (Window::isSafeScript):
2620         (WindowFunc::tryCall):
2621         (Location::put):
2622         (LocationFunc::tryCall):
2623
2624 2004-04-09  David Hyatt  <hyatt@apple.com>
2625
2626         Fix for 3613081, repaint glitches when using overflow:auto/overlay.
2627         
2628         Reviewed by john
2629
2630         * khtml/rendering/render_layer.cpp:
2631         (RenderLayer::updateScrollInfoAfterLayout):
2632
2633 2004-04-09  David Hyatt  <hyatt@apple.com>
2634
2635         Fix for 3608445, garbage characters rendered after doing delete.  Delta was unsigned when it was supposed to
2636         be signed, since deletion involves a negative delta.  Also had an off-by-one error in the line break end check.
2637         
2638         Reviewed by john
2639
2640         * khtml/rendering/render_text.cpp:
2641         (RenderText::setTextWithOffset):
2642
2643 2004-04-09  Ken Kocienda  <kocienda@apple.com>
2644
2645         Reviewed by me
2646         
2647         Added two more layout tests for editing.
2648
2649         * layout-tests/editing/selection/move-between-blocks-no-001-expected.txt: Added.
2650         * layout-tests/editing/selection/move-between-blocks-no-001.html: Added.
2651         * layout-tests/editing/selection/move-between-blocks-yes-001-expected.txt: Added.
2652         * layout-tests/editing/selection/move-between-blocks-yes-001.html: Added.
2653
2654 2004-04-09  Ken Kocienda  <kocienda@apple.com>
2655
2656         Reviewed by Dave
2657         
2658         Small collection of editing improvements.
2659
2660         * ChangeLog:
2661         * khtml/editing/htmlediting_impl.cpp:
2662         (shouldDeleteUpstreamPosition): This was deleting significant spaces on preceding
2663         lines when the caret was at the start of a line. Fixed. 
2664         (DeleteSelectionCommandImpl::doApply): Fixed a case where caret jumped to previous
2665         line when deleting a character at the start of a line after a BR.
2666         (InputNewlineCommandImpl::doApply): Handle more cases correctly. Previously, this
2667         only handled inserting a newline when the caret was already in a text node.
2668         (InputTextCommandImpl::prepareForTextInsertion): Ditto.
2669         (InputTextCommandImpl::execute): Ditto.
2670         * khtml/editing/htmlediting_impl.h:
2671         * khtml/rendering/render_block.cpp:
2672         (khtml::RenderBlock::checkSelectionPointIgnoringContinuations): Now can place caret
2673         with a click in an empty block.
2674         * khtml/rendering/render_block.h: Added checkSelectionPointIgnoringContinuations declaration.
2675         * khtml/rendering/render_replaced.cpp: 
2676         (RenderReplaced::checkSelectionPointIgnoringContinuations): Now can place caret with a click 
2677         on a replaced element.
2678         * khtml/rendering/render_replaced.h: Added checkSelectionPointIgnoringContinuations declaration.
2679         * khtml/rendering/render_text.cpp:
2680         (InlineTextBox::checkSelectionPoint): Now can place caret with a click in text on a line made "tall"
2681         by an image on the same line.
2682         * khtml/xml/dom_docimpl.cpp:
2683         (DocumentImpl::createEditingTextNode): This creates a text node subclass that whill always create
2684         a renderer for itself.
2685         * khtml/xml/dom_docimpl.h:
2686         * khtml/xml/dom_position.cpp:
2687         (DOMPosition::isLastRenderedPositionInEditableBlock): Improved code to handle more cases.
2688         * khtml/xml/dom_textimpl.cpp:
2689         (TextImpl::TextImpl): Rolled out m_rendererIsNeeded flag.
2690         (TextImpl::rendererIsNeeded): Ditto.
2691         (EditingTextImpl::EditingTextImpl): New class.
2692         (EditingTextImpl::~EditingTextImpl): New.
2693         (EditingTextImpl::rendererIsNeeded): New. Always returns true.
2694         * khtml/xml/dom_textimpl.h: New EditingTextImpl class.
2695         * layout-tests/editing/deleting/delete-3608430-fix-expected.txt: Added.
2696         * layout-tests/editing/deleting/delete-3608430-fix.html: Added.
2697         * layout-tests/editing/deleting/delete-3608462-fix-expected.txt: Added.
2698         * layout-tests/editing/deleting/delete-3608462-fix.html: Added.
2699         * layout-tests/editing/deleting/delete-trailing-ws-002-expected.txt: Added.
2700         * layout-tests/editing/deleting/delete-trailing-ws-002.html: Added.
2701
2702 2004-04-08  Chris Blumenberg  <cblu@apple.com>
2703
2704         Renamed the PasteHTMLCommand to PasteMarkupCommand. Removed PasteImageCommand because we will use PasteMarkupCommand for pasting images.
2705
2706         Reviewed by kocienda.
2707
2708         * ChangeLog:
2709         * khtml/editing/htmlediting.cpp:
2710         (PasteMarkupCommand::PasteMarkupCommand):
2711         (PasteMarkupCommand::~PasteMarkupCommand):
2712         (PasteMarkupCommand::impl):
2713         (PasteMarkupCommand::markupString):
2714         * khtml/editing/htmlediting.h:
2715         (khtml::):
2716         * khtml/editing/htmlediting_impl.cpp:
2717         (PasteMarkupCommandImpl::PasteMarkupCommandImpl):
2718         (PasteMarkupCommandImpl::~PasteMarkupCommandImpl):
2719         (PasteMarkupCommandImpl::commandID):
2720         (PasteMarkupCommandImpl::doApply):
2721         * khtml/editing/htmlediting_impl.h:
2722         (khtml::PasteMarkupCommandImpl::markupString):
2723         * khtml/khtml_part.cpp:
2724         (KHTMLPart::pasteMarkupString):
2725         * khtml/khtml_part.h:
2726         * kwq/WebCoreBridge.h:
2727         * kwq/WebCoreBridge.mm:
2728         (-[WebCoreBridge pasteMarkupString:]):
2729
2730
2731 2004-04-08  David Hyatt  <hyatt@apple.com>
2732
2733         Fix for 3608430 and 3608462, crashes in findNextLineBreak when deleting.  Make sure that the removal of line boxes
2734         always checks the previous root line box's line break information and dirties the line if it is pointing
2735         to the deleted object.
2736         
2737         Reviewed by kocienda
2738
2739         * khtml/rendering/render_line.cpp:
2740         (InlineFlowBox::removeChild):
2741
2742 2004-04-08  Chris Blumenberg  <cblu@apple.com>
2743
2744         Removed DOMExtensions.h from DOM.h until it is public.
2745
2746         Reviewed by koicienda.
2747
2748         * kwq/DOM.h:
2749
2750 2004-04-07  Chris Blumenberg  <cblu@apple.com>
2751
2752         WebCore side for supporting WebDOMOperations.   
2753
2754         Reviewed by rjw.
2755
2756         * WebCore-combined.exp:
2757         * WebCore.exp:
2758         * kwq/DOM.mm:
2759         * kwq/DOMExtensions.h:
2760         * kwq/WebCoreBridge.h:
2761         * kwq/WebCoreBridge.mm:
2762         (+[WebCoreBridge bridgeForDOMDocument:]): new
2763         (-[WebCoreBridge imageForImageElement:]): new
2764
2765 2004-04-07  Darin Adler  <darin@apple.com>
2766
2767         Reviewed by Chris.
2768
2769         * kwq/DOMCSS.h: Changed DOMCSS2Properties to be a category on DOMCSSStyleDeclaration
2770         (after API review, oops!, but I doubt anyone will even notice).
2771         * kwq/DOM-CSS.mm: Implemented the entire DOMCSS2Properties category.
2772
2773 2004-04-07  Ken Kocienda  <kocienda@apple.com>
2774
2775         Reviewed by Chris
2776
2777         * kwq/WebCoreBridge.mm:
2778         (-[WebCoreBridge _stringWithDocumentTypeStringAndMarkupString:]): Do not add a newline in between
2779         the doctype and the content. The newline was showing up when the content was pasted.
2780
2781 2004-04-07  Ken Kocienda  <kocienda@apple.com>
2782
2783         Reviewed by John
2784
2785         Removed concept of currentSelection from EditCommands and refined concept of
2786         startingSelection and endingSelection, making them work more sensibly in the 
2787         system of composed editing commands.
2788
2789         * khtml/editing/htmlediting.cpp: Removed currentSelection().
2790         * khtml/editing/htmlediting.h: Ditto.
2791         * khtml/editing/htmlediting_impl.cpp: currentSelection().
2792         (CompositeEditCommandImpl::applyCommandToComposite): Set the startingSelection 
2793         and endingSelection for the command being applied to the endingSelection of
2794         its new parent. This is the proper starting and ending point.
2795         (CompositeEditCommandImpl::deleteSelection): Changed call to currentSelection
2796         to endingSelection.
2797         (DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl): Ditto.
2798         (DeleteSelectionCommandImpl::DeleteSelectionCommandImpl): Changed call from startingSelection
2799         to endingSelection.
2800         (DeleteSelectionCommandImpl::joinTextNodesWithSameStyle): Changed call to currentSelection
2801         to endingSelection.
2802         (InputNewlineCommandImpl::doApply): Ditto.
2803         (InputTextCommandImpl::deleteCharacter): Ditto.
2804         (InputTextCommandImpl::prepareForTextInsertion): Ditto.
2805         (InputTextCommandImpl::execute): Ditto.
2806         (PasteHTMLCommandImpl::doApply): Ditto.
2807         (TypingCommandImpl::insertText): Remove extraneous call to reset endingSelection. This has
2808         already been done by the helpers this command uses to do its work.
2809         (TypingCommandImpl::issueCommandForDeleteKey): Changed call to currentSelection
2810         to endingSelection.
2811         (TypingCommandImpl::deleteKeyPressed): Remove extraneous call to reset endingSelection. This has
2812         already been done by the helpers this command uses to do its work.
2813         * khtml/editing/htmlediting_impl.h:
2814         (khtml::EditCommandImpl::endingSelection): Remove extraneous call to reset endingSelection. This has
2815         already been done by the helpers this command uses to do its work.
2816
2817 2004-04-07  Ken Kocienda  <kocienda@apple.com>
2818
2819         Reviewed by John
2820         
2821         Make paste work again. It has been broken for some undetermined
2822         period of time.
2823
2824         * khtml/editing/htmlediting_impl.cpp:
2825         (CompositeEditCommandImpl::insertNodeAt): Handle inserting a node when
2826         the reference node has children, or is an empty block.
2827         (CompositeEditCommandImpl::inputText): New convenience to create and
2828         apply an InputTextCommand.
2829         (InputTextCommandImpl::execute): Collapse whitespace when selection is
2830         not a range. Deleting the selection when it is a range already does that, 
2831         so no need to make special accommodation for it.
2832         (PasteHTMLCommandImpl::PasteHTMLCommandImpl): Initialize m_HTMLString using 
2833         an initialization list.
2834         (PasteHTMLCommandImpl::doApply): Collapse whitespace.... as above for 
2835         InputTextCommandImpl::execute. Don't need to qualify NodeImpl's with DOM 
2836         namespace. Clean up selection access; no need to grep around for it, the
2837         desired selection is returned by calling currentSelection(). Treat "simple
2838         text paste" like typing. Tighten up and simplify HTML fragment paste; no
2839         real change in algorithm. 
2840         (SplitTextNodeCommandImpl::SplitTextNodeCommandImpl): m_text1 member variable
2841         not initialized. This bug was introduced by a recent change by me. Fixing now.
2842         * khtml/editing/htmlediting_impl.h: Add inputText() declaration.
2843
2844 2004-04-06  Ken Kocienda  <kocienda@apple.com>
2845
2846         Reviewed by Richard
2847
2848         * khtml/khtml_part.cpp:
2849         (KHTMLPart::setSelection): Now calls setFocusNodeIfNeeded.
2850         (KHTMLPart::takeSelectionFrom): Now calls setFocusNodeIfNeeded.
2851         (KHTMLPart::clearSelection): Now calls setFocusNodeIfNeeded.
2852         (KHTMLPart::invalidateSelection): Now calls setFocusNodeIfNeeded.
2853         (KHTMLPart::setSelectionVisible): Now calls setFocusNodeIfNeeded.
2854         (KHTMLPart::setFocusNodeIfNeeded): New function focuses first element 
2855         of a selection that is contenteditable, if any of the nodes are. The "first"
2856         determination is made by doing a document-order search.
2857         * khtml/khtml_part.h:
2858         * khtml/xml/dom_nodeimpl.cpp: Remove debug spam.
2859         * kwq/WebCoreBridge.mm:
2860         (-[WebCoreBridge setSelectedDOMRange:]): Now updates document layout before
2861         setting the selection. This was needed for Blot, so that setting the 
2862         contenteditable attribute on the body is "seen" when the attempt is made
2863         to set the selection right immediately after.
2864
2865 2004-04-06  David Hyatt  <hyatt@apple.com>
2866
2867         After columns have been expanded to their preferred sizes, if space is left over in the table, then
2868         fixed columns should expand to fill space before percentage width columns do.  The old code had it
2869         backwards.
2870         
2871         Reviewed by john
2872
2873         * khtml/rendering/table_layout.cpp:
2874         (AutoTableLayout::layout):
2875
2876 2004-04-06  Ken Kocienda  <kocienda@apple.com>
2877
2878         Reviewed by Dave
2879
2880         * khtml/dom/dom_node.cpp:
2881         (Node::isContentEditable): Added. Calls through to impl function of same name.
2882         * khtml/dom/dom_node.h: Added isContentEditable declaration.
2883         * khtml/khtmlview.cpp:
2884         (KHTMLView::viewportMouseMoveEvent): Now, the cursor will change
2885         to an i-beam whenever it is over a node that is contenteditable, and nothing, 
2886         like a link, takes precedence.
2887
2888 2004-04-06  Ken Kocienda  <kocienda@apple.com>
2889
2890         Reviewed by Dave
2891
2892         * khtml/css/html4.css: Refine focus rules so that HTML and BODY
2893         elements do not draw a focus ring around themselves when focused.
2894         This prevents a silly-looking focus ring from drawing around a 
2895         document's entire contents when a body element is contenteditable.
2896
2897 2004-04-06  Ken Kocienda  <kocienda@apple.com>
2898
2899         Reviewed by Dave
2900
2901         Caret height is now the height of the tallest element on the line,
2902         mimicking NSText behavior.
2903
2904         * khtml/rendering/render_box.cpp:
2905         (RenderBox::caretPos): Use root line box topOverflow and bottomOverflow 
2906         for the calculation of caret height.
2907         * khtml/rendering/render_text.cpp:
2908         (RenderText::caretPos): Ditto.
2909
2910 2004-04-06  Ken Kocienda  <kocienda@apple.com>
2911
2912         Reviewed by me
2913
2914         Added a new suite of layout tests for editing, all added
2915         in the new layout-tests/editing subtree.
2916
2917         * layout-tests/editing/abe.jpg: Added.
2918         * layout-tests/editing/deleting/delete-block-contents-001-expected.txt: Added.
2919         * layout-tests/editing/deleting/delete-block-contents-001.html: Added.
2920         * layout-tests/editing/deleting/delete-block-contents-002-expected.txt: Added.
2921         * layout-tests/editing/deleting/delete-block-contents-002.html: Added.
2922         * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Added.
2923         * layout-tests/editing/deleting/delete-block-contents-003.html: Added.
2924         * layout-tests/editing/deleting/delete-br-001-expected.txt: Added.
2925         * layout-tests/editing/deleting/delete-br-001.html: Added.
2926         * layout-tests/editing/deleting/delete-br-002-expected.txt: Added.
2927         * layout-tests/editing/deleting/delete-br-002.html: Added.
2928         * layout-tests/editing/deleting/delete-br-003-expected.txt: Added.
2929         * layout-tests/editing/deleting/delete-br-003.html: Added.
2930         * layout-tests/editing/deleting/delete-br-004-expected.txt: Added.
2931         * layout-tests/editing/deleting/delete-br-004.html: Added.
2932         * layout-tests/editing/deleting/delete-br-005-expected.txt: Added.
2933         * layout-tests/editing/deleting/delete-br-005.html: Added.
2934         * layout-tests/editing/deleting/delete-br-006-expected.txt: Added.
2935         * layout-tests/editing/deleting/delete-br-006.html: Added.
2936         * layout-tests/editing/deleting/delete-character-001-expected.txt: Added.
2937         * layout-tests/editing/deleting/delete-character-001.html: Added.
2938         * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Added.
2939         * layout-tests/editing/deleting/delete-contiguous-ws-001.html: Added.
2940         * layout-tests/editing/deleting/delete-image-001-expected.txt: Added.
2941         * layout-tests/editing/deleting/delete-image-001.html: Added.
2942         * layout-tests/editing/deleting/delete-image-002-expected.txt: Added.
2943         * layout-tests/editing/deleting/delete-image-002.html: Added.
2944         * layout-tests/editing/deleting/delete-image-003-expected.txt: Added.
2945         * layout-tests/editing/deleting/delete-image-003.html: Added.
2946         * layout-tests/editing/deleting/delete-leading-ws-001-expected.txt: Added.
2947         * layout-tests/editing/deleting/delete-leading-ws-001.html: Added.
2948         * layout-tests/editing/deleting/delete-selection-001-expected.txt: Added.
2949         * layout-tests/editing/deleting/delete-selection-001.html: Added.
2950         * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Added.
2951         * layout-tests/editing/deleting/delete-trailing-ws-001.html: Added.
2952         * layout-tests/editing/editing.js: Added.
2953         * layout-tests/editing/inserting/typing-001-expected.txt: Added.
2954         * layout-tests/editing/inserting/typing-001.html: Added.
2955         * layout-tests/editing/inserting/typing-002-expected.txt: Added.
2956         * layout-tests/editing/inserting/typing-002.html: Added.
2957         * layout-tests/editing/inserting/typing-around-br-001-expected.txt: Added.
2958         * layout-tests/editing/inserting/typing-around-br-001.html: Added.
2959         * layout-tests/editing/inserting/typing-around-image-001-expected.txt: Added.
2960         * layout-tests/editing/inserting/typing-around-image-001.html: Added.
2961         * layout-tests/editing/selection/extend-by-character-001-expected.txt: Added.
2962         * layout-tests/editing/selection/extend-by-character-001.html: Added.
2963         * layout-tests/editing/selection/extend-by-character-002-expected.txt: Added.
2964         * layout-tests/editing/selection/extend-by-character-002.html: Added.
2965         * layout-tests/editing/selection/extend-by-character-003-expected.txt: Added.
2966         * layout-tests/editing/selection/extend-by-character-003.html: Added.
2967         * layout-tests/editing/selection/extend-by-character-004-expected.txt: Added.
2968         * layout-tests/editing/selection/extend-by-character-004.html: Added.
2969         * layout-tests/editing/selection/extend-by-character-005-expected.txt: Added.
2970         * layout-tests/editing/selection/extend-by-character-005.html: Added.
2971         * layout-tests/editing/selection/move-by-character-001-expected.txt: Added.
2972         * layout-tests/editing/selection/move-by-character-001.html: Added.
2973         * layout-tests/editing/selection/move-by-character-002-expected.txt: Added.
2974         * layout-tests/editing/selection/move-by-character-002.html: Added.
2975         * layout-tests/editing/selection/move-by-character-003-expected.txt: Added.
2976         * layout-tests/editing/selection/move-by-character-003.html: Added.
2977         * layout-tests/editing/selection/move-by-character-004-expected.txt: Added.
2978         * layout-tests/editing/selection/move-by-character-004.html: Added.
2979         * layout-tests/editing/selection/move-by-character-005-expected.txt: Added.
2980         * layout-tests/editing/selection/move-by-character-005.html: Added.
2981         * layout-tests/editing/undo/redo-typing-001-expected.txt: Added.
2982         * layout-tests/editing/undo/redo-typing-001.html: Added.
2983         * layout-tests/editing/undo/undo-typing-001-expected.txt: Added.
2984         * layout-tests/editing/undo/undo-typing-001.html: Added.
2985
2986 2004-04-06  Ken Kocienda  <kocienda@apple.com>
2987
2988         Reviewed by Dave
2989
2990         Added execCommand feature. 
2991         Added Javascript selection object.
2992         This lays the groundwork for layout tests for editing.
2993
2994         * khtml/dom/dom_doc.cpp:
2995         (DOM::Document::execCommand): Added. Calls through to impl's execCommand.
2996         * khtml/dom/dom_doc.h: Added execCommand declaration.
2997         * khtml/ecma/kjs_dom.cpp:
2998         (DOMDocumentProtoFunc::tryCall): Switch on new ExecCommand constant and call through to the document.
2999         * khtml/ecma/kjs_dom.h: Added ExecCommand constant.
3000         (KJS::DOMDocument::):
3001         * khtml/ecma/kjs_dom.lut.h: Generated file.
3002         * khtml/ecma/kjs_window.cpp:
3003         (Window::Window): Initialize selection object.
3004         (Window::selection): Return window's selection object.
3005         (Window::mark): Mark selection object.
3006         (WindowFunc::tryCall): Return selection object on GetSelection.
3007         (LocationFunc::tryCall): Added.
3008         (Selection::Selection): Added.
3009         (Selection::~Selection): Added.
3010         (Selection::get): Added.
3011         (Selection::put): Added.
3012         (Selection::toPrimitive): Added.
3013         (Selection::toString): Added.
3014         (SelectionFunc::tryCall): Added.
3015         * khtml/ecma/kjs_window.h:
3016         (KJS::Selection::): Added.
3017         (KJS::Selection::part): Added.
3018         (KJS::Selection::classInfo): Added.
3019         * khtml/ecma/kjs_window.lut.h: Generated file.
3020         * khtml/editing/htmlediting_impl.cpp:
3021         (debugPosition): Debugging aid.
3022         (DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): Move the ending position
3023         if you are about to delete it. Fixes a crasher I discovered while writing tests.
3024         (DeleteSelectionCommandImpl::doApply): Move to containing editable block position 0
3025         instead of 1 in a block in delete case 1.
3026         (InputTextCommandImpl::prepareForTextInsertion):
3027         (TypingCommandImpl::issueCommandForDeleteKey):
3028         * khtml/khtml_part.h:
3029         * khtml/khtml_selection.cpp:
3030         (KHTMLSelection::validate): Now adjusts the selection down to leaf nodes if needed.
3031         (KHTMLSelection::debugPosition): Debugging aid.
3032         * khtml/xml/dom_docimpl.cpp:
3033         (DocumentImpl::execCommand): Added. Supports five different commands.
3034         * khtml/xml/dom_docimpl.h:
3035         * khtml/xml/dom_nodeimpl.cpp:
3036         (NodeImpl::previousEditable): Use false instead of 0 for equality check.
3037         (NodeImpl::nextEditable): Ditto.
3038         * khtml/xml/dom_position.cpp:
3039         (DOMPosition::equivalentLeafPosition): New function
3040         (DOMPosition::previousRenderedEditablePosition): New function
3041         (DOMPosition::nextRenderedEditablePosition): New function
3042         (DOMPosition::equivalentUpstreamPosition): Refined behavior to handle more cases correctly.
3043         (DOMPosition::equivalentDownstreamPosition): Ditto.
3044         (DOMPosition::atStartOfContainingEditableBlock):New function
3045         (DOMPosition::atStartOfRootEditableBlock):New function
3046         * khtml/xml/dom_position.h:
3047         * kwq/KWQKHTMLPart.h:
3048         * kwq/KWQKHTMLPart.mm:
3049         (KWQKHTMLPart::issueUndoCommand): New function for calling undo programatically.
3050         (KWQKHTMLPart::issueRedoCommand): Ditto, but for redo.
3051         * kwq/KWQRenderTreeDebug.cpp:
3052         (nodePositionRelativeToRoot): New function to generate log information for the selection.
3053         (writeSelection): Writes the selection if there is one.
3054         (externalRepresentation): Calls writeSelection
3055         * kwq/WebCoreBridge.h: New declarations for issueUndoCommand and issueRedoCommand.
3056
3057 2004-04-05  Darin Adler  <darin@apple.com>
3058
3059         * khtml/html/kentities.gperf: Added &COPY; and &REG;, both supported by Gecko
3060         (and presumably by WinIE). Also re-sorted the list.
3061         * khtml/html/kentities.c: Regenerated.
3062
3063 2004-04-05  Darin Adler  <darin@apple.com>
3064
3065         Reviewed by Dave.
3066
3067         - rolled over fix from KHTML tree; anchor inside another anchor
3068
3069         * khtml/rendering/render_layer.cpp: (RenderLayer::nodeAtPoint):
3070         Make sure the URL element is the innermost one, by not setting it once
3071         it's already set.
3072
3073 2004-04-05  David Hyatt  <hyatt@apple.com>
3074
3075         Implement overflow: overlay so that a scrollbar can show/hide without causing a layout.
3076         
3077         Reviewed by darin
3078
3079         * ChangeLog:
3080         * khtml/css/css_computedstyle.cpp:
3081         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3082         * khtml/css/cssparser.cpp:
3083         (CSSParser::parseValue):
3084         * khtml/css/cssstyleselector.cpp:
3085         (khtml::CSSStyleSelector::applyProperty):
3086         * khtml/css/cssvalues.c:
3087         (hash_val):
3088         (findValue):
3089         * khtml/css/cssvalues.h:
3090         * khtml/css/cssvalues.in:
3091         * khtml/rendering/render_block.cpp:
3092         (khtml::RenderBlock::layoutBlock):
3093         (khtml::RenderBlock::layoutBlockChildren):
3094         (khtml::RenderBlock::rightOffset):
3095         * khtml/rendering/render_box.cpp:
3096         (RenderBox::contentWidth):
3097         (RenderBox::contentHeight):
3098         * khtml/rendering/render_layer.cpp:
3099         (RenderLayer::updateScrollInfoAfterLayout):
3100         * khtml/rendering/render_object.cpp:
3101         (RenderObject::clientWidth):
3102         (RenderObject::clientHeight):
3103         * khtml/rendering/render_style.h:
3104         (khtml::):
3105         (khtml::RenderStyle::hasAutoScrollbars):
3106         (khtml::RenderStyle::scrollsOverflow):
3107         (khtml::RenderStyle::includeScrollbarSize):
3108
3109 2004-04-03  David Hyatt  <hyatt@apple.com>
3110
3111         Implementation of <input type=range>, which makes sliders available in Web pages.
3112         
3113         Reviewed by john
3114
3115         * WebCore.pbproj/project.pbxproj:
3116         * khtml/ecma/kjs_dom.cpp:
3117         (DOMNode::getValueProperty):
3118         (DOMNode::putValue):
3119         * khtml/ecma/kjs_dom.h:
3120         (KJS::DOMNode::):
3121         * khtml/ecma/kjs_dom.lut.h:
3122         (KJS::):
3123         * khtml/html/html_formimpl.cpp:
3124         (HTMLInputElementImpl::setType):
3125         (HTMLInputElementImpl::type):
3126         (HTMLInputElementImpl::click):
3127         (HTMLInputElementImpl::accessKeyAction):
3128         (HTMLInputElementImpl::parseHTMLAttribute):
3129         (HTMLInputElementImpl::rendererIsNeeded):
3130         (HTMLInputElementImpl::createRenderer):
3131         (HTMLInputElementImpl::encoding):
3132         * khtml/html/html_formimpl.h:
3133         (DOM::HTMLInputElementImpl::):
3134         * khtml/misc/htmlattrs.c:
3135         (hash_attr):
3136         (findAttr):
3137         * khtml/misc/htmlattrs.h:
3138         * khtml/misc/htmlattrs.in:
3139         * khtml/rendering/render_form.cpp:
3140         (RenderLineEdit::slotTextChanged):
3141         (:RenderFormElement):
3142         (RenderSlider::calcMinMaxWidth):
3143         (RenderSlider::updateFromElement):
3144         (RenderSlider::slotSliderValueChanged):
3145         * khtml/rendering/render_form.h:
3146         (khtml::RenderSlider::element):
3147         (khtml::RenderSlider::renderName):
3148         (khtml::RenderSlider::canHaveIntrinsicMargins):
3149         * khtml/xml/dom2_eventsimpl.cpp:
3150         (EventImpl::typeToId):
3151         (EventImpl::idToType):
3152         * khtml/xml/dom2_eventsimpl.h:
3153         (DOM::EventImpl::):
3154         * kwq/KWQSlider.h: Added.
3155         * kwq/KWQSlider.mm: Added.
3156         (-[KWQSlider initWithQSlider:]):
3157         (-[KWQSlider slide:]):
3158         (m_val):
3159         (QSlider::setFont):
3160         (QSlider::sizeHint):
3161         (QSlider::setValue):
3162         (QSlider::setMinValue):
3163         (QSlider::setMaxValue):
3164         (QSlider::value):
3165         (QSlider::minValue):
3166         (QSlider::maxValue):
3167         (QSlider::sliderValueChanged):
3168         (QSlider::dimensions):
3169         * kwq/KWQSlot.mm:
3170         (KWQSlot::KWQSlot):
3171         (KWQSlot::call):
3172
3173 2004-04-05  Chris Blumenberg  <cblu@apple.com>
3174
3175         Fixed: <rdar://problem/3612580>: SPI: WebPlugin selection
3176
3177         Reviewed by kocienda.
3178
3179         * WebCore.pbproj/project.pbxproj:
3180         * khtml/rendering/render_replaced.cpp:
3181         (RenderWidget::setSelectionState): new override, calls QWidget::setIsSelected
3182         * khtml/rendering/render_replaced.h:
3183         (khtml::RenderWidget::selectionState): new override
3184         * kwq/KWQWidget.h:
3185         * kwq/KWQWidget.mm:
3186         (QWidget::setIsSelected): new, calls [WebCoreBridge setIsSelected:forView:]
3187         (QWidget::isSelected): new, calls [WebCoreBridge isViewSelected:]
3188         * kwq/WebCoreBridge.h:
3189         * kwq/WebCoreBridge.mm:
3190         (-[WebCoreBridge selectionColor]): new
3191
3192 2004-04-03  David Hyatt  <hyatt@apple.com>
3193
3194         Fix for 3601728, text overlaps borders at ejai.org.  Remove all the code in addForbidden for
3195         dir, menu, nobr, and pre that made them too restrictive regarding what child tags they could
3196         contain.
3197         
3198         Reviewed by kocienda
3199
3200         * khtml/html/dtd.cpp:
3201         (DOM::addForbidden):
3202         (DOM::removeForbidden):
3203
3204 2004-04-02  Chris Blumenberg  <cblu@apple.com>
3205
3206         Moved the DOM extensions to their own headers
3207
3208         Reviewed by kocienda.
3209
3210         * WebCore.pbproj/project.pbxproj:
3211         * kwq/DOM.h: include DOMExtensions.h
3212         * kwq/DOMExtensions.h: Added.
3213         * kwq/DOMHTML.h: moved extensions to DOMExtensions.h
3214         * kwq/DOMHTML.mm: Renamed to match header
3215
3216 2004-04-02  David Hyatt  <hyatt@apple.com>
3217
3218         Fix for 3610662, rendering sometimes doesn't update in response to mouse events that change style.
3219         The document changed list was getting messed up.
3220         
3221         Reviewed by darin
3222
3223         * khtml/xml/dom_docimpl.cpp:
3224         (DocumentImpl::updateDocumentsRendering):
3225         * khtml/xml/dom_docimpl.h:
3226
3227 === Safari-135 ===
3228
3229 2004-04-01  Darin Adler  <darin@apple.com>
3230
3231         Based on a fix by Eric Albert.
3232
3233         - fixed <rdar://problem/3594247>: Safari crashes when a background image has a height or width of 0
3234
3235         * khtml/rendering/render_box.cpp: (RenderBox::paintBackgroundExtended):
3236         Change code path so we don't mod with 0.
3237
3238 2004-04-01  Darin Adler  <darin@apple.com>
3239
3240         Reviewed by Dave.
3241
3242         - fixed <rdar://problem/3608305>: DEMO: menu in search field has one disabled item: localized string not found
3243
3244         * khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::HTMLInputElementImpl):
3245         Initialize m_maxResults to 0.
3246
3247 2004-04-01  Darin Adler  <darin@apple.com>
3248
3249         Reviewed by John.
3250
3251         - cleaned up image map code and made it work with XML documents
3252
3253         * khtml/html/html_documentimpl.h: Removed getMap and mapMap.
3254         * khtml/html/html_documentimpl.cpp: Removed getMap; moved to base class.
3255
3256         * khtml/html/html_imageimpl.cpp:
3257         (HTMLMapElementImpl::~HTMLMapElementImpl): Call new removeImageMap function instead
3258         of manipulating the mapMap field directly.
3259         (HTMLMapElementImpl::parseHTMLAttribute): Rewrite name changing code for simplicity
3260         and to avoid running off the end of the bufffer.
3261         Also remove image map before changing name so it doesn't end up in the map twice
3262         under both the old and new names.
3263         * khtml/html/html_imageimpl.h: Use a DOMString instead of QString for the name, since
3264         the public API already uses a DOMString.
3265
3266         * khtml/rendering/render_image.cpp: (RenderImage::nodeAtPoint): Call the new
3267         getImageMap instead of the old getMap.
3268
3269         * khtml/xml/dom_docimpl.h: Added addImageMap, removeImageMap, getImageMap, and m_imageMapsByName.
3270         * khtml/xml/dom_docimpl.cpp:
3271         (DocumentImpl::addImageMap): Added. Stores the image map under its name, unless there's
3272         already another map of the same.
3273         (DocumentImpl::removeImageMap): Added. Removes the image map if it's already filed by
3274         name. Avoid pitfall of removing another image map that has the same name.
3275         (DocumentImpl::getImageMap): Added. Simplified version of logic from getMap in HTMLDocumentImpl.
3276
3277 2004-04-01  Darin Adler  <darin@apple.com>
3278
3279         Reviewed by Ken.
3280
3281         - fixed <rdar://problem/3608978>: dual <map> means you can't select the enter site button at jurassicpark.com (same problem in MacIE, works in Netscape)
3282
3283         * khtml/html/html_imageimpl.cpp: (HTMLMapElementImpl::parseHTMLAttribute):
3284         Make the first <map> seen win, as in other browsers. The old code made the last <map> seen win.
3285
3286 2004-04-01  Ken Kocienda  <kocienda@apple.com>
3287
3288         Reviewed by me
3289         
3290         Missing file broke build after my last checkin
3291
3292         * ForwardingHeaders/rendering/render_line.h: Added.
3293
3294 2004-03-31  Ken Kocienda  <kocienda@apple.com>
3295
3296         Reviewed by Dave.
3297         
3298         Many, many editing improvements, with a concentration on getting
3299         caret navigation and deleting selections working correctly.
3300
3301         * WebCore.pbproj/project.pbxproj:
3302         * khtml/dom/dom_position.cpp: Removed.
3303         * khtml/dom/dom_position.h: Removed.
3304         * khtml/editing/htmlediting.cpp:
3305         (EditCommand::isNull): Inlined.
3306         (EditCommand::notNull): New function.
3307         (EditCommand::parent): Commands now have parents. Allows for walking the tree of composite commands.
3308         (EditCommand::setParent): Ditto.
3309         (EditCommand::emptyCommand): Returns a static empty command.
3310         (AppendNodeCommand::AppendNodeCommand): 
3311         (AppendNodeCommand::parentNode): Member variable name change only. parent -> parentNode.
3312         (DeleteCollapsibleWhitespaceCommand::DeleteCollapsibleWhitespaceCommand): New command.
3313         (InputTextCommand::InputTextCommand):
3314         (InputTextCommand::input):
3315         (InputTextCommand::charactersAdded):
3316         (JoinTextNodesCommand::JoinTextNodesCommand): Now derives directly from EditCommand.
3317         (RemoveNodeAndPruneCommand::RemoveNodeAndPruneCommand): New command.
3318         (SplitTextNodeCommand::SplitTextNodeCommand): Now derives directly from EditCommand.
3319         * khtml/editing/htmlediting.h:
3320         * khtml/editing/htmlediting_impl.cpp:
3321         (isNBSP): New helper.
3322         (isWS): New helper.
3323         (shouldPruneNode): New helper.
3324         (leadingWhitespacePosition): New helper.
3325         (trailingWhitespacePosition): New helper.
3326         (textNodesAreJoinable): New helper.
3327         (nonBreakingSpaceString): Returns a static DOMString containing a non-breaking space.
3328         (EditCommandImpl::EditCommandImpl):
3329         (EditCommandImpl::setStartingSelection): Now recursively sets starting selection on parents.
3330         (EditCommandImpl::setEndingSelection): As above, for ending selection.
3331         (EditCommandImpl::parent): New accessor.
3332         (EditCommandImpl::setParent): New accessor.
3333         (CompositeEditCommandImpl::doUnapply): Removed some logging.
3334         (CompositeEditCommandImpl::doReapply): Removed some logging.
3335         (CompositeEditCommandImpl::applyCommandToComposite): Sets parent.
3336         (CompositeEditCommandImpl::removeNodeAndPrune): New comvenience.
3337         (CompositeEditCommandImpl::replaceText): New comvenience.
3338         (CompositeEditCommandImpl::deleteSelection): New comvenience.
3339         (CompositeEditCommandImpl::deleteCollapsibleWhitespace): New comvenience.
3340         (AppendNodeCommandImpl::AppendNodeCommandImpl): Member variable name change only. parent -> parentNode.
3341         (AppendNodeCommandImpl::~AppendNodeCommandImpl): Ditto.
3342         (AppendNodeCommandImpl::doApply): Ditto.
3343         (AppendNodeCommandImpl::doUnapply): Ditto.
3344         (DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl): New command
3345         (debugPosition): New debugging aid.
3346         (DeleteSelectionCommandImpl::doApply): Major reworking to handle more cases correctly.
3347         (InputNewlineCommandImpl::doApply): Position and selection tweaks.
3348         (InputTextCommandImpl::InputTextCommandImpl): Handles more cases now, like typing after an image.
3349         (JoinTextNodesCommandImpl::JoinTextNodesCommandImpl): Now derives directly from EditCommand.
3350         Implements the guts of the command itself now, rather than replying on its former base class.
3351         (RemoveNodeAndPruneCommandImpl::RemoveNodeAndPruneCommandImpl): New command.
3352         (SplitTextNodeCommandImpl::SplitTextNodeCommandImpl): Now derives directly from EditCommand.
3353         Implements the guts of the command itself now, rather than replying on its former base class.
3354         (TypingCommandImpl::TypingCommandImpl): Major rework to handle more cases correctly.
3355         * khtml/editing/htmlediting_impl.h:
3356         * khtml/html/html_elementimpl.cpp:
3357         (HTMLElementImpl::isContentEditable): More efficient use of the style system to answer the question.
3358         * khtml/khtml_part.cpp:
3359         (KHTMLPart::setSelection): Fixes an issue where the caret would not repaint after being moved when undoing.
3360         (KHTMLPart::takeSelectionFrom): Ditto.
3361         (KHTMLPart::clearSelection): Ditto.
3362         (KHTMLPart::invalidateSelection): Ditto.
3363         (KHTMLPart::setSelectionVisible): Ditto.
3364         (KHTMLPart::slotClearSelection): Ditto.
3365         (KHTMLPart::clearCaretRectIfNeeded):  Ditto.
3366         (KHTMLPart::notifySelectionChanged): Ditto.
3367         (KHTMLPart::unappliedEditing): Now uses EditCommand::emptyCommand().
3368         (KHTMLPart::reappliedEditing): Ditto.
3369         * khtml/khtml_part.h:
3370         * khtml/khtml_selection.cpp:
3371         (KHTMLSelection::KHTMLSelection):
3372         (KHTMLSelection::modify): Updated to work with new DOMPosition API.
3373         (KHTMLSelection::paintCaret): Ditto.
3374         (KHTMLSelection::moveToRenderedContent): Ditto.
3375         (KHTMLSelection::basePosition): New convenience.
3376         (KHTMLSelection::extentPosition): New convenience.