Safari 2.0 (v143) stamp
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 === Safari-143 ===
2
3 2004-06-04  Kevin Decker  <kdecker@apple.com>
4
5         Reviewed by Dave.
6
7         - kwq/KWQKHTMLPart.mm: addMessagetoConsole places sourceURL in the dictionary
8         - khtml/xml/dom_docimpl.cpp: right now, we don't have a way to get a url,
9           so we leave this blank
10         - khtml/ecma/kjs_window.cpp: still need to get the real line number and sourceURL
11         - khtml/ecma/kjs_proxy.cpp: now passing the sourceURL to addMessageToConsole
12         - khtml/ecma/kjs_events.cpp: still need to grab an accurate line number and sourceURL
13         
14         * khtml/ecma/kjs_events.cpp:
15         (JSEventListener::handleEvent):
16         (JSLazyEventListener::handleEvent):
17         * khtml/ecma/kjs_proxy.cpp:
18         (KJSProxyImpl::evaluate):
19         * khtml/ecma/kjs_window.cpp:
20         (Window::isSafeScript):
21         (ScheduledAction::execute):
22         * khtml/xml/dom_docimpl.cpp:
23         (DocumentImpl::open):
24         * kwq/KWQKHTMLPart.h:
25         * kwq/KWQKHTMLPart.mm:
26         (KWQKHTMLPart::addMessageToConsole):
27
28 2004-06-04  Ken Kocienda  <kocienda@apple.com>
29
30         Reviewed by Hyatt
31
32         Fix a comical little bug where the style-applying code did not take into
33         account deleting content from the start of a block. After the deletion, 
34         the caret is placed in the node before the deleted content and so 
35         inserting a styled fragment after the deletion position works great.
36         The problem is that if the selectionis at the start of a block, there
37         is no "position before the deletion" and the caret is placed in the new
38         first child of the block. Inserting the styled content after this 
39         node is just plain wrong. Now, this case is handled correctly, and the
40         styled content is inserted in the proper position.
41
42         * khtml/editing/htmlediting_impl.cpp:
43         (khtml::ApplyStyleCommandImpl::insertFragment):
44
45 2004-06-04  Ken Kocienda  <kocienda@apple.com>
46
47         Reviewed by Hyatt
48
49         * khtml/rendering/bidi.cpp:
50         (khtml::RenderBlock::layoutInlineChildren): Only add additional line height
51         in for root editable elements. This helps to keep layout from deviating too
52         much from the intended page layout, but still gives an empty document a line
53         in which it can blink the caret.
54
55 2004-06-04  Ken Kocienda  <kocienda@apple.com>
56
57         Reviewed by Hyatt
58
59         Made some progress on this set of related bugs:
60         
61         <rdar://problem/3675867>: "Make execCommand work as specified in the Javascript execCommand Compatibility Plan"
62         <rdar://problem/3675898>: "Make queryCommandEnabled work as specified in the Javascript execCommand Compatibility Plan"
63         <rdar://problem/3675899>: "Make queryCommandIndeterm work as specified in the Javascript execCommand Compatibility Plan"
64         <rdar://problem/3675901>: "Make queryCommandState work as specified in the Javascript execCommand Compatibility Plan"
65         <rdar://problem/3675903>: "Make queryCommandSupported work as specified in the Javascript execCommand Compatibility Plan"
66         <rdar://problem/3675904>: "Make queryCommandValue work as specified in the Javascript execCommand Compatibility Plan"
67         
68         I did several things to move the ahead with the plan:
69         
70         1. The latter five methods did not appear in the tree at all. Now they do, although
71         
72         2. I removed the implementation for these editing methods from dom_docimpl.cpp, and moved
73            them out to new js_editing.cpp/js_editing.h files. The remaining code in dom_docimpl.cpp
74            is glue to call over to the new JSEditor object defined in the new files.
75            
76         3. For a couple of the command implementations in js_editing.cpp, I made a stab at returning sensible values.
77            For others, I just return place-holder values. I have added some comments to describe what has been done and
78            what still needs to be done. 
79
80         * WebCore.pbproj/project.pbxproj:
81         * khtml/dom/dom_doc.cpp: Add call-overs for these methods.
82         (DOM::Document::queryCommandEnabled):
83         (DOM::Document::queryCommandIndeterm):
84         (DOM::Document::queryCommandState):
85         (DOM::Document::queryCommandSupported):
86         (DOM::Document::queryCommandValue):
87         * khtml/dom/dom_doc.h:
88         * khtml/ecma/kjs_dom.cpp: Add queryCommandXXX terminology.
89         (DOMDocumentProtoFunc::tryCall):
90         * khtml/ecma/kjs_dom.h:
91         (KJS::DOMDocument::):
92         * khtml/ecma/kjs_dom.lut.h:
93         (KJS::):
94         * khtml/editing/jsediting.cpp: Added. This file implements the guts of editing-related JS methods.
95         (DOM::execCommandNotImplemented):
96         (DOM::queryBoolNotImplemented):
97         (DOM::queryValueNotImplemented):
98         (DOM::JSEditor::commandDict):
99         (DOM::JSEditor::JSEditor):
100         (DOM::JSEditor::~JSEditor):
101         (DOM::JSEditor::commandIdentifier):
102         (DOM::JSEditor::addCommand):
103         (DOM::JSEditor::initDict):
104         (DOM::JSEditor::execCommand):
105         (DOM::JSEditor::queryCommandEnabled):
106         (DOM::JSEditor::queryCommandIndeterm):
107         (DOM::JSEditor::queryCommandState):
108         (DOM::JSEditor::queryCommandSupported):
109         (DOM::JSEditor::queryCommandValue):
110         (DOM::JSEditor::execCommandCopy):
111         (DOM::JSEditor::execCommandCut):
112         (DOM::JSEditor::execCommandDelete):
113         (DOM::JSEditor::execCommandInsertText):
114         (DOM::JSEditor::execCommandPaste):
115         (DOM::JSEditor::execCommandRedo):
116         (DOM::JSEditor::execCommandSelectAll):
117         (DOM::JSEditor::execCommandUndo):
118         (DOM::JSEditor::enabledIfPartNotNull):
119         (DOM::JSEditor::enabledIfSelectionNotEmpty):
120         (DOM::JSEditor::enabledIfSelectionIsRange):
121         (DOM::JSEditor::commandSupported):
122         * khtml/editing/jsediting.h: Added.
123         (DOM::JSEditor::CommandIdentifier::CommandIdentifier):
124         (DOM::JSEditor::document):
125         (DOM::JSEditor::part):
126         * khtml/xml/dom_docimpl.cpp: Rework JS editing support into glue that calls over into new JSEditor object.
127         (DocumentImpl::DocumentImpl):
128         (DocumentImpl::~DocumentImpl):
129         (DocumentImpl::jsEditor):
130         (DocumentImpl::execCommand):
131         (DocumentImpl::queryCommandEnabled):
132         (DocumentImpl::queryCommandIndeterm):
133         (DocumentImpl::queryCommandState):
134         (DocumentImpl::queryCommandSupported):
135         (DocumentImpl::queryCommandValue):
136         * khtml/xml/dom_docimpl.h:
137
138 2004-06-03  Richard Williamson   <rjw@apple.com>
139
140         Added setCompositeOperation method to Context2D.
141         Actually pass composite operation to drawPixmap (instead of 1).
142
143         Reviewed by jay lo.
144
145         * khtml/ecma/kjs_html.cpp:
146         (KJS::Context2DFunction::tryCall):
147         * khtml/ecma/kjs_html.h:
148         (KJS::Context2D::):
149         * khtml/ecma/kjs_html.lut.h:
150         (KJS::):
151         * kwq/KWQPainter.h:
152         * kwq/KWQPainter.mm:
153         (QPainter::compositeOperatorFromString):
154         (QPainter::drawPixmap):
155
156 2004-06-03  David Hyatt  <hyatt@apple.com>
157
158         Add support for box-flex-group-transition (whew!), a new property that is going to enable some incredibly
159         complicated flexing layouts in HTML.
160
161         This is Stage 1 - wire up the CSS property and make it get parsed into front-end data.  Nobody actually looks
162         at this data yet.
163         
164         Reviewed by darin
165
166         * khtml/css/css_valueimpl.cpp:
167         (CSSInheritedValueImpl::cssText):
168         (ShadowValueImpl::cssText):
169         (length):
170         (FlexGroupTransitionValueImpl::~FlexGroupTransitionValueImpl):
171         (FlexGroupTransitionValueImpl::cssText):
172         * khtml/css/css_valueimpl.h:
173         (DOM::FlexGroupTransitionValueImpl::cssValueType):
174         * khtml/css/cssparser.cpp:
175         (CSSParser::parseValue):
176         (CSSParser::parseShadow):
177         (FlexGroupTransitionParseContext::length):
178         (FlexGroupTransitionParseContext::~FlexGroupTransitionParseContext):
179         (FlexGroupTransitionParseContext::failed):
180         (FlexGroupTransitionParseContext::allowGroup):
181         (FlexGroupTransitionParseContext::commitGroup):
182         (FlexGroupTransitionParseContext::commitSlash):
183         (FlexGroupTransitionParseContext::commitLength):
184         (FlexGroupTransitionParseContext::commitValue):
185         (CSSParser::parseFlexGroupTransition):
186         * khtml/css/cssparser.h:
187         * khtml/css/cssproperties.c:
188         (hash_prop):
189         (findProp):
190         * khtml/css/cssproperties.h:
191         * khtml/css/cssproperties.in:
192         * khtml/rendering/render_style.cpp:
193         (StyleFlexibleBoxData::StyleFlexibleBoxData):
194         (StyleFlexibleBoxData::operator==):
195         (StyleFlexibleBoxData::transitionDataEquivalent):
196         (StyleCSS3InheritedData::operator==):
197         (StyleCSS3InheritedData::shadowDataEquivalent):
198         (ShadowData::operator==):
199         (RenderStyle::setBoxFlexGroupTransition):
200         (length):
201         (FlexGroupTransitionData::operator==):
202         * khtml/rendering/render_style.h:
203         (khtml::FlexGroupTransitionData::next):
204         (khtml::FlexGroupTransitionData::~FlexGroupTransitionData):
205         (khtml::FlexGroupTransitionData::operator!=):
206         (khtml::StyleFlexibleBoxData::~StyleFlexibleBoxData):
207         (khtml::RenderStyle::boxFlexGroupTransition):
208
209 2004-06-03  Richard Williamson   <rjw@apple.com>
210
211         Add extra sanity check to Image parameter of drawImage...
212
213         Reviewed by Hyatt.
214
215         * khtml/ecma/kjs_html.cpp:
216         (KJS::Context2DFunction::tryCall):
217
218 2004-06-02  David Hyatt  <hyatt@apple.com>
219
220         Fix for 3673931, negative margins on objects that dodge floats not handled correctly.
221         
222         Reviewed by darin
223
224         * khtml/rendering/render_block.cpp:
225         (khtml::RenderBlock::layoutBlockChildren):
226
227 2004-06-03  Ken Kocienda  <kocienda@apple.com>
228
229         Reviewed by Hyatt
230
231         Fix for layout regression I caused when fixing:
232
233         <rdar://problem/3668619>: "REGRESSION: text placed on pasteboard by WebKit is offset by one character"
234
235         Extra height is added to empty blocks that are editable, so we can click to place
236         the caret in them. This extra height was erroneously being added to non-editable
237         blocks as a result of my earlier change. After looking at this and doing some
238         code review, there are the following changes:
239         
240         Change away from "containingBlock" terminology in the NodeImpl class. The
241         operation we are doing in NodeImpl is not the same as what is done in CSS
242         when it uses the term "containingBlock" so:
243             containingBlock changes to enclosingBlockFlowElement, and
244             rootEditableBlock changes to rootEditableElement
245         
246         The vast majority of changes here are to make these name changes. The other
247         significant piece of work, and the fix for the regression, is to change 
248         bidi.cpp to only include this extra line height if a block is empty
249         and is content-editable.    
250
251         * khtml/editing/htmlediting_impl.cpp:
252         (khtml::leadingWhitespacePosition):
253         (khtml::trailingWhitespacePosition):
254         (khtml::DeleteSelectionCommandImpl::doApply):
255         (khtml::InputNewlineCommandImpl::doApply):
256         (khtml::RemoveNodeAndPruneCommandImpl::doApply):
257         (khtml::TypingCommandImpl::issueCommandForDeleteKey):
258         * khtml/rendering/bidi.cpp:
259         (khtml::RenderBlock::layoutInlineChildren):
260         * khtml/xml/dom_docimpl.cpp:
261         (DocumentImpl::relinquishesEditingFocus):
262         (DocumentImpl::acceptsEditingFocus):
263         * khtml/xml/dom_nodeimpl.cpp:
264         * khtml/xml/dom_nodeimpl.h:
265         * khtml/xml/dom_position.cpp:
266         (DOM::Position::equivalentLeafPosition):
267         (DOM::Position::previousCharacterPosition):
268         (DOM::Position::nextCharacterPosition):
269         (DOM::Position::previousLinePosition):
270         (DOM::Position::nextLinePosition):
271         (DOM::Position::equivalentUpstreamPosition):
272         (DOM::Position::equivalentDownstreamPosition):
273         (DOM::Position::atStartOfRootEditableElement):
274         (DOM::Position::inRenderedContent):
275         (DOM::Position::rendersOnSameLine):
276         (DOM::Position::rendersInDifferentPosition):
277         (DOM::Position::isLastRenderedPositionInEditableBlock):
278         (DOM::Position::inFirstEditableInRootEditableElement):
279         (DOM::Position::inLastEditableInRootEditableElement):
280         (DOM::Position::inFirstEditableInContainingEditableBlock):
281         (DOM::Position::inLastEditableInContainingEditableBlock):
282         * khtml/xml/dom_position.h:
283         * khtml/xml/dom_selection.cpp:
284         (DOM::Selection::moveToRenderedContent):
285
286 2004-06-02  Trey Matteson  <trey@apple.com>
287
288         Added types property to JS clipboard object.
289
290         Reviewed by Richard.
291
292         * khtml/ecma/kjs_events.cpp:
293         (Clipboard::getValueProperty):  Create JS array for strings coming from the clipboard impl.
294         * khtml/ecma/kjs_events.h:
295         (KJS::Clipboard::):
296         * khtml/ecma/kjs_events.lut.h:
297         * kwq/KWQClipboard.mm:
298         (MIMETypeFromCocoaType):  New helper routine to map types.
299         (KWQClipboard::types):  Implement based on NSPasteboard's types.
300
301 2004-06-02  Richard Williamson   <rjw@apple.com>
302
303         Corrected typo ID_IMG should have been ID_CANVAS when
304         checking for the canvas composite operator.
305
306         Reviewed by Ken.
307
308         * khtml/rendering/render_canvasimage.cpp:
309         (RenderCanvasImage::paint):
310
311 2004-06-02  Richard Williamson   <rjw@apple.com>
312
313         Correctly size the <CANVAS> if margins, borders, or
314         padding is added.
315
316         Reviewed by Trey.
317
318         * khtml/rendering/render_canvasimage.cpp:
319         (RenderCanvasImage::createDrawingContext):
320
321 >>>>>>> 1.2855
322 2004-06-01  Trey Matteson  <trey@apple.com>
323
324         First cut at the source side of DHTML dragging.  Following IE, new events are added:
325         ondragstart, ondrag, ondragend.  The recently added CSS property -khtml-user-drag can
326         be used to make an element draggable.  event.dataTransfer.setDragImage(ImageObject,x,y)
327         can be used from ondragstart to set a static image for the dragImage.  x,y is the location
328         of the mouse within the image from the upper right corner.  clipboard methods setdata
329         and cleardata are implemented.
330
331         Reviewed by hyatt.
332
333         * khtml/ecma/kjs_dom.cpp:
334         (DOMNode::getValueProperty):  Boilerplate for new events
335         (DOMNode::putValue):  Boilerplate for new events
336         * khtml/ecma/kjs_dom.h:
337         (KJS::DOMNode::):   Boilerplate for new events
338         * khtml/ecma/kjs_dom.lut.h:
339         * khtml/ecma/kjs_events.cpp:
340         (DOMMouseEvent::getValueProperty):  Return undefined for clipboard when its not a drag event.
341         (ClipboardProtoFunc::tryCall):  setDragImage glue to clipboard routine.
342         * khtml/ecma/kjs_events.h:
343         (KJS::Clipboard::):
344         * khtml/ecma/kjs_events.lut.h:
345         * khtml/html/html_elementimpl.cpp:
346         (HTMLElementImpl::parseHTMLAttribute):  Boilerplate for new events
347         * khtml/khtml_part.cpp:
348         (KHTMLPart::shouldDragAutoNode):  Empty impl of new method, where UA determines
349         draggability for events with -khtml-user-drag=auto
350         * khtml/khtml_part.h:
351         * khtml/misc/htmlattrs.c:
352         * khtml/misc/htmlattrs.h:
353         * khtml/misc/htmlattrs.in:  Boilerplate for new events
354         * khtml/rendering/render_object.cpp:
355         (RenderObject::draggableNode):  Find the node or parent node which might be dragged.
356         * khtml/rendering/render_object.h:
357         * khtml/xml/dom2_eventsimpl.cpp:
358         (EventImpl::typeToId):  Boilerplate for new events
359         (EventImpl::idToType):  Boilerplate for new events
360         * khtml/xml/dom2_eventsimpl.h:
361         (DOM::EventImpl::):  Boilerplate for new events
362         * kwq/KWQClipboard.h:
363         * kwq/KWQClipboard.mm:
364         (KWQClipboard::clearData):  Implemented to call NSPasteboard
365         (KWQClipboard::clearAllData): ditto
366         (KWQClipboard::getData):  fix corner case that came up testing
367         (KWQClipboard::setData):  Implemented to call NSPasteboard
368         (KWQClipboard::dragLocation):  Simple setter/getters
369         (KWQClipboard::setDragLocation):
370         (KWQClipboard::dragImage):
371         (KWQClipboard::setDragImage):
372         (KWQClipboard::dragNSImage):
373         * kwq/KWQKHTMLPart.h:
374         * kwq/KWQKHTMLPart.mm:
375         (KWQKHTMLPart::KWQKHTMLPart): init new member var
376         (KWQKHTMLPart::dragHysteresisExceeded):  Hysteresis moved here from WebKit
377         (KWQKHTMLPart::dispatchDragSrcEvent):  Send a dragging event to the current dragSource
378         (KWQKHTMLPart::khtmlMouseMoveEvent):  Initiate dragging, now including consulting DHTML,
379         hysteresis and sending ondragstart.
380         (KWQKHTMLPart::dragSourceMovedTo):  simple passthrough
381         (KWQKHTMLPart::dragSourceEndedAt):  simple passthrough
382         (KWQKHTMLPart::mouseDown):  salt away _mouseDownX, _mouseDownY
383         (KWQKHTMLPart::shouldDragAutoNode):  Called for -khtml-user-drag=auto.  We just call
384         out to WebKit.
385         * kwq/WebCoreBridge.h:
386         * kwq/WebCoreBridge.mm:
387         (-[WebCoreBridge dragSourceMovedTo:]):  New glue to drive new dragging events.
388         (-[WebCoreBridge dragSourceEndedAt:operation:]):
389
390 2004-06-02  Ken Kocienda  <kocienda@apple.com>
391
392         Reviewed by me
393
394         Finish off name change from previous check-in by changing dom_edititerator
395         file names to dom_positioniterator. Files copied and renamed in repository.
396         Includes updated as needed.
397
398         * ForwardingHeaders/xml/dom_edititerator.h: Removed.
399         * ForwardingHeaders/xml/dom_positioniterator.h: Added.
400         * WebCore.pbproj/project.pbxproj:
401         * khtml/editing/htmlediting_impl.cpp:
402         * khtml/xml/dom_edititerator.cpp: Removed.
403         * khtml/xml/dom_edititerator.h: Removed.
404         * khtml/xml/dom_position.cpp:
405         * khtml/xml/dom_positioniterator.cpp: Added.
406         (DOM::PositionIterator::peekPrevious):
407         (DOM::PositionIterator::peekNext):
408         (DOM::PositionIterator::atStart):
409         (DOM::PositionIterator::atEnd):
410         * khtml/xml/dom_positioniterator.h: Added.
411         (DOM::PositionIterator::PositionIterator):
412         (DOM::PositionIterator::current):
413         (DOM::PositionIterator::previous):
414         (DOM::PositionIterator::next):
415         (DOM::PositionIterator::setPosition):
416         (DOM::PositionIterator::isEmpty):
417         * khtml/xml/dom_selection.cpp:
418
419 2004-06-02  Ken Kocienda  <kocienda@apple.com>
420
421         Reviewed by Darin
422
423         Probable fix for this bug:
424         
425         <rdar://problem/3668619>: "REGRESSION: text placed on pasteboard by WebKit is offset by one character"
426         
427         I could not reproduce the bug myself, which is why I call the fix
428         as probable.
429         
430         Darin and I did some code inspection and found some problems
431         with the equivalentUpstreamPosition and
432         equivalentDownstreamPosition functions on DOM::Position and how
433         these functions dealt with changing from editable to
434         non-editable content. As a result of these discoveries, I went
435         over this code and the helpers and functions which support them,
436         and made some corrections and simplifications. The big changes
437         are as follows:
438         
439         1. Rename EditIterator class to PositionIterator. This class needs
440         to run code for selections in non-editable content, so the name
441         change is appropriate.
442         
443         2. Change containingEditableBlock to containingBlock. It turns out
444         that none of the editing code relies on the distinction between
445         editable blocks and non-editable blocks. The important distinction
446         is the block boundary. The notion of rootEditableBlock remains.
447          
448         * khtml/editing/htmlediting_impl.cpp:
449         (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): PositionIterator name change.
450         (khtml::DeleteSelectionCommandImpl::joinTextNodesWithSameStyle): Ditto.
451         (khtml::DeleteSelectionCommandImpl::containsOnlyWhitespace): Ditto.
452         (khtml::DeleteSelectionCommandImpl::doApply): Ditto.
453         (khtml::InputNewlineCommandImpl::doApply): Ditto.
454         (khtml::RemoveNodeAndPruneCommandImpl::doApply): Ditto.
455         * khtml/rendering/bidi.cpp:
456         (khtml::RenderBlock::layoutInlineChildren): Ditto.
457         * khtml/xml/dom_edititerator.cpp:
458         (DOM::PositionIterator::peekPrevious): Call for previousLeafNode instead of previousEditable.
459         Editable check is not appropriate as this class is used for non-editable content.
460         (DOM::PositionIterator::peekNext): Call nextLeafNode instead of nextEditable, as above.
461         (DOM::PositionIterator::atStart): Call for previousLeafNode instead of previousEditable, as above.
462         (DOM::PositionIterator::atEnd): Call nextLeafNode instead of nextEditable, as above.
463         * khtml/xml/dom_edititerator.h:
464         (DOM::PositionIterator::PositionIterator): PositionIterator name change. Remove unused and unneeded constructors.
465         * khtml/xml/dom_nodeimpl.cpp:
466         (NodeImpl::previousEditable): Simplify. Rely on previousLeafNode as a helper.
467         (NodeImpl::nextEditable): Ditto, but rely on nextLeafNode.
468         (NodeImpl::previousLeafNode): Remove tree-walking code. Rely on traversePreviousNode as a helper.
469         (NodeImpl::nextLeafNode): Ditto, but rely on traverseNextNode.
470         (NodeImpl::containingBlock): Renamed replacement for containingEditableBlock.
471         (NodeImpl::inSameContainingEditableBlock): Call renamed containingBlock.
472         * khtml/xml/dom_nodeimpl.h:
473         * khtml/xml/dom_position.cpp:
474         (DOM::Position::previousCharacterPosition): Various name changes, as described above.
475         (DOM::Position::nextCharacterPosition): Ditto.
476         (DOM::Position::previousWordPosition): Ditto.
477         (DOM::Position::nextWordPosition): Ditto.
478         (DOM::Position::previousLinePosition): Ditto.
479         (DOM::Position::nextLinePosition): Ditto.
480         (DOM::Position::equivalentUpstreamPosition): Remove bogus check for editable node in loop. Perform
481         improved block-crossing check at start of loop which works for editable and non-editable content.
482         This is the crux of the fix for the bug.
483         (DOM::Position::equivalentDownstreamPosition): Ditto.
484         (DOM::Position::inRenderedContent): Various name changes, as described above.
485         (DOM::Position::rendersOnSameLine): Ditto.
486         (DOM::Position::rendersInDifferentPosition): Ditto.
487         (DOM::Position::isFirstRenderedPositionOnLine): Ditto.
488         (DOM::Position::isLastRenderedPositionOnLine): Ditto.
489         (DOM::Position::isLastRenderedPositionInEditableBlock): Ditto.
490         (DOM::Position::inFirstEditableInRootEditableBlock): Ditto.
491         (DOM::Position::inLastEditableInRootEditableBlock): Ditto.
492         (DOM::Position::inFirstEditableInContainingEditableBlock): Ditto.
493         (DOM::Position::inLastEditableInContainingEditableBlock): Ditto.
494
495 2004-06-01  Richard Williamson   <rjw@apple.com>
496
497         Fixed deployment build warning.
498
499         * khtml/rendering/render_canvasimage.cpp:
500         (RenderCanvasImage::paint):
501
502 2004-06-01  Richard Williamson   <rjw@apple.com>
503
504         Added support for composite attribute to <CANVAS>
505         Added support for drawImage and drawImageFromRect to <CANVAS>, i.e.:
506
507             <html>
508             <head>
509             <script>
510             
511             var img = new Image(600,600);
512             
513             function drawImage()
514             {
515                     var aCanvas = document.getElementById ("canvas1");
516                     var context = aCanvas.getContext("context-2d");
517                     context.drawImage (img, 0, 0, 600, 600, "copy");
518             }
519             
520             img.onload = drawImage;
521             img.src = "http://www.google.com/images/logo.gif";
522             
523             </script>
524             </head>
525             <body>
526             <canvas id="canvas1" width=600 height=600>
527             </body>
528             <html>
529
530         Reviewed by Trey.
531
532         * khtml/ecma/kjs_html.cpp:
533         (KJS::Context2DFunction::tryCall):
534         (Context2D::Context2D):
535         * khtml/ecma/kjs_html.h:
536         * khtml/rendering/render_canvasimage.cpp:
537         (RenderCanvasImage::paint):
538         * kwq/KWQPainter.h:
539         * kwq/KWQPainter.mm:
540         (QPainter::getCompositeOperation):
541         (QPainter::setCompositeOperation):
542         (QPainter::drawPixmap):
543         (QPainter::drawTiledPixmap):
544         * kwq/KWQPixmap.h:
545         * kwq/KWQPixmap.mm:
546         (QPixmap::flushRasterCache):
547         * kwq/WebCoreImageRenderer.h:
548         * kwq/WebCoreImageRendererFactory.h:
549
550 2004-06-01  Ken Kocienda  <kocienda@apple.com>
551
552         Reviewed by Darin
553
554         Fix for these bugs:
555         
556         <rdar://problem/3655028>: "Text styles have hard-coded values making bold the only supported text style"
557         <rdar://problem/3656969>: "HTML Editing: Font panel doesn't work"
558
559         * khtml/css/css_valueimpl.cpp:
560         (FontFamilyValueImpl::cssText): Added implementation for this subclass. Returns parsedFontName.  
561         * khtml/css/css_valueimpl.h: Declare cssText() on FontFamilyValueImpl.
562         (DOM::CSSProperty::value):
563         * khtml/editing/htmlediting.cpp:
564         (khtml::ApplyStyleCommand::ApplyStyleCommand): Changed signature to take a CSSStyleDeclarationImpl.
565         (khtml::ApplyStyleCommand::style): Added accessor.
566         * khtml/editing/htmlediting.h: Changed constructor signature to take a CSSStyleDeclarationImpl.
567         * khtml/editing/htmlediting_impl.cpp:
568         (khtml::styleSpanClassString): Added helper to return attribute used to tag spans we add to apply styles.
569         (khtml::ApplyStyleCommandImpl::ApplyStyleCommandImpl): Ref style passed in.
570         (khtml::ApplyStyleCommandImpl::~ApplyStyleCommandImpl): Deref style passed in.
571         (khtml::ApplyStyleCommandImpl::doApply): m_removingStyle is obsolete. Removed.
572         (khtml::ApplyStyleCommandImpl::isHTMLStyleNode): Now checks all properties in the object's declaration.
573         (khtml::ApplyStyleCommandImpl::removeCSSStyle): Again, now is multi-property-savvy. Will now remove an empty span
574         if we added it.
575         (khtml::ApplyStyleCommandImpl::currentlyHasStyle): Replaced, bold-only code with code that can handle all styles.
576         (khtml::ApplyStyleCommandImpl::computeStyleChange): Helper which helps to determine whether we want to apply
577         HTML-style markup for bold and italic, and gathers up all style changes that need to be done.
578         (khtml::ApplyStyleCommandImpl::positionInsertionPoint): Added comment explaining possible optimization that might be
579         done in the future.
580         (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Significant reworking; now handles applying multiple styles.
581         (khtml::ApplyStyleCommandImpl::cloneSelection): Assert fragment has at least one child. Don't want to work
582         on empty fragments.
583         (khtml::ApplyStyleCommandImpl::surroundContentsWithElement): New helper.
584         (khtml::RemoveCSSPropertyCommandImpl::~RemoveCSSPropertyCommandImpl): Juggle asserts and lifecycle methods to be
585         more like other commands.
586         (khtml::RemoveCSSPropertyCommandImpl::doApply): Ditto.
587         (khtml::RemoveNodeAttributeCommandImpl::~RemoveNodeAttributeCommandImpl): Ditto.
588         (khtml::RemoveNodeAttributeCommandImpl::doApply):Ditto.
589         * khtml/editing/htmlediting_impl.h:
590         (khtml::ApplyStyleCommandImpl::style): Added.
591         (khtml::ApplyStyleCommandImpl::StyleChange::StyleChange): Added.
592         * kwq/DOM-CSS.mm:
593         (-[DOMCSSStyleDeclaration setProperty:::]): Fix problem where passing an empty NSString to a function expecting a boolean
594         made all properties important priority.
595         * kwq/WebCoreBridge.mm:
596         (-[WebCoreBridge applyStyle:]): Remove provisional code and comment. Now pass along style, following the intended design.
597
598 2004-06-01  Chris Blumenberg  <cblu@apple.com>
599
600         Reviewed by kocienda.
601
602         * kwq/WebCoreBridge.h:
603         * kwq/WebCoreBridge.mm:
604         (-[WebCoreBridge dragCaretDOMRange]): new, lets WebKit pass the drag caret DOM range to the editing delegate
605
606 2004-05-28  John Louch  <ouch@apple.com>
607
608         Reviewed by gramps.
609
610         - removed setShadowWithColor and change setShadow to work with optional attributes
611           it follows the same rules as setFill/StrokeColor
612         - Fixed bug in setFillColor and setStrokeColor for CMYK colors (missing break in case).
613
614         * khtml/ecma/kjs_html.cpp:
615         (KJS::Context2DFunction::tryCall):
616         * khtml/ecma/kjs_html.h:
617         (KJS::Context2D::):
618         * khtml/ecma/kjs_html.lut.h:
619         (KJS::):
620
621 2004-05-28  Darin Adler  <darin@apple.com>
622
623         Reviewed by Ken.
624
625         - various editing-related improvements
626
627         * khtml/xml/dom_selection.h: Removed UP and DOWN directions, and added PARAGRAPH granularity.
628         * khtml/xml/dom_selection.cpp:
629         (DOM::Selection::modify): Got rid of the UP and DOWN directions, and made movement
630         between lines happen when granularity is LINE. Added a new unimplemented granularity:
631         PARAGRAPH.
632         (DOM::Selection::validate): Remove some unneeded APPLE_CHANGES. The code need not be ifdef'd.
633         (DOM::Selection::debugPosition): Ditto.
634
635         * kwq/WebCoreBridge.h: Removed WebSelectUp and WebSelectDown, and added WebSelectByParagraph.
636         Added stringForRange: and selectedDOMRangeWithGranularity:, and renamed replaceSelectionWithNewline
637         to insertNewline because it has the insertText: semantic, not the replaceSelectionWithText: one.
638         * kwq/WebCoreBridge.mm:
639         (-[WebCoreBridge stringForRange:]): Added.
640         (-[WebCoreBridge selectedDOMRangeWithGranularity:]): Added.
641         (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Updated code to understand
642         that vertical movement is based on granularity now, not direction.
643         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]): Moved an ensureCaretVisible
644         from the WebKit down here. I think perhaps this should go down even further in WebCore.
645         (-[WebCoreBridge insertNewline]): Renamed, and moved ensureCaretVisible here.
646         (-[WebCoreBridge insertText:]): Moved ensureCaretVisible here.
647         (-[WebCoreBridge deleteKeyPressed]): Moved ensureCaretVisible here.
648
649         * khtml/xml/dom_position.cpp: Some ifdef tweaks.
650
651         * khtml/misc/helper.cpp: Namespace and formatting tweaks.
652         * khtml/misc/helper.h: Removed some unused stuff.
653
654         * khtml/dom/dom2_range.h: Make range constructor public so that anyone with
655         a RangeImpl can easily make a Range.
656
657 2004-05-28  Richard Williamson   <rjw@apple.com>
658
659         setStrokeColor and setFillColor now support
660         old school web color string, oswcs+alpha, gray, gray+alpha,
661         rgba, and cmyka.
662
663         Reviewed by jay-lo.
664
665         * khtml/css/cssparser.cpp:
666         (CSSParser::parseColor):
667         (CSSParser::parseColorFromValue):
668         * khtml/css/cssparser.h: Made parseColor static public class method
669         * khtml/ecma/kjs_html.cpp:
670         (KJS::Context2DFunction::tryCall):
671
672 2004-05-28  David Hyatt  <hyatt@apple.com>
673
674         Implement -khtml-user-select and add support for the property -khtml-user-drag (although someone will still
675         need to wire it up).
676         
677         Reviewed by rjw
678
679         * khtml/css/cssparser.cpp:
680         (CSSParser::parseValue):
681         * khtml/css/cssproperties.c:
682         (hash_prop):
683         (findProp):
684         * khtml/css/cssproperties.h:
685         * khtml/css/cssproperties.in:
686         * khtml/css/cssstyleselector.cpp:
687         (khtml::CSSStyleSelector::applyProperty):
688         * khtml/css/cssvalues.c:
689         (hash_val):
690         (findValue):
691         * khtml/css/cssvalues.h:
692         * khtml/css/cssvalues.in:
693         * khtml/khtml_part.cpp:
694         (KHTMLPart::handleMousePressEventDoubleClick):
695         (KHTMLPart::handleMousePressEventTripleClick):
696         (KHTMLPart::handleMousePressEventSingleClick):
697         (KHTMLPart::handleMouseMoveEventSelection):
698         * khtml/rendering/render_canvas.cpp:
699         (RenderCanvas::setSelection):
700         * khtml/rendering/render_object.cpp:
701         (RenderObject::shouldSelect):
702         * khtml/rendering/render_object.h:
703         * khtml/rendering/render_style.cpp:
704         (userSelect):
705         (StyleCSS3NonInheritedData::operator==):
706         (RenderStyle::diff):
707         * khtml/rendering/render_style.h:
708         (khtml::):
709         (khtml::RenderStyle::userDrag):
710         (khtml::RenderStyle::userSelect):
711         (khtml::RenderStyle::setUserDrag):
712         (khtml::RenderStyle::setUserSelect):
713         (khtml::RenderStyle::initialUserDrag):
714         (khtml::RenderStyle::initialUserSelect):
715
716 2004-05-28  John Louch  <set EMAIL_ADDRESS environment variable>
717         added addArc and clip path routines.
718
719         Reviewed by sullivan.
720
721         * khtml/ecma/kjs_html.cpp:
722         (KJS::Context2DFunction::tryCall):
723         * khtml/ecma/kjs_html.h:
724         (KJS::Context2D::):
725         * khtml/ecma/kjs_html.lut.h:
726         (KJS::):
727
728 2004-05-28  John Louch  <ouch@apple.com>
729
730         Added addArcToPoint and addRect path routines.
731
732         Reviewed by sullivan.
733
734         * khtml/ecma/kjs_html.cpp:
735         (KJS::Context2DFunction::tryCall):
736         * khtml/ecma/kjs_html.h:
737         (KJS::Context2D::):
738         * khtml/ecma/kjs_html.lut.h:
739         (KJS::):
740
741 2004-05-27  Ken Kocienda  <kocienda@apple.com>
742
743         Reviewed by John
744
745         * khtml/xml/dom_selection.cpp:
746         (DOM::Selection::toRange): Add call to update document layout before returning a Range.
747         This is done to ensure recently-done editing changes are reflected in the calculation
748         of the Range. This change solves a specific problem with updating the font panel, where
749         the wrong Range was used, resulting in an incorrect font. Also, defer converting 
750         positions to be range-compliant positions. The nodeIsBeforeNode function is not 
751         range-compliant-position-savvy.
752
753 2004-05-27  Kevin Decker  <kdecker@apple.com>
754
755         Reviewed by Ken.
756         
757         - added support for the new JavaScript error console
758         - error messages are now wired directly to the bridge
759         - revised generated error message content
760         
761         * khtml/ecma/kjs_events.cpp:
762         (JSEventListener::handleEvent):
763         * khtml/ecma/kjs_proxy.cpp:
764         (KJSProxyImpl::evaluate):
765         * khtml/ecma/kjs_window.cpp:
766         (Window::isSafeScript):
767         (ScheduledAction::execute):
768         * kwq/KWQKHTMLPart.h:
769         * kwq/KWQKHTMLPart.mm:
770         (KWQKHTMLPart::addMessageToConsole):
771         * kwq/WebCoreBridge.h:
772         * kwq/WebCoreBridge.mm:
773
774 2004-05-27  Trey Matteson  <trey@apple.com>
775
776         Two dragging tweaks:  ondragleave events are sent before ondragenter events when
777         going across element boundaries, to match WinIE.
778         For compatibility with WinIE, we honor MIME types of "Text" and "URL".
779
780         Reviewed by rjw.
781
782         * khtml/khtmlview.cpp:
783         (KHTMLView::updateDragAndDrop):
784         * kwq/KWQClipboard.mm:
785         (cocoaTypeFromMIMEType):
786
787 === Safari-142 ===
788
789 2004-05-27  Vicki Murley <vicki@apple.com>
790
791         Reviewed by Darin.
792
793         - Fix Tiger build failure.  Rename constant "S" to "WHITESPACE",
794         and change all instances of S to WHITESPACE.
795
796         * khtml/css/cssparser.cpp:
797         (DOM::CSSParser::lex): S to WHITESPACE
798         * khtml/css/parser.cpp: regenerated file
799         * khtml/css/parser.h: regenerated file
800         * khtml/css/parser.y: S to WHITESPACE
801         * khtml/css/tokenizer.cpp: regenerated file
802         * khtml/css/tokenizer.flex: S to WHITESPACE
803
804 2004-05-27  John Louch  <set EMAIL_ADDRESS environment variable>
805
806         Reviewed by NOBODY (OOPS!).
807
808         * khtml/ecma/kjs_html.cpp:
809         (KJS::Context2DFunction::tryCall):
810         * khtml/ecma/kjs_html.h:
811         (KJS::Context2D::):
812         * khtml/ecma/kjs_html.lut.h:
813         (KJS::):
814
815 2004-05-27  Trey Matteson  <trey@apple.com>
816
817         First cut at DHTML dragging, destination side.  Dragging text, files
818         and URLs onto elements works.  Type conversion from NSPasteboard to
819         MIME types is hardwired.  No JS access yet to modifier keys, or
820         drag operations mask.
821
822         Per IE's dragging API, we have the new DOM events ondragenter,
823         ondragover, ondragleave and ondrop.
824         We also have an event.dataTransfer object providing access to the
825         NSPasteboard bearing the incoming data.
826
827         Reviewed by rjw.
828
829         * WebCore.pbproj/project.pbxproj:  add 2 new files.
830         * khtml/ecma/kjs_dom.cpp:
831         (DOMNode::getValueProperty):  JS access to ondragenter and pals
832         (DOMNode::putValue):  Ditto
833         * khtml/ecma/kjs_dom.h:
834         (KJS::DOMNode::):  New attr enum values.
835         * khtml/ecma/kjs_dom.lut.h:
836         (KJS::):
837         * khtml/ecma/kjs_events.cpp:
838         (DOMMouseEvent::mark):  Pass along mark to dataTransfer we hold.
839         (DOMMouseEvent::getValueProperty):  Create and return dataTransfer.
840         (Clipboard::Clipboard):  New class exposed in JS.
841         (Clipboard::~Clipboard):
842         (Clipboard::tryGet):  Boilerplate.
843         (Clipboard::getValueProperty):  Return the clipboard's props.
844         (Clipboard::tryPut):  Boilerplate.
845         (Clipboard::putValue):  Set the clipboard's props.
846         (ClipboardProtoFunc::tryCall): Implement clipboard's funcs.
847         * khtml/ecma/kjs_events.h:
848         (KJS::DOMMouseEvent::DOMMouseEvent):  Init clipboard ptr.
849         (KJS::DOMMouseEvent::):
850         (KJS::Clipboard::toBoolean):
851         (KJS::Clipboard::classInfo):
852         (KJS::Clipboard::):
853         * khtml/ecma/kjs_events.lut.h:
854         (KJS::):
855         * khtml/html/html_elementimpl.cpp:
856         (HTMLElementImpl::parseHTMLAttribute):  Enable setting ondragenter
857         and friends as html attributes.
858         * khtml/khtmlview.cpp:
859         (KHTMLView::dispatchDragEvent):  Send a drag related event to the DOM.
860         (KHTMLView::updateDragAndDrop):  Handle a dragenter or dragupdate.
861         (KHTMLView::cancelDragAndDrop):  Handle a dragexit.
862         (KHTMLView::performDragAndDrop):  Handle an actual drop.
863         * khtml/khtmlview.h:
864         * khtml/misc/htmlattrs.c:  Generated code.
865         * khtml/misc/htmlattrs.h:  Generated code.
866         * khtml/misc/htmlattrs.in:  Add ondragenter, etc
867         * khtml/xml/dom2_eventsimpl.cpp:
868         (EventImpl::typeToId):  Handle new event types for dragging.
869         (EventImpl::idToType):  Ditto.
870         (MouseEventImpl::MouseEventImpl):  Init new clipboard ptr.
871         (MouseEventImpl::~MouseEventImpl):  Deref clipboard.
872         (ClipboardImpl::ClipboardImpl):
873         (ClipboardImpl::~ClipboardImpl):
874         * khtml/xml/dom2_eventsimpl.h:
875         (DOM::EventImpl::):  New event enums.
876         (DOM::MouseEventImpl::clipboard):
877         * kwq/KWQClipboard.h: Added.
878         * kwq/KWQClipboard.mm: Added.
879         (KWQClipboard::KWQClipboard):
880         (KWQClipboard::~KWQClipboard):
881         (KWQClipboard::isForDragging): Trivial getter/setters.
882         (KWQClipboard::dropEffect):
883         (KWQClipboard::setDropEffect):
884         (KWQClipboard::dropAllowed):
885         (KWQClipboard::setDropAllowed):
886         (cocoaTypeFromMIMEType):  Convert MIME pboard type to Cocoa type.
887         (KWQClipboard::clearData):  OSX specific clipboard impl. of IE func
888         (KWQClipboard::clearAllData):   Ditto
889         (KWQClipboard::getData): Ditto
890         (KWQClipboard::setData): Ditto
891         * kwq/WebCoreBridge.h:
892         * kwq/WebCoreBridge.mm:
893         (-[WebCoreBridge dragOperationForDraggingInfo:]):  Passthrough from WebKit to khtmlpart
894         (-[WebCoreBridge dragExitedWithDraggingInfo:]):  Ditto
895         (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto
896
897 2004-05-27  Ken Kocienda  <kocienda@apple.com>
898
899         Reviewed by Gramps
900
901         * kwq/KWQKHTMLPart.h: Declare new fontForCurrentPosition helper.
902         * kwq/KWQKHTMLPart.mm:
903         (KWQKHTMLPart::fontForCurrentPosition): Determines the "current font" in the way that Cocoa
904         does. Either the font of the character before the caret, when the selection is a caret, or
905         the font of the first character selected, when the selection is a range.
906         * kwq/WebCoreBridge.h: Declare bridge method so this can be called from WebKit.
907         * kwq/WebCoreBridge.mm:
908         (-[WebCoreBridge fontForCurrentPosition]): Calls through to fontForCurrentPosition on KWQKHTMLPart.
909
910 2004-05-27  Ken Kocienda  <kocienda@apple.com>
911
912         Reviewed by Gramps
913         
914         Adds a typing style member variable to khtml part.
915         This patch adds basic life-cycle management and 
916         accessors. In addition, one essential piece of
917         behavior has been added: Clearing the typing style
918         whenever the selection changes.
919
920         Follow-on work will make this typing style a fully 
921         functional part of applying styles to text while typing.
922
923         * khtml/khtml_part.cpp:
924         (KHTMLPart::notifySelectionChanged): Clear typing style.
925         (KHTMLPart::typingStyle): Getter.
926         (KHTMLPart::setTypingStyle): Setter.
927         (KHTMLPart::clearTypingStyle): Convenience. Sets to 0.
928         * khtml/khtml_part.h: Function declarations.
929         * khtml/khtmlpart_p.h:
930         (KHTMLPartPrivate::KHTMLPartPrivate): Initialize member variable.
931         (KHTMLPartPrivate::~KHTMLPartPrivate): Deref if necessary.
932
933 2004-05-27  Ken Kocienda  <kocienda@apple.com>
934
935         Reviewed by Gramps
936
937         Add helper to get the DOM element for a Position.
938         
939         * khtml/xml/dom_position.cpp:
940         (DOM::Position::element): Returns the Position's node if it is an element, or
941         the first ancestor of the node that is an element. Returns 0 if node is not
942         an element and has no parent that is an element.
943         * khtml/xml/dom_position.h: Added declaration.
944
945 2004-05-27  Darin Adler  <darin@apple.com>
946
947         Reviewed by Maciej.
948
949         - moved to new symlink technique for embedding frameworks
950
951         * WebCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
952         because we don't need it any more.
953
954 2004-05-27  Darin Adler  <darin@apple.com>
955
956         - fixed bug where all pages with images would cause a crash
957         - fixed Deployment build
958
959         * kwq/KWQPainter.mm: (QPainter::drawPixmap): Put #if 0 around placeholder code
960         for setting up the graphics context.
961
962 2004-05-26  Richard Williamson   <rjw@apple.com>
963
964         Added shadow support (w/ Louch).
965         Added infrastructure for drawing images.
966
967         New context methods:
968
969         setShadow
970         setShadowWithColor
971         clearShadow
972
973         Reviewed by me and Louch.
974
975         * khtml/ecma/kjs_html.cpp:
976         (KJS::Context2DFunction::tryCall):
977         * khtml/ecma/kjs_html.h:
978         (KJS::Image::image):
979         (KJS::Context2D::):
980         * khtml/ecma/kjs_html.lut.h:
981         (KJS::):
982         * kwq/KWQPainter.h:
983         * kwq/KWQPainter.mm:
984         (QPainter::drawPixmap):
985
986 2004-05-26  Richard Williamson   <rjw@apple.com>
987
988         Fixed build snafu.
989
990         * khtml/ecma/kjs_html.cpp:
991         (KJS::Context2DFunction::tryCall):
992         * khtml/ecma/kjs_html.h:
993         (KJS::Context2D::):
994         * khtml/ecma/kjs_html.lut.h:
995         (KJS::):
996
997 2004-05-26  Richard Williamson   <rjw@apple.com>
998
999         Part 2 of the new <CANVAS> tag implementation.  This adds the 
1000         basic machinery and draw operations for the <CANVAS> tag.  Pretty cool.  
1001
1002         function drawLine() {
1003             var canvas1 = document.getElementById ("canvas1");
1004             var context = canvas1.getContext("context-2d");
1005
1006             context.setStrokeColor ("red");
1007             context.setLineWidth (10);
1008             context.beginPath();
1009             context.moveToPoint (0,0);
1010             context.addLineToPoint (400,400);
1011             context.strokePath();
1012         }
1013
1014         ...
1015
1016         <canvas id="canvas1" width="400" height="400">
1017
1018 Currently supported operations on the 2D context are:
1019
1020 Save, Restore,
1021 Scale, Rotate, Translate,
1022 BeginPath, ClosePath,
1023 SetStrokeColor, SetFillColor, SetLineWidth, SetLineCap, SetLineJoin, SetMiterLimit,
1024 FillPath, StrokePath,
1025 MoveToPoint, AddLineToPoint, AddQuadraticCurveToPoint, AddBezierCurveToPoint,
1026 ClearRect
1027
1028         More to come.
1029
1030         Reviewed by Dave.
1031
1032         * khtml/ecma/kjs_html.cpp:
1033         (KJS::HTMLElementFunction::tryCall):
1034         (KJS::Context2DFunction::tryCall):
1035         (Context2D::tryGet):
1036         (Context2D::getValueProperty):
1037         (Context2D::tryPut):
1038         (Context2D::putValue):
1039         (Context2D::Context2D):
1040         (Context2D::~Context2D):
1041         * khtml/ecma/kjs_html.h:
1042         (KJS::Context2D::toBoolean):
1043         (KJS::Context2D::classInfo):
1044         (KJS::Context2D::):
1045         * khtml/ecma/kjs_html.lut.h:
1046         (KJS::):
1047         * khtml/html/html_canvasimpl.cpp:
1048         (HTMLCanvasElementImpl::HTMLCanvasElementImpl):
1049         * khtml/html/htmlparser.cpp:
1050         (KHTMLParser::getElement):
1051         * khtml/rendering/render_canvasimage.cpp:
1052         (RenderCanvasImage::RenderCanvasImage):
1053         (RenderCanvasImage::~RenderCanvasImage):
1054         (RenderCanvasImage::createDrawingContext):
1055         (RenderCanvasImage::drawingContext):
1056         (RenderCanvasImage::setNeedsImageUpdate):
1057         (RenderCanvasImage::updateDrawnImage):
1058         (RenderCanvasImage::drawnImage):
1059         (RenderCanvasImage::paint):
1060         (RenderCanvasImage::layout):
1061         * khtml/rendering/render_canvasimage.h:
1062         * khtml/rendering/render_image.cpp:
1063         (RenderImage::paint):
1064         * khtml/rendering/render_image.h:
1065         * khtml/rendering/render_replaced.cpp:
1066         (RenderReplaced::shouldPaint):
1067         (RenderWidget::paint):
1068         * kwq/KWQPainter.h:
1069         * kwq/KWQPainter.mm:
1070         (QPainter::currentContext):
1071
1072 2004-05-26  Darin Adler  <darin@apple.com>
1073
1074         - fixed warning that prevents Deployment build from compiling
1075
1076         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMousePressEvent):
1077         Moved use of single-click boolean outside the scope of the "block exceptions" macros.
1078
1079 2004-05-25  Chris Blumenberg  <cblu@apple.com>
1080
1081         Fixed a regression where selections that were created via double or triple were not draggable.
1082
1083         Reviewed by darin.
1084
1085         * kwq/KWQKHTMLPart.mm:
1086         (KWQKHTMLPart::khtmlMousePressEvent): if the click count is greater than 1, don't allow drags
1087         (KWQKHTMLPart::khtmlMouseMoveEvent): allow drags to occur even if the selection was originally created via double or triple click
1088
1089 2004-05-25  Chris Blumenberg  <cblu@apple.com>
1090
1091         Fixed regression where undoing typing would undo character-by-character.
1092
1093         Reviewed by kocienda.
1094
1095         * kwq/WebCoreBridge.h:
1096         * kwq/WebCoreBridge.mm:
1097         (-[WebCoreBridge insertText:]): new, this method used to be replaceSelectionWithText, but replaceSelectionWithText now is one operation whereas calls to insertText: are coalesced
1098
1099 2004-05-25  Ken Kocienda  <kocienda@apple.com>
1100
1101         Reviewed by John
1102
1103         Change postDidChangeSelectionNotification and postDidChangeNotification tp
1104         respondToChangedSelection and respondToChangedContents, respectively, to
1105         account for the fact that we do work in these calls other than post a
1106         notification.
1107
1108         * khtml/khtml_part.cpp:
1109         (KHTMLPart::notifySelectionChanged): Use new names.
1110         (KHTMLPart::appliedEditing): Ditto.
1111         (KHTMLPart::unappliedEditing): Ditto.
1112         (KHTMLPart::reappliedEditing): Ditto.
1113         * kwq/KWQKHTMLPart.h: Change name of functions as described.
1114         * kwq/KWQKHTMLPart.mm:
1115         (KWQKHTMLPart::respondToChangedSelection): Ditto.
1116         (KWQKHTMLPart::respondToChangedContents): Ditto.
1117         * kwq/WebCoreBridge.h: Ditto.
1118
1119 2004-05-25  Maciej Stachowiak  <mjs@apple.com>
1120
1121         Fixed build.
1122
1123         * ForwardingHeaders/misc/khtml_text_operations.h: Added.
1124
1125 2004-05-25  Richard Williamson   <rjw@apple.com>
1126
1127         Part 1 of the new <CANVAS> tag implementation.  This patch
1128         adds the boiler plate for the new element.
1129
1130         Reviewed by Dave.
1131
1132         * ForwardingHeaders/html/html_canvasimpl.h: Added.
1133         * ForwardingHeaders/rendering/render_canvasimage.h: Added.
1134         * WebCore.pbproj/project.pbxproj:
1135         * khtml/ecma/kjs_html.cpp:
1136         (KJS::HTMLElement::classInfo):
1137         (KJS::HTMLElementFunction::tryCall):
1138         * khtml/ecma/kjs_html.h:
1139         (KJS::HTMLElement::):
1140         * khtml/ecma/kjs_html.lut.h:
1141         (KJS::):
1142         * khtml/html/dtd.cpp:
1143         (DOM::checkChild):
1144         * khtml/html/html_canvasimpl.cpp: Added.
1145         (HTMLCanvasElementImpl::HTMLCanvasElementImpl):
1146         (HTMLCanvasElementImpl::~HTMLCanvasElementImpl):
1147         (HTMLCanvasElementImpl::id):
1148         (HTMLCanvasElementImpl::mapToEntry):
1149         (HTMLCanvasElementImpl::parseHTMLAttribute):
1150         (HTMLCanvasElementImpl::createRenderer):
1151         (HTMLCanvasElementImpl::attach):
1152         (HTMLCanvasElementImpl::detach):
1153         (HTMLCanvasElementImpl::isURLAttribute):
1154         * khtml/html/html_canvasimpl.h: Added.
1155         * khtml/html/htmlparser.cpp:
1156         (KHTMLParser::getElement):
1157         * khtml/misc/htmltags.c:
1158         (hash_tag):
1159         (findTag):
1160         * khtml/misc/htmltags.h:
1161         * khtml/misc/htmltags.in:
1162         * khtml/rendering/render_canvasimage.cpp: Added.
1163         (RenderCanvasImage::RenderCanvasImage):
1164         (RenderCanvasImage::~RenderCanvasImage):
1165         (RenderCanvasImage::paint):
1166         (RenderCanvasImage::layout):
1167         * khtml/rendering/render_canvasimage.h: Added.
1168         (khtml::RenderCanvasImage::renderName):
1169         (khtml::RenderCanvasImage::element):
1170
1171 2004-05-25  Chris Blumenberg  <cblu@apple.com>
1172
1173         Fixed: <rdar://problem/3546418>: (when dragging text within an editable HTML doc, the selection should be moved not copied)
1174
1175         Reviewed by kocienda.
1176
1177         * khtml/editing/htmlediting_impl.cpp:
1178         (khtml::MoveSelectionCommandImpl::doApply): implemented
1179         * khtml/khtml_part.cpp:
1180         (KHTMLPart::setDragCaret): make the old drag cursor rect dirty
1181         * khtml/khtml_part.h:
1182
1183 2004-05-25  Maciej Stachowiak  <mjs@apple.com>
1184
1185         Reviewed by John.
1186
1187         - fixed <rdar://problem/3657363>: (Editing: export innerText, innerHTML, outerText, outerHTML and setters to Objective-C)
1188         - partial fix for <rdar://problem/3656706>: (Fix innerText and setInnerText DOM extensions)
1189         
1190         * khtml/html/html_elementimpl.cpp:
1191         (HTMLElementImpl::innerText): Use plainText() to make the text, to
1192         match other browsers.
1193         (HTMLElementImpl::outerText): Extended comment.
1194         * khtml/misc/khtml_text_operations.h:
1195         * kwq/DOMExtensions.h:
1196         * kwq/DOMHTML.mm:
1197         (-[DOMHTMLElement outerText]): Added new ObjC wrapper for this.
1198         (-[DOMHTMLElement setOuterText:]): Ditto.
1199
1200 2004-05-25  Ken Kocienda  <kocienda@apple.com>
1201
1202         Reviewed by Chris
1203         
1204         Defer setting the selection to delete when none has been passed in to the
1205         time that the command is run. This fixes a problem where a command nested
1206         in a composite was not correctly picking up the right selection to begin
1207         its work. Now, the command will correctly use the ending selection of
1208         its parent when no selection has been passed in.
1209
1210         * khtml/editing/htmlediting_impl.cpp:
1211         (khtml::DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl):
1212         (khtml::DeleteCollapsibleWhitespaceCommandImpl::doApply):
1213         (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
1214         (khtml::DeleteSelectionCommandImpl::doApply):
1215         * khtml/editing/htmlediting_impl.h:
1216
1217 2004-05-24  Maciej Stachowiak  <mjs@apple.com>
1218
1219         Reviewed by Dave.
1220
1221         Added a new simple layout test for outerText.
1222
1223         * layout-tests/fast/dom/outerText-expected.txt: Added.
1224         * layout-tests/fast/dom/outerText.html: Added.
1225
1226 2004-05-24  Darin Adler  <darin@apple.com>
1227
1228         Reviewed by Vicki.
1229
1230         - fixed <rdar://problem/3665813>: (iBench is crashing in TOT)
1231
1232         * khtml/html/html_formimpl.cpp: (HTMLSelectElementImpl::HTMLSelectElementImpl):
1233         Initialize m_options to 0.
1234
1235 2004-05-24  Ken Kocienda  <kocienda@apple.com>
1236
1237         Reviewed by Richard
1238
1239         * khtml/xml/dom_selection.cpp:
1240         (DOM::Selection::toRange): Improved the code to return ranges that are
1241         convenient to use by WebKit code which needs to perform text-editor-like
1242         operations with ranges. Comments in the code describe this behavior.
1243         (DOM::Selection::nodeIsBeforeNode): Make this method const.
1244         * khtml/xml/dom_selection.h: Ditto.
1245
1246 2004-05-24  Chris Blumenberg  <cblu@apple.com>
1247
1248         Improved editing via drag.
1249
1250         Reviewed by kocienda.
1251
1252         * khtml/editing/htmlediting.cpp: Renamed PasteMarkupCommand to ReplaceSelectionCommand
1253         (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
1254         (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
1255         (khtml::ReplaceSelectionCommand::impl):
1256         (khtml::MoveSelectionCommand::MoveSelectionCommand):
1257         (khtml::MoveSelectionCommand::~MoveSelectionCommand):
1258         (khtml::MoveSelectionCommand::impl):
1259         * khtml/editing/htmlediting.h:
1260         (khtml::):
1261         * khtml/editing/htmlediting_impl.cpp:
1262         (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl):
1263         (khtml::ReplaceSelectionCommandImpl::~ReplaceSelectionCommandImpl):
1264         (khtml::ReplaceSelectionCommandImpl::commandID):
1265         (khtml::ReplaceSelectionCommandImpl::doApply):
1266         (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): new command
1267         (khtml::MoveSelectionCommandImpl::~MoveSelectionCommandImpl):
1268         (khtml::MoveSelectionCommandImpl::commandID):
1269         (khtml::MoveSelectionCommandImpl::doApply):
1270         * khtml/editing/htmlediting_impl.h:
1271         * khtml/khtml_part.cpp:
1272         (KHTMLPart::dragCaret): new
1273         (KHTMLPart::setDragCaret): new
1274         (KHTMLPart::notifyDragCaretChanged): new
1275         (KHTMLPart::paintDragCaret): new
1276         * khtml/khtml_part.h:
1277         * khtml/khtmlpart_p.h:
1278         * khtml/rendering/render_block.cpp:
1279         (khtml::RenderBlock::paintObject): paint the drag caret
1280         * kwq/DOM.mm:
1281         (+[DOMDocumentFragment _documentFragmentWithImpl:]): made internally available
1282         (-[DOMDocumentFragment _fragmentImpl]):
1283         * kwq/DOMInternal.h:
1284         * kwq/WebCoreBridge.h:
1285         * kwq/WebCoreBridge.mm:
1286         (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): new
1287         (-[WebCoreBridge documentFragmentWithText:]): new
1288         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]): new
1289         (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:]): renamed to take the selectReplacement BOOL
1290         (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:]): ditto
1291         (-[WebCoreBridge replaceSelectionWithText:selectReplacement:]): ditto
1292         (-[WebCoreBridge replaceSelectionWithNewline]): moved
1293         (-[WebCoreBridge setSelectionToDragCaret]): new
1294         (-[WebCoreBridge moveSelectionToDragCaret:]): new
1295         (-[WebCoreBridge moveDragCaretToPoint:]): set the drag caret, not the selection
1296         (-[WebCoreBridge removeDragCaret]): new
1297
1298 2004-05-24  Ken Kocienda  <kocienda@apple.com>
1299
1300         Reviewed by John
1301         
1302         Fixed some life-cycle issues with node iterators and detaching. Big deal is
1303         to detach in DOMNodeIterator dealloc. Otherwise, NodeIterators created from
1304         obj-c leak.
1305
1306         * khtml/xml/dom2_traversalimpl.cpp:
1307         (DOM::NodeIteratorImpl::detach): Only detach if not yet detached.
1308         * khtml/xml/dom2_traversalimpl.h:
1309         (DOM::NodeIteratorImpl::setDetached): New convenience.
1310         * kwq/DOM.mm:
1311         (-[DOMNodeIterator dealloc]): Detach here, if not yet detached; fixes leak.
1312
1313 2004-05-24  Ken Kocienda  <kocienda@apple.com>
1314
1315         Reviewed by Hyatt
1316
1317         * khtml/css/css_computedstyle.cpp:
1318         (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Fixed to return the property value, 
1319         as it should, instead of the whole property, as it was doing before.
1320
1321 2004-05-23  Darin Adler  <darin@apple.com>
1322
1323         Reviewed by Ken.
1324
1325         - fixed <rdar://problem/3259919>: (Shift click should extend selection)
1326
1327         * khtml/khtmlpart_p.h: Renamed m_textElement to m_selectionGranularity and
1328         m_mouseMovedSinceLastMousePress to m_beganSelectingText.
1329         * khtml/khtml_part.cpp:
1330         (KHTMLPart::handleMousePressEventDoubleClick): Set m_beganSelectingText if the double-click
1331         began selecting text.
1332         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1333         (KHTMLPart::handleMousePressEventSingleClick): Added code to extend selection if shift is down.
1334         (KHTMLPart::khtmlMousePressEvent): Remove code that sets the selection granularity to
1335         "by character". We only want to do that if we start selecting with a single click.
1336         Otherwise we want to leave the selection granularity alone.
1337         (KHTMLPart::khtmlMouseReleaseEvent): Change the code that clears the selection on a plain old
1338         click to check the m_beganSelectingText boolean so it won't run when you shift-click, for example.
1339         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMouseMoveEvent): Updated for m_textElement
1340         name change.
1341
1342 2004-05-22  Darin Adler  <darin@apple.com>
1343
1344         Reviewed by Ken.
1345
1346         - went through things marked "unimplemented" or "not implemented" and removed
1347           or implemented as many as possible
1348
1349         * kwq/DOM.mm: (-[DOMNode dispatchEvent:]): Implemented.
1350         Also moved DOMAbstractView and DOMDocumentView into DOMViews.mm.
1351         * kwq/DOM-CSS.mm: (-[DOMDocument getComputedStyle::]): Implemented.
1352
1353         * kwq/DOMEventsInternal.h: Added.
1354         * kwq/DOMEvents.mm:
1355         (-[DOMEvent type]): Implemented.
1356         (-[DOMEvent target]): Implemented.
1357         (-[DOMEvent currentTarget]): Implemented.
1358         (-[DOMEvent eventPhase]): Implemented.
1359         (-[DOMEvent bubbles]): Implemented.
1360         (-[DOMEvent cancelable]): Implemented.
1361         (-[DOMEvent timeStamp]): Implemented.
1362         (-[DOMEvent stopPropagation]): Implemented.
1363         (-[DOMEvent preventDefault]): Implemented.
1364         (-[DOMEvent initEvent:::]): Implemented.
1365         (-[DOMEvent _eventImpl]): Added.
1366         (-[DOMEvent _initWithEventImpl:]): Added.
1367         (+[DOMEvent _eventWithImpl:]): Added.
1368         (-[DOMMouseEvent _mouseEventImpl]): Added.
1369         (-[DOMMouseEvent screenX]): Implemented.
1370         (-[DOMMouseEvent screenY]): Implemented.
1371         (-[DOMMouseEvent clientX]): Implemented.
1372         (-[DOMMouseEvent clientY]): Implemented.
1373         (-[DOMMouseEvent ctrlKey]): Implemented.
1374         (-[DOMMouseEvent shiftKey]): Implemented.
1375         (-[DOMMouseEvent altKey]): Implemented.
1376         (-[DOMMouseEvent metaKey]): Implemented.
1377         (-[DOMMouseEvent button]): Implemented.
1378         (-[DOMMouseEvent relatedTarget]): Implemented.
1379         (-[DOMMouseEvent initMouseEvent:::::::::::::::]): Implemented.
1380         (-[DOMMutationEvent _mutationEventImpl]): Added.
1381         (-[DOMMutationEvent relatedNode]): Implemented.
1382         (-[DOMMutationEvent prevValue]): Implemented.
1383         (-[DOMMutationEvent newValue]): Implemented.
1384         (-[DOMMutationEvent attrName]): Implemented.
1385         (-[DOMMutationEvent attrChange]): Implemented.
1386         (-[DOMMutationEvent initMutationEvent::::::::]):
1387         (-[DOMUIEvent _UIEventImpl]): Added.
1388         (-[DOMUIEvent view]): Implemented.
1389         (-[DOMUIEvent detail]): Implemented.
1390         (-[DOMUIEvent initUIEvent:::::]): Implemented.
1391         (-[DOMDocument createEvent:]): Implemented.
1392
1393         * kwq/DOMHTMLInternal.h: Added.
1394         * kwq/DOMHTML.mm:
1395         (+[DOMHTMLOptionsCollection _optionsCollectionWithImpl:]): Added.
1396         (-[DOMHTMLOptionsCollection length]): Implemented.
1397         (-[DOMHTMLOptionsCollection setLength:]): Implemented.
1398         (-[DOMHTMLOptionsCollection item:]): Implemented.
1399         (-[DOMHTMLOptionsCollection namedItem:]): Implemented.
1400         (-[DOMHTMLSelectElement options]): Implemented.
1401
1402         * kwq/DOMViews.h: Changed DOMDocumentView to be a category on DOMDocument
1403         rather than a separate class.
1404         * kwq/DOMViewsInternal.h: Added.
1405         * kwq/DOMViews.mm: Added.
1406         (-[DOMAbstractView document]): Implemnted.
1407         (-[DOMAbstractView _abstractViewImpl]): Added.
1408         (-[DOMAbstractView _initWithAbstractViewImpl:]): Added.
1409         (+[DOMAbstractView _abstractViewWithImpl:]): Added.
1410         (-[DOMDocument defaultView]): Implemented.
1411
1412         * khtml/dom/dom2_views.h: Made AbstractView constructor public to allow creation in
1413         the bindings. Would not be necessary if the impl classes were used consistently.
1414
1415         * khtml/html/html_formimpl.h: Added options() function to HTMLSelectElementImpl.
1416         Added HTMLOptionsCollectionImpl class.
1417         * khtml/html/html_formimpl.cpp:
1418         (HTMLSelectElementImpl::~HTMLSelectElementImpl): Added code to detach and deref the
1419         options collection.
1420         (HTMLSelectElementImpl::options): Create an options collection if needed.
1421         (HTMLOptionsCollectionImpl::length): Added. Not yet implemented.
1422         (HTMLOptionsCollectionImpl::setLength): Ditto.
1423         (HTMLOptionsCollectionImpl::item): Ditto.
1424         (HTMLOptionsCollectionImpl::namedItem): Ditto.
1425
1426         * khtml/khtmlview.h: Move unused focusNextPrevChild virtual function inside !APPLE_CHANGES.
1427         * khtml/khtmlview.cpp: Put the tp, paintBuffer, and formCompletions fields entirely
1428         inside !APPLE_CHANGES. Also made QT_NO_TOOLTIP entirely disable the tooltip field.
1429         Also put focusNextPrevChild and formCompletionItems functions inside !APPLE_CHANGES.
1430
1431         * khtml/rendering/render_text.h: Removed unused isFixedWidthFont member function.
1432         * khtml/rendering/render_text.cpp: Ditto.
1433
1434         * kwq/KWQCursor.h: Removed unused pos member function.
1435         * kwq/KWQCursor.mm: Ditto.
1436
1437         * kwq/KWQFontMetrics.h: Removed unused rightBearing and leftBearing member functions.
1438         * kwq/KWQFontMetrics.mm: Ditto.
1439
1440         * kwq/KWQKComboBox.h: Removed KCompletionBase as a base class.
1441
1442         * kwq/KWQKConfigBase.h: Removed unused readBoolEntry, writeEntry, and readListEntry
1443         member functions.
1444         * kwq/KWQKConfigBase.mm: Ditto.
1445         (KConfig::readEntry): Improved "not implemented" message to indicate which key is uinimplemented.
1446         (KConfig::readNumEntry): Ditto.
1447         (KConfig::readUnsignedNumEntry): Ditto.
1448
1449         * kwq/KWQKLineEdit.h: Removed everything, since all the KLineEdit stuff was unused.
1450         Changed KLineEdit to just be a typedef for QLineEdit.
1451
1452         * kwq/KWQSlot.mm: Removed slotAutoScroll.
1453         (KWQSlot::KWQSlot): And from here.
1454         (KWQSlot::call): And from here.
1455
1456         * kwq/KWQTextStream.h: Removed unused QTextOStream and QTextIStream.
1457         * kwq/KWQTextStream.mm: Removed unused QTextIStream function. Also made buffer sizes larger
1458         so we don't have any problems on 64-bit systems. 10 bytes might not be long enough to sprintf an
1459         integer or a long or a pointer, but 100 bytes surely will.
1460
1461         * kwq/KWQWidget.h: Removed unused focusNextPrevChild.
1462         * kwq/KWQWidget.mm: Ditto.
1463
1464         * WebCore.pbproj/project.pbxproj: Removed some files, added others.
1465
1466         * ForwardingHeaders/kcompletionbox.h: Emptied out, no KWQKCompletionBox.h any more.
1467         * ForwardingHeaders/kiconloader.h: Emptied out, no KWQKIconLoader.h any more.
1468         * ForwardingHeaders/kmimetype.h: Emptied out, no KWQKMimeType.h any more.
1469         * ForwardingHeaders/ksimpleconfig.h: Emptied out, no KWQKSimpleConfig.h any more.
1470         * ForwardingHeaders/qfontinfo.h: Emptied out, no KWQFontInfo.h any more.
1471         * ForwardingHeaders/qtooltip.h: Replaced with define of QT_NO_TOOLTIP, no
1472         KWQToolTip.h any more.
1473
1474         * kwq/KWQCompletion.h: Removed.
1475         * kwq/KWQCompletion.mm: Removed.
1476         * kwq/KWQFontInfo.h: Removed.
1477         * kwq/KWQFontInfo.mm: Removed.
1478         * kwq/KWQKCompletionBox.h: Removed.
1479         * kwq/KWQKIconLoader.h: Removed.
1480         * kwq/KWQKIconLoader.mm: Removed.
1481         * kwq/KWQKMimeType.h: Removed.
1482         * kwq/KWQKMimeType.mm: Removed.
1483         * kwq/KWQKSimpleConfig.h: Removed.
1484         * kwq/KWQKSimpleConfig.mm: Removed.
1485         * kwq/KWQToolTip.h: Removed.
1486
1487 2004-05-21  Darin Adler  <darin@apple.com>
1488
1489         Reviewed by Maciej.
1490
1491         - fixed <rdar://problem/3663659>: (result of toString mistakenly includes all subsequent sibling content)
1492
1493         * khtml/xml/dom2_rangeimpl.h: Added private startNode() and pastEndNode() functions.
1494         * khtml/xml/dom2_rangeimpl.cpp:
1495         (DOM::RangeImpl::toString): Rewrote to use startNode(), pastEndNode(), and traverseNextNode().
1496         The old code here was wrong, and it was easier to rewrite than fix.
1497         (DOM::RangeImpl::checkDeleteExtract): Extracted the logic to compute the start node and the past-end
1498         node into separate functions.
1499         (DOM::RangeImpl::startNode): Added. Started with code extracted from checkDeleteExtract, but then
1500         also fixed bugs by using the new traverseNextSibling. The old code handled cases where the offset was
1501         past the last child in a container incorrectly.
1502         (DOM::RangeImpl::pastEndNode): Added. Started with code extracted from checkDeleteExtract, but then
1503         also fixed bugs by using the new traverseNextSibling. The old code hanlded cases where the offset was
1504         past the last child in a container incorrectly, and also iterated one node too few in cases where the
1505         end contaier was a text node.
1506
1507         * khtml/xml/dom2_traversalimpl.h: Removed a bunch of unused and unneeded member functions.
1508
1509         * khtml/xml/dom_nodeimpl.h: Added traverseNextSibling.
1510         * khtml/xml/dom_nodeimpl.cpp:
1511         (NodeImpl::traverseNextNode): Reformatted the code a little bit.
1512         (NodeImpl::traverseNextSibling): Added. Like traverseNextNode except it starts after the node's children
1513         instead of starting at the beginning of the first child.
1514
1515 2004-05-21  Maciej Stachowiak  <mjs@apple.com>
1516
1517         Reviewed by Trey.
1518
1519         <rdar://problem/3656722>: Implement outerText and setOuterText DOM extensions
1520         
1521         * khtml/html/html_elementimpl.cpp:
1522         (HTMLElementImpl::outerText): Return same value as innerText().
1523         (HTMLElementImpl::setInnerText): Fix comment.
1524         (HTMLElementImpl::setOuterText): Replace node with text, merge neighboring text nodes.
1525         * khtml/html/html_elementimpl.h: Prototype new methods.
1526         * khtml/dom/html_element.cpp:
1527         (HTMLElement::outerText): Hook up to impl.
1528         (HTMLElement::setOuterText): Ditto.
1529         * khtml/dom/html_element.h: Prototype new methods.
1530         * khtml/ecma/kjs_html.cpp:
1531         (KJS::HTMLElement::getValueProperty): Glue up outerText.
1532         (KJS::HTMLElement::putValue): Ditto. 
1533         * khtml/ecma/kjs_html.h: Added new enum value.
1534         * khtml/ecma/kjs_html.lut.h:
1535         (KJS::): Regenerated.
1536
1537 2004-05-21  Richard Williamson   <rjw@apple.com>
1538
1539         Removed _bindObject:forFrame: SPI.
1540         
1541         Reviewed by Chris.
1542
1543         * kwq/KWQKHTMLPart.h:
1544         * kwq/KWQKHTMLPart.mm:
1545         * kwq/WebCoreBridge.h:
1546         * kwq/WebCoreBridge.mm:
1547
1548 2004-05-21  David Hyatt  <hyatt@apple.com>
1549
1550         Fix for 3663644, repaints don't occur when the .innerHTML of a positioned element is changed.
1551         
1552         Reviewed by john
1553
1554         * khtml/rendering/bidi.cpp:
1555         (khtml::RenderBlock::layoutInlineChildren):
1556         * khtml/rendering/render_layer.h:
1557         (khtml::RenderLayer::repaintRect):
1558
1559 === Safari-141 ===
1560
1561 2004-05-21  Darin Adler  <darin@apple.com>
1562
1563         Reviewed by Ken and Chris.
1564
1565         - fixed <rdar://problem/3656948>: (markup strings that contain <html> and <body> elements don't work, producing nothing)
1566
1567         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::createContextualFragment):
1568         Changed things around so that nodes are removed from their parent node before 
1569
1570 2004-05-21  Darin Adler  <darin@apple.com>
1571
1572         Reviewed by Ken and Chris.
1573
1574         - fixed part of <rdar://problem/3656948>: (HTML Editing: -[WebView replaceSelectionWithMarkupString:] doesn't seem to work)
1575
1576         * khtml/editing/htmlediting_impl.cpp: (khtml::PasteMarkupCommandImpl::doApply):
1577         Changed code to handle case where contextual fragment parses to nothing without crashing.
1578
1579 2004-05-21  Darin Adler  <darin@apple.com>
1580
1581         Reviewed by Ken.
1582
1583         * kwq/DOM-CSS.mm: Change DOMCSSStyleDeclaration methods to use strings with dash-separators in them
1584         rather than interCaps.
1585
1586 2004-05-21  Darin Adler  <darin@apple.com>
1587
1588         Reviewed by Maciej.
1589
1590         - fixed <rdar://problem/3090663>: (scroll to top of page when anchor is "#top" or "#")
1591
1592         * khtml/khtml_part.cpp:
1593         (KHTMLPart::gotoAnchor): Detect anchor by checking for non-null, not non-empty, because an
1594         empty anchor is not the same as no anchor.
1595         (KHTMLPart::gotoAnchor): Add special case for anchors named "" and "top" (case insensitive),
1596         to scroll to the top left of the frame to match what WinIE and Mozilla do.
1597         (KHTMLPart::checkCompleted): Check for non-null here too for consistency.
1598
1599         * kwq/KWQKURL.mm:
1600         (KURL::ref): Change check so that we return empty, not null, if there's an empty ref,
1601         as opposed to no ref.
1602         (KURL::hasRef): Return true if there's an empty ref, as opposed to no ref.
1603         (KURL::parse): Preserve an empty fragment when parsing.
1604
1605 2004-05-20  Darin Adler  <darin@apple.com>
1606
1607         Reviewed by Maciej.
1608
1609         - fixed <rdar://problem/3575385>: (multiple radio buttons checked when arriving at sites (poll at www.1170kfaq.com, many others))
1610
1611         * khtml/html/html_formimpl.cpp:
1612         (HTMLInputElementImpl::parseHTMLAttribute): Use setChecked to set the default value if we are still in
1613         "use default checked" mode. That way, other radio buttons will be unchecked properly and the proper
1614         changed methods will be dispatched.
1615         (HTMLInputElementImpl::reset): Ditto.
1616         * khtml/html/html_formimpl.h: (DOM::HTMLInputElementImpl::checked): Changed to just return m_checked.
1617         The m_useDefaultChecked flag is now only really looked at when you parse a checked attribute; that's
1618         because m_checked and m_defaultChecked are kept equal as long as m_useDefaultChecked is true.
1619
1620         * khtml/xml/dom_nodeimpl.h: Removed an unnecessary virtual, to make code a little smaller and faster.
1621
1622 2004-05-20  Darin Adler  <darin@apple.com>
1623
1624         Reviewed by Chris.
1625
1626         - fixed <rdar://problem/3662383>: (REGRESSION: drag slide-back sometimes causes link to load)
1627         - fixed <rdar://problem/3662556>: (REGRESSION: letting up mouse while dragging over link activates the link)
1628
1629         * khtml/khtmlview.h: Added invalidateClick.
1630         * khtml/khtmlview.cpp: (KHTMLView::invalidateClick): Added. Sets clickCount to 0.
1631
1632         * kwq/KWQKHTMLPart.mm:
1633         (KWQKHTMLPart::matchLabelsAgainstElement): Changed a string replace to a character replace for slightly
1634         faster code and smaller code size.
1635         (KWQKHTMLPart::khtmlMouseMoveEvent): Call invalidateClick at the appropriate times. To do this correctly,
1636         had to add a boolean result to handleMouseDragged: so I can tell if a drag started or not (due to hysteresis).
1637         (KWQKHTMLPart::attributedString): Changed a string append to a character append for slightly faster code
1638         and smaller code size.
1639
1640         * kwq/WebCoreBridge.h: Added BOOL result to handleMouseDragged:.
1641
1642         Reviewed by Dave.
1643
1644         - handle rules with empty bodies properly
1645
1646         * khtml/css/parser.y: Remove bogus check for empty body that prevents the rule
1647         from being created.
1648         * khtml/css/parser.cpp: Regenerated.
1649
1650 2004-05-20  David Hyatt  <hyatt@apple.com>
1651
1652         Revise the patch for incorrect caret positions when brs get deleted.  It can be even simpler.
1653         
1654         Reviewed by kocienda
1655
1656         * khtml/rendering/render_flow.cpp:
1657         (RenderFlow::dirtyLinesFromChangedChild):
1658         * khtml/rendering/render_text.cpp:
1659         (RenderText::detach):
1660
1661 2004-05-20  David Hyatt  <hyatt@apple.com>
1662
1663         Fix for 3629816, caret in wrong position when deleting <br>s on lines by themselves or when moving <br>s
1664         on lines by themselves.
1665         
1666         Reviewed by kocienda
1667
1668         * khtml/rendering/render_box.cpp:
1669         (RenderBox::detach):
1670         * khtml/rendering/render_br.cpp:
1671         (RenderBR::setPos):
1672         * khtml/rendering/render_br.h:
1673         * khtml/rendering/render_flow.cpp:
1674         (RenderFlow::dirtyLinesFromChangedChild):
1675
1676 2004-05-20  Ken Kocienda  <kocienda@apple.com>
1677
1678         Reviewed by Hyatt
1679
1680         Provide the methods to glue the WebView's editing delegate so that these methods work:
1681         
1682         <rdar://problem/3655316>: "Editing: -webViewShouldBeginEditing:inDOMRange: method unimplemented (WebKit editing API)"
1683         <rdar://problem/3655317>: "Editing: -webViewShouldEndEditing:inDOMRange: method unimplemented (WebKit editing API)"
1684
1685         While I was in the neighborhood and working on understanding focus shifts, I fixed this bug as well:
1686         
1687         <rdar://problem/3645154>: "contentEditable div receives focus and blur twice when focus changes to new element"
1688
1689         * khtml/khtml_part.cpp:
1690         (KHTMLPart::invalidateSelection): Do not move focus in this function. That is just a mistake. This function
1691         is all about redraw.
1692         (KHTMLPart::selectionLayoutChanged): New function. Factor out the redraw parts of notifySelectionChanged so
1693         that invalidateSelection can call it.
1694         (KHTMLPart::notifySelectionChanged): Call selectionLayoutChanged now that the redraw parts have been
1695         factored out.
1696         (KHTMLPart::shouldBeginEditing): New function that calls through to the KWQKHTMLPart in an APPLE_CHANGES
1697         block. This is part of the code path that will eventually The WebView's delegate to ask the
1698         shouldBeginEditing question. 
1699         (KHTMLPart::shouldEndEditing): Ditto, except the question is about shouldEndEditing.
1700         * khtml/khtml_part.h:
1701         * khtml/khtmlview.cpp:
1702         (KHTMLView::dispatchMouseEvent): Now looks at the boolean value returned from DocumentImpl::setFocusNode 
1703         (described below). If the focus shift was blocked, swallow the mouse event.
1704         * khtml/xml/dom_docimpl.cpp:
1705         (DocumentImpl::relinquishesEditingFocus): Part of the WebView's delegation call chain described above.
1706         (DocumentImpl::acceptsEditingFocus): Ditto.
1707         (DocumentImpl::setFocusNode): Many improvements. Now handles WebView delegation and switching focus
1708         in the handlers called as a result of the DOM events that this function calls. Also now returns a 
1709         boolean to say whether the attempt to set focus was blocked by a handler or by the WebView's delegate.
1710         * khtml/xml/dom_docimpl.h:
1711         * kwq/KWQKHTMLPart.h:
1712         * kwq/KWQKHTMLPart.mm:
1713         (KWQKHTMLPart::shouldBeginEditing): More WebView's delegation glue.
1714         (KWQKHTMLPart::shouldEndEditing): Ditto.
1715         * kwq/WebCoreBridge.h:
1716
1717 2004-05-20  Richard Williamson   <rjw@apple.com>
1718
1719         Reviewed by NOBODY (OOPS!).
1720
1721         * kwq/DOM.mm:
1722         (-[DOMObject _init]):
1723         * kwq/DOMInternal.mm:
1724         (-[WebScriptObject _init]):
1725         (-[WebScriptObject _initializeScriptDOMNodeImp]):
1726         * kwq/KWQKHTMLPart.h:
1727         * kwq/KWQKHTMLPart.mm:
1728         (KWQKHTMLPart::KWQKHTMLPart):
1729         (KWQKHTMLPart::bindingRootObject):
1730         (KWQKHTMLPart::windowScriptObject):
1731
1732 2004-05-20  Darin Adler  <darin@apple.com>
1733
1734         Reviewed by Ken.
1735
1736         - fixed <rdar://problem/3661918>: "repro nil-deref in RenderImage::paint (www.codepoetry.net)"
1737
1738         * khtml/rendering/render_image.cpp: (RenderImage::paint): Check renderer pointer to see if it's
1739         nil before dereferencing it.
1740
1741         - fixed <rdar://problem/3658455>: "readFromData:options:documentAttributes: crashes when passed page without a body (in WebKit mode)"
1742
1743         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::bodyBackgroundColor): Check renderer pointer to see if it's
1744         nil before dereferencing it.
1745
1746         - fixed <rdar://problem/2948112>: "implement addRule for JavaScript for style sheets"
1747
1748         * khtml/dom/css_stylesheet.h: Added addRule.
1749         * khtml/dom/css_stylesheet.cpp: (CSSStyleSheet::addRule): Added.
1750         * khtml/css/css_stylesheetimpl.h: Added addRule.
1751         * khtml/css/css_stylesheetimpl.cpp: (CSSStyleSheetImpl::addRule): Added an implementation
1752         based on the Microsoft documentation. An index of -1 means "at the end of the list".
1753
1754         * khtml/dom/dom_string.h: Changed the string-append operator to be a non-member function
1755         so it works even if the left side has to undergo type conversion.
1756         * khtml/dom/dom_string.cpp: (DOM::operator+): Changed implementation to match above.
1757         Also changed to not use anything private or protected so it doesn't have to be a friend.
1758
1759         * khtml/ecma/kjs_css.h: Added addRule to the list of functions for CSS style sheets.
1760         * khtml/ecma/kjs_css.cpp: (DOMCSSStyleSheetProtoFunc::tryCall): Add support for addRule,
1761         based on the Microsoft documentation; always returns -1. Also removed unused string conversions.
1762         * khtml/ecma/kjs_css.lut.h: Regenerated.
1763
1764 2004-05-19  David Hyatt  <hyatt@apple.com>
1765
1766         Implement support for notification posting to accessibility clients for layouts and loads.
1767         
1768         * khtml/khtmlview.cpp:
1769         (KHTMLView::layout):
1770         * khtml/xml/dom_docimpl.cpp:
1771         (DocumentImpl::close):
1772         * kwq/KWQAccObjectCache.h:
1773         (KWQAccObjectCache::enableAccessibility):
1774         (KWQAccObjectCache::accessibilityEnabled):
1775         * kwq/KWQAccObjectCache.mm:
1776         (KWQAccObjectCache::accObject):
1777         (KWQAccObjectCache::setAccObject):
1778         (KWQAccObjectCache::removeAccObject):
1779         (KWQAccObjectCache::detach):
1780         (KWQAccObjectCache::childrenChanged):
1781         (KWQAccObjectCache::postNotification):
1782         * kwq/WebCoreBridge.mm:
1783         (-[WebCoreBridge accessibilityTree]):
1784
1785 2004-05-19  Chris Blumenberg  <cblu@apple.com>
1786
1787         Tweaks for forthcoming dragging improvements.
1788
1789         Reviewed by john.
1790
1791         * kwq/WebCoreBridge.h:
1792         * kwq/WebCoreBridge.mm:
1793         (-[WebCoreBridge moveDragCaretToPoint:]): renamed for future reasons, removed text only restrictions
1794
1795 2004-05-19  Ken Kocienda  <kocienda@apple.com>
1796
1797         Reviewed by Hyatt and Darin
1798
1799         Fix for this bug:
1800         
1801         <rdar://problem/3643230>: "can't tab out of contentEditable Elements"
1802
1803         * khtml/xml/dom_elementimpl.cpp: Now checks if key event was intercepted by the editing
1804         key-handler before setting the event as defaultHandled.
1805         (ElementImpl::defaultEventHandler):
1806         * kwq/KWQKHTMLPart.h: Name change from editingKeyEvent.
1807         Also now returns a BOOL to report whether the event was handled or not.
1808         * kwq/KWQKHTMLPart.mm: 
1809         (KWQKHTMLPart::interceptEditingKeyEvent): Ditto.
1810         * kwq/WebCoreBridge.h: Renamed from _editingKeyDown.
1811
1812 2004-05-19  Ken Kocienda  <kocienda@apple.com>
1813
1814         Reviewed by John
1815
1816         Fix for this bug:
1817         
1818         <rdar://problem/3655601>: "deleting characters is much slower than inserting them"
1819
1820         Cleaned up the way selections are set in edit commands, and how KHTMLPart is
1821         notified of these changes. This clears up a number of inefficiencies, including unnecessary repaints
1822         which were causing the performace problem.
1823
1824         * khtml/editing/htmlediting.cpp: Removed moveToStartingSelection and moveToEndingSelection functions.
1825         This work is going to be done using another pre-existing communication facility shared by edit commands
1826         and the part.
1827         * khtml/editing/htmlediting.h: Ditto.
1828         * khtml/editing/htmlediting_impl.cpp:
1829         (khtml::EditCommandImpl::setStartingSelection): Fix coding mistake which caused double recursion while setting
1830         ancestor values.
1831         (khtml::EditCommandImpl::setEndingSelection): Ditto.
1832         (khtml::CompositeEditCommandImpl::doUnapply): No longer calls moveToStartingSelection. Work done in the part now.
1833         (khtml::CompositeEditCommandImpl::doReapply): No longer calls moveToEndingSelection. Work done in the part now.
1834         (khtml::TypingCommandImpl::typingAddedToOpenCommand): New function. Provides a hook for
1835         typing commands to tell the part about additional typing that has been done.
1836         (khtml::TypingCommandImpl::insertText): Now calls typingAddedToOpenCommand.
1837         (khtml::TypingCommandImpl::insertNewline): Ditto.
1838         (khtml::TypingCommandImpl::issueCommandForDeleteKey): Ditto.
1839         (khtml::TypingCommandImpl::deleteKeyPressed): Ditto.
1840         * khtml/editing/htmlediting_impl.h: Removed moveToStartingSelection and moveToEndingSelection functions.
1841         * khtml/khtml_part.cpp:
1842         (KHTMLPart::setSelection): Modified to take an argument which tells whether the set closes an active
1843         typing command.
1844         (KHTMLPart::notifySelectionChanged): Changed endTyping variable to be consistent with "close typing"
1845         terminology used elsewhere.
1846         (KHTMLPart::appliedEditing): Now sets the selection using the value of the passed-in command. Added
1847         an assert for typing cases. Fixed problem where didChangeNotification was not being posted for typing
1848         changes after the first one.
1849         (KHTMLPart::unappliedEditing): Now sets the selection using the value of the passed-in command.
1850         (KHTMLPart::reappliedEditing): Now sets the selection using the value of the passed-in command.
1851         * khtml/khtml_part.h:
1852         * khtml/rendering/render_canvas.cpp:
1853         (RenderCanvas::clearSelection): Do not call repaint when the selection is a caret.
1854
1855 2004-05-19  Ken Kocienda  <kocienda@apple.com>
1856
1857         Reviewed by Hyatt
1858
1859         * khtml/html/html_elementimpl.cpp:
1860         (HTMLElementImpl::isContentEditable): Ask if the part is contenteditable.
1861         True value is treated as an "override" and will short-circuit, returning true.
1862         * khtml/khtml_part.cpp:
1863         (KHTMLPart::isContentEditable): Call over bridge. Has the effect of checking the
1864         isEditable method on the WebView which contains this part.
1865         * khtml/khtml_part.h: Declare isContentEditable.
1866         * kwq/KWQKHTMLPart.h: Declare isContentEditable.
1867         * kwq/KWQKHTMLPart.mm:
1868         (KWQKHTMLPart::isContentEditable): Call over bridge, as described above.
1869         * kwq/WebCoreBridge.h: Declare isEditable.
1870
1871 2004-05-19  Darin Adler  <darin@apple.com>
1872
1873         - fixed headers with licenses mangled by Xcode auto-indenting
1874
1875         * kwq/DOMExtensions.h:
1876         * kwq/KWQAccObject.h:
1877         * kwq/KWQAccObject.mm:
1878         * kwq/KWQAccObjectCache.h:
1879         * kwq/KWQKSSLKeyGen.mm:
1880         * kwq/KWQScrollBar.mm:
1881         * kwq/KWQSlider.mm:
1882         * kwq/WebCoreGraphicsBridge.h:
1883         * kwq/WebCoreGraphicsBridge.m:
1884         * kwq/WebCoreKeyGenerator.h:
1885         * kwq/WebCoreKeyGenerator.m:
1886
1887 2004-05-18  David Hyatt  <hyatt@apple.com>
1888
1889         Add two new attributes for accessibility that can be polled by the screen reader.  AXLayoutCount indicates
1890         the number of layouts that have occurred, and AXLoaded indicates whether or not a page has finished loading.
1891         
1892         * khtml/khtmlview.cpp:
1893         (KHTMLViewPrivate::reset):
1894         (KHTMLView::layoutCount):
1895         (KHTMLView::layout):
1896         * khtml/khtmlview.h:
1897         * kwq/KWQAccObject.mm:
1898         (-[KWQAccObject roleDescription]):
1899         (-[KWQAccObject accessibilityAttributeNames]):
1900         (-[KWQAccObject accessibilityAttributeValue:]):
1901
1902 2004-05-18  David Hyatt  <hyatt@apple.com>
1903
1904         Fix crash when retrieving the AXHelp text.
1905         
1906         * kwq/KWQAccObject.mm:
1907         (-[KWQAccObject helpText]):
1908
1909 2004-05-18  David Hyatt  <hyatt@apple.com>
1910
1911         Improve layout scheduling and add instrumentation for debugging layout scheduling
1912         
1913         Reviewed by kocienda
1914
1915         * khtml/khtml_part.cpp:
1916         (KHTMLPart::slotFinishedParsing):
1917         (KHTMLPart::checkCompleted):
1918         * khtml/khtmlview.cpp:
1919         (KHTMLViewPrivate::KHTMLViewPrivate):
1920         (KHTMLViewPrivate::reset):
1921         (KHTMLView::layout):
1922         (KHTMLView::scheduleRelayout):
1923         (KHTMLView::haveDelayedLayoutScheduled):
1924         (KHTMLView::unscheduleRelayout):
1925         * khtml/khtmlview.h:
1926         * khtml/rendering/render_object.cpp:
1927         (RenderObject::repaintAfterLayoutIfNeeded):
1928         * khtml/rendering/render_replaced.cpp:
1929         (RenderWidget::updateWidgetPositions):
1930         * khtml/xml/dom_docimpl.cpp:
1931         (DocumentImpl::DocumentImpl):
1932         (DocumentImpl::close):
1933         (DocumentImpl::setParsing):
1934         (DocumentImpl::shouldScheduleLayout):
1935         (DocumentImpl::minimumLayoutDelay):
1936         (DocumentImpl::elapsedTime):
1937         (DocumentImpl::finishParsing):
1938         (DocumentImpl::updateStyleSelector):
1939         * khtml/xml/dom_docimpl.h:
1940         (DOM::DocumentImpl::allDataReceived):
1941         * kwq/KWQDateTime.h:
1942         * kwq/KWQDateTime.mm:
1943         (QTime::elapsed):
1944         * kwq/KWQWidget.mm:
1945         (QWidget::setFrameGeometry):
1946
1947 2004-05-18  Richard Williamson   <rjw@apple.com>
1948
1949         Finished implementing support for windowScriptObject.
1950
1951         Reviewed by Maciej.
1952
1953         * khtml/khtml_part.cpp:
1954         (KHTMLPart::begin):
1955         * kwq/KWQKHTMLPart.h:
1956         * kwq/KWQKHTMLPart.mm:
1957         (KWQKHTMLPart::KWQKHTMLPart):
1958         (KWQKHTMLPart::~KWQKHTMLPart):
1959         (KWQKHTMLPart::windowScriptObject):
1960         * kwq/WebCoreBridge.mm:
1961         (updateRenderingForBindings):
1962
1963 2004-05-18  Richard Williamson   <rjw@apple.com>
1964
1965         Added stubs to get the WebScriptObject for the window
1966         JS object.
1967         
1968         Made updateRenderingForBindings more robust when handed a
1969         nil root object.  This was causing a crash in DB.  Still need to
1970         address root cause of nil root object.
1971
1972         Reviewed by Maciej.
1973
1974         * khtml/khtml_part.cpp:
1975         (KHTMLPart::begin):
1976         * kwq/KWQKHTMLPart.h:
1977         * kwq/KWQKHTMLPart.mm:
1978         (KWQKHTMLPart::windowScriptObject):
1979         (KWQKHTMLPart::partClearedInBegin):
1980         * kwq/WebCoreBridge.h:
1981         * kwq/WebCoreBridge.mm:
1982         (updateRenderingForBindings):
1983         (-[WebCoreBridge init]):
1984         (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]):
1985         (-[WebCoreBridge windowScriptObject]):
1986
1987 2004-05-17  Maciej Stachowiak  <mjs@apple.com>
1988
1989         Reviewed by Ken.
1990
1991         <rdar://problem/3656719>: Implement outerHTML and setOuterHTML DOM extensions
1992
1993         They were already implemented (by Chris), all that was required
1994         was exporting them to JavaScript.
1995
1996         * khtml/dom/html_element.cpp:
1997         (HTMLElement::outerHTML): Call impl.
1998         (HTMLElement::setOuterHTML): Ditto.
1999         * khtml/dom/html_element.h: Prototype new methods.
2000         * khtml/ecma/kjs_html.cpp:
2001         (KJS::HTMLElement::getValueProperty): Add OuterHTML.
2002         (KJS::HTMLElement::putValue): Add OuterHTML.
2003         * khtml/ecma/kjs_html.h: Add new enum values.
2004         * khtml/ecma/kjs_html.lut.h: Regenerated.
2005
2006 2004-05-18  Ken Kocienda  <kocienda@apple.com>
2007
2008         Reviewed by Hyatt
2009
2010         Removed support for designMode attribute, which we will not be supporting for Tiger.
2011         Removed inEditMode from KHTMLPart. This cached designMode value.
2012         Removed KHTMLPart::isEditingAtNode function. Asking a node if it is content-editable
2013         is a suitable replacement.
2014
2015         * khtml/dom/dom_misc.h: Remove TristateFlag enum that was used to track designMode values.
2016         * khtml/dom/html_document.cpp: Remove designMode and setDesignMode.
2017         * khtml/dom/html_document.h: Ditto.
2018         * khtml/ecma/kjs_html.cpp:
2019         (KJS::HTMLDocument::tryGet): Remove designMode.
2020         (KJS::HTMLDocument::putValue): Ditto.
2021         * khtml/ecma/kjs_html.lut.h:
2022         (KJS::): Ditto.
2023         * khtml/html/html_documentimpl.cpp: Remove designMode and setDesignMode.
2024         * khtml/html/html_documentimpl.h: Ditto.
2025         * khtml/khtml_part.cpp: Remove setEditMode, editMode, inEditMode, and isEditingAtNode.
2026         * khtml/khtml_part.h: Ditto.
2027         * khtml/khtmlpart_p.h: Remove m_inEditMode variable.
2028         (KHTMLPartPrivate::KHTMLPartPrivate):
2029         * khtml/khtmlview.cpp:
2030         (KHTMLView::focusNextPrevNode): Change over one use in tree of isEditingAtNode to use
2031         isContentEditable instead. isContentEditable will be modified in future patch to handle
2032         whether the per-part switch has been thrown to override whether something is editable or not.
2033
2034 2004-05-17  Richard Williamson   <rjw@apple.com>
2035
2036         Implemented new API for WebScriptObject.
2037         Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
2038
2039         Reviewed by Hyatt.
2040
2041         * kwq/WebCoreBridge.mm:
2042         (updateRenderingForBindings):
2043         (-[WebCoreBridge init]):
2044
2045 2004-05-14  Vicki Murley  <vicki@apple.com>
2046
2047         Reviewed by mjs.
2048  
2049         <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
2050
2051         * WebCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
2052
2053 2004-05-14  Darin Adler  <darin@apple.com>
2054
2055         Reviewed by Darin, coded by Maciej.
2056
2057         - fixed extra repaints when doing auto-fill checks on all pages that have pop-up buttons
2058
2059         * kwq/KWQComboBox.mm:
2060         (QComboBox::populateMenu): Set the populating-menu flag and clear it when done.
2061         (-[KWQPopUpButton setPopulatingMenu:]): Added. Sets flag.
2062         (-[KWQPopUpButton setNeedsDisplayInRect:]): Do nothing if the flag is set.
2063
2064 2004-05-14  Darin Adler  <darin@apple.com>
2065
2066         Reviewed by Dave.
2067
2068         - fixed <rdar://problem/3650026>: "background property doesn't work right on webdevtips.com due to background:inherit"
2069
2070         * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
2071         Added CSS_PROP_BACKGROUND to the list of properties that must be applied in the first pass.
2072
2073 === Safari-140 ===
2074
2075 2004-05-13  David Hyatt  <hyatt@apple.com>
2076
2077         Fix image loading for <input type=image> and <object>.  Make sure it works dynamically and make sure
2078         the renderer is properly null-checked at attach time.
2079         
2080         Reviewed by darin
2081
2082         * khtml/html/html_formimpl.cpp:
2083         (HTMLInputElementImpl::HTMLInputElementImpl):
2084         (HTMLInputElementImpl::~HTMLInputElementImpl):
2085         (HTMLInputElementImpl::parseHTMLAttribute):
2086         (HTMLInputElementImpl::attach):
2087         * khtml/html/html_formimpl.h:
2088         * khtml/html/html_objectimpl.cpp:
2089         (HTMLObjectElementImpl::HTMLObjectElementImpl):
2090         (HTMLObjectElementImpl::~HTMLObjectElementImpl):
2091         (HTMLObjectElementImpl::parseHTMLAttribute):
2092         (HTMLObjectElementImpl::attach):
2093         * khtml/html/html_objectimpl.h:
2094
2095 2004-05-14  Chris Blumenberg  <cblu@apple.com>
2096
2097         - Made DOMEventTarget a formal protocol that is implemented by DOMNode
2098         - Made DOMEventListener a formal protocol that any object can implement
2099
2100         Reviewed by kocienda.
2101
2102         * kwq/DOMCore.h:
2103         * kwq/DOMEvents.h:
2104
2105 2004-05-13  Richard Williamson   <rjw@apple.com>
2106
2107         Removed vestigial isSelected method.
2108
2109         Reviewed by Chris.
2110
2111         * kwq/KWQWidget.h:
2112         * kwq/KWQWidget.mm:
2113         (QWidget::setIsSelected):
2114         * kwq/WebCoreBridge.h:
2115
2116 2004-05-13  Chris Blumenberg  <cblu@apple.com>
2117
2118         Fixed: <rdar://problem/3616555>: (API: Make DOM extensions and WebKit DOM operations public)
2119
2120         Reviewed by rjw.
2121
2122         * kwq/DOM.h: added DOMExtensions.h
2123         * kwq/DOMHTML.h: renamed frame on DOMHTMLTableElement to frameBorders to avoid NSView conflicts
2124         * kwq/DOMHTML.mm:
2125         (-[DOMHTMLTableElement frameBorders]):
2126         (-[DOMHTMLTableElement setFrameBorders:]):
2127
2128 2004-05-13  Richard Williamson   <rjw@apple.com>
2129
2130         Changed imports of all DOM headers.  DOM headers
2131         should be imported using the normal #import <WebCore/foo.h>,
2132         they import is modified when copied to WebKit.
2133
2134         Reviewed by Chris.
2135
2136         * ChangeLog:
2137         * kwq/DOM.h:
2138         * kwq/DOMCSS.h:
2139         * kwq/DOMCore.h:
2140         * kwq/DOMEvents.h:
2141         * kwq/DOMExtensions.h:
2142         * kwq/DOMHTML.h:
2143         * kwq/DOMInternal.h:
2144         * kwq/DOMRange.h:
2145         * kwq/DOMStylesheets.h:
2146         * kwq/DOMTraversal.h:
2147         * kwq/DOMViews.h:
2148
2149 2004-05-13  Ken Kocienda  <kocienda@apple.com>
2150
2151         Reviewed by me
2152
2153         * khtml/editing/htmlediting_impl.cpp:
2154         (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Fix deployment
2155         build bustage. Uninitialized variable.
2156
2157 2004-05-13  Ken Kocienda  <kocienda@apple.com>
2158
2159         Reviewed by Hyatt
2160
2161         Implemented first cut at text style change code.
2162
2163         * khtml/editing/htmlediting.cpp:
2164         (khtml::ApplyStyleCommand::ApplyStyleCommand):
2165         (khtml::ApplyStyleCommand::~ApplyStyleCommand):
2166         (khtml::ApplyStyleCommand::impl):
2167         (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand):
2168         (khtml::RemoveCSSPropertyCommand::~RemoveCSSPropertyCommand):
2169         (khtml::RemoveCSSPropertyCommand::impl):
2170         (khtml::RemoveCSSPropertyCommand::styleDeclaration):
2171         (khtml::RemoveCSSPropertyCommand::property):
2172         (khtml::RemoveNodeAttributeCommand::RemoveNodeAttributeCommand):
2173         (khtml::RemoveNodeAttributeCommand::~RemoveNodeAttributeCommand):
2174         (khtml::RemoveNodeAttributeCommand::impl):
2175         (khtml::RemoveNodeAttributeCommand::element):
2176         (khtml::RemoveNodeAttributeCommand::attribute):
2177         (khtml::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
2178         (khtml::RemoveNodePreservingChildrenCommand::~RemoveNodePreservingChildrenCommand):
2179         (khtml::RemoveNodePreservingChildrenCommand::impl):
2180         (khtml::RemoveNodePreservingChildrenCommand::node):
2181         (khtml::SetNodeAttributeCommand::SetNodeAttributeCommand):
2182         (khtml::SetNodeAttributeCommand::~SetNodeAttributeCommand):
2183         (khtml::SetNodeAttributeCommand::impl):
2184         (khtml::SetNodeAttributeCommand::element):
2185         (khtml::SetNodeAttributeCommand::attribute):
2186         (khtml::SetNodeAttributeCommand::value):
2187         * khtml/editing/htmlediting.h:
2188         (khtml::):
2189         (khtml::ApplyStyleCommand::):
2190         
2191         Removed a bunch of unnecessary DOM namespace qualifiers.
2192         Fixed calls to parent(), which relied on the TreeShared interface to get a parent,
2193         and changed to the parentNode() DOM Node call, which is more suitable given the
2194         intention.
2195         
2196         * khtml/editing/htmlediting_impl.cpp:
2197         (khtml::CompositeEditCommandImpl::insertNodeBefore):
2198         (khtml::CompositeEditCommandImpl::insertNodeAfter):
2199         (khtml::CompositeEditCommandImpl::appendNode):
2200         (khtml::CompositeEditCommandImpl::removeNode):
2201         (khtml::CompositeEditCommandImpl::removeNodeAndPrune):
2202         (khtml::CompositeEditCommandImpl::removeNodePreservingChildren):
2203         (khtml::CompositeEditCommandImpl::splitTextNode):
2204         (khtml::CompositeEditCommandImpl::joinTextNodes):
2205         (khtml::CompositeEditCommandImpl::insertText):
2206         (khtml::CompositeEditCommandImpl::deleteText):
2207         (khtml::CompositeEditCommandImpl::replaceText):
2208         (khtml::CompositeEditCommandImpl::removeCSSProperty):
2209         (khtml::CompositeEditCommandImpl::removeNodeAttribute):
2210         (khtml::CompositeEditCommandImpl::setNodeAttribute):
2211         
2212         
2213         Text style change command implementations.
2214         There are a couple more parent() -> parentNode() changes in here as well.
2215         
2216         (khtml::ApplyStyleCommandImpl::ApplyStyleCommandImpl):
2217         (khtml::ApplyStyleCommandImpl::~ApplyStyleCommandImpl):
2218         (khtml::ApplyStyleCommandImpl::commandID):
2219         (khtml::ApplyStyleCommandImpl::doApply):
2220         (khtml::ApplyStyleCommandImpl::isHTMLStyleNode):
2221         (khtml::ApplyStyleCommandImpl::removeHTMLStyleNode):
2222         (khtml::ApplyStyleCommandImpl::removeCSSStyle):
2223         (khtml::ApplyStyleCommandImpl::removeCSSProperty):
2224         (khtml::ApplyStyleCommandImpl::setNodeAttribute):
2225         (khtml::ApplyStyleCommandImpl::removeNodeAttribute):
2226         (khtml::ApplyStyleCommandImpl::removeNodePreservingChildren):
2227         (khtml::ApplyStyleCommandImpl::mustExlicitlyApplyStyle):
2228         (khtml::ApplyStyleCommandImpl::createExplicitApplyStyleNode):
2229         (khtml::ApplyStyleCommandImpl::currentlyHasStyle):
2230         (khtml::ApplyStyleCommandImpl::cssProperty):
2231         (khtml::ApplyStyleCommandImpl::matchesTargetStyle):
2232         (khtml::ApplyStyleCommandImpl::positionInsertionPoint):
2233         (khtml::ApplyStyleCommandImpl::splitTextAtStartIfNeeded):
2234         (khtml::ApplyStyleCommandImpl::splitTextAtEndIfNeeded):
2235         (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded):
2236         (khtml::ApplyStyleCommandImpl::removeStyle):
2237         (khtml::ApplyStyleCommandImpl::cloneSelection):
2238         (khtml::ApplyStyleCommandImpl::insertFragment):
2239         (khtml::ApplyStyleCommandImpl::applyInPlace):
2240         (khtml::ApplyStyleCommandImpl::applyUsingFragment):
2241         (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
2242         (khtml::InsertNodeBeforeCommandImpl::doApply):
2243         (khtml::InsertNodeBeforeCommandImpl::doUnapply):
2244         (khtml::JoinTextNodesCommandImpl::doApply):
2245         (khtml::PasteMarkupCommandImpl::PasteMarkupCommandImpl):
2246         (khtml::RemoveCSSPropertyCommandImpl::RemoveCSSPropertyCommandImpl):
2247         (khtml::RemoveCSSPropertyCommandImpl::~RemoveCSSPropertyCommandImpl):
2248         (khtml::RemoveCSSPropertyCommandImpl::commandID):
2249         (khtml::RemoveCSSPropertyCommandImpl::doApply):
2250         (khtml::RemoveCSSPropertyCommandImpl::doUnapply):
2251         (khtml::RemoveNodeAttributeCommandImpl::RemoveNodeAttributeCommandImpl):
2252         (khtml::RemoveNodeAttributeCommandImpl::~RemoveNodeAttributeCommandImpl):
2253         (khtml::RemoveNodeAttributeCommandImpl::commandID):
2254         (khtml::RemoveNodeAttributeCommandImpl::doApply):
2255         (khtml::RemoveNodeAttributeCommandImpl::doUnapply):
2256         (khtml::RemoveNodePreservingChildrenCommandImpl::RemoveNodePreservingChildrenCommandImpl):
2257         (khtml::RemoveNodePreservingChildrenCommandImpl::~RemoveNodePreservingChildrenCommandImpl):
2258         (khtml::RemoveNodePreservingChildrenCommandImpl::commandID):
2259         (khtml::RemoveNodePreservingChildrenCommandImpl::doApply):
2260         (khtml::SetNodeAttributeCommandImpl::SetNodeAttributeCommandImpl):
2261         (khtml::SetNodeAttributeCommandImpl::~SetNodeAttributeCommandImpl):
2262         (khtml::SetNodeAttributeCommandImpl::commandID):
2263         (khtml::SetNodeAttributeCommandImpl::doApply):
2264         (khtml::SetNodeAttributeCommandImpl::doUnapply):
2265         (khtml::SplitTextNodeCommandImpl::doUnapply):
2266         (khtml::TypingCommandImpl::insertText):
2267
2268
2269         Text style change command implementations.
2270
2271         * khtml/editing/htmlediting_impl.h:
2272         (khtml::ApplyStyleCommandImpl::):
2273         (khtml::ApplyStyleCommandImpl::removingStyle):
2274         (khtml::RemoveCSSPropertyCommandImpl::styleDeclaration):
2275         (khtml::RemoveCSSPropertyCommandImpl::property):
2276         (khtml::RemoveNodeAttributeCommandImpl::element):
2277         (khtml::RemoveNodeAttributeCommandImpl::attribute):
2278         (khtml::RemoveNodePreservingChildrenCommandImpl::node):
2279         (khtml::SetNodeAttributeCommandImpl::element):
2280         (khtml::SetNodeAttributeCommandImpl::attribute):
2281         (khtml::SetNodeAttributeCommandImpl::value):
2282         
2283         
2284         Fixed a bug where the TreeWalker returned the current node instead
2285         of null when an attempt was made to use the iterator to go to a
2286         non-existent location.
2287         
2288         * khtml/xml/dom2_traversalimpl.cpp:
2289         (DOM::TreeWalkerImpl::parentNode):
2290         (DOM::TreeWalkerImpl::firstChild):
2291         (DOM::TreeWalkerImpl::lastChild):
2292         (DOM::TreeWalkerImpl::previousSibling):
2293         (DOM::TreeWalkerImpl::nextSibling):
2294         (DOM::TreeWalkerImpl::previousNode):
2295         (DOM::TreeWalkerImpl::nextNode):
2296         
2297         
2298         A convenience.
2299         
2300         * khtml/xml/dom_elementimpl.cpp:
2301         (ElementImpl::hasAttributes):
2302         * khtml/xml/dom_elementimpl.h:
2303         
2304         
2305         New helpers to begin moving us to using DOM Range-compliant positions in our code.
2306         
2307         * khtml/xml/dom_position.cpp:
2308         (DOM::Position::equivalentRangeCompliantPosition):
2309         (DOM::Position::equivalentShallowPosition):
2310         (DOM::Position::inLastEditableInContainingEditableBlock):
2311         
2312         
2313         (DOM::Position::debugPosition): Debugging aid.
2314         * khtml/xml/dom_position.h:
2315        
2316         * kwq/WebCoreBridge.mm:
2317         (-[WebCoreBridge applyStyle:]): First bit of wiring up. Some hard-coded temporary code 
2318         in here will need to be improved soon.
2319
2320 2004-05-12  David Hyatt  <hyatt@apple.com>
2321
2322         Improve layout scheduling.  Make sure no layouts can be scheduled until over a minimum delay threshold.
2323         
2324         * khtml/khtmlview.cpp:
2325         (KHTMLView::scheduleRelayout):
2326         * khtml/rendering/render_frames.cpp:
2327         (RenderPart::updateWidgetPositions):
2328         * khtml/rendering/render_text.cpp:
2329         (RenderText::paint):
2330         * khtml/xml/dom_docimpl.cpp:
2331         (DocumentImpl::DocumentImpl):
2332         (DocumentImpl::close):
2333         (DocumentImpl::setParsing):
2334         (DocumentImpl::shouldScheduleLayout):
2335         (DocumentImpl::minimumLayoutDelay):
2336         * khtml/xml/dom_docimpl.h:
2337
2338 2004-05-11  Chris Blumenberg  <cblu@apple.com>
2339
2340         Support for: <rdar://problem/3616471>: (API: provide way to get from WebFrame to DOMDocument and vice versa)
2341
2342         Reviewed by rjw.
2343
2344         * kwq/DOM.mm:
2345         (-[DOMDocument _ownerElement]): new
2346         * kwq/DOMInternal.h:
2347         * kwq/WebCoreBridge.h:
2348         * kwq/WebCoreBridge.mm:
2349         (-[WebCoreBridge frameElement]): new
2350
2351 2004-05-11  David Hyatt  <hyatt@apple.com>
2352
2353         Fix makeChildrenNonInline so that it does not wrap floats unless an inline is actually found.
2354
2355         Fix block minmaxwidth to add together contiguous runs of floats.
2356
2357         Fix the content image loader to not destroy the image when removed from the document.
2358
2359         Reviewed by darin
2360         
2361         * ChangeLog:
2362         * khtml/html/html_imageimpl.cpp:
2363         (HTMLImageLoader::~HTMLImageLoader):
2364         (HTMLImageElementImpl::detach):
2365         * khtml/html/html_imageimpl.h:
2366         (DOM::):
2367         * khtml/html/html_objectimpl.cpp:
2368         (HTMLObjectElementImpl::createRenderer):
2369         * khtml/html/html_objectimpl.h:
2370         * khtml/rendering/render_block.cpp:
2371         (khtml::getInlineRun):
2372         (khtml::RenderBlock::calcInlineMinMaxWidth):
2373         (khtml::RenderBlock::calcBlockMinMaxWidth):
2374
2375 2004-05-06  David Hyatt  <hyatt@apple.com>
2376
2377         Fix makeChildrenNonInline so that it does not wrap floats unless an inline is actually found.
2378
2379         Fix block minmaxwidth to add together contiguous runs of floats.
2380
2381         Fix the content image loader to not destroy the image when removed from the document.
2382         
2383         Reviewed by darin
2384
2385         * khtml/rendering/render_block.cpp:
2386         (khtml::getInlineRun):
2387         (khtml::RenderBlock::calcBlockMinMaxWidth):
2388
2389 2004-05-11  Vicki Murley  <vicki@apple.com>
2390
2391         Reviewed by Vicki (fixed by Darin).
2392
2393         * kwq/KWQKSSLKeyGen.h: fix build failure in B&I due to case sensitivity
2394
2395 2004-05-09  Maciej Stachowiak  <mjs@apple.com>
2396
2397         Reviewed by Darin.
2398
2399         - avoid redecoding animated images that are only used once for
2400         ~2.5% iBench speedup (WebCore part of fix)
2401
2402         * khtml/rendering/render_image.cpp:
2403         (RenderImage::setPixmap): Maintain use count for pixmap.
2404         (RenderImage::~RenderImage): Likewise.
2405         * kwq/KWQPixmap.h:
2406         * kwq/KWQPixmap.mm:
2407         (QPixmap::increaseUseCount): Call WebCoreImageRenderer
2408         (QPixmap::decreaseUseCount): Call WebCoreImageRenderer
2409         * kwq/WebCoreImageRenderer.h: Prototype new protocol methods.
2410
2411 2004-05-10  David Hyatt  <hyatt@apple.com>
2412
2413         Make sure that when finished parsing if all the right conditions are met, we just go ahead and updateRendering and
2414         layout.
2415         
2416         Reviewed by rjw
2417         
2418         * khtml/khtmlview.cpp:
2419         (KHTMLView::scheduleRelayout):
2420
2421 2004-05-08  Maciej Stachowiak  <mjs@apple.com>
2422
2423         Reviewed by Dave.
2424
2425         - some minor performance tweaks that together give .5% or so on
2426         the HTML iBench
2427         
2428         * khtml/css/css_valueimpl.h: don't use a bitfield for id and important,
2429         unpacking the bitfield is too expensive
2430         * kwq/KWQArrayImpl.h:
2431         * kwq/KWQArrayImpl.mm:
2432         (KWQArrayImpl::at): inline this method because it's so hot
2433         * kwq/KWQString.mm:
2434         (allocateHandle): inline this function because it's so hot
2435         (initializeHandleNodes): move this in the file so above can be inlined
2436         (allocateNode): ditto
2437
2438 2004-05-10  David Hyatt  <hyatt@apple.com>
2439
2440         Move image loading to content.
2441         
2442         Reviewed by kocienda
2443
2444         * khtml/html/html_imageimpl.cpp:
2445         (m_imageComplete):
2446         (HTMLImageLoader::~HTMLImageLoader):
2447         (HTMLImageLoader::updateFromElement):
2448         (HTMLImageLoader::removedFromDocument):
2449         (HTMLImageLoader::dispatchLoadEvent):
2450         (HTMLImageLoader::notifyFinished):
2451         (HTMLImageElementImpl::HTMLImageElementImpl):
2452         (HTMLImageElementImpl::parseHTMLAttribute):
2453         (HTMLImageElementImpl::attach):
2454         (HTMLImageElementImpl::detach):
2455         (HTMLImageElementImpl::removedFromDocument):
2456         (HTMLImageElementImpl::currentImage):
2457         * khtml/html/html_imageimpl.h:
2458         (DOM::):
2459         * khtml/html/html_objectimpl.cpp:
2460         (HTMLObjectElementImpl::HTMLObjectElementImpl):
2461         (HTMLObjectElementImpl::removedFromDocument):
2462         (HTMLObjectElementImpl::attach):
2463         * khtml/html/html_objectimpl.h:
2464         * khtml/misc/loader.cpp:
2465         (CachedImage::ref):
2466         * khtml/rendering/render_image.cpp:
2467         (RenderImage::RenderImage):
2468         (RenderImage::setImage):
2469         (RenderImage::updateAltText):
2470         * khtml/rendering/render_image.h:
2471         (khtml::RenderImage::getImage):
2472         * khtml/rendering/render_object.cpp:
2473         (RenderObject::canvas):
2474         * khtml/xml/dom_docimpl.cpp:
2475         (DocumentImpl::dispatchImageLoadEventSoon):
2476         (DocumentImpl::removeImage):
2477         (DocumentImpl::dispatchImageLoadEventsNow):
2478         * khtml/xml/dom_docimpl.h:
2479
2480 2004-05-10  Darin Adler  <darin@apple.com>
2481
2482         Reviewed by Vicki.
2483
2484         - fixed build failure seen in B&I log (due to case sensitive file system?)
2485
2486         * kwq/KWQLoader.h: Include "KWQCString.h" rather than "QCString.h". The latter was
2487         failing because the forwarding header is called "qcstring.h" and I guess B&I started
2488         building with a case sensitive file system. I could have changed this to "qcstring.h",
2489         but it seemed better to use the header's real name since we're inside KWQ here.
2490
2491 2004-05-07  Maciej Stachowiak  <mjs@apple.com>
2492
2493         Reviewed by Dave.
2494
2495         - change things around so extremely hot TokenizerString::current()
2496         method doesn't have to do any work. It's cheaper to maintain the
2497         relevant state than to always compute it.
2498         
2499         * khtml/misc/stringit.h:
2500         (khtml::TokenizerString::TokenizerString): Initialize m_currentChar
2501         (khtml::TokenizerString::push): update m_currentChar
2502         (khtml::TokenizerString::advance): ditto
2503         (khtml::TokenizerString::current): return m_currentChar
2504         * khtml/misc/stringit.cpp:
2505         (khtml::TokenizerString::clear): update m_currentChar
2506         (khtml::TokenizerString::append): update m_currentChar
2507         (khtml::TokenizerString::prepend): update m_currentChar
2508
2509 2004-05-07  Don Melton  <gramps@apple.com>
2510
2511         Reviewed by Dave.
2512
2513         Fixed minor, edge-case regression in KEYGEN RSA logic caused by Dave's
2514         "atomic string" patch back in January.
2515
2516         * khtml/html/html_formimpl.cpp:
2517         (HTMLKeygenElementImpl::encoding):
2518
2519 === Safari-139 ===
2520
2521 2004-05-06  Maciej Stachowiak  <mjs@apple.com>
2522
2523         Reviewed by Darin.
2524
2525         - two trivial changes for a 1% speedup, thanks to Shark
2526         
2527         * khtml/dom/dom_string.cpp:
2528         * khtml/dom/dom_string.h:
2529         (DOM::DOMString::~DOMString): inline this method because it's hot and the
2530         function call overhead was very costly.
2531         * WebCore.pbproj/project.pbxproj: Add -falign-loops=16
2532         optimization flag, as suggested by Shark.
2533
2534 2004-05-06  Chris Blumenberg  <cblu@apple.com>
2535
2536         Added alpha to DOMRGBColor as an extension.
2537
2538         Reviewed by dave.
2539
2540         * kwq/DOM-CSS.mm:
2541         (-[DOMRGBColor alpha]): new
2542         * kwq/DOMExtensions.h:
2543
2544 2004-05-05  David Hyatt  <hyatt@apple.com>
2545
2546         Fix whitespace rendering for brs inside pres. The bug is 3640711.
2547         
2548         Reviewed by kocienda
2549
2550         * khtml/rendering/bidi.cpp:
2551         (khtml::RenderBlock::layoutInlineChildren):
2552         (khtml::RenderBlock::findNextLineBreak):
2553
2554 2004-04-25  Maciej Stachowiak  <mjs@apple.com>
2555
2556         Reviewed by Darin.
2557
2558         * khtml/ecma/kjs_events.cpp:
2559         (JSLazyEventListener::parseCode): Make sure to protect the
2560         permanent "event" string object.
2561
2562 2004-05-05  David Hyatt  <hyatt@apple.com>
2563
2564         Fixes for 3637924, 3643356, and 3558513, all crashes in recalcStyle.  Make sure the tree is always in a
2565         sane state when removing children while changing .innerHTML.
2566         
2567         Reviewed by darin
2568
2569         * khtml/xml/dom_nodeimpl.cpp:
2570
2571 2004-05-05  David Hyatt  <hyatt@apple.com>
2572
2573         A collection of fixes.
2574
2575         (1) Fix a regression from the style sharing landing that made visited and unvisited links accidentally share.
2576         (2) Make sure 100% height divs fill the <body> in quirks mode, even if the body has no height specified.
2577         (3) Make sure table cell percentage heights exclude border/padding.
2578         (4) Make sure that before flexing auto height is used for the contents of the cells.
2579         
2580         Reviewed by darin
2581
2582         * khtml/css/cssstyleselector.cpp:
2583         (khtml::CSSStyleSelector::canShareStyleWithElement):
2584         (khtml::CSSStyleSelector::locateSharedStyle):
2585         * khtml/rendering/render_box.cpp:
2586         (RenderBox::calcPercentageHeight):
2587         * khtml/rendering/render_table.cpp:
2588         (RenderTable::layout):
2589         (RenderTableSection::layoutRows):
2590
2591 2004-05-05  Chris Blumenberg  <cblu@apple.com>
2592
2593         - DOM Extensions API tweaks
2594         - Implemented outerHTML
2595
2596         Reviewed by kocienda.
2597
2598         * WebCore-combined.exp:
2599         * khtml/html/html_elementimpl.cpp:
2600         (HTMLElementImpl::outerHTML): new
2601         (HTMLElementImpl::setOuterHTML): mew
2602         * khtml/html/html_elementimpl.h:
2603         * kwq/DOMExtensions.h: removed background methods on table and table cell since these are unnecessary conveniences
2604         * kwq/DOMHTML.mm:
2605         (-[DOMHTMLElement outerHTML]): new
2606         (-[DOMHTMLElement setOuterHTML:]): mew
2607
2608 2004-05-04  David Hyatt  <hyatt@apple.com>
2609
2610         Fix for 3641331, make sure <th> elements don't reset text-align to center if they inherit a specified
2611         value.
2612
2613         Also remove the styles from <abbr> and <acronym>.
2614         
2615         Reviewed by darin
2616
2617         * khtml/css/cssstyleselector.cpp:
2618         (khtml::CSSStyleSelector::adjustRenderStyle):
2619         * khtml/css/html4.css:
2620         * khtml/css/quirks.css:
2621
2622 2004-05-04  Ken Kocienda  <kocienda@apple.com>
2623
2624         Reviewed by Hyatt
2625         
2626         Fix for behavior which extends selection drawing to beginning and end of blocks.
2627         I added this feature a few days ago, but my checks to see if the extension should
2628         be done was naive: Is first or last item in root line box selected? Clearly this 
2629         needs to be "selection is *beyond* first or last item in root line box. Done.
2630
2631         * khtml/rendering/render_image.cpp:
2632         (RenderImage::paint): Add selectionState() == SelectionInside check.
2633         * khtml/rendering/render_text.cpp:
2634         (InlineTextBox::paintSelection): Constrain passed-in offsets to be relative to box.
2635         Use passed-in offsets to check whether selection extends beyond this box. Also, now
2636         passes in flag to tell whether the whole RenderText has selectionState() == SelectionInside
2637         (in which case you always want to extend).
2638         (RenderText::paint): Remove box offset constraining from here. Now done in above function.
2639         * khtml/rendering/render_text.h: Modify paintSelection interface to add 
2640         selectionState() == SelectionInside flag.
2641
2642 2004-05-04  Ken Kocienda  <kocienda@apple.com>
2643
2644         Reviewed by me
2645         
2646         Added layout tests for DOM traversal objects.
2647
2648         * layout-tests/traversal/node-iterator-001-expected.txt: Added.
2649         * layout-tests/traversal/node-iterator-001.html: Added.
2650         * layout-tests/traversal/node-iterator-002-expected.txt: Added.
2651         * layout-tests/traversal/node-iterator-002.html: Added.
2652         * layout-tests/traversal/node-iterator-003-expected.txt: Added.
2653         * layout-tests/traversal/node-iterator-003.html: Added.
2654         * layout-tests/traversal/node-iterator-004-expected.txt: Added.
2655         * layout-tests/traversal/node-iterator-004.html: Added.
2656         * layout-tests/traversal/node-iterator-005-expected.txt: Added.
2657         * layout-tests/traversal/node-iterator-005.html: Added.
2658         * layout-tests/traversal/node-iterator-006-expected.txt: Added.
2659         * layout-tests/traversal/node-iterator-006.html: Added.
2660         * layout-tests/traversal/node-iterator-007-expected.txt: Added.
2661         * layout-tests/traversal/node-iterator-007.html: Added.
2662         * layout-tests/traversal/traversal.js: Added.
2663         * layout-tests/traversal/tree-walker-001-expected.txt: Added.
2664         * layout-tests/traversal/tree-walker-001.html: Added.
2665         * layout-tests/traversal/tree-walker-002-expected.txt: Added.
2666         * layout-tests/traversal/tree-walker-002.html: Added.
2667         * layout-tests/traversal/tree-walker-003-expected.txt: Added.
2668         * layout-tests/traversal/tree-walker-003.html: Added.
2669         * layout-tests/traversal/tree-walker-004-expected.txt: Added.
2670         * layout-tests/traversal/tree-walker-004.html: Added.
2671
2672 2004-05-04  Ken Kocienda  <kocienda@apple.com>
2673
2674         Reviewed by Hyatt
2675
2676         * khtml/xml/dom2_traversalimpl.cpp:
2677         (DOM::NodeIteratorImpl::nextNode): Change to make NodeIterators behave like the spec in that
2678         reference node is null until you iterate the first time. 
2679         (DOM::NodeIteratorImpl::previousNode): Ditto.
2680
2681 2004-05-04  Ken Kocienda  <kocienda@apple.com>
2682
2683         Reviewed by me
2684
2685         * WebCore.pbproj/project.pbxproj: Backed out unintentional
2686         change.
2687
2688 2004-05-04  Ken Kocienda  <kocienda@apple.com>
2689
2690         Reviewed by Hyatt
2691         
2692         Implemented DOM traversal objects, NodeIterator and TreeWalker.
2693
2694         * WebCore-combined.exp: Regenerate
2695         * WebCore.exp: Export DOMNodeFilter protocol
2696         * khtml/dom/dom2_traversal.cpp: Completed half-done implementation pulled from KDE tree.
2697         * khtml/dom/dom2_traversal.h: Ditto.
2698         * khtml/dom/dom_doc.cpp:
2699         (DOM::Document::createNodeIterator): Ditto.
2700         (DOM::Document::createTreeWalker): Ditto.
2701         * khtml/dom/dom_doc.h: Ditto.
2702         * khtml/ecma/kjs_dom.cpp:
2703         (DOMDocumentProtoFunc::tryCall): Fix cases that create traversal objects.
2704         * khtml/ecma/kjs_traversal.cpp:
2705         (DOMNodeIterator::getValueProperty): Add referenceNode and pointerBeforeReferenceNode
2706         properties to node interator.
2707         (DOMTreeWalkerProtoFunc::tryCall): Fix typo where DOMTreeWalker::PreviousNode case called previousSibling function.
2708         (JSNodeFilterCondition::JSNodeFilterCondition): Implement JS glue class for node filter conditions.
2709         (JSNodeFilterCondition::acceptNode): Ditto.
2710         * khtml/ecma/kjs_traversal.h:
2711         (KJS::DOMNodeIterator::): Add ReferenceNode and PointerBeforeReferenceNode constants.
2712         * khtml/ecma/kjs_traversal.lut.h:
2713         (KJS::): Regenerated
2714         * khtml/xml/dom2_traversalimpl.cpp: Completed half-done implementation pulled from KDE tree.
2715         * khtml/xml/dom2_traversalimpl.h: Ditto.
2716         * khtml/xml/dom_docimpl.cpp:
2717         (DocumentImpl::createNodeIterator): Ditto.
2718         (DocumentImpl::createTreeWalker): Ditto.
2719         * khtml/xml/dom_docimpl.h: Ditto.
2720         * khtml/xml/dom_nodeimpl.cpp:
2721         (NodeImpl::checkAddChild): Patched due to change in isAncestor function. This was the one pre-existing caller.
2722         (NodeImpl::isAncestor): Changed so that it does not return true for itself: node->isAncestor(node) now returns false.
2723         * khtml/xml/dom_nodeimpl.h: Made isAncestor const.
2724         * kwq/DOM.mm: Implemented obj-c glue for traversal objects.
2725         * kwq/DOMInternal.h: Ditto.
2726         * kwq/DOMTraversal.h: Ditto.
2727
2728 2004-05-04  Darin Adler  <darin@apple.com>
2729
2730         Reviewed by Ken.
2731
2732         - fixed <rdar://problem/3642252>: "starting to drag a link and then releasing needs to activate the link if you are still over it"
2733
2734         * khtml/khtmlview.cpp:
2735         (KHTMLView::viewportMouseMoveEvent): Put hysteresis check inside !APPLE_CHANGES because
2736         the Web Kit does our hysteresis checks.
2737         (KHTMLView::viewportMouseReleaseEvent): Ditto.
2738
2739         * kwq/KWQApplication.h: Removed startDragDistance and globalStrut; unused.
2740         * kwq/KWQApplication.mm: Removed the implementations.
2741         * kwq/KWQPointArray.h: Removed manhattanLength; unused.
2742         * kwq/KWQPoint.mm:  Removed the implementation.
2743
2744         * WebCore-tests.exp: Removed manhattanLength.
2745         * WebCore-combined.exp: Regenerated.
2746
2747 2004-05-03  Ken Kocienda  <kocienda@apple.com>
2748
2749         Reviewed by Hyatt
2750
2751         Nifty hack to work around problem where BR's inserted at the end of a block do not 
2752         render. Since only the *last* BR has this quirk, insert two when at the end of a block.
2753         Once done, you can't caret past the last one, so you never insert two again.
2754
2755         * khtml/editing/htmlediting_impl.cpp:
2756         (InputNewlineCommandImpl::doApply)
2757
2758 2004-05-03  Darin Adler  <darin@apple.com>
2759
2760         Reviewed by Ken
2761
2762         - fixed <rdar://problem/3091531>: "should format copied tables with tabs between cells, spreadsheet-style, for pasting to Excel"
2763         - fixed <rdar://problem/3110002>: "Find doesn't match across formatting boundaries"
2764         - fixed <rdar://problem/3640340>: "REGRESSION (136-137): nil-deref in KHTMLPart::setFocusNodeIfNeeded inside triple click code after repeatedly click/drag selecting text"
2765         - fixed <rdar://problem/3640422>: "too many blank lines between paragraphs in copied text"
2766
2767         * khtml/dom/dom2_range.h: Added == and != operators to DOMRange.
2768         * khtml/dom/dom2_range.cpp: (DOM::operator==): Added.
2769
2770         * khtml/khtml_part.cpp:
2771         (KHTMLPart::init): Don't call findTextBegin any more; it's now not used at all
2772         in WebCore.
2773         (KHTMLPart::clear): Don't call findTextBegin any more. Also don't set up the
2774         load statistics variables.
2775         (KHTMLPart::findTextNext): Roll out APPLE_CHANGES; this function is no longer
2776         used in WebCore any more and instead the entire thing is compiled out.
2777         (KHTMLPart::text): Reimplement this by calling one of the new text operations. All the interesting
2778         parts were moved into the TextIterator class.
2779         (KHTMLPart::setFocusNodeIfNeeded): Add a check for nil; this is the fix for 364030.
2780
2781         * khtml/khtmlpart_p.h: (KHTMLPartPrivate::KHTMLPartPrivate): Put m_findPos,
2782         m_findNode, m_overURL, m_overURLTarget, m_scrollTimer, m_loadedObjects,
2783         m_totalObjectCount, and m_jobPercent inside !APPLE_CHANGES.
2784
2785         * khtml/xml/dom_selection.h: Replaced uses of 4-character tabs with spaces.
2786         (DOM::Selection::Selection): Added a constructor that takes a DOM range.
2787         (DOM::Selection::operator=): Overloaded operator= for DOM range and position.
2788         This is slightly more efficient than letting a second Selection object be constructed.
2789         * khtml/xml/dom_selection.cpp: Replaced uses of 4-character tabs with spaces.
2790         (DOM::Selection::Selection): Added a constructor that takes a DOM range.
2791
2792         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::findString): Reimplement find so it uses
2793         the new text operations function for finding.
2794
2795         * khtml/misc/khtml_text_operations.h:
2796         * khtml/misc/khtml_text_operations.cpp:
2797         * WebCore.pbproj/project.pbxproj:
2798         Added new text iterator classes that do the heavy lifting.
2799
2800 2004-05-03  David Hyatt  <hyatt@apple.com>
2801
2802         Make sure that XML processing instructions set themselves as the parent node of the stylesheets they load,
2803         so that they will get stylesheetLoaded() notifications when @imported stylesheets are contained inside the
2804         sheet.
2805
2806         Reviewed by cblu
2807
2808         * khtml/xml/dom_xmlimpl.cpp:
2809         (ProcessingInstructionImpl::setStyleSheet):
2810
2811 2004-04-30  Chris Blumenberg  <cblu@apple.com>
2812
2813         Fixed: <rdar://problem/3543662>: HITLIST-137: REGRESSION: reproducible hang copying all text at Dave's blog, and other pages
2814
2815         Reviewed by dave.
2816
2817         * khtml/xml/dom2_rangeimpl.cpp:
2818         (RangeImpl::toHTMLWithOptions): when looping with containingBlock, check the value to see if it is the same
2819
2820 2004-04-30  David Hyatt  <hyatt@apple.com>
2821
2822         Fix for 3639530, regression on generated content pages.  They crash because I forgot to null-check the style
2823         object.
2824         
2825         Reviewed by kocienda
2826
2827         * khtml/css/cssstyleselector.cpp:
2828         (khtml::CSSStyleSelector::checkOneSelector):
2829
2830 2004-04-30  John Sullivan  <sullivan@apple.com>
2831
2832         - added bridge method to get the NSFont used to render a node, to
2833         help with supporting the font panel
2834
2835         Reviewed by Ken.
2836
2837         * kwq/WebCoreBridge.h:
2838         * kwq/WebCoreBridge.mm:
2839         (-[WebCoreBridge renderedFontForNode:]):
2840         return nil if no renderer, otherwise return NSFont
2841
2842 2004-04-29  David Hyatt  <hyatt@apple.com>
2843
2844         Expose summary on tables.
2845         
2846         Reviewed by darin
2847
2848         * kwq/KWQAccObject.mm:
2849         (-[KWQAccObject helpText]):
2850
2851 2004-04-29  David Hyatt  <hyatt@apple.com>
2852
2853         Implement image maps for accessibility.
2854         
2855         Reviewed by darin
2856
2857         * khtml/html/html_imageimpl.cpp:
2858         (HTMLAreaElementImpl::getRect):
2859         * khtml/html/html_imageimpl.h:
2860         * khtml/rendering/render_image.cpp:
2861         (RenderImage::imageMap):
2862         (RenderImage::nodeAtPoint):
2863         * khtml/rendering/render_image.h:
2864         * kwq/KWQAccObject.h:
2865         * kwq/KWQAccObject.mm:
2866         (-[KWQAccObject initWithRenderer:]):
2867         (-[KWQAccObject anchorElement]):
2868         (-[KWQAccObject parentObject]):
2869         (-[KWQAccObject parentObjectUnignored]):
2870         (-[KWQAccObject addChildrenToArray:]):
2871         (-[KWQAccObject role]):
2872         (-[KWQAccObject helpText]):
2873         (-[KWQAccObject value]):
2874         (-[KWQAccObject title]):
2875         (-[KWQAccObject position]):
2876         (-[KWQAccObject size]):
2877         (-[KWQAccObject accessibilityIsIgnored]):
2878         (-[KWQAccObject accessibilityAttributeNames]):
2879         (-[KWQAccObject accessibilityAttributeValue:]):
2880         * kwq/KWQRegion.mm:
2881         (QRegion::boundingRect):
2882
2883 2004-04-29  Chris Blumenberg  <cblu@apple.com>
2884
2885         Fixed:
2886         <rdar://problem/3631431>: web archive of .Mac welcome page renders has gaps in layout
2887         <rdar://problem/3631470>: news.google.com web archive has a different font than the live site
2888
2889         Reviewed by kocienda.
2890
2891         * khtml/html/html_documentimpl.cpp:
2892         (HTMLDocumentImpl::determineParseMode): don't set a name on the doc type when there is no doc type in the source
2893         * khtml/xml/dom_docimpl.cpp:
2894         (DocumentTypeImpl::toString): don't return "<!DOCTYPE>" when there is no doc type in the source
2895         * khtml/xml/dom_nodeimpl.cpp:
2896         (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
2897
2898 2004-04-29  Darin Adler  <darin@apple.com>
2899
2900         Reviewed by Dave.
2901
2902         - some tweaks on image
2903
2904         * khtml/html/html_imageimpl.h: Remove unused noref bit and unneeded override of isURLAttribute.
2905         * khtml/html/html_imageimpl.cpp:
2906         (HTMLAreaElementImpl::HTMLAreaElementImpl): Remove unused noref bit.
2907         (HTMLAreaElementImpl::parseHTMLAttribute): Remove parsing of noref; no need to store the
2908         bit since it has no meaning.
2909
2910 2004-04-29  David Hyatt  <hyatt@apple.com>
2911
2912         1. Change the role of links from AXButton to AXLink.
2913         2. Add support for list markers using a new role, AXListMarker.
2914         
2915         Reviewed by kocienda
2916
2917         * khtml/rendering/render_list.h:
2918         (khtml::RenderListMarker::text):
2919         * kwq/KWQAccObject.mm:
2920         (-[KWQAccObject role]):
2921         (-[KWQAccObject roleDescription]):
2922         (-[KWQAccObject value]):
2923         (-[KWQAccObject accessibilityIsIgnored]):
2924
2925 2004-04-29  Darin Adler  <darin@apple.com>
2926
2927         Reviewed by Ken.
2928
2929         - fixed <rdar://problem/3636566>: "space bar on a form button hits default button instead (autorestore.apple.com)"
2930
2931         * khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::defaultEventHandler):
2932         Remove special handling for space, falling back to default AppKit behavior. Change enter handling to
2933         click the form element itself in the case of elements other than text input ones.
2934
2935 2004-04-29  Darin Adler  <darin@apple.com>
2936
2937         Reviewed by Ken.
2938
2939         - fixed <rdar://problem/3636673>: "unrepro nil-deref crash in KHTMLPart::frameDetached() (espn.com)"
2940
2941         * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Check for nil.
2942
2943 2004-04-28  Chris Blumenberg  <cblu@apple.com>
2944
2945         - Implemented DOMHTMLElementExtensions.
2946         - Added stubs for the rest of the DOM API.
2947
2948         Reviewed by dave.
2949
2950         * WebCore.pbproj/project.pbxproj:
2951         * khtml/dom/html_element.cpp:
2952         (HTMLElement::setContentEditable): moved implementation from here to HTMLElementImpl
2953         * khtml/html/html_elementimpl.cpp:
2954         (HTMLElementImpl::setContentEditable): new, moved from HTMLElement
2955         * khtml/html/html_elementimpl.h:
2956         * kwq/DOM-CSS.mm:
2957         (-[DOMObject sheet]):
2958         (-[DOMDocument getComputedStyle::]):
2959         * kwq/DOM.mm:
2960         (-[DOMAbstractView document]):
2961         (-[DOMDocumentView defaultView]):
2962         (-[DOMDocument createNodeIterator::::]):
2963         (-[DOMDocument createTreeWalker::::]):
2964         (-[DOMNodeFilter acceptNode:]):
2965         (-[DOMNodeIterator root]):
2966         (-[DOMNodeIterator whatToShow]):
2967         (-[DOMNodeIterator filter]):
2968         (-[DOMNodeIterator expandEntityReferences]):
2969         (-[DOMNodeIterator nextNode]):
2970         (-[DOMNodeIterator previousNode]):
2971         (-[DOMNodeIterator detach]):
2972         (-[DOMTreeWalker root]):
2973         (-[DOMTreeWalker whatToShow]):
2974         (-[DOMTreeWalker filter]):
2975         (-[DOMTreeWalker expandEntityReferences]):
2976         (-[DOMTreeWalker currentNode]):
2977         (-[DOMTreeWalker setCurrentNode:]):
2978         (-[DOMTreeWalker parentNode]):
2979         (-[DOMTreeWalker firstChild]):
2980         (-[DOMTreeWalker lastChild]):
2981         (-[DOMTreeWalker previousSibling]):
2982         (-[DOMTreeWalker nextSibling]):
2983         (-[DOMTreeWalker previousNode]):
2984         (-[DOMTreeWalker nextNode]):
2985         * kwq/DOMEvents.mm: Added.
2986         (-[DOMEvent type]):
2987         (-[DOMEvent target]):
2988         (-[DOMEvent currentTarget]):
2989         (-[DOMEvent eventPhase]):
2990         (-[DOMEvent bubbles]):
2991         (-[DOMEvent cancelable]):
2992         (-[DOMEvent timeStamp]):
2993         (-[DOMEvent stopPropagation]):
2994         (-[DOMEvent preventDefault]):
2995         (-[DOMEvent initEvent:::]):
2996         (-[DOMEventTarget addEventListener:::]):
2997         (-[DOMEventTarget removeEventListener:::]):
2998         (-[DOMEventTarget dispatchEvent:]):
2999         (-[DOMMouseEvent screenX]):
3000         (-[DOMMouseEvent screenY]):
3001         (-[DOMMouseEvent clientX]):
3002         (-[DOMMouseEvent clientY]):
3003         (-[DOMMouseEvent ctrlKey]):
3004         (-[DOMMouseEvent shiftKey]):
3005         (-[DOMMouseEvent altKey]):
3006         (-[DOMMouseEvent metaKey]):
3007         (-[DOMMouseEvent button]):
3008         (-[DOMMouseEvent relatedTarget]):
3009         (-[DOMMouseEvent initMouseEvent:::::::::::::::]):
3010         (-[DOMMutationEvent relatedNode]):
3011         (-[DOMMutationEvent prevValue]):
3012         (-[DOMMutationEvent newValue]):
3013         (-[DOMMutationEvent attrName]):
3014         (-[DOMMutationEvent attrChange]):
3015         (-[DOMMutationEvent initMutationEvent::::::::]):
3016         (-[DOMUIEvent view]):
3017         (-[DOMUIEvent detail]):
3018         (-[DOMUIEvent initUIEvent:::::]):
3019         (-[DOMDocument createEvent:]):
3020         * kwq/DOMHTML.mm:
3021         (-[DOMHTMLElement innerHTML]): implemented
3022         (-[DOMHTMLElement setInnerHTML:]): implemented
3023         (-[DOMHTMLElement innerText]): implemented
3024         (-[DOMHTMLElement setInnerText:]): implemented
3025         (-[DOMHTMLElement children]): implemented
3026         (-[DOMHTMLElement contentEditable]): implemented
3027         (-[DOMHTMLElement setContentEditable:]): implemented
3028         (-[DOMHTMLElement isContentEditable]): implemented
3029
3030 2004-04-27  David Hyatt  <hyatt@apple.com>
3031
3032         Implement sharing of similar style objects. Cuts the # of style objects allocated on the PLT by more
3033         than half.
3034         
3035         Reviewed by kocienda
3036
3037         * khtml/css/cssstyleselector.cpp:
3038         (khtml::CSSStyleSelector::initElementAndPseudoState):
3039         (khtml::CSSStyleSelector::initForStyleResolve):
3040         (khtml::cleanpath):
3041         (khtml::checkPseudoState):
3042         (khtml::CSSStyleSelector::locateSiblingList):
3043         (khtml::CSSStyleSelector::canShareStyleWithElement):
3044         (khtml::CSSStyleSelector::locateSharedStyle):
3045         (khtml::CSSStyleSelector::styleForElement):
3046         (khtml::CSSStyleSelector::pseudoStyleForElement):
3047         (khtml::CSSStyleSelector::checkOneSelector):
3048         * khtml/css/cssstyleselector.h:
3049         * khtml/css/html4.css:
3050         * khtml/css/parser.cpp:
3051         * khtml/css/parser.y:
3052         * khtml/html/html_baseimpl.cpp:
3053         (HTMLBodyElementImpl::mapToEntry):
3054         (HTMLIFrameElementImpl::mapToEntry):
3055         * khtml/html/html_baseimpl.h:
3056         * khtml/html/html_blockimpl.cpp:
3057         (HTMLDivElementImpl::mapToEntry):
3058         (HTMLHRElementImpl::mapToEntry):
3059         (HTMLParagraphElementImpl::mapToEntry):
3060         (HTMLMarqueeElementImpl::mapToEntry):
3061         * khtml/html/html_blockimpl.h:
3062         * khtml/html/html_elementimpl.cpp:
3063         (HTMLNamedAttrMapImpl::declCount):
3064         (HTMLNamedAttrMapImpl::mapsEquivalent):
3065         (HTMLElementImpl::attributeChanged):
3066         (HTMLElementImpl::mapToEntry):
3067         * khtml/html/html_elementimpl.h:
3068         (DOM::HTMLElementImpl::isMappedAttribute):
3069         * khtml/html/html_formimpl.cpp:
3070         (HTMLInputElementImpl::mapToEntry):
3071         * khtml/html/html_formimpl.h:
3072         * khtml/html/html_imageimpl.cpp:
3073         (HTMLImageElementImpl::mapToEntry):
3074         * khtml/html/html_imageimpl.h:
3075         * khtml/html/html_inlineimpl.cpp:
3076         (HTMLBRElementImpl::mapToEntry):
3077         (HTMLFontElementImpl::mapToEntry):
3078         * khtml/html/html_inlineimpl.h:
3079         * khtml/html/html_listimpl.cpp:
3080         (HTMLUListElementImpl::mapToEntry):
3081         (HTMLOListElementImpl::mapToEntry):
3082         (HTMLLIElementImpl::mapToEntry):
3083         * khtml/html/html_listimpl.h:
3084         * khtml/html/html_objectimpl.cpp:
3085         (HTMLAppletElementImpl::mapToEntry):
3086         (HTMLEmbedElementImpl::mapToEntry):
3087         (HTMLObjectElementImpl::mapToEntry):
3088         * khtml/html/html_objectimpl.h:
3089         * khtml/html/html_tableimpl.cpp:
3090         (HTMLTableElementImpl::mapToEntry):
3091         (HTMLTablePartElementImpl::mapToEntry):
3092         (HTMLTableCellElementImpl::mapToEntry):
3093         (HTMLTableColElementImpl::mapToEntry):
3094         (HTMLTableCaptionElementImpl::mapToEntry):
3095         * khtml/html/html_tableimpl.h:
3096         * khtml/rendering/render_object.cpp:
3097         (RenderObject::setStyle):
3098         * khtml/rendering/render_style.cpp:
3099         (m_affectedByAttributeSelectors):
3100         (RenderStyle::RenderStyle):
3101         * khtml/rendering/render_style.h:
3102         (khtml::):
3103         (khtml::RenderStyle::pseudoState):
3104         (khtml::RenderStyle::setPseudoState):
3105         (khtml::RenderStyle::affectedByAttributeSelectors):
3106         (khtml::RenderStyle::setAffectedByAttributeSelectors):
3107         * khtml/xml/dom_docimpl.cpp:
3108         (DocumentImpl::DocumentImpl):
3109         * khtml/xml/dom_docimpl.h:
3110         (DOM::DocumentImpl::usesSiblingRules):
3111         (DOM::DocumentImpl::setUsesSiblingRules):
3112
3113 2004-04-28  Darin Adler  <darin@apple.com>
3114
3115         Reviewed by Chris.
3116
3117         - another step of refinement on the reinterpret_cast stuff; now it's a compile-time
3118           error if you do it wrong
3119         - fixed a couple of storage leaks
3120
3121         * kwq/DOMInternal.h: Added new DOM_cast template function. Like reinterpret_cast, but a
3122         compile-time error if you use it with the wrong parameters. Also added type-safe versions
3123         of the wrapper functions that do the DOM_cast automatically.
3124         * kwq/DOMInternal.mm:
3125         (getDOMWrapperImpl): Changed name and parameter type as part of above change.
3126         (addDOMWrapperImpl): Ditto.
3127         (removeDOMWrapper): Ditto.
3128
3129         * kwq/DOM.mm: Use the new DOM_cast instead of reinterpret_cast, and the new
3130         DOM wrapper calls that do the cast automatically.
3131         * kwq/DOM-CSS.mm: More of the same.
3132         (-[DOMCSSStyleSheet dealloc]): Added override to deref, fixes leak.
3133         * kwq/DOMHTML.mm: More of the same.
3134         (-[DOMHTMLCollection dealloc]): Added override to deref, fixes leak.
3135         (-[DOMHTMLOptionsCollection dealloc]): Added override to deref, fixes theoretical leak.
3136
3137 2004-04-28  Darin Adler  <darin@apple.com>
3138
3139         Reviewed by Chris.
3140
3141         - fixed reinterpret_cast mistakes and some style issues in DOM implementation
3142
3143         * kwq/DOM-CSS.mm:
3144         (-[DOMCSSStyleRule _styleRuleImpl]): Fix broken reinterpret_cast; you must reinterpret_cast back
3145         to the class you reinterpret_casted from, not to a derived class.
3146         (-[DOMCSSMediaRule _mediaRuleImpl]): Ditto.
3147         (-[DOMCSSFontFaceRule _fontFaceRuleImpl]): Ditto.
3148         (-[DOMCSSPageRule _pageRuleImpl]): Ditto.
3149         (-[DOMCSSImportRule _importRuleImpl]): Ditto.
3150         (-[DOMCSSCharsetRule _importRuleImpl]): Ditto.
3151         * kwq/DOMHTML.mm:
3152         (-[DOMHTMLOptionsCollection length]): Put in an "unimplemented" version instead of leaving out
3153         the class implementation altogether.
3154         (-[DOMHTMLOptionsCollection setLength:]): Ditto.
3155         (-[DOMHTMLOptionsCollection item:]): Ditto.
3156         (-[DOMHTMLOptionsCollection namedItem:]): Ditto.
3157         (+[DOMHTMLElement _elementWithImpl:]): Corrected this implementation. The wrapper must use a
3158         standard node wrapper, since this is a subclass of DOMNode. Also moved into a separate category
3159         so it gets checked against the declarations above.
3160         (-[DOMHTMLElement _HTMLElementImpl]): Fix broken reinterpret_cast.
3161         (-[DOMHTMLHtmlElement _HTMLHtmlElementImpl]): Ditto.
3162         (-[DOMHTMLHeadElement _headElementImpl]): Ditto.
3163         (-[DOMHTMLLinkElement _linkElementImpl]): Ditto.
3164         (-[DOMHTMLTitleElement _titleElementImpl]): Ditto.
3165         (-[DOMHTMLMetaElement _metaElementImpl]): Ditto.
3166         (-[DOMHTMLBaseElement _baseElementImpl]): Ditto.
3167         (-[DOMHTMLStyleElement _styleElementImpl]): Ditto.
3168         (-[DOMHTMLBodyElement _bodyElementImpl]): Ditto.
3169         (-[DOMHTMLFormElement _formElementImpl]): Ditto.
3170         (+[DOMHTMLFormElement _formElementWithImpl:]): Another DOMNode subclass wrapper fix.
3171         (-[DOMHTMLIsIndexElement _isIndexElementImpl]): Fix broken reinterpret_cast.
3172         (-[DOMHTMLSelectElement _selectElementImpl]): Ditto.
3173         (-[DOMHTMLOptGroupElement _optGroupElementImpl]): Ditto.
3174         (-[DOMHTMLOptionElement _optionElementImpl]): Ditto.
3175         (-[DOMHTMLInputElement _inputElementImpl]): Ditto.
3176         (-[DOMHTMLTextAreaElement _textAreaElementImpl]): Ditto.
3177         (-[DOMHTMLButtonElement _buttonElementImpl]): Ditto.
3178         (-[DOMHTMLLabelElement _labelElementImpl]): Ditto.
3179         (-[DOMHTMLFieldSetElement _fieldSetElementImpl]): Ditto.
3180         (-[DOMHTMLLegendElement _legendElementImpl]): Ditto.
3181         (-[DOMHTMLUListElement _uListElementImpl]): Ditto.
3182         (-[DOMHTMLOListElement _oListElementImpl]): Ditto.
3183         (-[DOMHTMLDListElement _dListElementImpl]): Ditto.
3184         (-[DOMHTMLDirectoryElement _directoryListElementImpl]): Ditto.
3185         (-[DOMHTMLMenuElement _menuListElementImpl]): Ditto.
3186         (-[DOMHTMLLIElement _liElementImpl]): Ditto.
3187         (-[DOMHTMLQuoteElement _quoteElementImpl]): Ditto.
3188         (-[DOMHTMLDivElement _divElementImpl]): Ditto.
3189         (-[DOMHTMLParagraphElement _paragraphElementImpl]): Ditto.
3190         (-[DOMHTMLHeadingElement _headingElementImpl]): Ditto.
3191         (-[DOMHTMLPreElement _preElementImpl]): Ditto.
3192         (-[DOMHTMLBRElement _BRElementImpl]): Ditto.
3193         (-[DOMHTMLBaseFontElement _baseFontElementImpl]): Ditto.
3194         (-[DOMHTMLFontElement _fontElementImpl]): Ditto.
3195         (-[DOMHTMLHRElement _HRElementImpl]): Ditto.
3196         (-[DOMHTMLModElement _modElementImpl]): Ditto.
3197         (-[DOMHTMLAnchorElement _anchorElementImpl]): Ditto.
3198         (-[DOMHTMLImageElement _imageElementImpl]): Ditto.
3199         (-[DOMHTMLObjectElement _objectElementImpl]): Ditto.
3200         (-[DOMHTMLParamElement _paramElementImpl]): Ditto.
3201         (-[DOMHTMLAppletElement _appletElementImpl]): Ditto.
3202         (-[DOMHTMLMapElement _mapElementImpl]): Ditto.
3203         (-[DOMHTMLAreaElement _areaElementImpl]): Ditto.
3204         (-[DOMHTMLScriptElement _scriptElementImpl]): Ditto.
3205         (+[DOMHTMLTableCaptionElement _tableCaptionElementWithImpl:]): Another DOMNode subclass wrapper fix.
3206         (-[DOMHTMLTableCaptionElement _tableCaptionElementImpl]): Fix broken reinterpret_cast.
3207         (+[DOMHTMLTableSectionElement _tableSectionElementWithImpl:]): Another DOMNode subclass wrapper fix.
3208         (-[DOMHTMLTableSectionElement _tableSectionElementImpl]): Fix broken reinterpret_cast.
3209         (+[DOMHTMLTableElement _tableElementWithImpl:]): Another DOMNode subclass wrapper fix.
3210         (-[DOMHTMLTableElement _tableElementImpl]): Fix broken reinterpret_cast.
3211         (-[DOMHTMLTableColElement _tableColElementImpl]): Ditto.
3212         (-[DOMHTMLTableRowElement _tableRowElementImpl]): Ditto.
3213         (+[DOMHTMLTableCellElement _tableCellElementWithImpl:]): Another DOMNode subclass wrapper fix.
3214         (-[DOMHTMLTableCellElement _tableCellElementImpl]): Fix broken reinterpret_cast.
3215         (-[DOMHTMLFrameSetElement _frameSetElementImpl]): Ditto.
3216         (-[DOMHTMLFrameElement _frameElementImpl]): Ditto.
3217         (-[DOMHTMLIFrameElement _IFrameElementImpl]): Ditto.
3218         (-[DOMHTMLEmbedElement _embedElementImpl]): Ditto.
3219
3220         * kwq/HTMLDOM.mm: Removed.
3221
3222 2004-04-28  Ken Kocienda  <kocienda@apple.com>
3223
3224         Reviewed by Darin
3225
3226         * khtml/khtml_part.cpp:
3227         (KHTMLPart::notifySelectionChanged): Call new postDidChangeSelectionNotification function
3228         to send Cocoa notification when the selection changes.
3229         (KHTMLPart::appliedEditing): Call postDidChangeNotification to send Cocoa notification when the document changes
3230         due to editing.
3231         (KHTMLPart::unappliedEditing): Ditto.
3232         (KHTMLPart::reappliedEditing): Ditto.
3233         * kwq/DOMHTML.mm:
3234         (-[DOMHTMLDocument _HTMLDocumentImpl]): Fix cast to account for multiple inheritance used by the impl class.
3235         * kwq/KWQKHTMLPart.h:
3236         * kwq/KWQKHTMLPart.mm:
3237         (KWQKHTMLPart::postDidChangeSelectionNotification): New function. Call the bridge to post the notification.
3238         (KWQKHTMLPart::postDidChangeNotification): Ditto.
3239         * kwq/WebCoreBridge.h: Declare new -postDidChangeSelectionNotification and -postDidChangeNotification methods.
3240
3241 2004-04-28  Darin Adler  <darin@apple.com>
3242
3243         Reviewed by Ken.
3244
3245         - fixed <rdar://problem/3636261>: "nil-deref in selectedStylesheetSet iterating through properties in a non-view document"
3246
3247         * khtml/xml/dom_docimpl.cpp:
3248         (DocumentImpl::selectedStylesheetSet): Add nil check.
3249         (DocumentImpl::setSelectedStylesheetSet): Ditto.
3250
3251 2004-04-27  Richard Williamson   <rjw@apple.com>
3252
3253         <rdar://problem/3564519>: API: please add a way to set the media type for a WebView
3254
3255         Reviewed by Chris.
3256
3257         * khtml/khtmlview.cpp:
3258         (KHTMLView::mediaType):
3259         * kwq/KWQKHTMLPart.h:
3260         * kwq/KWQKHTMLPart.mm:
3261         (KWQKHTMLPart::overrideMediaType):
3262         * kwq/WebCoreBridge.h:
3263
3264 2004-04-27  Ken Kocienda  <kocienda@apple.com>
3265
3266         Reviewed by Hyatt
3267         
3268         Make selections draw in a more Cocoa-like way, where
3269         fully-selected lines draw out to the ends of lines, and
3270         spaces between lines are drawn with the selection color as well.
3271
3272         * WebCore-combined.exp: Add _WebCoreInitializeEmptyTextGeometry symbol
3273         * WebCore.exp: Ditto.
3274         * khtml/khtml_part.cpp:
3275         (KHTMLPart::isPointInsideSelection): Marginally-related change. Fix up this function
3276         so that it works right, given my recent changes to positionForCoordinates. This fix
3277         "really" fixes the problem. Unlike my attempt to fix yesterday.
3278         * khtml/rendering/font.cpp:
3279         (Font::drawHighlightForText): New drawHighlightForText interface which includes extra
3280         information to draw the selection.
3281         * khtml/rendering/font.h: Ditto.
3282         * khtml/rendering/render_block.cpp:
3283         (khtml::RenderBlock::positionForCoordinates): Some minor improvements and cleanups to
3284         make this code work correctly in more cases.
3285         * khtml/rendering/render_block.h: Remove spurious semi-colon after namespace block.
3286         * khtml/rendering/render_container.cpp:
3287         (RenderContainer::positionForCoordinates): Fix typo in comment. Also, clean up
3288         one unnecessary call to absolutePosition.
3289         * khtml/rendering/render_image.cpp:
3290         (RenderImage::paint): Many changes to add the new selection drawing behavior.
3291         * khtml/rendering/render_inline.cpp:
3292         (RenderInline::positionForCoordinates): Added to help make selections work right 
3293         with continuations.
3294         * khtml/rendering/render_inline.h: Ditto.
3295         * khtml/rendering/render_object.h: Give zero default argument to inlineBox() helper.
3296         * khtml/rendering/render_text.cpp:
3297         (InlineTextBox::paintSelection): Many changes to add the new selection drawing behavior.
3298         * kwq/KWQListBox.mm:
3299         (-[KWQTableView drawRow:clipRect:]): Use new WebCoreTextGeometry struct.
3300         * kwq/KWQPainter.h: New drawHighlightForText interface which includes extra
3301         information to draw the selection.
3302         * kwq/KWQPainter.mm:
3303         (QPainter::drawText): Use new WebCoreInitializeEmptyTextGeometry struct.
3304         (QPainter::drawHighlightForText): Use new WebCoreTextGeometry struct.
3305         * kwq/WebCoreTextRenderer.h: Declare new WebCoreTextGeometry struct.
3306         * kwq/WebCoreTextRendererFactory.m:
3307         (WebCoreInitializeEmptyTextGeometry): Initializer for WebCoreTextGeometry struct.
3308
3309 2004-04-27  Richard Williamson   <rjw@apple.com>
3310
3311         Don't do unnecessary string comparisons when no composite operator is
3312         specified.  
3313
3314         Reviewed by Hyatt.
3315
3316         * kwq/KWQPainter.mm:
3317         (compositeOperatorFromString):
3318
3319 2004-04-27  Darin Adler  <darin@apple.com>
3320
3321         Reviewed by Ken.
3322
3323         - fixed <rdar://problem/3623694>: "top level <option> and <optgroup> labels look identical in pop-up menus; should not"
3324
3325         * khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
3326         Call appendGroupLabel instead of appendItem for group labels.
3327
3328         * kwq/KWQComboBox.h: Added appendGroupLabel, private setControlSize, labelFont, setTitle, _labelFont,
3329         and make _items a QValueList<KWQListBoxItem> instead of QStringList.
3330         * kwq/KWQComboBox.mm:
3331         (QComboBox::QComboBox): Initializes _labelFont to nil.
3332         (QComboBox::~QComboBox): Release _labelFont.
3333         (QComboBox::setTitle): Added helper function. Uses an attributed string for group labels, and also sets
3334         the action to NULL so they are disabled.
3335         (QComboBox::appendItem): Added isLabel boolean parameter, make KWQListBoxItem, call setTitle.
3336         (QComboBox::sizeHint): Changed to handle group labels with a separate renderer to measure bolded text.
3337         (QComboBox::setCurrentItem): Changed to use setTitle helper.
3338         (QComboBox::setFont): Release _labelFont if control size changed.
3339         (QComboBox::labelFont): Compute label font lazily.
3340         (QComboBox::populateMenu): Changed to use setTitle helper.
3341
3342         * kwq/KWQListBox.h: Removed excess includes, fixed comment.
3343
3344 2004-04-26  Darin Adler  <darin@apple.com>
3345
3346         Reviewed by Maciej.
3347
3348         - follow-on to fix for <rdar://problem/3488892>: "anchor names with non-ASCII characters in them do not work"
3349         This part fixes anchor names with non-ASCII characters in local files.
3350
3351         * kwq/KWQKURL.mm: (KURL::KURL): For file and help URLs, force UTF-8 only for the path part of the URL.
3352         Use the document encoding for the rest of the URL.
3353         * kwq/KWQTextCodec.h: (operator!=): Added.
3354
3355 2004-04-26  David Hyatt  <hyatt@apple.com>
3356
3357         Fix for Emerson truncation problem using apple-line-clamp.  Always dirty positioned objects so that they
3358         will move when the height changes.
3359         
3360         Reviewed by darin
3361
3362         * khtml/rendering/render_block.cpp:
3363         (khtml::RenderBlock::markPositionedObjectsForLayout):
3364         * khtml/rendering/render_block.h:
3365         * khtml/rendering/render_flexbox.cpp:
3366         (khtml::RenderFlexibleBox::layoutVerticalBox):
3367
3368 2004-04-26  Richard Williamson   <rjw@apple.com>
3369
3370         Added support for specifying composite operation on an
3371         image element.  Attribute name is "composite", possible values
3372         are:
3373
3374         clear,
3375         copy
3376         source-over
3377         source-in
3378         source-out
3379         source-atop
3380         destination-over
3381         destination-in
3382         destination-out
3383         destination-atop
3384         xor