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