Reviewed by John.
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 2005-02-14  Darin Adler  <darin@apple.com>
2
3         Reviewed by John.
4
5         - fixed <rdar://problem/3686434> Safari uses too much RAM on file upload, leading to malloc errors and crashes (HP printers)
6
7         * khtml/html/html_formimpl.cpp:
8         (DOM::FormDataList::begin): Updated to use a list of FormDataListItem instead of QCString.
9         (DOM::FormDataList::end): Ditto.
10         (DOM::HTMLFormElementImpl::formData): Same here, and also use appendFile rather than appendData
11         when we encounter a path name rather than data.
12         (DOM::HTMLInputElementImpl::appendFormData): Use appendFile here rather than reading the file
13         in; the reading now happens inside WebKit.
14         (DOM::FormDataList::appendString): Updated for FormDataListItem.
15         (DOM::FormDataList::appendFile): Added.
16
17         * ForwardingHeaders/kfileitem.h: Emptied out the file; no longer includes KWQKFileItem.h.
18         * ForwardingHeaders/netaccess.h: Emptied out the file; no longer includes KWQKIONetAccess.h.
19         * kwq/KWQKFileItem.h: Removed.
20         * kwq/KWQKFileItem.mm: Removed.
21         * kwq/KWQKIONetAccess.h: Removed.
22         * kwq/KWQKIONetAccess.mm: Removed.
23         * WebCore.pbproj/project.pbxproj: Removed the 4 files above.
24
25         - small unrelated fix (not reviewed by John)
26
27         * khtml/ecma/kjs_window.cpp: (Window::isSafeScript): Put some logging code outside if statements so it works all the time.
28
29 2005-02-14  David Harrison  <harrison@apple.com>
30
31         Reviewed by Darin.
32
33         <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
34
35         Fixed nextLinePosition to calculate affinity rather than take it as a parameter.  Propagated the parameter change out to related methods.
36
37         * khtml/editing/htmlediting.cpp:
38         (khtml::DeleteSelectionCommand::initializePositionData):
39         (khtml::InsertLineBreakCommand::doApply):
40         (khtml::InsertParagraphSeparatorCommand::doApply):
41         (khtml::InsertTextCommand::input):
42         (khtml::ReplaceSelectionCommand::doApply):
43         (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes):
44         * khtml/editing/selection.cpp:
45         (khtml::Selection::modifyExtendingRightForward):
46         (khtml::Selection::modifyMovingRightForward):
47         (khtml::Selection::modifyExtendingLeftBackward):
48         (khtml::Selection::modifyMovingLeftBackward):
49         (khtml::Selection::modify):
50         (khtml::Selection::validate):
51         * khtml/editing/visible_position.cpp:
52         (khtml::visiblePositionsOnDifferentLines):
53         * khtml/editing/visible_units.cpp:
54         (khtml::rootBoxForLine):
55         (khtml::startOfLine):
56         (khtml::endOfLine):
57         (khtml::inSameLine):
58         (khtml::isStartOfLine):
59         (khtml::isEndOfLine):
60         (khtml::previousLinePosition):
61         (khtml::nextLinePosition):
62         (khtml::previousSentencePosition):
63         (khtml::nextSentencePosition):
64         (khtml::previousParagraphPosition):
65         (khtml::nextParagraphPosition):
66         * khtml/editing/visible_units.h:
67         * khtml/khtml_events.cpp:
68         (khtml::MouseEvent::offset):
69         * khtml/khtml_part.cpp:
70         (KHTMLPart::isPointInsideSelection):
71         (KHTMLPart::selectClosestWordFromMouseEvent):
72         (KHTMLPart::handleMousePressEventTripleClick):
73         (KHTMLPart::handleMousePressEventSingleClick):
74         (KHTMLPart::handleMouseMoveEventSelection):
75         (KHTMLPart::khtmlMouseReleaseEvent):
76         * khtml/rendering/render_block.cpp:
77         (khtml::RenderBlock::positionForCoordinates):
78         * khtml/rendering/render_block.h:
79         * khtml/rendering/render_br.cpp:
80         (RenderBR::positionForCoordinates):
81         * khtml/rendering/render_br.h:
82         * khtml/rendering/render_container.cpp:
83         (RenderContainer::positionForCoordinates):
84         * khtml/rendering/render_container.h:
85         * khtml/rendering/render_inline.cpp:
86         (RenderInline::positionForCoordinates):
87         * khtml/rendering/render_inline.h:
88         * khtml/rendering/render_object.cpp:
89         (RenderObject::caretRect):
90         (RenderObject::positionForCoordinates):
91         * khtml/rendering/render_object.h:
92         * khtml/rendering/render_replaced.cpp:
93         (RenderReplaced::positionForCoordinates):
94         * khtml/rendering/render_replaced.h:
95         * khtml/rendering/render_text.cpp:
96         (RenderText::positionForCoordinates):
97         * khtml/rendering/render_text.h:
98         * khtml/xml/dom_position.cpp:
99         (DOM::Position::previousCharacterPosition):
100         (DOM::Position::nextCharacterPosition):
101         (DOM::Position::leadingWhitespacePosition):
102         (DOM::Position::trailingWhitespacePosition):
103         * khtml/xml/dom_position.h:
104         * kwq/KWQAccObject.mm:
105         (-[KWQAccObject value]):
106         (-[KWQAccObject accessibilityAttributeValue:]):
107         (-[KWQAccObject doAXLineForTextMarker:]):
108         (-[KWQAccObject doAXTextMarkerRangeForLine:]):
109         (-[KWQAccObject doAXTextMarkerForPosition:]):
110         (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
111         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
112         (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
113         (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
114         * kwq/KWQKHTMLPart.mm:
115         * kwq/WebCoreBridge.mm:
116         (-[WebCoreBridge _visiblePositionForPoint:]):
117
118 05-02-07  Maciej Stachowiak  <mjs@apple.com>
119
120         Reviewed by Ken and John.
121
122         Re-fixed a specific case of the following:
123
124         <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
125
126         Oddly, Cmd-B, Cmd-U, type some text, return, Cmd-U, Cmd-B, type
127         some text, worked fine. But hitting the second Cmd-B before the
128         second Cmd-U still failed to remove underlining. The reason for
129         this is that our code to compute the style of the current position
130         did not work when you had a typing style and were positioned right
131         at a <br> element. For various reasons, this did not show up for
132         bold and italic, since those are handled through the font manager.
133
134         The following change fixes this - for elements that can't have
135         children, we add the dummy span after the element of interest,
136         rather than as a child of it.
137         
138         * khtml/khtml_part.cpp:
139         (KHTMLPart::selectionComputedStyle): 
140
141 2005-02-11  David Harrison  <harrison@apple.com>
142
143         Reviewed by Darin.
144
145         <rdar://problem/3978980> Double Clicking on a line in Mail selected the entire body
146
147         * khtml/editing/visible_units.cpp:
148         (khtml::startOfWord):
149         (khtml::endOfWord):
150         Pay attention to being at the end of a paragraph.
151         
152         (khtml::previousLinePosition):
153         (khtml::nextLinePosition):
154         (khtml::endOfParagraph):
155         Use DOWNSTREAM per recent affinity changes.
156
157 2005-02-11  Richard Williamson   <rjw@apple.com>
158
159         Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
160
161         Re-factored how 'native' wrappers for JS objects are created.  The interpreter now
162         creates these wrappers.  The WebCore subclass of the interpreter now overrides
163         createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
164
165         * WebCore.pbproj/project.pbxproj:
166         * khtml/ecma/kjs_binding.cpp:
167         (ScriptInterpreter::createLanguageInstanceForValue):
168         * khtml/ecma/kjs_binding.h:
169         * kwq/DOMUtility.mm: Added.
170         (KJS::ScriptInterpreter::createObjcInstanceForValue):
171         * kwq/KWQKHTMLPart.mm:
172         (KWQKHTMLPart::getAppletInstanceForView):
173         (getInstanceForView):
174         (KWQKHTMLPart::getEmbedInstanceForView):
175         (KWQKHTMLPart::getObjectInstanceForView):
176
177 2005-02-11  Chris Blumenberg  <cblu@apple.com>
178
179         Fixed: <rdar://problem/3937352> Quote level not maintained when copied and pasted within a Mail message
180
181         Reviewed by harrison.
182
183         * khtml/editing/markup.cpp:
184         (khtml::isMailBlockquote): new 
185         (khtml::createMarkup): retain the Mail quote level by including all ancestor mail block quotes
186         * khtml/rendering/render_block.cpp:
187         (khtml::RenderBlock::positionForCoordinates): default to downstream for the affinity since the affinity is only upstream when the cursor is clicked to the right of a wrapped line
188         * khtml/rendering/render_text.cpp:
189         (RenderText::positionForCoordinates): ditto
190
191 2005-02-11  Adele Amchan  <adele@apple.com>
192
193         Reviewed by Darin.
194
195         fix for <rdar://problem/4004004> no need to add body element for xml documents
196
197         In the fix for <rdar://problem/3758785> we decided to add a body element when closing a document 
198         to ensure that the onload handler would fire.  This is unnecessary for xml documents, 
199         so now we also check to see if we're dealing with an html document before adding the body element.
200
201         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): 
202
203 2005-02-11  Adele Amchan  <adele@apple.com>
204
205         Reviewed by Darin.
206
207         * layout-tests/apple-only/base/www.excite.com/index-expected.txt: updates tests because of custom tag change.
208         * layout-tests/apple-only/base/www.msnbc.com/index-expected.txt:
209         * layout-tests/apple-only/base/www.time.com/index-expected.txt:
210         * layout-tests/apple-only/base/www.travelocity.com/index-expected.txt:
211         * layout-tests/apple-only/base/www.zdnet.com/index-expected.txt:
212         * layout-tests/fast/overflow/003-expected.txt:
213
214         * layout-tests/fast/js/window-object-cross-frame-calls-expected.txt: updated test because of added Body (see rdar://problem/3758785)
215
216 === Safari-186 ===
217
218 2005-02-11  Darin Adler  <darin@apple.com>
219
220         Reviewed by John.
221
222         - fixed <rdar://problem/3915449> paths are relative to the old src URL after document.open, which is supposed to clear the document, including the URL
223
224         * khtml/xml/dom_docimpl.h: Added a new openInternal function for use by KHTMLPart.
225         * khtml/xml/dom_docimpl.cpp:
226         (DocumentImpl::open): Changed to do everything we did before, but also clear the URL and set the
227         base URL based on the enclosing document. This is the basic JavaScript/DOM operation of opening a
228         document, which is supposed to clear the document, including the URL. In the long run we might want
229         to do even more document "resetting and clearing" in here, but this URL clearing is what's needed
230         now to fix the most important problem.
231         (DocumentImpl::openInternal): Moved the old open code in here, except for the "parsing" check, which
232         is unnecessary and inappropriate in the one place we call this.
233
234         * khtml/khtml_part.cpp: (KHTMLPart::begin): Call openInternal instead of open.
235
236 2005-02-10  Ken Kocienda  <kocienda@apple.com>
237
238         Reviewed by Hyatt
239
240         Fix for this bug:
241         
242         <rdar://problem/3992092> 8A374: Mail crash while pasting - RemoveNodeCommand
243
244         * khtml/editing/htmlediting.cpp:
245         (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in 
246         the document. We try to do a good job of detecting all these cases, and generally do. This
247         one was missed. Fixed.
248
249 2005-02-10  Darin Adler  <darin@apple.com>
250
251         Reviewed by Harrison.
252
253         - added support needed to fix <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined
254
255         * kwq/WebCoreBridge.h: Added selectionHasStyle: method.
256         * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part.
257
258 2005-02-10  Darin Adler  <darin@apple.com>
259
260         Reviewed by Harrison.
261
262         - fixed <rdar://problem/3990484> cursor changes to I-beam when moving over text in widgets, even when selection off via CSS
263
264         * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent): Changed code to check canSelect when deciding
265         whether to show an I-beam cursor.
266
267         * khtml/rendering/render_object.h: Added canSelect.
268         * khtml/rendering/render_object.cpp:
269         (selectStartNode): Added. Helper function with the guts of shouldSelect.
270         (RenderObject::canSelect): Added. Like shouldSelect, but does not call the "start selecting" event handler.
271         (RenderObject::shouldSelect): Refactored to use selectStartNode.
272
273         * khtml/css/cssvalues.c: Regnerated with newer gperf.
274
275 2005-02-10  David Hyatt  <hyatt@apple.com>
276
277         Fix for 3867759, .mac regression where scrollers don't show up.  Make sure you can set the .width and
278         .height properties on the Image object.
279         
280         Reviewed by John Sullivan
281
282         * khtml/ecma/kjs_html.cpp:
283         (ImageConstructorImp::construct):
284         (Image::getValueProperty):
285         (Image::putValue):
286         (Image::Image):
287         * khtml/ecma/kjs_html.h:
288
289 2005-02-10  Ken Kocienda  <kocienda@apple.com>
290
291         Reviewed by Chris
292
293         Fix for this bug:
294         
295         <rdar://problem/3965158> Drag-n-drop within a rich text message sometimes changes the color of the dragged text
296         
297         This change fixes the bug....and much more. Now, for the first time, the paste code can do "smart merging"
298         or "smooshing" of styles during its operation. Since this new code is actively, rather than passively
299         working with styles, it fixes the bug, and lays the groundwork for similar work we need to do to
300         preserve quote levels in Mail.
301
302         * khtml/css/css_valueimpl.cpp:
303         (DOM::CSSMutableStyleDeclarationImpl::clear): New method.
304         (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
305         (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): Ditto.
306         (DOM::operator==): Add operator for CSSProperty.
307         * khtml/css/css_valueimpl.h: Declare new functions.
308         * khtml/editing/htmlediting.cpp:
309         (khtml::isEmptyStyleSpan): Improved the test in this function, rolling together the old implementation
310         with some code that did this work inline elsewhere. Sum of the parts is better than either test was by itself.
311         (khtml::isStyleSpan): Check for ID_SPAN.
312         (khtml::ApplyStyleCommand::removeCSSStyle): Call isEmptyStyleSpan. This was the place with an inline implementation before.
313         (khtml::ReplacementFragment::ReplacementFragment): Now takes a DocumentImpl argument. No longer does a "default style"
314         check, but rather calls functions which do a similar check to that, and much more.
315         (khtml::ReplacementFragment::~ReplacementFragment): Deref document, and computed styles.
316         (khtml::ReplacementFragment::styleForNode): New helper. Looks up and returns computed style for a node.
317         (khtml::ReplacementFragment::removeNodePreservingChildren): New helper.
318         (khtml::ReplacementFragment::computeStylesForNodes): New function which computes the "desired" style for
319         every node in the fragment. This information is used later after paste is done as a reference for testing
320         what styles need to be added, and which can be removed as redundant, from all the nodes inserted by the
321         replacement code.
322         (khtml::ReplacementFragment::removeStyleNodes): Clears out all style nodes from the fragment. They are
323         no longer needed after the call to computeStylesForNodes(),
324         (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): Add a document to the call to initialize the
325         command's ReplacementFragment.
326         (khtml::ReplaceSelectionCommand::doApply): Call applyStyleToInsertedNodes() after inserting nodes to make
327         styles come out right.
328         (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): This is the "style smooshing" function. It 
329         computes the styles that need to be added to each node inserted, comparing the style it gets from just
330         being inserted into its correct destination with the computed "desired style" done in the 
331         ReplacementFragment constructor. It then adds in all the necessary styles, and will also remove redundant styles.
332         * khtml/editing/htmlediting.h: Update declarations and member variables as needed.
333         * khtml/editing/markup.cpp:
334         (khtml::startMarkup): Add additional style annotations to the markup we generate, so that paste code can preserve it.
335         (khtml::markup): Ditto.
336         (khtml::createMarkup): Ditto.
337         
338         These test results are subtly better with this change. They no longer have an unneeded empty span.
339         Visually the same as before.
340         
341         * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
342         * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
343         * layout-tests/editing/style/remove-underline-expected.txt
344         * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt
345
346         New tests:
347
348         * layout-tests/editing/style/smoosh-styles-001-expected.txt
349         * layout-tests/editing/style/smoosh-styles-002-expected.txt
350         * layout-tests/editing/style/smoosh-styles-001.html
351         * layout-tests/editing/style/smoosh-styles-002.html
352
353 2005-02-10  Darin Adler  <darin@apple.com>
354
355         Reviewed by Adele.
356
357         - fixed <rdar://problem/3974988> WebHTMLView drops scroll wheel events when deltas are 0
358
359         * kwq/WebCoreScrollView.m: (-[WebCoreScrollView autoforwardsScrollWheelEvents]): Added, for Tiger only.
360         For Tiger, removed the override of scrollWheel:, which doesn't work quite right because of how the
361         delta attributes return all 0 for newfangled scrolling events from the new trackpads.
362
363 2005-02-10  David Harrison  <harrison@apple.com>
364
365         Reviewed by Darin.
366
367         <rdar://problem/3991532> REGRESSION (Mail): Triple-click on trailing blank line should select previous line but doesn't
368
369         * khtml/css/cssvalues.c:
370         (hash_val):
371         (findValue):
372         * khtml/editing/selection.cpp:
373         (khtml::Selection::validate):
374         Do moral equiavalent of LeftWordIfOnBoundary for PARAGRAPH.
375
376 2005-02-10  David Harrison  <harrison@apple.com>
377
378         Reviewed by Darin.
379
380         <rdar://problem/3991848> Double-click on first character selects wrong item
381
382         * khtml/editing/selection.cpp:
383         (khtml::Selection::validate):
384         Honor the fact that clicking on a character positions the cursor on the left side of the character.
385
386 2005-02-10  David Hyatt  <hyatt@apple.com>
387
388         Fix for 3980778, repro crash in RootInlineBox::paint.  Make sure that when merging blocks we dirty them for layout
389         up front. That way as we do the merge, we dont attempt to examine the lines in dirtyLinesForChangedChild.
390         
391         Reviewed by mjs
392
393         * khtml/rendering/render_block.cpp:
394         (khtml::RenderBlock::removeChild):
395
396 2005-02-10  David Hyatt  <hyatt@apple.com>
397
398         Fix for 3987010, fix a bug that caused the self-collapsing-block-cleared-float bit to never get set correctly.
399         
400         Reviewed by mjs
401
402         * khtml/rendering/render_block.h:
403         (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
404
405 2005-02-10  David Hyatt  <hyatt@apple.com>
406
407         Fix  for 3992440, text not wrapping correctly on half moon bay web site.  Refine an incorrect optimization I
408         added to be less restrictive.
409         
410         Reviewed by mjs
411
412         * khtml/rendering/render_block.cpp:
413         (khtml::RenderBlock::layoutBlockChildren):
414
415 2005-02-08  Maciej Stachowiak  <mjs@apple.com>
416
417         Reviewed by Darin.
418
419         <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
420
421         I fixed this by removing all event listeners for a document, it's
422         children, and any disconnected nodes that used to be in the
423         document at document detach time. Mozilla temporarily disables
424         event listeners on such nodes, but re-enables them if you
425         re-parant a node into a new document. However, in WebCore, you
426         can't re-parent a node into another document, so there is no
427         observable change in behavior.
428
429         We have to do this to break the possible reference cycles between
430         event listeners and the dom nodes they are attached to (e.g. via
431         scope chain, as in this case).
432
433         * khtml/xml/dom_docimpl.cpp:
434         (DocumentImpl::detach):
435         (DocumentImpl::removeAllEventListenersFromAllNodesx):
436         (DocumentImpl::registerDisconnectedNodeWithEventListeners):
437         (DocumentImpl::unregisterDisconnectedNodeWithEventListeners):
438         (DocumentImpl::removeAllDisconnectedNodeEventListeners):
439         * khtml/xml/dom_docimpl.h:
440         * khtml/xml/dom_nodeimpl.cpp:
441         (NodeImpl::~NodeImpl):
442         (NodeImpl::addEventListener):
443         (NodeImpl::removeEventListener):
444         (NodeImpl::removeAllEventListeners):
445         (NodeImpl::removeHTMLEventListener):
446         (NodeImpl::insertedIntoDocument):
447         (NodeImpl::removedFromDocument):
448         * khtml/xml/dom_nodeimpl.h:
449
450 2005-02-09  Chris Blumenberg  <cblu@apple.com>
451
452         Fixed: <rdar://problem/3999213> Sometimes 2 Windows Media Player plugin instances are loaded
453
454         Reviewed by hyatt.
455
456         * khtml/html/html_objectimpl.cpp:
457         (HTMLObjectElementImpl::attach): Set needWidgetUpdate to false before calling updateWidget because updateWidget may cause this method or another method (which also calls updateWidget) to be called.
458         (HTMLObjectElementImpl::recalcStyle): ditto
459
460 2005-02-09  David Harrison  <harrison@apple.com>
461
462         Reviewed by Darin.
463         
464         <rdar://problem/3937447> Mail-689: Arrow key navigation in new message body stops working when a line ends with a bold word
465         
466         Added affinity to VisiblePosition.  Changed Selection code to use affinity more.
467         
468         (Partial) <rdar://problem/3982096> editing/pasteboard/paste-text-007 is failing
469         
470         Changed ReplaceSelectionCommand to also pay attention to the top children of the incoming fragment, not just the very last node inserted, when deciding whether to insert a paragraph for the Apple interchange newline.
471
472         * khtml/ecma/kjs_window.cpp:
473         (SelectionFunc::tryCall):
474         * khtml/editing/htmlediting.cpp:
475         (khtml::EditCommandPtr::setStartingSelection):
476         (khtml::EditCommandPtr::setEndingSelection):
477         (khtml::EditCommand::setStartingSelection):
478         (khtml::EditCommand::setEndingSelection):
479         (khtml::CompositeEditCommand::deleteInsignificantTextDownstream):
480         (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
481         (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
482         (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
483         (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
484         (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
485         (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
486         (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
487         (khtml::ApplyStyleCommand::joinChildTextNodes):
488         (khtml::DeleteSelectionCommand::initializePositionData):
489         (khtml::DeleteSelectionCommand::handleGeneralDelete):
490         (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
491         (khtml::DeleteSelectionCommand::doApply):
492         (khtml::InsertLineBreakCommand::doApply):
493         (khtml::InsertParagraphSeparatorCommand::doApply):
494         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
495         (khtml::InsertTextCommand::input):
496         (khtml::MoveSelectionCommand::doApply):
497         (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
498         (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
499         (khtml::ReplaceSelectionCommand::doApply):
500         (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
501         (khtml::ReplaceSelectionCommand::updateNodesInserted):
502         (khtml::TypingCommand::deleteKeyPressed):
503         (khtml::TypingCommand::forwardDeleteKeyPressed):
504         (khtml::TypingCommand::markMisspellingsAfterTyping):
505         * khtml/editing/htmlediting.h:
506         * khtml/editing/selection.cpp:
507         (khtml::Selection::Selection):
508         (khtml::Selection::init):
509         (khtml::Selection::moveTo):
510         (khtml::Selection::modifyExtendingRightForward):
511         (khtml::Selection::modifyMovingRightForward):
512         (khtml::Selection::modifyExtendingLeftBackward):
513         (khtml::Selection::modifyMovingLeftBackward):
514         (khtml::Selection::modify):
515         (khtml::Selection::xPosForVerticalArrowNavigation):
516         (khtml::Selection::clear):
517         (khtml::Selection::setBase):
518         (khtml::Selection::setExtent):
519         (khtml::Selection::setBaseAndExtent):
520         (khtml::Selection::layout):
521         (khtml::Selection::validate):
522         * khtml/editing/selection.h:
523         (khtml::Selection::startAffinity):
524         (khtml::Selection::endAffinity):
525         (khtml::Selection::baseAffinity):
526         (khtml::Selection::extentAffinity):
527         (khtml::operator==):
528         * khtml/editing/text_affinity.h:
529         (khtml::):
530         * khtml/editing/visible_position.cpp:
531         (khtml::VisiblePosition::VisiblePosition):
532         (khtml::VisiblePosition::init):
533         (khtml::VisiblePosition::initUpstream):
534         (khtml::VisiblePosition::initDownstream):
535         (khtml::VisiblePosition::next):
536         (khtml::VisiblePosition::previous):
537         (khtml::startVisiblePosition):
538         (khtml::endVisiblePosition):
539         * khtml/editing/visible_position.h:
540         (khtml::VisiblePosition::):
541         (khtml::VisiblePosition::VisiblePosition):
542         (khtml::VisiblePosition::affinity):
543         (khtml::VisiblePosition::setAffinity):
544         (khtml::operator==):
545         * khtml/editing/visible_units.cpp:
546         (khtml::previousBoundary):
547         (khtml::nextBoundary):
548         (khtml::startOfLine):
549         (khtml::endOfLine):
550         (khtml::previousLinePosition):
551         (khtml::nextLinePosition):
552         (khtml::startOfParagraph):
553         (khtml::endOfParagraph):
554         (khtml::previousParagraphPosition):
555         (khtml::nextParagraphPosition):
556         (khtml::startOfBlock):
557         (khtml::endOfBlock):
558         (khtml::startOfDocument):
559         (khtml::endOfDocument):
560         * khtml/editing/visible_units.h:
561         * khtml/khtml_part.cpp:
562         (KHTMLPart::findTextNext):
563         (KHTMLPart::selectClosestWordFromMouseEvent):
564         (KHTMLPart::handleMousePressEventTripleClick):
565         (KHTMLPart::handleMousePressEventSingleClick):
566         (KHTMLPart::handleMouseMoveEventSelection):
567         (KHTMLPart::khtmlMouseReleaseEvent):
568         (KHTMLPart::selectAll):
569         (KHTMLPart::computeAndSetTypingStyle):
570         (KHTMLPart::selectionComputedStyle):
571         * khtml/rendering/render_br.cpp:
572         (RenderBR::positionForCoordinates):
573         * khtml/xml/dom_docimpl.cpp:
574         (DocumentImpl::updateSelection):
575         * khtml/xml/dom_nodeimpl.cpp:
576         (NodeBaseImpl::setFocus):
577         * khtml/xml/dom_position.cpp:
578         (DOM::Position::previousCharacterPosition):
579         (DOM::Position::nextCharacterPosition):
580         * khtml/xml/dom_position.h:
581         * kwq/KWQAccObject.mm:
582         (-[KWQAccObject value]):
583         (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
584         (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
585         (-[KWQAccObject accessibilityAttributeValue:]):
586         (-[KWQAccObject doAXLineForTextMarker:]):
587         (-[KWQAccObject doAXTextMarkerRangeForLine:]):
588         (-[KWQAccObject doAXTextMarkerForPosition:]):
589         (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
590         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
591         (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
592         (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
593         (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
594         (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
595         (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
596         * kwq/KWQAccObjectCache.mm:
597         (KWQAccObjectCache::textMarkerForVisiblePosition):
598         (KWQAccObjectCache::visiblePositionForTextMarker):
599         * kwq/KWQKHTMLPart.mm:
600         (KWQKHTMLPart::findString):
601         (KWQKHTMLPart::advanceToNextMisspelling):
602         (KWQKHTMLPart::styleForSelectionStart):
603         (KWQKHTMLPart::baseWritingDirectionForSelectionStart):
604         (KWQKHTMLPart::setSelectionFromNone):
605         (KWQKHTMLPart::respondToChangedSelection):
606         * kwq/WebCoreBridge.mm:
607         (-[WebCoreBridge setSelectedDOMRange:affinity:]):
608         (-[WebCoreBridge selectionAffinity]):
609         (-[WebCoreBridge setMarkDOMRange:]):
610         (-[WebCoreBridge _visiblePositionForPoint:]):
611         (-[WebCoreBridge moveDragCaretToPoint:]):
612         (-[WebCoreBridge editableDOMRangeForPoint:]):
613         (-[WebCoreBridge ensureSelectionVisible]):
614         (-[WebCoreBridge rangeOfCharactersAroundCaret]):
615
616 2005-02-09  Chris Blumenberg  <cblu@apple.com>
617
618         Fixed: <rdar://problem/3985211> Seed: Mail: Drag-and-drop destination indicator / insertion point disappears
619
620         Reviewed by kocienda.
621
622         * khtml/rendering/render_block.cpp:
623         (khtml::RenderBlock::paintCaret): new
624         (khtml::RenderBlock::paintObject): call paintCaret for the cursor caret and the drag caret
625         * khtml/rendering/render_block.h:
626
627 === Safari-185 ===
628
629 2005-02-08  Ken Kocienda  <kocienda@apple.com>
630
631         Reviewed by John
632
633         Fix for this bug:
634         
635         <rdar://problem/3996344> Entire document content is deleted when only the first paragraph was supposed to be
636
637         Problem stems from my attempt to fix this bug: <rdar://problem/3986155> Insertion point goes 
638         to beginning of doc after deleting.
639         
640         I added an "optimization" that proved to do more harm than good. So, basically, the fix is to remove code.
641
642         * khtml/editing/htmlediting.cpp:
643         (khtml::DeleteSelectionCommand::handleGeneralDelete)
644
645 2005-02-07  Darin Adler  <darin@apple.com>
646
647         Reviewed by Kevin.
648
649         - fixed <rdar://problem/3890352> REGRESSION (125-170, Panther-only): pasted textarea contents disappear (exception in NSText)
650
651         * kwq/KWQTextArea.mm: (-[KWQTextArea tile]): Don't resize the text view immediately here.
652         Use performWithDelay to defer it to avoid the re-entrancy that bothers the Panther version
653         of NSTextView. On Tiger, leave the code alone.
654
655 2005-02-07  Adele Amchan  <adele@apple.com>
656
657         Reviewed by Darin.
658
659         Fix for <rdar://problem/3993628> REGRESSION (180-181): Logitelnet bank's website doesn't work
660
661         This fixes an oversight in the fix for <rdar://problem/3964286>.  
662         We're now making sure there is a document before calling checkCompleted in slotLoaderRequestDone.
663         That function is called even when other parts finish loads of their subresources, so we could end
664         up calling checkCompleted before we had a document. We also looked over all the other calls to
665         checkCompleted to convince ourselves no other call sites had a similar issue.
666
667         * khtml/khtml_part.cpp: (KHTMLPart::slotLoaderRequestDone): Check if doc is nil before calling
668         checkCompleted.
669
670 2005-02-07  Ken Kocienda  <kocienda@apple.com>
671
672         Reviewed by Darin
673
674         Fix for this bug:
675         
676         <rdar://problem/3953302> Replacing quoted text ends up with blue-colored text that is not quoted
677
678         * khtml/editing/htmlediting.cpp:
679         (khtml::DeleteSelectionCommand::doApply): Removed special case delete code for select all. It was
680         causing as many bugs as it fixed. What's more, the design concept is a bit shaky. By removing
681         this special case, the bug goes away.
682         * khtml/editing/htmlediting.h: Remove declaration.
683         
684         Test results using selectAll() updated to reflect changed behavior.
685         
686         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
687         * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
688         * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
689         * layout-tests/editing/inserting/insert-3654864-fix-expected.txt:
690         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
691         * layout-tests/editing/inserting/insert-3851164-fix-expected.txt:
692         * layout-tests/editing/inserting/insert-3907422-fix-expected.txt:
693         * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
694
695 2005-02-06  Darin Adler  <darin@apple.com>
696
697         Reviewed by Ken.
698
699         - fixed <rdar://problem/3994164> setting a new style attribute with setAttribute("style") doesn't blow away the old style
700
701         * khtml/css/css_valueimpl.h: Renamed parseProperty to parseDeclaration, since it's used to parse
702         an entire style declaration, not a single property.
703         * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::parseDeclaration): Renamed,
704         and added code to clear m_values.
705         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Call function by its
706         new name, and remove some unnecessary comments.
707
708 2005-02-06  Darin Adler  <darin@apple.com>
709
710         Reviewed by Maciej.
711
712         - fixed <rdar://problem/3993722> need oncut and onpaste handlers implemented for <textarea> (needed for widgets)
713
714         * kwq/KWQTextArea.mm:
715         (-[KWQTextAreaTextView dispatchHTMLEvent:]): Added.
716         (-[KWQTextAreaTextView cut:]): Dispatch "before cut" and "cut" events.
717         (-[KWQTextAreaTextView copy:]): Dispatch "before copy" and "copy" events.
718         (-[KWQTextAreaTextView paste:]): Dispatch "before paste" and "paste" events.
719         (-[KWQTextAreaTextView pasteAsPlainText:]): Ditto.
720         (-[KWQTextAreaTextView pasteAsRichText:]): Ditto.
721
722 2005-02-06  Darin Adler  <darin@apple.com>
723
724         Reviewed by Maciej.
725
726         - fixed <rdar://problem/3943038> <input type=search> that is focused in onload handler doesn't have a visible editor
727
728         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setFocusNode): Always update layout before giving focus to a widget.
729         This prevents the bad case where we give a widget focus before it has been positioned or sized, causing us to
730         exercise edge cases AppKit doesn't handle well.
731
732         * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Remove workaround code I added
733         to fix bug 3943049. Updating the layout fixes the same problem in a cleaner, safer way, and solves another problem,
734         with the way the clip view is set up.
735
736 2005-02-06  Darin Adler  <darin@apple.com>
737
738         Reviewed by Maciej.
739
740         - fixed <rdar://problem/3425232> textarea won't trigger onchange action when clicking to new field
741
742         * khtml/rendering/render_form.h: Added new m_dirty data member.
743         * khtml/rendering/render_form.cpp:
744         (RenderTextArea::RenderTextArea): Initialize m_dirty to false.
745         (RenderTextArea::detach): Call value() on the DOM element to cause it to fetch the value from this object.
746         (RenderTextArea::handleFocusOut): Ditto. Also send the onchange event based only on the m_dirty flag.
747         (RenderTextArea::updateFromElement): Clear the m_dirty flag if the edited value is blown away by a value
748         that comes from the DOM element. Remove code to clear the element's m_dirtyvalue flag; that's an unnecessary
749         optimization, and ideally we'll stop having code in the render object that knows about that flag later.
750         (RenderTextArea::slotTextChanged): Set the m_dirty flag.
751
752 2005-02-06  Darin Adler  <darin@apple.com>
753
754         Reviewed by Maciej.
755
756         - re-fixed <rdar://problem/3760910> please add support for custom tag names in HTML
757
758         * khtml/xml/dom_docimpl.cpp:
759         (DocumentImpl::tagId): Use ID_LAST_TAG + 1 for the ID of the first assigned tag ID. Before we'd use ID_LAST_TAG,
760         which resulted in the same number being used for ID_COMMENT and the first custom tag.
761         (DocumentImpl::tagName): Use ID_LAST_TAG + 1, as above.
762         (DocumentImpl::namespaceURI): Change a < ID_LAST_TAG to <= ID_LAST_TAG in the same spirit as above.
763
764 2005-02-06  Darin Adler  <darin@apple.com>
765
766         Reviewed by Maciej.
767
768         - fixed <rdar://problem/3986639> Crash occurs after choosing Undo Typing from the Edit menu
769
770         * kwq/KWQTextArea.mm: (-[KWQTextArea viewWillMoveToWindow:]): Remove actions from undo manager when the view is
771         removed from the window. Unfortunately, to do this the code has to know that the target of NSTextView actions
772         will be the text storage object, but given the NSText architecture, that's pretty clear.
773
774 2005-02-05  Chris Blumenberg  <cblu@apple.com>
775
776         Fixed: <rdar://problem/3991974> REGRESSION: www.jabra.com world location screen does not work
777
778         Reviewed by hyatt.
779
780         * kwq/KWQKJavaAppletWidget.mm:
781         (KJavaAppletWidget::KJavaAppletWidget): fallback to the document's base URL if there is no baseURL attribute
782         * kwq/WebCoreBridge.h:
783         * kwq/WebCoreBridge.mm:
784         (-[WebCoreBridge baseURL]): new
785
786 2005-02-04  David Harrison  <harrison@apple.com>
787
788         Reviewed by Darin.
789
790         Rolled out Ken's accidental checkin when committing <rdar://problem/3986155> fix yesterday.
791         
792         * khtml/editing/selection.cpp:
793         (khtml::Selection::validate):
794
795 2005-02-04  Adele Amchan  <adele@apple.com>
796
797         Reviewed by Darin.
798
799         Fix for <rdar://problem/3758785> Safari no longer works at BankOfAmerica online banking for military users
800   
801         When closing the document, if a body doesn't exist we now create one.  This bug was preventing the onload handler from
802         firing in cases where there wasn't a body.  In the BankOfAmerica case, the page was just a bit of script where the onload
803         handler redirected to the correct page.
804
805         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
806
807 2005-02-03  Ken Kocienda  <kocienda@apple.com>
808
809         Reviewed by Chris
810
811         Fix for this bug:
812         
813         <rdar://problem/3986155> Insertion point goes to beginning of doc after deleting
814
815         * khtml/editing/htmlediting.cpp:
816         (khtml::DeleteSelectionCommand::setStartNode): New convenience to handle reference counting when setting.
817         (khtml::DeleteSelectionCommand::handleGeneralDelete): This contains the crux of the bug fix. Improve tests
818         that detect when a selected node needs to be retained, rather than deleted, to preserve the intent of the user.
819         This has the side effect of causing the insertion point placement code to succeed rather than fail. Before
820         this fix, the failure of the insertion point placement code caused the insertion point to jump to the start
821         of the document, which is the symptom that can be perceived by users when editing.
822         * khtml/editing/htmlediting.h: Add setStartNode declaration.
823         * khtml/editing/visible_units.cpp:
824         (khtml::startOfBlock): This function had a stubbed-in non-tested implementation. Implement and 
825         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001-expected.txt: Added.
826         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001.html: Added.
827         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt: Added.
828         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002.html: Added.
829         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt: Added.
830         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003.html: Added.
831         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt: Added.
832         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004.html: Added.
833         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005-expected.txt: Added.
834         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005.html: Added.
835         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006-expected.txt: Added.
836         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006.html: Added.
837
838 === Safari-183 ===
839
840 2005-02-03  Richard Williamson   <rjw@apple.com>
841
842         Fixed <rdar://problem/3987419> Stocks and Weather leak what appears to XMLHTTPRequest results
843
844         XMLHTTPRequests were causing massive leaks.  _webcore_initWithHeaderString: did funky things with
845         self replacement.  Re-wrote to use more traditional factory constructor avoiding self replacement.
846         
847         Reviewed by David Harrison.
848
849         * kwq/KWQLoader.mm:
850         (+[NSDictionary _webcore_dictionaryWithHeaderString:]):
851         (KWQServeRequest):
852         (KWQServeSynchronousRequest):
853
854 2005-02-03  Chris Blumenberg  <cblu@apple.com>
855
856         Fixed: <rdar://problem/3938763> Cannot view Windows Media Player videos (soundtrack is played twice with delay)
857
858         Reviewed by hyatt.
859
860         * khtml/html/html_objectimpl.cpp:
861         (HTMLObjectElementImpl::attach): set needWidgetUpdate to false right after calling updateWidget because dispatchHTMLEvent can end up calling this method again
862         (HTMLObjectElementImpl::recalcStyle): ditto
863
864 2005-02-02  John Sullivan  <sullivan@apple.com>
865
866         Reviewed by Chris.
867
868         - WebCore part of fix for <rdar://problem/3980651> REGRESSION (125-180): Huge number of pages printed from certain page, 
869         iFrame involved
870         
871         This also fixes the problems with printing from GMail, yay!
872
873         * khtml/rendering/render_flow.cpp:
874         (RenderFlow::paintLines):
875         If the current line is taller than the entire page height (e.g. tall iFrame), don't try
876         to avoid splitting it across pages.
877         
878         * kwq/WebCoreBridge.mm:
879         (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
880         Handle error cases in a more obvious manner; this will cause future problems like this
881         to print a blank page and complain to the console on debug builds, rather than print a 
882         zillionty mostly-blank pages.
883
884 2005-02-02  Chris Blumenberg  <cblu@apple.com>
885
886         Fixed: <rdar://problem/3960304> can't load a particular applet (at www.escape.de) unless it's the first applet to be loaded
887
888         Reviewed by hyatt.
889
890         * khtml/rendering/render_frames.cpp:
891         (RenderPartObject::updateWidget): when getting the MIME type from the PARAM tag, make sure the MIME type is the text from the left of the semi-colon if there is one. We do this elsewhere as well.
892
893 2005-02-02  Chris Blumenberg  <cblu@apple.com>
894
895         Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)
896
897         Reviewed by rjw.
898
899         * kwq/KWQKHTMLPart.mm:
900         (KWQKHTMLPart::sendContextMenuEvent): check if SPI to always enable selecting closest word is enabled
901         * kwq/WebCoreBridge.h:
902
903 2005-02-02  Ken Kocienda  <kocienda@apple.com>
904
905         Reviewed by me
906
907         * khtml/editing/markup.cpp:
908         (khtml::createMarkup): Removed debug spam I committed earlier in error.
909
910 2005-02-02  Ken Kocienda  <kocienda@apple.com>
911
912         Reviewed by Darin
913
914         Fix for this bug:
915         
916         <rdar://problem/3823109> WebKit should support -toggleBaseWritingDirection: (bidi editing support)
917
918         Since base writing direction is a paragraph-level property in AppKit, and we use the CSS direction
919         property in WebCore, which can be applied to inline elements as well as blocks, a new notion has
920         been added to the WebCore apply style logic. It is now possible to force all properties in a 
921         style declaration to be applied as though they were block properties.
922
923         * khtml/editing/htmlediting.cpp:
924         (khtml::ApplyStyleCommand::ApplyStyleCommand): Add an enum and a flag to this command that controls whether to force all
925         properties in the style to be applied as block styles. Default is "no", retaining previous behavior.
926         (khtml::ApplyStyleCommand::doApply): Switch on new flag to apply styles as before, or force all preoperties to be applied
927         as block styles.
928         * khtml/editing/htmlediting.h:
929         (khtml::ApplyStyleCommand::): Add an enum and a flag, as above.
930         * khtml/khtml_part.cpp:
931         (KHTMLPart::applyParagraphStyle): New method to force application of all style properties as block styles.
932         * khtml/khtml_part.h: Update header declarations.
933         * kwq/KWQKHTMLPart.h: Update header declarations.
934         * kwq/KWQKHTMLPart.mm:
935         (KWQKHTMLPart::baseWritingDirectionForSelectionStart): Accessor to help WebKit do a toggle operation on 
936         writing direction.
937         * kwq/WebCoreBridge.h: Update header declarations.
938         * kwq/WebCoreBridge.mm:
939         (-[WebCoreBridge applyParagraphStyle:withUndoAction:]): New method to force application of all style properties as block styles.
940         (-[WebCoreBridge baseWritingDirectionForSelectionStart]): Accessor to help WebKit do a toggle operation on 
941         writing direction.
942
943         Fix for this bug:
944         
945         <rdar://problem/3985035> REGRESSION (Mail): Text copied from wrapped line contains extra character when pasted
946
947         * khtml/editing/markup.cpp:
948         (khtml::renderedText): Add an enum and a flag to this command that controls whether to force all
949         This is the result of an error in the code that computes the rendered text that is selected 
950         when copying. Since spaces collapse at the end of lines, and these spaces need to be copied 
951         when the selection spans line endings, code runs to compute this text. However, this code 
952         was also running incorrectly in cases where lines wrapped. I have now added the missing 
953         test to check that the selection does indeed extend to the end of the line.
954
955
956 2005-02-02  Ken Kocienda  <kocienda@apple.com>
957
958         Reviewed by Darin
959
960         Fix for these bugs:
961         
962         <rdar://problem/3984894> REGRESSION (Mail): Command-right-arrow in reply does the wrong thing (two ways)
963         <rdar://problem/3985130> REGRESSION (Mail): command-right-arrow in pasted RTF selects only up to tab
964
965         * khtml/editing/visible_units.cpp:
966         (khtml::endOfLine): Two separate problems in this new function recently added to take the place of
967         selectionForLine. In the first, endOfLine did not stop at BR elements, and returned the position
968         beyond them. In the second, the VisiblePosition constructor gives the wrong answer in certain cases.
969         Darin is going to work on a solution for that problem. In the meantime, I can fix the symptom of this
970         bug by going down to the last leaf child of the root line box; a one line change we will roll out when
971         Darin's fix is in.
972
973 2005-02-01  Richard Williamson   <rjw@apple.com>
974
975         Fixed <rdar://problem/3985535> QT Plug-in JavaScript support now fails in <embed> tag only case
976
977         Reviewed by Maciej.
978
979         * khtml/ecma/kjs_html.cpp:
980         (KJS::HTMLDocument::tryGet):
981
982 2005-02-01  John Sullivan  <sullivan@apple.com>
983
984         Written by Darin, reviewed and tested by me
985         
986         - fixed <rdar://problem/3969684> Panther-only: extra blank lines between 
987         pasted content from Blot
988
989         * kwq/KWQKHTMLPart.mm:
990         (KWQKHTMLPart::attributedString):
991         don't emit paragraph breaks if the margins are tiny; matches what
992         we do for plain-text conversion
993
994 === Safari-182 ===
995
996 2005-02-01  Ken Kocienda  <kocienda@apple.com>
997
998         Reviewed by John
999
1000         Fix for this bug:
1001         
1002         <rdar://problem/3985160> Deficiencies in pasting architecture blocking progress on other bugs
1003
1004         * khtml/editing/html_interchange.h: Move style span text used to mark element added to 
1005         add style to this header.
1006         * khtml/editing/htmlediting.cpp:
1007         (khtml::styleSpanClassString): Change to use constant moved to html_interchange.h.
1008         (khtml::isStyleSpan): New helper function. Checks if this is a span we added to apply style.
1009         (khtml::CompositeEditCommand::insertNodeBefore): Added an assert to check that the node
1010         we are inserting before is not the body.
1011         (khtml::CompositeEditCommand::insertNodeAfter): Ditto, but check is for after.
1012         (khtml::ReplacementFragment::ReplacementFragment): Added code to process the "default style"
1013         that is added by the copy code.
1014         (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): first and last nodes inserted are
1015         now member variables instead of function locals. Initialize them here.
1016         (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): Deref first and last nodes inserted
1017         if necessary.
1018         (khtml::ReplaceSelectionCommand::doApply): Change design to fix the bug. Major change is to
1019         separate out the code that inserts nodes into the tree so additional styling checks can
1020         be done in a centralized way. Also got rid of the notion of "merging into the end block." That
1021         concept was just wrong.
1022         (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Tweak interface now that first and 
1023         last nodes inserted are member variables.
1024         (khtml::ReplaceSelectionCommand::insertNodeAfterAndUpdateNodesInserted): New helper used
1025         by replace code to do the stated DOM operation and update state internal to the command.
1026         This will also be a catch point to handle the kinds of additional style checks needed to
1027         make paste work right.
1028         (khtml::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted): Ditto.
1029         (khtml::ReplaceSelectionCommand::insertNodeBeforeAndUpdateNodesInserted): Ditto.
1030         (khtml::ReplaceSelectionCommand::updateNodesInserted): Ditto.
1031         * khtml/editing/htmlediting.h: Update declarations as needed.
1032         * khtml/editing/markup.cpp:
1033         (khtml::createMarkup): Adds a "default style" span to the content written to the pasteboard.
1034         This will help us to fix some of the bugs blocked by the bug above.
1035         * khtml/xml/dom_nodeimpl.cpp:
1036         (NodeImpl::lastDescendent): New helper.
1037         * khtml/xml/dom_nodeimpl.h: Ditto.
1038         * khtml/xml/dom_position.cpp:
1039         (DOM::Position::upstream): Fixed a bug which would allow the upstream position returned to be
1040         in unrendered content.
1041         (DOM::Position::downstream): Ditto.
1042
1043         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Ending positions tweaked due to 
1044         changes in upstream() and downstream() functions.
1045         * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Ditto
1046         * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Ditto
1047         * layout-tests/editing/selection/extend-by-character-006-expected.txt: Ditto
1048
1049         * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Changed what we expect, given
1050         new behavior of paste code.
1051
1052 2005-01-31  John Sullivan  <sullivan@apple.com>
1053
1054         Reviewed by Dave Hyatt.
1055         
1056         - fixed <rdar://problem/3983097> Tabbing on RSS pages gets stuck in search field 
1057         with "full keyboard navigation" off
1058
1059         * kwq/KWQSlider.h:
1060         * kwq/KWQSlider.mm:
1061         (QSlider::focusPolicy):
1062         Implemented this method for KWQSlider. It is needed for our widget subclasses that
1063         can become focused in some situations. I missed this when fixing 3949203 because
1064         it only comes into play when tab-to-controls is on, and because the other relevant
1065         methods are objective-C methods.
1066
1067 2005-01-31  David Harrison  <harrison@apple.com>
1068
1069         Reviewed by Darin.
1070
1071         <rdar://problem/3964164> AXWebArea needs to unregister on going invisible
1072
1073         * khtml/xml/dom_docimpl.cpp:
1074         (DocumentImpl::detach):
1075         Detach the AX UIElement for the AXWebArea.
1076
1077 2005-01-31  David Harrison  <harrison@apple.com>
1078
1079         Reviewed by Darin
1080
1081         <rdar://problem/3850876> AX: button exposed as only an AXImage at http://appleseed.apple.com/ site (<input type=image>)
1082
1083         * khtml/rendering/render_form.h:
1084         (khtml::RenderImageButton::isImageButton):
1085         New.
1086         * khtml/rendering/render_image.h:
1087         (khtml::RenderImage::isImageButton):
1088         New.
1089         * kwq/KWQAccObject.mm:
1090         (-[KWQAccObject isImageButton]):
1091         (-[KWQAccObject actionElement]):
1092         (-[KWQAccObject role]):
1093         (-[KWQAccObject accessibilityActionNames]):
1094         (-[KWQAccObject accessibilityPerformAction:]):
1095         Represent RenderImageButton elements as buttons instead of images.
1096
1097 2005-01-31  David Harrison  <harrison@apple.com>
1098
1099         Prevent nil dereference in debug code.
1100
1101         * khtml/xml/dom_nodeimpl.cpp:
1102         (NodeImpl::displayTree):
1103         Stop when parent is 0, too.
1104
1105 2005-01-31  John Sullivan  <sullivan@apple.com>
1106
1107         Reviewed by Dave Hyatt.
1108         
1109         - fixed <rdar://problem/3949203> cannot tab to, within, or out of the RSS sidebar
1110
1111         * kwq/KWQSlider.mm:
1112         (-[KWQSlider becomeFirstResponder]):
1113         (-[KWQSlider resignFirstResponder]):
1114         (-[KWQSlider nextKeyView]):
1115         (-[KWQSlider previousKeyView]):
1116         (-[KWQSlider canBecomeKeyView]):
1117         (-[KWQSlider nextValidKeyView]):
1118         (-[KWQSlider previousValidKeyView]):
1119         Copied these methods from KWQButton. The lack of special handling for first-responder-ness
1120         here was causing the focus to get "stuck" on the RSS page's slider widget. Added FIXME
1121         about how it would be nice to share more of this code rather than replicating it in each
1122         KWQ widget subclass.
1123
1124 2005-01-31  Darin Adler  <darin@apple.com>
1125
1126         Reviewed by Harrison.
1127
1128         - fixed <rdar://problem/3980066> Double-click on single character moves insertion point to previous line
1129
1130         * khtml/khtml_part.cpp:
1131         (KHTMLPart::selectClosestWordFromMouseEvent): Set affinity too.
1132         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1133         (KHTMLPart::handleMouseMoveEventSelection): Ditto.
1134         (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
1135
1136         * khtml/editing/selection.cpp:
1137         (khtml::Selection::modifyExtendingRightForward): Use endOfLine and endOfDocument.
1138         (khtml::Selection::modifyMovingRightForward): Ditto.
1139         (khtml::Selection::modifyExtendingLeftBackward): Use startOfLine and startOfDocument.
1140         (khtml::Selection::modifyMovingLeftBackward): Ditto.
1141         (khtml::Selection::validate): Rewrote the section that handles double-click. Two main fixes: 1) use isStartOfLine to
1142         check for another case where we want to select the word to the right, and 2) use isEndOfParagraph, which seems
1143         to work correctly in cases where isLastVisiblePositionInParagraph is giving the wrong answer. Also changed the line
1144         code to use startOfLine/endOfLine and the document code to use startOfDocument/endOfDocument.
1145
1146 2005-01-31  Darin Adler  <darin@apple.com>
1147
1148         Reviewed by Harrison.
1149
1150         - fixed <rdar://problem/3935275> unexpected quit scrolling over link; last.fm (works in IE and Firefox)
1151
1152         * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): By using the correct document, fix the crash reported here.
1153         The page still crashes when you close the browser window, but it's not trivial to fix so I'll file a new bug after that.
1154
1155 2005-01-31  Darin Adler  <darin@apple.com>
1156
1157         Reviewed by Ken and Harrison.
1158
1159         - fixed <rdar://problem/3947901> REGRESSION (Mail): Pasting paragraph of rich text leaves insertion point before pasted text
1160         - fixed <rdar://problem/3949790> hitting return after underlined line results in too much or too little underlined
1161         - fixed <rdar://problem/3981759> nil-deref and crash when pasting just a paragraph break
1162         - fixed a couple problems I discovered while working with bug 3949790
1163
1164         * khtml/editing/htmlediting.cpp:
1165         (khtml::ApplyStyleCommand::applyInlineStyle): Pass StayInBlock to upstream. Without this, we end up going too far
1166         upstream in the test case in bug 3949790.
1167         (khtml::ApplyStyleCommand::removeInlineStyle): Pass StayInBlock to upstream and downstream. Same reason as above.
1168         (khtml::ReplaceSelectionCommand::doApply): Update endPos if inserting a new node and endPos is using that node's
1169         parent and an offset past the node being inserted. That change fixes a problem with the position of the insertion point
1170         after pasting into the top level of a document (from test cases in 3947901 and 3949790). When setting insertionPos, use
1171         code that works when lastNodeInserted is a block rather than a text node. That change fixes a problem where a newline is
1172         not added when pasting an entire paragraph into the end of a document (from test case in 3949790). Added nil check before
1173         checking if lastNodeInserted is a <br> element, which fixes the crash when pasting just a paragraph break.
1174
1175         * khtml/editing/visible_units.h: Filled out the set of calls to add some boolean checks for lines (needed for the
1176         bug fix), and calls for blocks (not yet implemented), and documents. The document checks may need refinement to
1177         properly handle documents with a mix of editable and non-editable content, but for now they just refactor code
1178         and make things a little clearer. Also removed the "include line break" parameter from endOfSentence.
1179         * khtml/editing/visible_units.cpp:
1180         (khtml::rootBoxForLine): Added.
1181         (khtml::startOfLine): Added. Algorithm taken from selectionForLine in selection.cpp.
1182         (khtml::endOfLine): Ditto.
1183         (khtml::inSameLine): Added.
1184         (khtml::isStartOfLine): Added.
1185         (khtml::isEndOfLine): Added.
1186         (khtml::endOfSentence): Removed "include line break" parameter.
1187         (khtml::inSameParagraph): Added a null check.
1188         (khtml::isStartOfParagraph): Ditto.
1189         (khtml::isEndOfParagraph): Ditto.
1190         (khtml::startOfBlock): Added.
1191         (khtml::endOfBlock): Added.
1192         (khtml::inSameBlock): Added.
1193         (khtml::isStartOfBlock): Added.
1194         (khtml::isEndOfBlock): Added.
1195         (khtml::startOfDocument): Added.
1196         (khtml::endOfDocument): Added.
1197         (khtml::inSameDocument): Added.
1198         (khtml::isStartOfDocument): Added.
1199         (khtml::isEndOfDocument): Added.
1200
1201 2005-01-30  Darin Adler  <darin@apple.com>
1202
1203         Reviewed by John.
1204
1205         - fixed <rdar://problem/3977000> form data set posted for <input type="image" ...> omits name/value pair
1206
1207         * khtml/html/html_formimpl.cpp:
1208         (DOM::HTMLInputElementImpl::appendFormData): Append a name/value pair for type IMAGE in addition to the X/Y
1209         coordinates.
1210
1211 2005-01-30  Darin Adler  <darin@apple.com>
1212
1213         Reviewed by John.
1214
1215         - fixed <rdar://problem/3974246> REGRESSION (125-180): popup menus are missing item text on Harmony Remote web site
1216
1217         * khtml/html/html_formimpl.cpp: (DOM::HTMLOptionElementImpl::text): Change this function to traverse the entire tree
1218         and gather all the text rather than just looking at immediate children.
1219
1220         * khtml/xml/dom_nodeimpl.h: Added const.
1221         * khtml/xml/dom_nodeimpl.cpp:
1222         (NodeImpl::traverseNextNode): Added const.
1223         (NodeImpl::traverseNextSibling): Ditto.
1224         (NodeImpl::traversePreviousNodePostOrder): Ditto.
1225         (NodeImpl::detach): Add a missing nil check.
1226
1227 2005-01-30  Darin Adler  <darin@apple.com>
1228
1229         Reviewed by John.
1230
1231         - fixed <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
1232
1233         * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Added missing ref/deref of newly created element.
1234
1235 2005-01-28  Darin Adler  <darin@apple.com>
1236
1237         * khtml/css/cssproperties.c: Regenerated with newer gperf.
1238
1239 2005-01-28  David Harrison  <harrison@apple.com>
1240
1241         Reviewed by John Sullivan.
1242
1243         <rdar://problem/3968144> AX need to be able to focus an AXLink by setting AXFocused to true
1244         
1245         * kwq/KWQAccObject.mm:
1246         (-[KWQAccObject accessibilityPerformAction:]):
1247         (-[KWQAccObject accessibilityIsAttributeSettable:]):
1248         Add AXFocused for AXLinks.
1249
1250 2005-01-28  David Harrison  <harrison@apple.com>
1251
1252         Reviewed by Darin.
1253
1254         <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
1255
1256         Use AppKit SPI _accessibilityParentForSubview to return KWQAccObject parent of AppKit AX object.
1257         
1258         * kwq/KWQAccObject.mm:
1259         (-[KWQAccObject _accessibilityParentForSubview:]):
1260         New.
1261
1262 2005-01-27  Adele Amchan  <adele@apple.com>
1263
1264         fixed by Darin, reviewed by me.
1265
1266         <rdar://problem/3976314> REGRESSION (180-TOT): submitting password fields fail on Panther
1267
1268         * kwq/KWQTextField.mm: (-[KWQTextFieldController string]): on panther, the secure text field's editor 
1269         does not contain the real string, so now we just call stringValue on the field in that case.
1270
1271 2005-01-26  Maciej Stachowiak  <mjs@apple.com>
1272
1273         Reviewed by Darin, Hyatt and Ken.
1274
1275         <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
1276         
1277         * khtml/css/css_computedstyle.cpp:
1278         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support
1279         for -khtml-text-decorations-in-effect property. This works like text-docration
1280         but follows proper inline semantics, that is, if a parent is causing text
1281         decoration then -khtml-text-decorations-in-effect on this element will reflect that.
1282         * khtml/css/cssproperties.in: Add -khtml-text-decorations-in-effect property.
1283         * khtml/css/cssproperties.h: regenerated
1284         * khtml/css/cssvalues.c: regenerated
1285         * khtml/css/cssparser.cpp: regenerated
1286         * khtml/css/cssproperties.c: regenerated
1287
1288         * khtml/css/css_valueimpl.h: Made copyPropertiesInSet public.
1289
1290         * khtml/editing/htmlediting.cpp:
1291         (khtml::StyleChange::init): Handle -khtml-text-decorations-in-effect
1292         specially, translate to text-decoration
1293         (khtml::ApplyStyleCommand::applyInlineStyle): Fix a comment.
1294         (khtml::ApplyStyleCommand::removeInlineStyle): Add new way of pushing down
1295         text-decoration styles around the edges of the selected range.
1296         (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAroundNode): Helper for this.
1297         (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): ditto
1298         (khtml::ApplyStyleCommand::nodeFullyUnselected): ditto
1299         (khtml::hasTextDecorationProperty): ditto
1300         (khtml::highestAncestorWithTextDecoration): ditto
1301         (khtml::ApplyStyleCommand::extractTextDecorationStyle): ditto
1302         (khtml::ApplyStyleCommand::extractAndNegateTextDecorationStyle): ditto
1303         (khtml::ApplyStyleCommand::applyTextDecorationStyle): ditto
1304         * khtml/editing/htmlediting.h: Prototype new methods.
1305         * khtml/editing/jsediting.cpp: Make underline execCommand use the new CSS property.
1306
1307         - as a necessary part of the fix, fixed the longstanding problem
1308         that mutating an element's inlineStyleDecl would not property
1309         update its style attribute. now it does.
1310         
1311         * khtml/css/css_valueimpl.cpp:
1312         (DOM::CSSMutableStyleDeclarationImpl::setChanged): If this is an inline style
1313         declaration, tell the element it's style attribute needs updating.
1314         * khtml/html/html_elementimpl.cpp:
1315         (HTMLElementImpl::invalidateStyleAttribute): New method, just calls down
1316         to the dom element.
1317         (HTMLElementImpl::updateStyleAttribute): Regenerate style attribute from
1318         inline style declaration.
1319         * khtml/html/html_elementimpl.h: Prototype new stuff.
1320         * khtml/xml/dom_elementimpl.cpp:
1321         (ElementImpl::ElementImpl): Initialize new attribute.
1322         (ElementImpl::updateStyleAttributeIfNeeded): New method to check if the style
1323         is dirty and this is an html element, and if so call the html element to
1324         regenerate the style attribute.
1325         (ElementImpl::attributes): update style if needed
1326         (ElementImpl::getAttribute): ditto
1327         (ElementImpl::hasAttributes): ditto
1328         (ElementImpl::dump): ditto
1329         (XMLElementImpl::cloneNode): ditto
1330         * khtml/xml/dom_elementimpl.h:
1331         (DOM::ElementImpl::isStyleAttributeValid): new method to manage style attr
1332         dirty bit
1333         (DOM::ElementImpl::setStyleAttributeValid): ditto
1334
1335         - added new layout tests for underlining:
1336         
1337         * layout-tests/editing/editing.js:
1338         * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt: Added.
1339         * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt: Added.
1340         * layout-tests/editing/style/remove-underline-across-paragraph-in-bold.html: Added.
1341         * layout-tests/editing/style/remove-underline-across-paragraph.html: Added.
1342         * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt: Added.
1343         * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt: Added.
1344         * layout-tests/editing/style/remove-underline-after-paragraph-in-bold.html: Added.
1345         * layout-tests/editing/style/remove-underline-after-paragraph.html: Added.
1346         * layout-tests/editing/style/remove-underline-expected.txt: Added.
1347         * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt: Added.
1348         * layout-tests/editing/style/remove-underline-from-stylesheet.html: Added.
1349         * layout-tests/editing/style/remove-underline-in-bold-expected.txt: Added.
1350         * layout-tests/editing/style/remove-underline-in-bold.html: Added.
1351         * layout-tests/editing/style/remove-underline.html: Added.
1352         * layout-tests/editing/style/underline-expected.txt: Added.
1353         * layout-tests/editing/style/underline.html: Added.
1354
1355 2005-01-27  David Hyatt  <hyatt@apple.com>
1356
1357         Fix for 3875199, search field needs to be able to  show a magnifying  glass without a dropdown menu.
1358         
1359         Reviewed by kocienda
1360
1361         * khtml/html/html_formimpl.cpp:
1362         (DOM::HTMLInputElementImpl::HTMLInputElementImpl):
1363         (DOM::HTMLInputElementImpl::parseHTMLAttribute):
1364         * kwq/KWQLineEdit.mm:
1365         (QLineEdit::setMaxResults):
1366
1367 2005-01-27  Ken Kocienda  <kocienda@apple.com>
1368
1369         Reviewed by Maciej
1370
1371         Fix for this bug:
1372         
1373         <rdar://problem/3973254> Deletions of ranges does not coalesce correctly with subsequent typing
1374
1375         * khtml/editing/htmlediting.cpp:
1376         (khtml::InsertTextCommand::deleteCharacter): Remove this dead code.
1377         (khtml::ReplaceSelectionCommand::editingAction): Moved this code to a better place in the file. 
1378         It was in with unrelated functions.
1379         (khtml::TypingCommand::TypingCommand): Reorganize initialization list so it is easier to read.
1380         (khtml::TypingCommand::issueCommandForDeleteKey): Remove dead code. Roll in remaining code into deleteKeyPressed.
1381         (khtml::TypingCommand::deleteKeyPressed): Add in support for carrying along smart delete flag.
1382         (khtml::TypingCommand::forwardDeleteKeyPressed): New function. Makes forward delete work like
1383         "regular" delete in terms of coalescing typing.
1384         (khtml::TypingCommand::doApply): Add case for ForwardDeleteKey.
1385         (khtml::TypingCommand::preservesTypingStyle): Ditto.
1386         * khtml/editing/htmlediting.h:
1387         (khtml::TypingCommand::): Add ForwardDeleteKey constant. Remove a couple declarations for now-dead code.
1388         (khtml::TypingCommand::smartDelete): New accessor.
1389         (khtml::TypingCommand::setSmartDelete): Ditto.
1390         * kwq/WebCoreBridge.h:
1391         * kwq/WebCoreBridge.mm:
1392         (-[WebCoreBridge deleteKeyPressedWithSmartDelete:]): Add smart delete flag.
1393         (-[WebCoreBridge forwardDeleteKeyPressedWithSmartDelete:]): New method.
1394         * khtml/editing/jsediting.cpp: Add supprt for ForwardDelete command
1395         * layout-tests/editing/editing.js: Ditto.
1396         * layout-tests/editing/deleting/delete-and-undo-expected.txt: Added.
1397         * layout-tests/editing/deleting/delete-and-undo.html: Added.
1398         * layout-tests/editing/deleting/forward-delete-expected.txt: Added.
1399         * layout-tests/editing/deleting/forward-delete.html: Added.
1400
1401 === Safari-181 ===
1402
1403 2005-01-27  David Harrison  <harrison@apple.com>
1404
1405         Reviewed by Ken.
1406
1407         <rdar://problem/3962214> AX: AXLeftLineTextMarkerRangeForTextMarker returns incorrect range
1408
1409         * kwq/KWQAccObject.mm:
1410         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
1411         Allowed for selection to end of line including the linebreak.
1412         
1413 2005-01-27  David Harrison  <harrison@apple.com>
1414
1415         Reviewed by Darin, Ken.
1416
1417         <rdar://problem/3964470> AX: Include attachments in AXAttributedStringForTextMarkerRange
1418
1419         * kwq/KWQAccObject.mm:
1420         (-[KWQAccObject isAttachment]):
1421         (-[KWQAccObject attachmentView]):
1422         (-[KWQAccObject role]):
1423         (-[KWQAccObject subrole]):
1424         (-[KWQAccObject roleDescription]):
1425         (-[KWQAccObject value]):
1426         (-[KWQAccObject title]):
1427         (-[KWQAccObject accessibilityDescription]):
1428         (-[KWQAccObject accessibilityIsIgnored]):
1429         (-[KWQAccObject accessibilityAttributeNames]):
1430         (-[KWQAccObject accessibilityAttributeValue:]):
1431         Make attachments accessible.
1432         
1433         (CreateCGColorIfDifferent):
1434         (AXAttributeStringSetColor):
1435         (AXAttributeStringSetNumber):
1436         (AXAttributeStringSetFont):
1437         (AXAttributeStringSetStyle):
1438         (AXAttributeStringSetElement):
1439         (AXLinkElementForNode):
1440         (AXAttributedStringAppendText):
1441         (AXAttributedStringAppendReplaced):
1442         (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
1443         Add attachments and more text attributes to AXAttributedStringForTextMarkerRange.
1444
1445 2005-01-27  Darin Adler  <darin@apple.com>
1446
1447         Reviewed by John.
1448
1449         - fixed <rdar://problem/3807935> DOM CSS computed style line-height is wrong in two ways
1450
1451         * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1452         Use specified size rather than computed size when dealing with a percentage for line height.
1453
1454 2005-01-27  Darin Adler  <darin@apple.com>
1455
1456         Reviewed by John.
1457
1458         - fixed <rdar://problem/3971372> SWB: template function DOM_cast() won't compile with gcc 4.0
1459         - fixed other gcc 4.0 compiling problems Patrick Beard pointed out on the phone
1460
1461         * kwq/DOMInternal.h: (DOM_cast): Change the "failToCompile()" trick to use a dependent name.
1462         Nowadays, if a name is not dependent, it is checked at template definition time. But we want
1463         a failure only at template instantiation time.
1464
1465         * ForwardingHeaders/editing/text_granularity.h: Added. Needed but a bug in the 3.3 compiler made
1466         it compile anyway without this.
1467
1468         - other changes
1469
1470         * khtml/html/html_miscimpl.h: For clarity, mark these functions virtual too. They are automatically
1471         virtual because the base class ones are virtual, but it's ugly to leave it this way.
1472
1473 2005-01-26  Ken Kocienda  <kocienda@apple.com>
1474
1475         Reviewed by Hyatt
1476
1477         Fix for this bug:
1478         
1479         <rdar://problem/3971609> REGRESSION (Mail): up/down arrow navigation broken after rewrapping text by resizing window
1480         <rdar://problem/3975661> REGRESSION (Mail): left/right arrow navigation can place insertion point after last character on line
1481
1482         * khtml/editing/selection.cpp:
1483         (khtml::Selection::modifyAffinity): PARAGRAPH and LINE movements should not alter affinity. This was
1484         just a mistake before when it reset to upstream in some cases.
1485         * khtml/rendering/render_line.cpp:
1486         (khtml::RootInlineBox::closestLeafChildForXPos): Move this function down from InlineBox, and 
1487         rework the implementation. This fixes 3971609.
1488         * khtml/rendering/render_line.h:
1489         * khtml/rendering/render_text.cpp:
1490         (RenderText::caretRect): Rework the algorithm to fix 3975661. This regressed when we began placing
1491         the spaces on the end of lines in text boxes when lines wrap.
1492
1493 2005-01-26  Richard Williamson   <rjw@apple.com>
1494
1495         Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
1496
1497         I added a member variable to ObjectImp.  This changed it's size and consequently
1498         hampered the optimizations built into the garbage collector.  Objects no longer
1499         fit within the allocators cell size, and thus allocation fell back to a slower
1500         allocator.
1501
1502         As a result of this fix I also dramatically cleaned up how runtime objects are
1503         accessed.  The path mostly *removes* code.
1504         
1505         Reviewed by Chris.
1506
1507         * khtml/ecma/kjs_dom.cpp:
1508         (DOMDocumentProtoFunc::tryCall):
1509         (DOMElementProtoFunc::tryCall):
1510         (KJS::getRuntimeObject):
1511         * khtml/ecma/kjs_dom.h:
1512         * khtml/ecma/kjs_html.cpp:
1513         (KJS::HTMLDocument::tryGet):
1514         (KJS::HTMLElement::tryGet):
1515         (KJS::HTMLElement::implementsCall):
1516         (KJS::HTMLElement::call):
1517         (KJS::HTMLElement::tryPut):
1518         (KJS::HTMLCollection::tryGet):
1519         (KJS::HTMLCollection::getNamedItems):
1520         * khtml/ecma/kjs_html.h:
1521         * khtml/ecma/kjs_window.cpp:
1522         (Window::get):
1523
1524 2005-01-26  Richard Williamson   <rjw@apple.com>
1525
1526         Fixed <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
1527
1528         For now we are using ICU UBreakIterator to determine grapheme boundaries for
1529         cursor and deletion.  This does not match what Cocoa does exactly, but does match
1530         what Carbon does.  The areas are difference are obscure, but, according to
1531         Deborah Goldsmith, using the UBreakIterator is the reasonable approach.
1532
1533         Reviewed by Ken.
1534
1535         * khtml/rendering/render_text.cpp:
1536         (RenderText::previousOffset):
1537         (RenderText::nextOffset):
1538
1539 2005-01-25  David Harrison  <harrison@apple.com>
1540
1541         Reviewed by Maciej and Richard.
1542
1543         <rdar://problem/3963731> AX VO: Changing window sizes causes a crash using with Voice Over - KWQPtrDictImpl::clear
1544
1545         * khtml/html/html_miscimpl.cpp:
1546         (HTMLCollectionImpl::HTMLCollectionImpl):
1547         Ensure that isHTMLDocument before calling HTMLDocument-only method.
1548
1549 2005-01-25  Richard Williamson   <rjw@apple.com>
1550
1551         Part one of fix for <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
1552
1553         This patch changes the semantics of next() and previous() on
1554         VisiblePosition to move a grapheme (character cluster) at a
1555         time.  This means that cursor navigation with correctly move
1556         over an entire cluster.
1557
1558         However, the expected behavior for deleting a grapheme is to
1559         delete individual code points, thus decomposing the grapheme
1560         into it constituent parts.  That will be addressed in the next
1561         part of the fix.
1562
1563         Reviewed by Ken.
1564
1565         * khtml/editing/visible_position.cpp:
1566         (khtml::VisiblePosition::previousPosition):
1567         (khtml::VisiblePosition::nextPosition):
1568         * khtml/editing/visible_position.h:
1569         * khtml/rendering/render_object.cpp:
1570         (RenderObject::previousOffset):
1571         (RenderObject::nextOffset):
1572         * khtml/rendering/render_object.h:
1573         * khtml/rendering/render_text.cpp:
1574         (RenderText::previousOffset):
1575         (RenderText::nextOffset):
1576         (RenderText::findNextInlineTextBox):
1577         * khtml/rendering/render_text.h:
1578         * khtml/xml/dom_nodeimpl.cpp:
1579         (NodeImpl::previousOffset):
1580         (NodeImpl::nextOffset):
1581         * khtml/xml/dom_nodeimpl.h:
1582
1583 2005-01-25  David Harrison  <harrison@apple.com>
1584
1585         Reviewed by Maciej.
1586
1587         <rdar://problem/3973067> AXWebArea for http://apple.netscape.com/ has an empty AXLinkUIElements
1588
1589         * kwq/KWQAccObject.mm:
1590         (-[KWQAccObject accessibilityAttributeValue:]):
1591         Omit ignored AXLinks from AXLinkUIElements result
1592
1593 2005-01-25  Ken Kocienda  <kocienda@apple.com>
1594
1595         Reviewed by John
1596
1597         Fix for this bug:
1598         
1599         <rdar://problem/3972851> REGRESSION (179-180+): Repro crash in ApplyStyleCommand::cleanUpEmptyStyleSpans
1600
1601         * khtml/editing/htmlediting.cpp:
1602         (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans): Added two null checks.
1603
1604 2005-01-25  Ken Kocienda  <kocienda@apple.com>
1605
1606         Reviewed by John
1607
1608         Fix for this bug:
1609         
1610         <rdar://problem/3954710> Mail crashed while editing signatures - NodeImpl::isBlockFlow
1611
1612         The fix is more general than for this one bug, and may work to fix many crashers. The problem
1613         is that the ReplaceSelectionCommand never checked whether its starting selection is empty. If
1614         it is, then we need to bail before doing the work of the command, which we need to deref the
1615         start and end points of the selection in order to do its work. I think you can see the crash
1616         potential.
1617
1618         * khtml/editing/htmlediting.cpp:
1619         (khtml::ReplaceSelectionCommand::doApply): Assert selection is not empty.
1620         * kwq/WebCoreBridge.mm:
1621         (partHasSelection): New helper function to test that bridge has a part with a selection.
1622         
1623         Use new helper function to test part and selection; return from these function if this test fails.
1624         
1625         (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:])
1626         (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:])
1627         (-[WebCoreBridge alterCurrentSelection:direction:granularity:])
1628         (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:])
1629         (-[WebCoreBridge alterCurrentSelection:verticalDistance:])
1630         (-[WebCoreBridge documentFragmentWithText:])
1631         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
1632         (-[WebCoreBridge insertLineBreak])
1633         (-[WebCoreBridge insertParagraphSeparator])
1634         (-[WebCoreBridge insertParagraphSeparatorInQuotedContent])
1635         (-[WebCoreBridge insertText:selectInsertedText:])
1636         (-[WebCoreBridge deleteSelectionWithSmartDelete:])
1637         (-[WebCoreBridge ensureSelectionVisible])
1638
1639 2005-01-24  Kevin Decker  <kdecker@apple.com>
1640
1641         Reviewed by Darin.
1642
1643         Fixed <rdar://problem/3932374> REGRESSION: 'ReferenceError - Can't find variable' JavaScript error at webxpress.fidelity.com
1644
1645         * khtml/html/html_miscimpl.h: Missing virtual identifiers for namedItem() and nextNamedItem() exposed a flaw that prevented finding variables in form [HTMLFormCollectionImpl] scopes.
1646         
1647
1648 2005-01-24  Vicki Murley <vicki@apple.com>
1649
1650         Reviewed by kocienda.
1651
1652         - fix <rdar://problem/3810661> computed style not handled for Apple extensions
1653  
1654         * khtml/css/css_computedstyle.cpp: (DOM::):
1655         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): add -apple-line-clamp and -apple-text-size-adjust
1656
1657 2005-01-24  Darin Adler  <darin@apple.com>
1658
1659         Reviewed by Kevin.
1660
1661         - fixed <rdar://problem/3969884> REGRESSION (179-180): Typing password not echoed as "bullets" at paypal.com when field is first focused
1662
1663         * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]):
1664         Sizing up the form editor, which fixes things for normal fields and search fields,
1665         screws things up for password fields. Eventually, I'll need to figure out why this is
1666         and file a bug so that the AppKit team fixes it. In the mean time, just check for the
1667         case of the secure text field, and don't size up in that case.
1668
1669 2005-01-24  Ken Kocienda  <kocienda@apple.com>
1670
1671         Reviewed by Hyatt
1672
1673         Fix for this bug:
1674         
1675         <rdar://problem/3963560> 8A354: Inserting Japanese text to the line head causes line break
1676
1677         * khtml/editing/htmlediting.cpp:
1678         (khtml::ReplaceSelectionCommand::doApply): Add one more case where we merge content into the
1679         existing line. This covers the situation see using the steps to reproduce this bug.
1680
1681 2005-01-21  Maciej Stachowiak  <mjs@apple.com>
1682
1683         Reviewed by Darin.
1684
1685         <rdar://problem/3967572> Editing should split elements before removing style
1686         
1687         * khtml/editing/htmlediting.cpp:
1688         (khtml::CompositeEditCommand::splitElement):
1689         (khtml::CompositeEditCommand::mergeIdenticalElements):
1690         (khtml::CompositeEditCommand::wrapContentsInDummySpan):
1691         (khtml::CompositeEditCommand::splitTextNodeContainingElement):
1692         (khtml::ApplyStyleCommand::applyInlineStyle):
1693         (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
1694         (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
1695         (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
1696         (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
1697         (khtml::areIdenticalElements):
1698         (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
1699         (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
1700         (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans):
1701         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
1702         (khtml::InsertParagraphSeparatorCommand::doApply):
1703         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1704         (khtml::InsertTextCommand::prepareForTextInsertion):
1705         (khtml::SplitTextNodeCommand::doUnapply):
1706         (khtml::SplitElementCommand::SplitElementCommand):
1707         (khtml::SplitElementCommand::~SplitElementCommand):
1708         (khtml::SplitElementCommand::doApply):
1709         (khtml::SplitElementCommand::doUnapply):
1710         (khtml::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand):
1711         (khtml::MergeIdenticalElementsCommand::~MergeIdenticalElementsCommand):
1712         (khtml::MergeIdenticalElementsCommand::doApply):
1713         (khtml::MergeIdenticalElementsCommand::doUnapply):
1714         (khtml::WrapContentsInDummySpanCommand::WrapContentsInDummySpanCommand):
1715         (khtml::WrapContentsInDummySpanCommand::~WrapContentsInDummySpanCommand):
1716         (khtml::WrapContentsInDummySpanCommand::doApply):
1717         (khtml::WrapContentsInDummySpanCommand::doUnapply):
1718         (khtml::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand):
1719         (khtml::SplitTextNodeContainingElementCommand::~SplitTextNodeContainingElementCommand):
1720         (khtml::SplitTextNodeContainingElementCommand::doApply):
1721         * khtml/editing/htmlediting.h:
1722
1723         New layout test that shows the side benefit of this.
1724         
1725         * layout-tests/editing/style/unbold-in-bold-expected.txt: Added.
1726         * layout-tests/editing/style/unbold-in-bold.html: Added.
1727
1728 2005-01-24  Darin Adler  <darin@apple.com>
1729
1730         Reviewed by John.
1731
1732         - fixed <rdar://problem/3933435> -[DOMRange cloneContents] sometimes alters the original DOMRange
1733
1734         * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Fixed code that was collapsing
1735         the range after processing the contents. That's right for extract and delete, but not clone.
1736
1737         - fixed <rdar://problem/3714184> inline input works incorrectly when I type Korean slowly in textfield in form on www.google.co.kr
1738         - fixed <rdar://problem/3193848> Can't enter SSN to sign up for Chase visa online account (changing focus inside key press handler)
1739         - fixed <rdar://problem/3874683> REGRESSION (161-162): Crash after typing command-Z to undo after pasting text with newline in it into a text field <input type=text>
1740
1741         * kwq/KWQLineEdit.mm:
1742         (QLineEdit::text): Changed to call a new string method on the controller instead of calling
1743         stringValue, since stringValue has a bad side effect of ending inline input.
1744         (QLineEdit::selectAll): Changed to only call selectText: when the field is already selected.
1745         When you are giving the field focus, it automatically gets all selected, and this change
1746         is required in the case where we defer the focus change.
1747
1748         * kwq/KWQTextField.h: Added a new string method to the controller.
1749         * kwq/KWQTextField.mm:
1750         (-[KWQTextFieldController setMaximumLength:]): Call the new string method instead of using stringValue.
1751         (-[KWQTextFieldController controlTextDidChange:]): Removed the code to truncate at the first CR or LF.
1752         That's now handled in the shouldChangeTextInRange method instead.
1753         (-[KWQTextFieldController textView:shouldHandleEvent:]): Add new logic to defer responder changes until
1754         after the event is handled. This makes sure the key gets into the field that's already handling it at
1755         rather than ending up in the newly-focused field if the key press handler focuses a different element.
1756         (-[KWQTextFieldController textView:didHandleEvent:]): Turn off deferral here, now that the key press
1757         has been handled.
1758         (-[KWQTextFieldController string]): Added. Calls stringValue only if there's no editor. If there is
1759         an editor, calls string on that instead.
1760         (-[KWQTextFieldController textView:shouldChangeTextInRange:replacementString:]): Added. Called by
1761         the three field subclasses. Truncates incoming strings at the first CR or LF character. This works
1762         properly with Undo, and the old technique did not.
1763         (-[KWQTextFieldController preprocessString:]): Added. Helper used for all the setStringValue methods
1764         so they all truncate at the first CR or LF as well as truncating to the appropriate length.
1765         (-[KWQTextField setStringValue:]): Changed to call the controller.
1766         (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): Added. Calls the controller.
1767         (-[KWQSecureTextField setStringValue:]): More of the same.
1768         (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
1769         (-[KWQSearchField setStringValue:]): Ditto.
1770         (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
1771
1772         * kwq/KWQWidget.h: Added the new setDeferFirstResponderChanges function.
1773         * kwq/KWQWidget.mm:
1774         (QWidget::~QWidget): Clear out the deferredFirstResponder global just in case we are destroyed
1775         while we "have the ball".
1776         (QWidget::hasFocus): If we are in the deferred mode, use the global to decide who to say is focused.
1777         (QWidget::setFocus): If we are in the deferred mode, set the global instead of making something be
1778         the first responder.
1779         (QWidget::setDeferFirstResponderChanges): Set the boolean. If the boolean is being cleared, then
1780         get the deferred first responder and call setFocus on it again, which will do the work we didn't
1781         want to do earlier.
1782
1783 2005-01-24  Ken Kocienda  <kocienda@apple.com>
1784
1785         Reviewed by John
1786
1787         Fix for this bug:
1788         
1789         <rdar://problem/3964350> Deleting all content and typing in a message gets one letter, then beeps
1790
1791         This is a problem with the way we turn key events, when a user starts typing, into editing commands. 
1792         Right now, that initial delete key in an empty window is turned into an editing command, and much 
1793         editing code runs that need not run. What's more, this is confusing the selection machinery. The
1794         solution is to detect the "delete in an empty window" case and don't turn this into an editing
1795         command at all.
1796
1797         * khtml/editing/htmlediting.cpp:
1798         (khtml::TypingCommand::deleteKeyPressed)
1799
1800 2005-01-23  Adele Amchan  <adele@apple.com>
1801
1802         Fixed <rdar://problem/3964286> REGRESSION (178-179): menus and "go to old site" link at Ameritrade's new site don't work
1803
1804         Removed check for document from checkCompleted.  In this case, WebCore never knew that a WebImageView was complete because 
1805         it fell into this document check case in checkCompleted.  
1806         Added check for document to tokenizerProcessedData (see <rdar://problem/3807144>)
1807
1808         Reviewed by Darin.
1809
1810         * khtml/khtml_part.cpp:
1811         (KHTMLPart::stop):
1812         (KHTMLPart::checkCompleted):
1813         * khtml/khtml_part.h:
1814         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::tokenizerProcessedData):
1815
1816 2005-01-21  Richard Williamson   <rjw@apple.com>
1817
1818         Fixed <rdar://problem/3759399> Javascript / Liveconnect problems ((event handler):Undefined value)
1819
1820         Java applets specified with <object> or <embed> weren't scriptable.  Now they are.
1821
1822         Reviewed by Chris.
1823
1824         * khtml/html/html_objectimpl.cpp:
1825         (HTMLEmbedElementImpl::getEmbedInstance):
1826         (HTMLObjectElementImpl::getObjectInstance):
1827
1828 2005-01-21  Ken Kocienda  <kocienda@apple.com>
1829
1830         Reviewed by John
1831
1832         Fix for this bug:
1833         
1834         <rdar://problem/3959464> REGRESSION (Mail): Insertion point goes back to beginning of document after deleting
1835
1836         * khtml/editing/htmlediting.cpp:
1837         (khtml::DeleteSelectionCommand::handleGeneralDelete): Add special case to handle retaining a fully-selected block.
1838         This fixes the bug.
1839         * layout-tests/editing/deleting/delete-3959464-fix-expected.txt: Added.
1840         * layout-tests/editing/deleting/delete-3959464-fix.html: Added.
1841
1842 2005-01-21  Richard Williamson   <rjw@apple.com>
1843
1844         Fixed <rdar://problem/3966998> REGRESSION(179-TOT) clicking on gmail message brings me to blank screen
1845
1846         getElementById() sometimes returns Undefined() instead of Null().
1847
1848         Reviewed by Hyatt.
1849
1850         * khtml/ecma/kjs_dom.cpp:
1851         (DOMDocumentProtoFunc::tryCall):
1852
1853 2005-01-21  David Hyatt  <hyatt@apple.com>
1854
1855         Fix for 3773809, make sure that overflow regions never end up at an invalid scroll offset because of a layout change.
1856         
1857         Reviewed by kocienda
1858
1859         * khtml/rendering/render_layer.cpp:
1860         (RenderLayer::updateScrollInfoAfterLayout):
1861
1862 2005-01-21  David Hyatt  <hyatt@apple.com>
1863
1864         Fix for 3966349, hang loading page.  Make sure that loops using popOneBlock properly check for a null
1865         blockStack to avoid an infinite loop.
1866         
1867         Reviewed by kocienda
1868
1869         * khtml/html/htmlparser.cpp:
1870         (KHTMLParser::parseToken):
1871         (KHTMLParser::insertNode):
1872         (KHTMLParser::popInlineBlocks):
1873
1874 2005-01-21  Ken Kocienda  <kocienda@apple.com>
1875
1876         Reviewed by John
1877
1878         Fix for this bug:
1879         
1880         <rdar://problem/3957204> Mail crashed when sending a message in ~InsertParagraphSeparatorInQuotedContentCommand
1881
1882         * khtml/editing/htmlediting.cpp:
1883         (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
1884         InsertParagraphSeparatorInQuotedContentCommand has this member variable: DOM::ElementImpl *m_breakNode;
1885         I failed to initialize this variable to null in the constructor, and there is an uncommonly-traveled 
1886         code path which does not set this variable to something good. In the destructor, we check for null, 
1887         and deref if non-null. Obvious "BOOM" potential. Fixed.
1888
1889 2005-01-21  Ken Kocienda  <kocienda@apple.com>
1890
1891         Reviewed by John
1892
1893         Fix for this bug:
1894         
1895         <rdar://problem/3966311> REGRESSION (Mail): Hitting return makes space character disappear
1896
1897         * khtml/editing/htmlediting.cpp:
1898         (khtml::InsertParagraphSeparatorCommand::doApply): When writing the code to insert a block
1899         in response to the return key, I did not write code to cover the case described in the bug.
1900         Now I have.
1901         * layout-tests/editing/inserting/insert-div-025-expected.txt: Added.
1902         * layout-tests/editing/inserting/insert-div-025.html: Added.
1903
1904 2005-01-20  Maciej Stachowiak  <mjs@apple.com>
1905
1906         Reviewed by Ken.
1907
1908         <rdar://problem/3965196> security fix for javascript: exploit missed one case (already fixed in updates)
1909         
1910         * khtml/ecma/kjs_window.cpp:
1911         (WindowFunc::tryCall): correct mistake in earlier fix for the following bug, caught by Adele:
1912
1913 2005-01-20  Maciej Stachowiak  <mjs@apple.com>
1914
1915         Reviewed by Ken.
1916
1917         <rdar://problem/3965466> editing needs to insert text before applying typing style
1918         
1919         * khtml/editing/htmlediting.cpp:
1920         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Remove a FIXME comment.
1921         (khtml::InsertLineBreakCommand::doApply): Apply style to the BR
1922         node after inserting it.
1923         (khtml::InsertTextCommand::prepareForTextInsertion): Don't try to
1924         apply style to any new nodes created before inserting.
1925         (khtml::InsertTextCommand::input): Apply style to the inserted range
1926         after doing the text insert.
1927         * khtml/editing/htmlediting.h:
1928
1929         This change leads to improved results on one of the layout tests:
1930         
1931         * layout-tests/editing/inserting/insert-div-024-expected.txt:
1932
1933 === Safari-180 ===
1934
1935 2005-01-20  Ken Kocienda  <kocienda@apple.com>
1936
1937         Reviewed by John
1938
1939         Fix for this bug:
1940         
1941         <rdar://problem/3964646> REGRESSION (179-180): Typing space at end of line makes following paragraph disappear
1942
1943         * khtml/editing/htmlediting.cpp:
1944         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Recent change to block placeholder removal code 
1945         caused this regression. The code became too aggressive in removing block placeholders, and would remove them
1946         from blocks other than the block containing the selection.
1947         * layout-tests/editing/inserting/insert-div-023-expected.txt: This file had a spurious BR element in it that
1948         I did not notice earlier.
1949         * layout-tests/editing/inserting/insert-div-024-expected.txt: Ditto.
1950
1951 2005-01-20  David Hyatt  <hyatt@apple.com>
1952
1953         Fix for oddness on albertsons.com.  Make sure not to crash when setting/removing style properties on a node
1954         with no document.  The bug # is 3813900.
1955         
1956         Reviewed by john
1957
1958 2005-01-20  David Harrison  <harrison@apple.com>
1959
1960         Reviewed by Darin.
1961
1962         PARTIAL fix for following bug.  Create attributed string with fonts and links.  Still need to add attachments.
1963         <rdar://problem/3942606> AX: Support kAXAttributedStringForTextMarkerRangeParameterizedAttribute
1964         
1965         * kwq/KWQAccObject.mm:
1966         (-[KWQAccObject textUnderElement]):
1967         Touched up previous checkin to match code review comments.
1968         
1969         (-[KWQAccObject value]):
1970         Use plainText for this one instead of obsolete attributedString.
1971         
1972         (-[KWQAccObject accessibilityParameterizedAttributeNames]):
1973         Advertise AXAttributedStringForTextMarkerRange.
1974         
1975         (AXAttributeStringAddFont):
1976         (AXAttributeStringAddElement):
1977         (-[KWQAccObject linkUIElementForNode:]):
1978         (-[KWQAccObject _addAttachmentForElement:URL:needsParagraph:usePlaceholder:]):
1979         (-[KWQAccObject accessibilityAttributedStringForRange:]):
1980         New routines to support AXAttributedStringForTextMarkerRange.
1981         
1982         (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
1983         Use new routines instead of obsolete attributedString.
1984
1985 2005-01-20  David Harrison  <harrison@apple.com>
1986
1987         Reviewed by Darin.
1988
1989         <rdar://problem/3960196> AX Crash in DOM::Range::setStartBefore
1990
1991         * khtml/xml/dom_docimpl.cpp:
1992         (DocumentImpl::getAccObjectCache):
1993         Adjust when detecting cache in non-top level WebArea.
1994         * kwq/KWQAccObject.mm:
1995         (-[KWQAccObject textUnderElement]):
1996         (-[KWQAccObject accessibilityAttributeValue:]):
1997         Make sure the elements document is the current one for the part.
1998
1999 2005-01-20  Darin Adler  <darin@apple.com>
2000
2001         Reviewed by John.
2002
2003         - fixed <rdar://problem/3922980> Mail not crashing, just quitting itself suddenly in -[WebHTMLView(MailExtras) findString:options:]
2004
2005         * khtml/dom/dom2_range.cpp: (DOM::operator==): Handle null and detached ranges without raising exceptions.
2006         The uncaught exception would make the entire program terminate.
2007
2008         - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
2009
2010         * kwq/DOM-CSS.mm: (-[DOMCSSStyleDeclaration setProperty:::]): Uncommented this code which I had to disable
2011         back in November because Mail was stumbling over it.
2012
2013         - fixed <rdar://problem/3943049> focus() called during onload handler results in square text field on <input type=search>        
2014
2015         * kwq/KWQLineEdit.mm: (QLineEdit::baselinePosition): Change computation so it will work even for fields
2016         that position their text in a way that depends on vertical size. In the case of a search field, the text
2017         is centered, so the old logic was broken.
2018         * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Set the frame size to
2019         something large enough to accomodate the field editor. If we start the frame at size 0,0 we run into
2020         AppKit trouble when it insets the frame to figure out the frame for the field editor. In the case of this
2021         bug this happens because we become first responder before being sized and positioned by the HTML layout code.
2022
2023         - improved debugging output when using "po" from gdb with Objective-C DOM
2024
2025         * kwq/DOM.mm:
2026         (-[DOMNode description]): Added. Includes node name ("<tr>") and node value (e.g., string for text node).
2027         (-[DOMRange description]): Tweaked format.
2028
2029 2005-01-19  Richard Williamson   <rjw@apple.com>
2030
2031         After further discussion with Real we have decided to NOT include the
2032         additional CLSID for the real plugin.  See 3958601.
2033
2034         Reviewed by Darin.
2035
2036         * khtml/rendering/render_frames.cpp:
2037         (RenderPartObject::updateWidget):
2038
2039 2005-01-19  David Harrison  <harrison@apple.com>
2040
2041         Reviewed by Maciej.
2042
2043         <rdar://problem/3949429> AX: word marker routines returns incorrect data for empty line
2044
2045         Previous checkin for this bug was missing some of the patch.  Editing snafu with multiple changes in tree.
2046         
2047         * kwq/KWQAccObject.mm:
2048         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2049         (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
2050         (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
2051         (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2052         (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
2053         (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
2054         (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
2055
2056 2005-01-19  Ken Kocienda  <kocienda@apple.com>
2057
2058         Reviewed by John
2059
2060         * khtml/editing/htmlediting.cpp:
2061         (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Small, cosmetic change John and I decided
2062         to do on my last checkin, but I forgot to do before landing.
2063
2064 2005-01-19  Ken Kocienda  <kocienda@apple.com>
2065
2066         Reviewed by John
2067
2068         Fix for this bug:
2069         
2070         <rdar://problem/3959727> REGRESSION (Mail): Style not preserved on blank lines
2071
2072         * khtml/editing/htmlediting.cpp:
2073         (khtml::CompositeEditCommand::applyStyle):
2074         (khtml::CompositeEditCommand::insertBlockPlaceholder): New function that unconditionally adds a block placeholder.
2075         (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Now returns bool based on whether
2076         placeholder was added or not.
2077         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now searches all the descendents of a block
2078         looking for a placeholder. The old code, which just looked at the last child of a node, started missing
2079         once block placeholders became styled (which started happening with this patch).
2080         (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Now handles applying typing style
2081         to a block placeholder at call time, rather than setting the typing style as a latent style that
2082         might be applied later. This is an important part of the bug fix.
2083         (khtml::DeleteSelectionCommand::doApply): Now uses bool return value from insertBlockPlaceholderIfNeeded()
2084         and passes it along to calculateStyleBeforeInsertion, so the case where a block placeholder needs to
2085         be styled can be detected.
2086         (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Changed the way this class
2087         managed style. Before it would calculate and set typing style for the block added. This is not
2088         sufficient. Added blocks need to styled immediately. Some name changes to instance variables in 
2089         this class due to the change to accommodate this change.
2090         (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Name changes, as above.
2091         (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Ditto.
2092         (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Ditto.
2093         (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
2094         (khtml::ReplaceSelectionCommand::doApply): Improve check for testing when a placeholder
2095         block can be removed in its entirety after the insertion.
2096         * khtml/editing/htmlediting.h: Update header accordingly.
2097         * khtml/khtml_part.cpp:
2098         (KHTMLPart::selectionComputedStyle): Move position for computed style check downstream before
2099         doing check when the position is in an empty block (this makes sure any style on any block
2100         placeholder is accounted for).
2101
2102         New layout tests to check bug fix.
2103
2104         * layout-tests/editing/style/block-style-004-expected.txt: Added.
2105         * layout-tests/editing/style/block-style-004.html: Added.
2106         * layout-tests/editing/style/block-style-005-expected.txt: Added.
2107         * layout-tests/editing/style/block-style-005.html: Added.
2108         * layout-tests/editing/style/block-style-006-expected.txt: Added.
2109         * layout-tests/editing/style/block-style-006.html: Added.
2110
2111         Results updated to reflect new block placeholder code.
2112
2113         * layout-tests/editing/inserting/insert-div-004-expected.txt 
2114         * layout-tests/editing/inserting/insert-div-005-expected.txt
2115         * layout-tests/editing/inserting/insert-div-006-expected.txt
2116         * layout-tests/editing/inserting/insert-div-008-expected.txt
2117         * layout-tests/editing/inserting/insert-div-011-expected.txt
2118         * layout-tests/editing/inserting/insert-div-012-expected.txt
2119         * layout-tests/editing/inserting/insert-div-013-expected.txt
2120         * layout-tests/editing/inserting/insert-div-014-expected.txt
2121         * layout-tests/editing/inserting/insert-div-015-expected.txt
2122         * layout-tests/editing/inserting/insert-div-016-expected.txt
2123         * layout-tests/editing/inserting/insert-div-017-expected.txt
2124         * layout-tests/editing/inserting/insert-div-018-expected.txt
2125         * layout-tests/editing/inserting/insert-div-019-expected.txt
2126         * layout-tests/editing/inserting/insert-div-021-expected.txt
2127         * layout-tests/editing/inserting/insert-div-022-expected.txt
2128         * layout-tests/editing/inserting/insert-div-023-expected.txt
2129         * layout-tests/editing/inserting/insert-div-024-expected.txt
2130
2131 2005-01-19  David Hyatt  <hyatt@apple.com>
2132
2133         Dont null-check the renderer before submitting, since a script can set it to display:none and still expect the
2134         submission to occur.  Fixes bug #3477282.
2135         
2136         Reviewed by kdecker
2137
2138         (DOM::HTMLInputElementImpl::defaultEventHandler):
2139
2140 2005-01-18  Richard Williamson   <rjw@apple.com>
2141         
2142         Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
2143
2144         Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
2145         Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
2146         Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
2147         Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
2148
2149         We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
2150         tags.  Also, if any of these elements are named they can be accessed from the document or window objects.
2151         Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
2152
2153         Reviewed by Chris.
2154
2155         * khtml/dom/html_document.cpp:
2156         (HTMLDocument::objects):
2157         * khtml/dom/html_document.h:
2158         * khtml/ecma/kjs_dom.cpp:
2159         (DOMDocumentProtoFunc::tryCall):
2160         (DOMElementProtoFunc::tryCall):
2161         (KJS::getRuntimeObject):
2162         * khtml/ecma/kjs_dom.h:
2163         * khtml/ecma/kjs_html.cpp:
2164         (KJS::HTMLDocument::tryGet):
2165         (KJS::HTMLElement::tryGet):
2166         (KJS::HTMLCollection::tryGet):
2167         (KJS::HTMLCollection::getNamedItems):
2168         * khtml/ecma/kjs_window.cpp:
2169         (Window::get):
2170         * khtml/html/html_miscimpl.cpp:
2171         (HTMLCollectionImpl::traverseNextItem):
2172         * khtml/html/html_miscimpl.h:
2173         (DOM::HTMLCollectionImpl::):
2174         * khtml/html/html_objectimpl.cpp:
2175         (HTMLAppletElementImpl::getAppletInstance):
2176         (HTMLObjectElementImpl::HTMLObjectElementImpl):
2177         (HTMLObjectElementImpl::getObjectInstance):
2178         * khtml/html/html_objectimpl.h:
2179         * khtml/rendering/render_frames.cpp:
2180         (RenderPartObject::updateWidget):
2181         * kwq/KWQKHTMLPart.h:
2182         * kwq/KWQKHTMLPart.mm:
2183         (KWQKHTMLPart::getObjectInstanceForView):
2184
2185 2005-01-18  David Hyatt  <hyatt@apple.com>
2186
2187         Fix for 3948123, rolling over link erases nearby text.  The repaint rect check for lines was wrong whenever
2188         two lines overlapped.
2189         
2190         Reviewed by kocienda
2191
2192         * khtml/rendering/render_flow.cpp:
2193         (RenderFlow::paintLines):
2194
2195 2005-01-18  Ken Kocienda  <kocienda@apple.com>
2196
2197         Reviewed by Hyatt
2198         
2199         Fix for this bug:
2200         
2201         <rdar://problem/3960116> Focus rings paint incorrectly for contenteditable blocks in web pages
2202
2203         * khtml/rendering/render_flow.cpp:
2204         (RenderFlow::addFocusRingRects): Fix painting of focus rings so that ring only paints around
2205         outermost contenteditable elements.
2206
2207 2005-01-18  David Harrison  <harrison@apple.com>
2208
2209         Reviewed by Darin.
2210
2211         <rdar://problem/3959668> accessibilityFocusedUIElement sometimes returns an ignored element; it must not
2212
2213         * kwq/KWQAccObject.mm:
2214         (-[KWQAccObject accessibilityFocusedUIElement]):
2215         Return parentObjectUnignored if focused object is ignored.
2216
2217 2005-01-18  Ken Kocienda  <kocienda@apple.com>
2218
2219         Reviewed by John
2220
2221         Fix for this bug:
2222         
2223         <rdar://problem/3952877> REGRESSION (Mail): Command-left/right-arrows don't work with file attachment
2224
2225         * khtml/editing/selection.cpp:
2226         (khtml::nodeForInlineBox): New helper function used in reimplementation of function below.
2227         (khtml::selectionForLine): Reimplemented using line box smarts. I originally wrote this code when
2228         I had a less than full understanding of line layout. I can do better now, and my new version no
2229         longer fails to notice attachments when doing the kind of navigation mentioned in the bug.
2230
2231 2005-01-17  David Harrison  <harrison@apple.com>
2232
2233         Reviewed by John Sullivan.
2234
2235         <rdar://problem/3949429> AX: word marker routines returns incorrect data for empty line
2236         <rdar://problem/3949848> AX: paragraph marker routines do not work when given a paragraph end marker
2237
2238         Also fixed sentence support in the same way.
2239         
2240         * kwq/KWQAccObject.mm:
2241         (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2242         (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
2243         (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
2244         (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
2245         (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
2246         Move one position in desired direction before calling visible_units.cpp code.
2247
2248 2005-01-17  David Harrison  <harrison@apple.com>
2249
2250         Updated expected test results.
2251         
2252         <rdar://problem/3945880> line-ending space seems not to be present
2253
2254         * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt:
2255         * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt:
2256         * layout-tests/editing/inserting/insert-div-020-expected.txt:
2257         * layout-tests/editing/inserting/insert-div-021-expected.txt:
2258         * layout-tests/editing/inserting/insert-div-022-expected.txt:
2259         * layout-tests/editing/inserting/insert-div-023-expected.txt:
2260         * layout-tests/editing/inserting/insert-div-024-expected.txt:
2261
2262 2005-01-17  David Harrison  <harrison@apple.com>
2263
2264         Reviewed by Dave Hyatt (bidi.cpp) and Darin Adler (selection.cpp).
2265
2266         <rdar://problem/3945880> line-ending space seems not to be present
2267
2268         * khtml/editing/selection.cpp:
2269         (khtml::Selection::validate):
2270         Extend AFTER_WHITE_SPACE code to support white spac in the middle of paragraphs, not just the end.
2271         * khtml/rendering/bidi.cpp:
2272         (khtml::RenderBlock::findNextLineBreak):
2273         Pick left/rightness of word selection based on being at the end of paragraph (i.e. after a hard line break).
2274
2275 2005-01-17  Darin Adler  <darin@apple.com>
2276
2277         Reviewed by John Louch.
2278
2279         - fixed <rdar://problem/3958503> need screenX and screenY to use WebKit windowFrame delegate
2280
2281         * khtml/ecma/kjs_window.cpp: (Window::get): Change screenX and screenY to use frameGeometry instead
2282         of using mapToGlobal and screen in a complicated way.
2283         * kwq/KWQKHTMLView.mm: Removed unused mapToGlobal function.
2284         * kwq/KWQWindowWidget.h: Ditto.
2285         * kwq/KWQWindowWidget.mm: Ditto.
2286
2287 2005-01-17  David Hyatt  <hyatt@apple.com>
2288
2289         Fix a screwup in rightmost/lowets position computation.  3955207.  Make sure floats with layers are still checked.
2290
2291         Reviewed by kocienda
2292         
2293         * khtml/rendering/render_block.cpp
2294
2295 2005-01-17  Ken Kocienda  <kocienda@apple.com>
2296
2297         Reviewed by John
2298
2299         <rdar://problem/3953366> Problems with typing attributes in HTML compose
2300
2301         * khtml/editing/htmlediting.cpp:
2302         (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Remove misguided "optimization"
2303         that tried to sense when typing style could be cleared without actually doing a style diff between
2304         before-delete and after-delete positions. Removing this extra check and running the 
2305         general-purpose code fixes the bug.
2306
2307 2005-01-17  Richard Williamson   <rjw@apple.com>
2308
2309         Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
2310
2311         Keep track of originating execution context and target execution
2312         context for native JS object wrappers, and perform appropriate
2313         security checks.
2314
2315         Reviewed by David Harrison.
2316
2317         * khtml/ecma/kjs_binding.cpp:
2318         (ScriptInterpreter::isGlobalObject):
2319         (ScriptInterpreter::isSafeScript):
2320         (ScriptInterpreter::interpreterForGlobalObject):
2321         * khtml/ecma/kjs_binding.h:
2322         * khtml/ecma/kjs_window.cpp:
2323         (Window::interpreter):
2324         (Window::isSafeScript):
2325         * khtml/ecma/kjs_window.h:
2326         * kwq/DOMInternal.mm:
2327         (-[WebScriptObject _initializeScriptDOMNodeImp]):
2328         * kwq/KWQKHTMLPart.mm:
2329         (KWQKHTMLPart::windowScriptObject):
2330         (KWQKHTMLPart::windowScriptNPObject):
2331         * kwq/WebCoreBridge.mm:
2332         (rootForView):
2333         (-[WebCoreBridge init]):
2334
2335 2005-01-17  Ken Kocienda  <kocienda@apple.com>
2336
2337         Reviewed by John
2338
2339         Fix for this bug:
2340         
2341         <rdar://problem/3786659> REGRESSION (Mail): editable WebViews don't work with 
2342         "size up" and "size down" NSFontManager changes
2343
2344         * khtml/css/cssparser.cpp:
2345         (CSSParser::parseValue): Add support for parsing new font size delta property.
2346         * khtml/css/cssproperties.c: Generated file.
2347         * khtml/css/cssproperties.h: Ditto.
2348         * khtml/css/cssproperties.in: Add support for parsing new font size delta property.
2349         * khtml/editing/htmlediting.cpp:
2350         (khtml::isEmptyStyleSpan): New helper function. Code existed before, but now factored out for convenient use.
2351         (khtml::CompositeEditCommand::removeNodeAttribute): Does check on value to see it exists before creating
2352         and running command to do the removal.
2353         (khtml::ApplyStyleCommand::doApply): Now calls new applyRelativeFontStyleChange() function as part of its work.
2354         (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): New function that does the "heavy lifting" to handle 
2355         relative font size changes.
2356         (khtml::ApplyStyleCommand::applyInlineStyle): Range check the start and end positions to make sure the start is
2357         before or equal to the end. Swap them if not true. I ran into this problem in some similar code in 
2358         applyRelativeFontStyleChange(). Moving that goodness here too.
2359         (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded): Uses a local variable to save a value used often.
2360         Code is the same, but reads better now. Function now returns bool as well, just like splitTextAtStartIfNeeded.
2361         I use the bool return value now (I obviously did not need it before).
2362         (khtml::ApplyStyleCommand::computedFontSize): New helper function.
2363         (khtml::ApplyStyleCommand::joinChildTextNodes): Ditto.
2364         (khtml::createStyleSpanElement): Ditto.
2365         * khtml/editing/htmlediting.h: Update header accordingly.
2366         * khtml/editing/jsediting.cpp: Add new command string to enable relative font size changes.
2367         * kwq/DOM-CSS.mm:
2368         (-[DOMCSSStyleDeclaration _fontSizeDelta]): New convenience.
2369         (-[DOMCSSStyleDeclaration _setFontSizeDelta:]): Ditto.
2370         * kwq/DOMPrivate.h: Declare new conveniences.
2371         * layout-tests/editing/editing.js: Add new JS to enable relative font size changes, as well as explicit font size setting.
2372         * layout-tests/editing/style/relative-font-size-change-001-expected.txt: Added.
2373         * layout-tests/editing/style/relative-font-size-change-001.html: Added.
2374         * layout-tests/editing/style/relative-font-size-change-002-expected.txt: Added.
2375         * layout-tests/editing/style/relative-font-size-change-002.html: Added.
2376         * layout-tests/editing/style/relative-font-size-change-003-expected.txt: Added.
2377         * layout-tests/editing/style/relative-font-size-change-003.html: Added.
2378         * layout-tests/editing/style/relative-font-size-change-004-expected.txt: Added.
2379         * layout-tests/editing/style/relative-font-size-change-004.html: Added.
2380
2381 2005-01-14  Darin Adler  <darin@apple.com>
2382
2383         * khtml/css/cssproperties.c: Regenerated with gperf 3.0.1.
2384         * khtml/css/cssvalues.c: Regenerated with gperf 3.0.1.
2385         * khtml/misc/htmlattrs.c: Regenerated with gperf 3.0.1.
2386         * khtml/misc/htmltags.c: Regenerated with gperf 3.0.1.
2387
2388 2005-01-14  Chris Blumenberg  <cblu@apple.com>
2389
2390         Fixed: <rdar://problem/3886415> arrow keys don't work when the user hits Back to return to RSS page
2391
2392         Reviewed by hyatt.
2393
2394         (KWQKHTMLPart::openURLFromPageCache): restore mousePressNode
2395         (KWQKHTMLPart::mousePressNode): new
2396         * kwq/KWQPageState.h:
2397         * kwq/KWQPageState.mm:
2398         (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]): save the mousePressNode
2399         (-[KWQPageState clear]): clear the mousePressNode
2400         (-[KWQPageState dealloc]): deref the mousePressNode
2401         (-[KWQPageState mousePressNode]): new
2402
2403 === Safari-179 ===
2404
2405 2005-01-13  Vicki Murley <vicki@apple.com>
2406
2407         Reviewed by Adele.
2408
2409         - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
2410
2411         * WebCore.pbproj/project.pbxproj: bump "2004" to "2005"
2412
2413 2005-01-13  David Harrison  <harrison@apple.com>
2414
2415         Reviewed by Ken Kocienda.
2416         
2417         Better fix for 3905066.
2418         
2419         * khtml/editing/htmlediting.cpp:
2420         (khtml::InsertParagraphSeparatorCommand::doApply):
2421
2422 2005-01-10  Maciej Stachowiak  <mjs@apple.com>
2423
2424         Reviewed by Darin.
2425
2426         <rdar://problem/3758033> REGRESSION (Mail): Support attributes in marked text (International input)
2427         
2428         * khtml/rendering/render_text.cpp:
2429         (InlineTextBox::paint): Support painting custom underline markers for
2430         marked text in place of generic yellow.
2431         (InlineTextBox::paintMarkedTextUnderline): New method that handles this.
2432         * khtml/rendering/render_text.h:
2433         * kwq/KWQKHTMLPart.h: Declare new methods and structs.
2434         * kwq/KWQKHTMLPart.mm:
2435         (KWQKHTMLPart::clear): Clear marked test underlines.
2436         (KWQKHTMLPart::setMarkedTextRange): Takes attributes and ranges now.
2437         (convertAttributesToUnderlines): Converts NSAttributedString attributes
2438         to simplified and C++-friendly form.
2439         (KWQKHTMLPart::markedTextUsesUnderlines): New method.
2440         (KWQKHTMLPart::markedTextUnderlines): New method.
2441         * kwq/KWQPainter.mm:
2442         (QPainter::drawLineForText): Handle pen width.
2443         * kwq/WebCoreBridge.h:
2444         * kwq/WebCoreBridge.mm:
2445         (-[WebCoreBridge setMarkedTextDOMRange:customAttributes:ranges:]): Take attributes
2446         and ranges.
2447         * kwq/WebCoreTextRenderer.h:
2448
2449 2005-01-12  David Harrison  <harrison@apple.com>
2450
2451         Reviewed by Dave Hyatt.
2452
2453         <rdar://problem/3888973> AX: Parent AXWebArea of nested AXWebAreas is messed up
2454         
2455         * kwq/KWQAccObject.mm:
2456         (-[KWQAccObject addChildrenToArray:]):
2457         Use the widget's outer view.
2458
2459 2005-01-12  David Harrison  <harrison@apple.com>
2460
2461         Reviewed by Darin Adler.
2462
2463         <rdar://problem/3949908> Crash when asking for the kAXLengthForTextMarkerRangeParameterizedAttribute
2464         
2465         * khtml/xml/dom_nodeimpl.cpp:
2466         (NodeImpl::displayNode):
2467         Add quotes around text node content.
2468         (NodeBaseImpl::childNode):
2469         Add nil check to return nil rather than crash when child node not found.
2470         * kwq/KWQAccObject.mm:
2471         (-[KWQAccObject doAXStringForTextMarkerRange:]):
2472         Pass range compliant positions to TextIterator.
2473
2474 2005-01-12  David Hyatt  <hyatt@apple.com>
2475
2476         Fix for 3951203, CSS border style incorrectly clipped on inline elements.  Make sure the repaint rect set during
2477         line layout is smarter about including the overflow for both old states and new states.
2478         
2479         Reviewed by john
2480
2481         * khtml/rendering/bidi.cpp:
2482         (khtml::RenderBlock::layoutInlineChildren):
2483
2484 2005-01-12  David Hyatt  <hyatt@apple.com>
2485
2486         Fix for bug 3937608, versiontracker.com flashes and displays the right column below content.  Make sure to move
2487         tables/overflows that dont fit within a block only in strict mode.
2488
2489         Fix for bug 3931049, characters dont show up when typing.  Make sure to dirty the right lines when this specific
2490         case in editing is hit.
2491         
2492         Reviewed by darin (first one), kocienda (second one)
2493
2494         * khtml/rendering/render_block.cpp:
2495         (khtml::RenderBlock::getClearDelta):
2496         * khtml/rendering/render_flow.cpp:
2497         (RenderFlow::dirtyLinesFromChangedChild):
2498         * khtml/rendering/render_line.cpp:
2499         (khtml::InlineFlowBox::verticallyAlignBoxes):
2500
2501 2005-01-12  Ken Kocienda  <kocienda@apple.com>
2502
2503         Reviewed by John
2504
2505         Fix for this bug:
2506         
2507         <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
2508
2509         * khtml/editing/htmlediting.cpp:
2510         (khtml::DeleteSelectionCommand::initializePositionData): Change test that will prevent block
2511         merging. End-of-line test was just wrong. Call new start-of and end-of paragraph functions
2512         added to visible_position files.
2513         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Add tests for BR elements, which makes
2514         tests to determine when to stop moving nodes more complete and correct. Also improved comments.
2515         * khtml/editing/visible_position.cpp:
2516         (khtml::isFirstVisiblePositionInParagraph): New function.
2517         (khtml::isLastVisiblePositionInParagraph): New function.
2518         * khtml/editing/visible_position.h: Update header accordingly.
2519         * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: New results, slightly different from former
2520         results but still correct.
2521         * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Ditto.
2522         * layout-tests/editing/deleting/delete-block-merge-contents-018-expected.txt: Added.
2523         * layout-tests/editing/deleting/delete-block-merge-contents-018.html: Added.
2524         * layout-tests/editing/deleting/delete-block-merge-contents-019-expected.txt: Added.
2525         * layout-tests/editing/deleting/delete-block-merge-contents-019.html: Added.
2526         * layout-tests/editing/deleting/delete-block-merge-contents-020-expected.txt: Added.
2527         * layout-tests/editing/deleting/delete-block-merge-contents-020.html: Added.
2528         * layout-tests/editing/deleting/delete-block-merge-contents-021-expected.txt: Added.
2529         * layout-tests/editing/deleting/delete-block-merge-contents-021.html: Added.
2530         * layout-tests/editing/deleting/delete-line-014-expected.txt: These new results are actually better, and fix a bug.
2531
2532 2005-01-11  Richard Williamson   <rjw@apple.com>
2533
2534         Fixed 3922875.  Fall back to DOM object is EMBED element
2535         has no associated runtime object.
2536
2537         Reviewed by Chris.
2538
2539         * khtml/ecma/kjs_dom.cpp:
2540         (KJS::getRuntimeObject):
2541         * khtml/ecma/kjs_html.cpp:
2542         (KJS::HTMLDocument::tryGet):
2543         (KJS::HTMLElement::tryGet):
2544         (KJS::HTMLCollection::tryGet):
2545         (KJS::HTMLCollection::getNamedItems):
2546
2547 2005-01-11  David Hyatt  <hyatt@apple.com>
2548
2549         Fix for 3882299, missing content on gibson.com.  Change our handling of " and ' in certain states of the parser to match
2550         other browsers.
2551         
2552         Reviewed by Maciej
2553
2554         * khtml/html/htmltokenizer.cpp:
2555         (khtml::HTMLTokenizer::parseTag):
2556
2557 2005-01-11  Chris Blumenberg  <cblu@apple.com>
2558
2559         Fixed: <rdar://problem/3930733> Mail prints second page of email blank
2560
2561         Reviewed by dave.
2562
2563         * khtml/rendering/render_canvas.cpp:
2564         (RenderCanvas::paint): cache the print rect since the dirty rect can get changed during printing
2565         * khtml/rendering/render_flow.cpp:
2566         (RenderFlow::paintLines): removed null check since the print rect should never be null
2567         * khtml/rendering/render_list.cpp:
2568         (RenderListMarker::paint): ditto
2569         * kwq/KWQKHTMLPart.mm:
2570         (KWQKHTMLPart::adjustPageHeight): don't set the print rect here since this method is not called for the last page
2571
2572 2005-01-10  Ken Kocienda  <kocienda@apple.com>
2573
2574         Reviewed by Hyatt
2575
2576         Fix for this bug:
2577         
2578         <rdar://problem/3943648> extra line is inserted after pressing return within quoted text of reply
2579
2580         * khtml/editing/htmlediting.cpp:
2581         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): This bug was the result of a 
2582         simple coding mistake. A local variable was erroneously redefined in a deeper scope, and so the 
2583         result calculated in that deeper scope was not available when tested.
2584
2585 2005-01-10  Ken Kocienda  <kocienda@apple.com>
2586
2587         Reviewed by John
2588
2589         Fix for this bug:
2590         
2591         <rdar://problem/3946852> Option-e goes to next line
2592
2593         * khtml/editing/htmlediting.cpp:
2594         (khtml::ReplaceSelectionCommand::doApply): Tweak case used to determine when merging content
2595         into the start line is done. We plan to change pretty substantially soon to better handle
2596         the problem described in <rdar://problem/3937352> Quote level not maintained when copied 
2597         and pasted within a Mail message. In the meantime, this change does no harm, and fixes the bug.
2598
2599 2005-01-10  Ken Kocienda  <kocienda@apple.com>
2600
2601         Reviewed by Darin
2602
2603         Fix for this bug:
2604         
2605         <rdar://problem/3907005> Applying block styles to a line of text can unexpectedly affect other lines
2606
2607         * khtml/editing/htmlediting.cpp:
2608         (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): New function which moves "paragraphs"
2609         to their own blocks if needed so that a block style can be applied.
2610         (khtml::CompositeEditCommand::isMailBlockquote): Moved this function to base class so it can be used more generally.
2611         (khtml::ApplyStyleCommand::applyBlockStyle): Pass a node instead of a block to addBlockStyleIfNeeded().
2612         (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Now accepts a node instead of a block for styling.
2613         This function also now calls moveParagraphContentsToNewBlockIfNecessary() to make sure that only the current
2614         paragraph is styled.
2615         (khtml::SetNodeAttributeCommand::doUnapply): Should not assert on undo if old value of attribute was null.
2616         Should remove attributue instead.
2617         * khtml/editing/htmlediting.h: Touch function declarations accordingly.
2618         * layout-tests/editing/style/create-block-for-style-001-expected.txt: Added.
2619         * layout-tests/editing/style/create-block-for-style-001.html: Added.
2620         * layout-tests/editing/style/create-block-for-style-002-expected.txt: Added.
2621         * layout-tests/editing/style/create-block-for-style-002.html: Added.
2622         * layout-tests/editing/style/create-block-for-style-003-expected.txt: Added.
2623         * layout-tests/editing/style/create-block-for-style-003.html: Added.
2624         * layout-tests/editing/style/create-block-for-style-004-expected.txt: Added.
2625         * layout-tests/editing/style/create-block-for-style-004.html: Added.
2626         * layout-tests/editing/style/create-block-for-style-005-expected.txt: Added.
2627         * layout-tests/editing/style/create-block-for-style-005.html: Added.
2628         * layout-tests/editing/style/create-block-for-style-006-expected.txt: Added.
2629         * layout-tests/editing/style/create-block-for-style-006.html: Added.
2630         * layout-tests/editing/style/create-block-for-style-007-expected.txt: Added.
2631         * layout-tests/editing/style/create-block-for-style-007.html: Added.
2632         * layout-tests/editing/style/create-block-for-style-008-expected.txt: Added.
2633         * layout-tests/editing/style/create-block-for-style-008.html: Added.
2634         * layout-tests/editing/style/create-block-for-style-009-expected.txt: Added.
2635         * layout-tests/editing/style/create-block-for-style-009.html: Added.
2636         * layout-tests/editing/style/create-block-for-style-010-expected.txt: Added.
2637         * layout-tests/editing/style/create-block-for-style-010.html: Added.
2638         * layout-tests/editing/style/create-block-for-style-011-expected.txt: Added.
2639         * layout-tests/editing/style/create-block-for-style-011.html: Added.
2640         * layout-tests/editing/style/create-block-for-style-012-expected.txt: Added.
2641         * layout-tests/editing/style/create-block-for-style-012.html: Added.
2642         * layout-tests/editing/style/create-block-for-style-013-expected.txt: Added.
2643         * layout-tests/editing/style/create-block-for-style-013.html: Added.
2644
2645         Unrelated updates to these expected results.
2646         * layout-tests/editing/inserting/insert-div-007-expected.txt
2647         * layout-tests/editing/pasteboard/paste-text-013-expected.txt
2648
2649 2005-01-10  Chris Blumenberg  <cblu@apple.com>
2650
2651         Fixed: <rdar://problem/3936844> Mail: Messages with rich text do not print
2652
2653         Reviewed by john.
2654
2655         * khtml/rendering/render_flow.cpp:
2656         (RenderFlow::paintLines): don't do pagination work if printRect is not set
2657         * khtml/rendering/render_list.cpp:
2658         (RenderListMarker::paint): ditto
2659
2660 2005-01-10  David Harrison  <harrison@apple.com>
2661
2662         Reviewed by Darin.
2663
2664         * kwq/KWQTextUtilities.mm:
2665         (currentTextBreakLocaleID):
2666         Return empty string (AKA root locale) if locale pref can not be canonicalized.
2667
2668 2005-01-10  John Sullivan  <sullivan@apple.com>
2669
2670         Fixed broken Panther build.
2671
2672         * kwq/KWQTextUtilities.mm:
2673         (currentTextBreakLocaleID):
2674         This recently-added function was using code copy/pasted from CarbonCore UnicodeUtilities.
2675         That code used a Tiger-only function, CFLocaleCreateCanonicalLanguageIdentifierFromString.
2676         To fix the build, I added a BUILDING_ON_PANTHER #ifdef that avoids the call to the Tiger
2677         function. However, the Tiger-only code was wrong; the string generated using 
2678         CFLocaleCreateCanonicalLanguageIdentifierFromString was not used at all, so I fixed that
2679         as well.
2680
2681 2005-01-09  David Harrison  <harrison@apple.com>
2682
2683         Reviewed by Ken Kocienda.
2684
2685         <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
2686         
2687         * khtml/editing/htmlediting.cpp:
2688         (khtml::ReplaceSelectionCommand::doApply):
2689         Tune check for need for insertParagraphSeparator when hasInterchangeNewline.
2690
2691 2005-01-09  Darin Adler  <darin@apple.com>
2692
2693         Reviewed by Harrison.
2694
2695         - fixed <rdar://problem/3939176> select() method does not work on <input type=search>
2696
2697         * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::select): Changed if statement
2698         to a switch statement. Added SEARCH to the set of types that treat the renderer as a
2699         RenderLineEdit.
2700
2701 2005-01-09  David Harrison  <harrison@apple.com>
2702
2703         Reviewed by Ken Kocienda.
2704
2705         <rdar://problem/3905066> REGRESSION (Mail): Hitting return key with caret in front of space causes space to become lost (resize fixes)
2706
2707         Problem was that InsertParagraphSeparatorCommand::doApply() was not collapsing
2708         whitespace to a single non-breaking space when splitting a text node.
2709
2710         * khtml/editing/htmlediting.cpp:
2711         (khtml::InsertParagraphSeparatorCommand::doApply):
2712
2713 2005-01-08  Kevin Decker  <kdecker@apple.com>
2714
2715         Reviewed by Ken.
2716
2717         Fixed: <rdar://problem/3924219> Calling setOuterHTML: on a DOMHTMLHtmlElement can crash a program
2718
2719         * khtml/html/html_elementimpl.cpp:
2720         (HTMLElementImpl::setOuterHTML): Added a nil check for fragments who don't have parents.
2721
2722 2005-01-07  Maciej Stachowiak  <mjs@apple.com>
2723
2724         Reviewed by Darin.
2725         
2726         <rdar://problem/3807144> REGRESSION (125-TOT): my bank's website doesn't work (Societe Generale, socgen.com)
2727
2728         * Khtml/khtml_part.cpp:
2729         (KHTMLPart::checkCompleted): If the document is NULL, assume this frame has
2730         not started loading yet so it could not possibly be finishing here...
2731         (KHTMLPart::stop): ...unless the part is explicitly stopped and there is still
2732         no document, in this case we must have hit an error or been loading a non-HTML
2733         frame.
2734         * khtml/khtml_part.h:
2735
2736 2005-01-08  David Harrison  <harrison@apple.com>
2737
2738         Reviewed by Maciej.
2739
2740         <rdar://problem/3943415> REGRESSION (Mail): double-clicking past word selects previous word instead of only blank space
2741         
2742         * khtml/editing/selection.cpp:
2743         (khtml::Selection::validate):
2744         Tune word selections left/right choice to use right if on empty last line.
2745
2746 2005-01-07  David Harrison  <harrison@apple.com>
2747
2748         Reviewed by Darin.
2749
2750         <rdar://problem/3942619> AX: Support sentence ax attributes
2751
2752         Needed to use the unicode utilities properly.  Twas lame before.
2753
2754         * khtml/editing/visible_units.cpp:
2755         (khtml::previousBoundary):
2756         (khtml::nextBoundary):
2757         (khtml::startOfWord):
2758         (khtml::endOfWord):
2759         (khtml::previousWordPosition):
2760         (khtml::nextWordPosition):
2761         (khtml::startOfSentence):
2762         (khtml::endOfSentence):
2763         (khtml::previousSentencePosition):
2764         (khtml::nextSentencePosition):
2765         * kwq/KWQAccObject.mm:
2766         (-[KWQAccObject accessibilityAttributeNames]):
2767         (-[KWQAccObject accessibilityAttributeValue:]):
2768         (-[KWQAccObject accessibilityParameterizedAttributeNames]):
2769         (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
2770         * kwq/KWQTextUtilities.mm:
2771         (currentTextBreakLocaleID):
2772         (KWQFindSentenceBoundary):
2773         (KWQFindNextSentenceFromIndex):
2774
2775 2005-01-07  Ken Kocienda  <kocienda@apple.com>
2776
2777         Reviewed by Kevin
2778
2779         Fix for these bugs:
2780         
2781         <rdar://problem/3939523> in some cases, text does not retain style info after pressing return twice
2782         <rdar://problem/3944492> after pressing return twice, text is bold when it shouldn't be
2783
2784         * khtml/editing/htmlediting.cpp:
2785         (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion):
2786         Merge the typing style with the computed style for the current position. Fixes both bugs.
2787         * khtml/editing/htmlediting.h:
2788         * layout-tests/editing/inserting/insert-div-023-expected.txt: Added.
2789         * layout-tests/editing/inserting/insert-div-023.html: Added.
2790         * layout-tests/editing/inserting/insert-div-024-expected.txt: Added.
2791         * layout-tests/editing/inserting/insert-div-024.html: Added.
2792
2793 2005-01-07  David Hyatt  <hyatt@apple.com>
2794
2795         Fix for 3941364, make sure tables reset overflowWidth/Height when they lay out again.  Fixes the odd scrolling
2796         behavior on worldofwarcraft.com.
2797         
2798         Reviewed by kevin
2799
2800         * khtml/rendering/render_table.cpp:
2801         (RenderTable::layout):
2802
2803 2005-01-06  David Hyatt  <hyatt@apple.com>
2804
2805         Fix for 3932418 and 3920998, assertion failures caused by stray inline content inside tables.  Bulletproof the hit testing to
2806         ignore inline flows in this case.
2807         
2808         Reviewed by kevin
2809
2810         * khtml/rendering/render_block.cpp:
2811         (khtml::RenderBlock::nodeAtPoint):
2812
2813 2005-01-07  Ken Kocienda  <kocienda@apple.com>
2814
2815         Reviewed by Hyatt
2816
2817         Fix for this bug:
2818         
2819         <rdar://problem/3848412> for forwarded message, tabbing to message view scrolls to bottom of view
2820
2821         * kwq/KWQKHTMLPart.mm:
2822         (KWQKHTMLPart::nextKeyViewInFrame): Don't scroll the focus node to visible if it is not
2823         in the document, or if it is not a descendent of the document element. In the case of the bug,
2824         since the selection has not yet been set up, the focus node passed here is the HTML element, and
2825         that does not yield a rect that is useful to us here. So now, in the case the bug mentions, we do nothing.
2826
2827 2005-01-06  Kevin Decker  <kdecker@apple.com>
2828
2829         Reviewed by mjs.
2830
2831         Fixed: <rdar://problem/3932215> REGRESSION (125-177): iFrame example at developer.apple.com fails in Safari
2832
2833         * khtml/khtml_part.cpp:
2834         (KHTMLPart::processObjectRequest): m_bComplete was never true for frames generated by Javascript due to our synchronous loading and as a result, scheduled redirects wouldn't fire in KHTMLPart::scheduleLocationChange().  By virtue of being an empty document, a document is complete.  In this special case it's safe at this point to call checkCompleted() which sets m_bComplete true. 
2835
2836 === Safari-178 ===
2837
2838 2005-01-06  David Harrison  <harrison@apple.com>
2839
2840         Reviewed by Chris.
2841
2842         (addendum to previous checkin for this bug) 
2843         <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
2844
2845         Fix line navigation.  Add AXUIElementForTextMarker.
2846
2847         * kwq/KWQAccObject.mm:
2848         (-[KWQAccObject accessibilityParameterizedAttributeNames]):
2849         (-[KWQAccObject doAXUIElementForTextMarker:]):
2850         (-[KWQAccObject doAXLineForTextMarker:]):
2851         (-[KWQAccObject doAXTextMarkerRangeForLine:]):
2852         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2853         (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2854         (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
2855         (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
2856
2857 2005-01-06  Darin Adler  <darin@apple.com>
2858
2859         Reviewed by Ken.
2860
2861         - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
2862
2863         (turns out the PLT regression was a false alarm)
2864
2865         * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
2866         the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
2867         much larger number.
2868         * khtml/html/htmlparser.cpp:
2869         (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
2870         sense to just have the array be a member so we don't have to use new and delete on it. Also needed
2871         to eliminate code that used ID_CLOSE_TAG for an array size.
2872         (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
2873         that manages isindex to use deref instead of delete.
2874         (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
2875         mistake of using ID_CLOSE_TAG for the array size too.
2876         (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
2877         there and it would prevent custom tags from working. Added range check before using the forbidden
2878         tag array with the token ID since custom tags will use index values past the end of the array.
2879         (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
2880         inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
2881         createElement call is still here. Last time I left out a few form element types from this switch;
2882         fixed now.
2883         * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
2884         document if getTagID fails; this creates a unique per-document ID.
2885
2886         * khtml/misc/htmltags.c: Regenerated.
2887         * khtml/misc/htmltags.h: Regenerated.
2888
2889         * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
2890         Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
2891         Also rewrote getTagName to work with the new scheme.
2892
2893 2005-01-06  David Harrison  <harrison@apple.com>
2894         
2895         Fixed Panther build.  Also, do not advertize sentence support since it is incomplete.
2896         
2897         * kwq/KWQAccObject.mm:
2898         (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
2899         (-[KWQAccObject accessibilityParameterizedAttributeNames]):
2900         (-[KWQAccObject accessibilityIsAttributeSettable:]):
2901
2902 2005-01-06  David Harrison  <harrison@apple.com>
2903
2904         Reviewed by Dave Hyatt.
2905
2906         <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
2907         <rdar://problem/3588548> AX: tabbing does not work correctly with the screen reader and a focused link; need AXFocusedUIElement to work
2908         
2909         Many more AX attributes supported.  Numerous fixes to previous AX work.
2910         
2911         * khtml/editing/visible_units.cpp:
2912         (khtml::startSentenceBoundary):
2913         (khtml::startOfSentence):
2914         (khtml::endSentenceBoundary):
2915         (khtml::endOfSentence):
2916         (khtml::previousSentencePositionBoundary):
2917         (khtml::previousSentencePosition):
2918         (khtml::nextSentencePositionBoundary):
2919         (khtml::nextSentencePosition):
2920         * khtml/editing/visible_units.h:
2921         * khtml/khtmlview.cpp:
2922         (KHTMLView::layout):
2923         * khtml/misc/helper.cpp:
2924         (khtml::findSentenceBoundary):
2925         (khtml::nextSentenceFromIndex):
2926         * khtml/misc/helper.h:
2927         * khtml/misc/htmltags.c:
2928         (hash_tag):
2929         (findTag):
2930         * khtml/rendering/render_container.cpp:
2931         (RenderContainer::removeChildNode):
2932         (RenderContainer::appendChildNode):
2933         (RenderContainer::insertChildNode):
2934         * khtml/rendering/render_object.cpp:
2935         (RenderObject::remove):
2936         * khtml/xml/dom_docimpl.cpp:
2937         (DocumentImpl::getAccObjectCache):
2938         (DocumentImpl::updateSelection):
2939         (DocumentImpl::close):
2940         (DocumentImpl::setFocusNode):
2941         (DocumentImpl::parentDocument):
2942         (DocumentImpl::topDocument):
2943         * khtml/xml/dom_docimpl.h:
2944         * kwq/KWQAccObject.mm:
2945         (-[KWQAccObject accessibilityShouldUseUniqueId]):
2946         (-[KWQAccObject detach]):
2947         (-[KWQAccObject anchorElement]):
2948         (-[KWQAccObject firstChild]):
2949         (-[KWQAccObject lastChild]):
2950         (-[KWQAccObject previousSibling]):
2951         (-[KWQAccObject nextSibling]):
2952         (-[KWQAccObject parentObject]):
2953         (-[KWQAccObject value]):
2954         (-[KWQAccObject accessibilityAttributeNames]):
2955         (-[KWQAccObject accessibilityPerformAction:]):
2956         (-[KWQAccObject textMarkerForVisiblePosition:]):
2957         (-[KWQAccObject visiblePositionForTextMarker:]):
2958         (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
2959         (-[KWQAccObject topDocument]):
2960         (-[KWQAccObject topRenderer]):
2961         (-[KWQAccObject topView]):
2962         (-[KWQAccObject accessibilityAttributeValue:]):
2963         (-[KWQAccObject accessibilityParameterizedAttributeNames]):
2964         (-[KWQAccObject doAXLineForTextMarker:]):
2965         (-[KWQAccObject doAXTextMarkerRangeForLine:]):
2966         (-[KWQAccObject doAXStringForTextMarkerRange:]):
2967         (-[KWQAccObject doAXTextMarkerForPosition:]):
2968         (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
2969         (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
2970         (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
2971         (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
2972         (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
2973         (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
2974         (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
2975         (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
2976         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2977         (-[KWQAccObject doAXSentenceTextMarkerRangeForTextMarker:]):
2978         (-[KWQAccObject doAXParagraphTextMarkerRangeForTextMarker:]):
2979         (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
2980         (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
2981         (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2982         (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
2983         (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
2984         (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
2985         (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
2986         (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
2987         (-[KWQAccObject doAXLengthForTextMarkerRange:]):
2988         (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
2989         (-[KWQAccObject accessibilityHitTest:]):
2990         (-[KWQAccObject accessibilityFocusedUIElement]):
2991         (-[KWQAccObject accessibilityIsAttributeSettable:]):
2992         (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
2993         (-[KWQAccObject setAccObjectID:]):
2994         (-[KWQAccObject removeAccObjectID]):
2995         * kwq/KWQAccObjectCache.h:
2996         * kwq/KWQAccObjectCache.mm:
2997         (KWQAccObjectCache::setAccObject):
2998         (KWQAccObjectCache::removeAccObject):
2999         (KWQAccObjectCache::visiblePositionForTextMarker):
3000         (KWQAccObjectCache::postNotificationToTopWebArea):
3001         (KWQAccObjectCache::postNotification):
3002         (KWQAccObjectCache::handleFocusedUIElementChanged):
3003         * kwq/KWQKHTMLPart.mm:
3004         (KWQKHTMLPart::respondToChangedContents):
3005         * kwq/KWQTextUtilities.h:
3006         * kwq/KWQTextUtilities.mm:
3007         (KWQFindNextWordFromIndex):
3008         (KWQFindSentenceBoundary):
3009         (KWQFindNextSentenceFromIndex):
3010         * kwq/WebCoreBridge.mm:
3011         (-[WebCoreBridge accessibilityTree]):
3012
3013 2005-01-05  Darin Adler  <darin@apple.com>
3014
3015         Reviewed by Ken.
3016
3017         - re-landing a subset of my custom tag change that does not fix the bug, but also does
3018           not introduce a performance regression
3019
3020         * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
3021         some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
3022
3023         * khtml/editing/htmlediting.cpp:
3024         (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
3025         per-document tags and is just better all around for things like the document.
3026         (khtml::debugNode): Ditto.
3027         * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
3028         * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
3029         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
3030         * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
3031
3032         * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
3033         non-HTML elements to be nested as desired.
3034
3035         * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
3036         * khtml/misc/htmlhashes.cpp:
3037         (khtml::getTagID): Changed return type to unsigned short.
3038         (khtml::getAttrID): Ditto.
3039
3040         * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
3041         * khtml/xml/dom_docimpl.cpp:
3042         (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
3043         Also updated for a few tags that the parser handled but this did not.
3044
3045         * kwq/KWQRenderTreeDebug.cpp:
3046         (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
3047         the tag ID directly, which only works for standard nodes.
3048         (operator<<): Update to call getTagName.
3049         (nodePositionRelativeToRoot): Ditto.
3050         (writeSelection): Ditto.
3051
3052 2005-01-05  Ken Kocienda  <kocienda@apple.com>
3053
3054         Reviewed by Hyatt
3055
3056         Fix for this bug:
3057         
3058         <rdar://problem/3941203> REGRESSION (Mail): Paste inserts content in wrong place
3059
3060         * khtml/editing/htmlediting.cpp:
3061         (khtml::ReplaceSelectionCommand::doApply): Some cleanup and refinement of the concepts used to make
3062         this operation work correctly, particularly in the logic to figure out whether to merge content, and
3063         also performing merges.
3064         * khtml/editing/visible_position.cpp:
3065         (khtml::isFirstVisiblePositionInBlock): Simplification of test used to make this determination.
3066         * khtml/editing/visible_units.cpp:
3067         (khtml::isStartOfParagraph): New helper, used in khtml::ReplaceSelectionCommand::doApply().
3068         (khtml::isEndOfParagraph): Ditto.
3069         * khtml/editing/visible_units.h: Declare new functions.
3070
3071 2005-01-04  Ken Kocienda  <kocienda@apple.com>
3072
3073         Reviewed by John
3074
3075         Fix for this bug:
3076         
3077         <rdar://problem/3926522> Pressing return in a quoted block inserts too many newlines
3078
3079         * khtml/editing/htmlediting.cpp:
3080         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Call to insertBlockPlaceholderIfNeeded()
3081         for the block we are adding was being done at the wrong time, which led to the placeholder remaining
3082         in the document when it was not needed. This resulted in the extra space reported in the bug.
3083
3084 2005-01-04  Kevin Decker  <kdecker@apple.com>
3085
3086         Reviewed by Hyatt.
3087
3088         Fixed: <rdar://problem/3936879> nil-deref, crash in InlineFlowBox::nodeAtPoint closing DHTML menus at hrweb.apple.com
3089
3090         * khtml/rendering/render_block.cpp:
3091         (khtml::RenderBlock::fillInlineSelectionGaps): Added a nil check. If there is no selection, don't try to get the selection's containing block. If we do, we'll crash. 
3092
3093 2005-01-04  David Hyatt  <hyatt@apple.com>
3094
3095         Fix for 3937203, force an update of the dashboard regions when scrollbars are added/removed.
3096         
3097         Reviewed by kevin
3098
3099         * khtml/rendering/render_layer.cpp:
3100         (RenderLayer::updateScrollInfoAfterLayout):
3101
3102 2005-01-04  Ken Kocienda  <kocienda@apple.com>
3103
3104         Reviewed by John
3105
3106         Fix for these two bugs:
3107         
3108         <rdar://problem/3938935> REGRESSION (Mail): Pasting into an empty document mangles content
3109         <rdar://problem/3939148> REGRESSION (Mail): Pasting mistakenly reverses lines
3110
3111         * khtml/editing/htmlediting.cpp:
3112         (khtml::ReplaceSelectionCommand::doApply): For 3938935, add one more case to handle an empty document; merge
3113         neither start nor end. For 3939148, improve the code which adjusts the insertion point during 
3114         the process of pasting. It formerly handled only one of the possible cases.
3115         * layout-tests/editing/pasteboard/paste-text-015-expected.txt: Added.
3116         * layout-tests/editing/pasteboard/paste-text-015.html: Added.
3117
3118 2005-01-04  David Hyatt  <hyatt@apple.com>
3119
3120         Fix for 3936571, placeholder attribute should work for normal inputs for Dashboard.
3121         
3122         Reviewed by john
3123
3124         * khtml/rendering/render_form.cpp:
3125         (RenderLineEdit::updateFromElement):
3126         * kwq/KWQLineEdit.mm:
3127         (QLineEdit::setPlaceholderString):
3128
3129 2005-01-04  David Hyatt  <hyatt@apple.com>
3130
3131         Fix for 3830936, hang on changeforamerica.com.  Make sure to ignore the style not yet available option when
3132         returning pseudo-styles.
3133         
3134         Reviewed by john
3135
3136         * khtml/css/cssstyleselector.cpp:
3137         (khtml::CSSStyleSelector::matchRulesForList):
3138         (khtml::CSSStyleSelector::pseudoStyleForElement):
3139         * khtml/rendering/render_style.cpp:
3140         (RenderStyle::addPseudoStyle):
3141
3142 2005-01-04  Darin Adler  <darin@apple.com>
3143
3144         - rolled out my custom tag name change again -- it caused a 1 ms PLT regression
3145
3146         * khtml/css/cssstyleselector.cpp:
3147         * khtml/editing/htmlediting.cpp:
3148         * khtml/editing/selection.cpp:
3149         * khtml/editing/visible_position.cpp:
3150         * khtml/html/dtd.cpp:
3151         * khtml/html/htmlparser.cpp:
3152         * khtml/html/htmlparser.h:
3153         * khtml/html/htmltokenizer.cpp:
3154         * khtml/misc/htmlhashes.cpp:
3155         * khtml/misc/htmlhashes.h:
3156         * khtml/misc/htmltags.c:
3157         * khtml/misc/htmltags.h:
3158         * khtml/misc/maketags:
3159         * khtml/xml/dom_docimpl.cpp:
3160         * khtml/xml/dom_docimpl.h:
3161         * khtml/xml/dom_nodeimpl.cpp:
3162         * khtml/xml/dom_position.cpp:
3163         * kwq/KWQRenderTreeDebug.cpp:
3164
3165 2005-01-04  Ken Kocienda  <kocienda@apple.com>
3166
3167         Reviewed by John
3168
3169         Fix for this bug:
3170         
3171         <rdar://problem/3927554> Style info applied to remainder of document after a newline is entered
3172
3173         * khtml/editing/htmlediting.cpp:
3174         (khtml::InsertParagraphSeparatorCommand::doApply): Clean up and simplification in code that inserts
3175         a paragraph separator. The bug was all about applying styles to the new paragraph that did not need
3176         to be applied. Now the code will detect when at the end of a style run and will not move and apply 
3177         that ending style to the new paragraph, though it will place that style into the typing style. This
3178         seems to match NSText behavior.
3179         * layout-tests/editing/inserting/insert-div-021-expected.txt: This test result exhibited the bug fixed 
3180         here. The only reason it was not noticed is that the erroneously copied inline was a span, and so did
3181         not have any visible effect on the document.
3182         * layout-tests/editing/inserting/insert-div-022-expected.txt: Added.
3183         * layout-tests/editing/inserting/insert-div-022.html: Added.
3184
3185 2005-01-04  David Hyatt  <hyatt@apple.com>
3186
3187         Fix for 3904562, make sure to clear the outline dictionary when drawing so that random focus rings dont get drawn
3188         all over the place.
3189         
3190         Reviewed by john
3191
3192         * khtml/rendering/render_flow.cpp:
3193         (RenderFlow::paintLines):
3194
3195 2005-01-03  David Hyatt  <hyatt@apple.com>
3196
3197         Fix for float painting regressions 3932524, 3931664, and 3933068.  Make the noPaint flag setting more
3198         robust and make it work regardless of which objects get a layout or not.
3199         
3200         Reviewed by mjs
3201
3202         * khtml/rendering/render_block.cpp:
3203         (khtml::RenderBlock::insertFloatingObject):
3204         (khtml::RenderBlock::addOverhangingFloats):
3205         (khtml::RenderBlock::addIntrudingFloats):
3206         * khtml/rendering/render_block.h:
3207         (khtml::RenderBlock::FloatingObject::FloatingObject):
3208
3209 2005-01-03  Maciej Stachowiak  <mjs@apple.com>
3210
3211         Reviewed by Kevin.
3212
3213         <rdar://problem/3935390> Tiger 8A341: nil deref crash in DOM::NodeImpl::traverseNextNode
3214         
3215         * khtml/html/html_miscimpl.cpp:
3216         (HTMLCollectionImpl::traverseNextItem): Assert that the starting point is not nil,
3217         it should not ever be (now).
3218         (HTMLCollectionImpl::item): When traversing items stop when we hit
3219         nil, meaning the end to avoid triggering above assert (formerly crash).
3220
3221 2005-01-03  Maciej Stachowiak  <mjs@apple.com>
3222
3223         Reviewed by John and Kevin.
3224
3225         <rdar://problem/3870317> REGRESSION(125.9-125.11) broken behavior at test.profoundlearning.com - used to
3226         
3227         * khtml/ecma/kjs_window.cpp:
3228         (Window::get): Look up frame names before buitin window properties
3229         to match other browsers. This regressed because we added a builtin
3230         "toolbar" property but this site had a frame with that name.
3231
3232 2004-12-21  Maciej Stachowiak  <mjs@apple.com>
3233
3234         Reviewed by Darin.
3235
3236         <rdar://problem/3888931> frame naming allows malicious site to bring up a window when you click on a link in another
3237         
3238         Added opener bridge method to help WebKit implement security check
3239         for named frame visibility.
3240         
3241         * khtml/khtml_part.h:
3242         * kwq/WebCoreBridge.h:
3243         * kwq/WebCoreBridge.mm:
3244         (-[WebCoreBridge opener]):
3245
3246 2005-01-03  Ken Kocienda  <kocienda@apple.com>
3247
3248         Reviewed by John
3249
3250         Fix for this bug:
3251         
3252         <rdar://problem/3933926> Tiger8A341: Mail crashes while forwarding embedded HTML message in -[WebCoreBridge ensureSelectionVisible]
3253
3254         * kwq/WebCoreBridge.mm:
3255         (-[WebCoreBridge ensureSelectionVisible]): Put in some null checks to prevent crash experienced in bug.
3256
3257 2005-01-03  David Hyatt  <hyatt@apple.com>
3258
3259         Fix for 3936881, make sure positioned objects prooperly update y-position.
3260         
3261         Reviewed by john
3262
3263         * khtml/rendering/render_block.cpp:
3264         (khtml::RenderBlock::layoutPositionedObjects):
3265
3266 2005-01-03  Ken Kocienda  <kocienda@apple.com>
3267
3268         Reviewed by Harrison
3269         
3270         Fix for this bug:
3271         
3272         <rdar://problem/3928250> REGRESSION (Mail): Typing style lost after hitting return key
3273
3274         * khtml/editing/htmlediting.cpp:
3275         (khtml::InsertLineBreakCommand::preservesTypingStyle): Now implemented, returning yes for this command.
3276         (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Initialize new typing style member variable.
3277         (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Deref new typing style member variable.
3278         (khtml::InsertParagraphSeparatorCommand::preservesTypingStyle): Now implemented, returning yes for this command.
3279         (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion): New function to set the typing style
3280         (khtml::InsertParagraphSeparatorCommand::calculateAndSetTypingStyleAfterInsertion): Function called after the <p>
3281         insertion is done. This function diffs the style created in setFullTypingStyleBeforeInsertion() with the style
3282         of the new <p> and only sets those styles needed to preserve the style in effect before the insertion.
3283         (khtml::InsertParagraphSeparatorCommand::doApply): Call new functions.
3284         (khtml::TypingCommand::preservesTypingStyle): Now yes for inserting line breaks and paragraphs.
3285          * khtml/editing/htmlediting.h: Declare new functions.
3286
3287 2004-12-25  Kevin Decker  <kdecker@apple.com>
3288
3289         Reviewed by Hyatt.
3290
3291         Fixed: <rdar://problem/3505072> hang in KHTMLParser::parseToken (consulting.soroos.net)
3292         
3293         * khtml/html/dtd.cpp: <label> needed a much higher priority such that it will close block elements.  Malformed HTML (ugh) is the only reason why we need to do this. 
3294
3295 2004-12-23  Darin Adler  <darin@apple.com>
3296
3297         Reviewed by Ken.
3298
3299         - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
3300
3301         * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
3302         some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
3303
3304         * khtml/editing/htmlediting.cpp:
3305         (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
3306         per-document tags and is just better all around for things like the document.
3307         (khtml::debugNode): Ditto.
3308         * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
3309         * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
3310         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
3311         * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
3312
3313         * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
3314         non-HTML elements to be nested as desired.
3315
3316         * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
3317         the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
3318         much larger number.
3319         * khtml/html/htmlparser.cpp:
3320         (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
3321         sense to just have the array be a member so we don't have to use new and delete on it. Also needed
3322         to eliminate code that used ID_CLOSE_TAG for an array size.
3323         (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
3324         that manages isindex to use deref instead of delete.
3325         (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
3326         mistake of using ID_CLOSE_TAG for the array size too.
3327         (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
3328         there and it would prevent custom tags from working. Added range check before using the forbidden
3329         tag array with the token ID since custom tags will use index values past the end of the array.
3330         (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
3331         inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
3332         createElement call is still here. Last time I left out a few form element types from this switch;
3333         fixed now.
3334         * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
3335         document if getTagID fails; this creates a unique per-document ID.
3336
3337         * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
3338         * khtml/misc/htmlhashes.cpp:
3339         (khtml::getTagID): Changed return type to unsigned short.
3340         (khtml::getAttrID): Ditto.
3341
3342         * khtml/misc/htmltags.c: Regenerated.
3343         * khtml/misc/htmltags.h: Regenerated.
3344
3345         * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
3346         Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
3347         Also rewrote getTagName to work with the new scheme.
3348
3349         * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
3350         * khtml/xml/dom_docimpl.cpp:
3351         (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
3352         Also updated for a few tags that the parser handled but this did not.
3353
3354         * kwq/KWQRenderTreeDebug.cpp:
3355         (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
3356         the tag ID directly, which only works for standard nodes.
3357         (operator<<): Update to call getTagName.
3358         (nodePositionRelativeToRoot): Ditto.
3359         (writeSelection): Ditto.
3360
3361 === Safari-177 ===
3362
3363 2004-12-22  Darin Adler  <darin@apple.com>
3364
3365         - rolled out my custom tag name change -- it broke amazon.com
3366
3367         * khtml/css/cssstyleselector.cpp:
3368         * khtml/editing/htmlediting.cpp:
3369         * khtml/editing/selection.cpp:
3370         * khtml/editing/visible_position.cpp:
3371         * khtml/html/dtd.cpp:
3372         * khtml/html/htmlparser.cpp:
3373         * khtml/html/htmlparser.h:
3374         * khtml/html/htmltokenizer.cpp:
3375         * khtml/misc/htmlhashes.cpp:
3376         * khtml/misc/htmlhashes.h:
3377         * khtml/misc/htmltags.c:
3378         * khtml/misc/htmltags.h:
3379         * khtml/misc/maketags:
3380         * khtml/xml/dom_docimpl.cpp:
3381         * khtml/xml/dom_docimpl.h:
3382         * khtml/xml/dom_nodeimpl.cpp:
3383         * khtml/xml/dom_position.cpp:
3384         * kwq/KWQRenderTreeDebug.cpp:
3385
3386 2004-12-22  David Harrison  <harrison@apple.com>
3387
3388         Reviewed by Darin Adler.
3389
3390         * khtml/editing/selection.cpp:
3391         (khtml::Selection::validate):
3392         The selecting/deselecting bad behavior is because the Selection code that expands by words
3393         had an inaccurate test for being at the end of the document (where double-clicking needs
3394         to select the last word).  Fixed that check.
3395
3396 2004-12-22  Adele Amchan  <adele@apple.com>
3397
3398         Reviewed by Chris.
3399
3400         Fix for <rdar://problem/3911650> tabs at safeway.com stop working after a while
3401
3402         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scrollToAnchor): removed call to cancelRedirection 
3403           so that we match Firefox and WinIE behavior.
3404
3405 2004-12-22  Darin Adler  <darin@apple.com>
3406
3407         Reviewed by Ken.
3408
3409         - fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
3410
3411         * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
3412         some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
3413
3414         * khtml/editing/htmlediting.cpp:
3415         (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
3416         per-document tags and is just better all around for things like the document.
3417         (khtml::debugNode): Ditto.
3418         * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
3419         * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
3420         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
3421         * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
3422
3423         * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
3424         non-HTML elements to be nested as desired.
3425
3426         * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
3427         the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
3428         much larger number.
3429         * khtml/html/htmlparser.cpp:
3430         (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
3431         sense to just have the array be a member so we don't have to use new and delete on it. Also needed
3432         to eliminate code that used ID_CLOSE_TAG for an array size.
3433         (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
3434         that manages isindex to use deref instead of delete.
3435         (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
3436         mistake of using ID_CLOSE_TAG for the array size too.
3437         (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
3438         there and it would prevent custom tags from working. Added range check before using the forbidden
3439         tag array with the token ID since custom tags will use index values past the end of the array.
3440         (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
3441         inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
3442         createElement call is still here.
3443         * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
3444         document if getTagID fails; this creates a unique per-document ID.
3445
3446         * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
3447         * khtml/misc/htmlhashes.cpp:
3448         (khtml::getTagID): Changed return type to unsigned short.
3449         (khtml::getAttrID): Ditto.
3450
3451         * khtml/misc/htmltags.c: Regenerated.
3452         * khtml/misc/htmltags.h: Regenerated.
3453
3454         * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
3455         Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
3456         Also rewrote getTagName to work with the new scheme.
3457
3458         * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
3459         * khtml/xml/dom_docimpl.cpp:
3460         (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
3461         Also updated for a few tags that the parser handled but this did not.
3462
3463         * kwq/KWQRenderTreeDebug.cpp:
3464         (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
3465         the tag ID directly, which only works for standard nodes.
3466         (operator<<): Update to call getTagName.
3467         (nodePositionRelativeToRoot): Ditto.
3468         (writeSelection): Ditto.
3469
3470 2004-12-21  David Harrison  <harrison@apple.com>
3471
3472         Reviewed by Ken Kocienda.
3473
3474         <rdar://problem/3924934> REGRESSION: double click at end of line selects start of next line
3475
3476         Problem was the TextIterator was not handling exitNode() from a P block properly.
3477         
3478         * khtml/editing/visible_text.cpp:
3479         (khtml::TextIterator::TextIterator):
3480         Add new param that specifies whether the iterator is for content or for searching.
3481         Search iterators do not prevent newlines at the beginning.
3482         (khtml::TextIterator::advance):
3483         Added some comments.
3484         (khtml::TextIterator::handleTextNode):
3485         Added some comments.
3486         (khtml::TextIterator::exitNode):
3487         Emit newline for P (and other) blocks with position following the block, instead of the m_lastTextNode.
3488         (khtml::TextIterator::emitCharacter):
3489         Added some comments.
3490         (khtml::TextIterator::range):
3491         Added some comments.
3492         (khtml::CharacterIterator::CharacterIterator):
3493         Specify search type TextIterator.
3494         (khtml::CharacterIterator::advance):
3495         * khtml/editing/visible_text.h:
3496         (khtml::):
3497         Add new TextIterator::TextIterator param that specifies whether the iterator is for content or for searching.
3498         * khtml/editing/visible_units.cpp:
3499         (khtml::nextWordBoundary):
3500         Specify search type TextIterator.
3501
3502 2004-12-21  David Harrison  <harrison@apple.com>
3503
3504         Reviewed by Ken Kocienda.
3505
3506         <rdar://problem/3924695> REGRESSION (Mail): double-clicking past end of line shows no selection, should select to EOL
3507         
3508         Problem was that RenderText::setSelectionState did not handle the SelectionStart case where start and end are the end of the line.
3509         Fixed by pretending the start == end-1 in that situation, as long as end > 0.
3510         
3511         * khtml/rendering/render_text.cpp:
3512         (RenderText::setSelectionState)
3513
3514 2004-12-21  Maciej Stachowiak  <mjs@apple.com>
3515
3516         Reviewed by John.
3517
3518         <rdar://problem/3929187> WebKit needs to restrict access to certain window operations by domain
3519         
3520         * khtml/ecma/kjs_window.cpp:
3521         (Window::get): Change most window functions to be restricted by
3522         XSS domain check.
3523
3524 2004-12-21  Ken Kocienda  <kocienda@apple.com>
3525
3526         Reviewed by John
3527
3528         Fix for this bug:
3529         
3530         <rdar://problem/3928305> selecting an entire line and typing over causes new inserted text at top of document
3531
3532         * khtml/editing/htmlediting.cpp:
3533         (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent): New function to detect case
3534         formerly undetected and unhandled. This is the crux of the bug fix.
3535         (khtml::DeleteSelectionCommand::doApply): Call insertPlaceholderForAncestorBlockContent() during
3536         execution of command.
3537         * khtml/editing/htmlediting.h: Declare new function.
3538         * layout-tests/editing/deleting/delete-3928305-fix-expected.txt: Added.
3539         * layout-tests/editing/deleting/delete-3928305-fix.html: Added.
3540
3541 2004-12-21  Ken Kocienda  <kocienda@apple.com>
3542
3543         Reviewed by me
3544
3545         * khtml/editing/htmlediting.cpp:
3546         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Note to self: Must compile code before
3547         checking in (aka must return false from function returning bool).
3548
3549 2004-12-21  Ken Kocienda  <kocienda@apple.com>
3550
3551         Reviewed by John
3552         
3553         Fix for this bug:
3554         
3555         <rdar://problem/3927752> Crash in khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded(DOM::NodeImpl*)
3556
3557         * khtml/editing/htmlediting.cpp:
3558         (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Added some null checks.
3559         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Ditto.
3560
3561 2004-12-21  Ken Kocienda  <kocienda@apple.com>
3562
3563         Reviewed by Darin
3564
3565         * khtml/editing/htmlediting.cpp:
3566         (khtml::ReplacementFragment::mergeStartNode): Refine concept of how this node is found based on
3567         further experiements.
3568         (khtml::ReplaceSelectionCommand::doApply): Add a special case for determining merges that need to
3569         be done if the insertion point is in an empty block.
3570         * layout-tests/editing/pasteboard/paste-text-012-expected.txt: Added.
3571         * layout-tests/editing/pasteboard/paste-text-012.html: Added.
3572         * layout-tests/editing/pasteboard/paste-text-013-expected.txt: Added.
3573         * layout-tests/editing/pasteboard/paste-text-013.html: Added.
3574         * layout-tests/editing/pasteboard/paste-text-014-expected.txt: Added.
3575         * layout-tests/editing/pasteboard/paste-text-014.html: Added.
3576
3577 2004-12-21  Darin Adler  <darin@apple.com>
3578
3579         Reviewed by Ken.
3580
3581         - fixed <rdar://problem/3899133> text search in a Safari window takes a very long time on Tiger updates page (and some other pages)
3582
3583         * khtml/editing/visible_text.h: Add an "offset base node" parameter to emitCharacter, and also
3584         add a field to track it. Must make a few things mutable so we can update them in the range accessor.
3585         * khtml/editing/visible_text.cpp:
3586         (khtml::TextIterator::advance): Pass in base node and offsets rather than computing actual offsets
3587         using the node's index. We only compute the node index if actually asked for the range.
3588         (khtml::TextIterator::handleTextNode): Pass 0 for base node and set base node to 0 when setting
3589         up the offsets.
3590         (khtml::TextIterator::handleTextBox): Ditto.
3591         (khtml::TextIterator::handleReplacedElement): Pass base node and set base node instead of calling
3592         nodeIndex.
3593         (khtml::TextIterator::handleNonTextNode): Pass 0 for offset.
3594         (khtml::TextIterator::exitNode): More of the same.
3595         (khtml::TextIterator::emitCharacter): Ditto.
3596         (khtml::TextIterator::range): If an offset base node is stored, then get its node index, and then
3597         add that in to the offsets. Doing the work here guarantees it's done only once when doing a text search.
3598
3599         - another small fix
3600
3601         * khtml/khtml_part.cpp: Removed SPEED_DEBUG define. Not sure why it was on.
3602
3603 === Safari-176 ===
3604
3605 2004-12-20  Ken Kocienda  <kocienda@apple.com>
3606
3607         Reviewed by Darin
3608
3609         * khtml/editing/htmlediting.cpp:
3610         (khtml::DeleteSelectionCommand::moveNodesAfterNode): My one-liner for this bug introduced layout test
3611         regressions: <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
3612         Rolling out until I can develop a real fix.
3613
3614 2004-12-20  David Harrison  <harrison@apple.com>
3615
3616         Reviewed by Dave Hyatt.
3617         
3618         Initial checkin of AXTextMarkerRef support.
3619
3620         * khtml/xml/dom_docimpl.cpp:
3621         (DocumentImpl::updateSelection):
3622         (DocumentImpl::setFocusNode):
3623         * kwq/KWQAccObject.h:
3624         * kwq/KWQAccObject.mm:
3625         (-[KWQAccObject detach]):
3626         (-[KWQAccObject anchorElement]):
3627         (-[KWQAccObject addChildrenToArray:]):
3628         (-[KWQAccObject accessibilityAttributeNames]):
3629         (-[KWQAccObject accessibilityActionDescription:]):
3630         (-[KWQAccObject accessibilityPerformAction:]):
3631         (-[KWQAccObject textMarkerRangeFromMarkers:andEndMarker:]):
3632         (-[KWQAccObject textMarkerForVisiblePosition:]):
3633         (-[KWQAccObject visiblePositionForTextMarker:]):
3634         (-[KWQAccObject AXTextMarkerRangeCopyStartMarkerWrapper:]):
3635         (-[KWQAccObject AXTextMarkerRangeCopyEndMarkerWrapper:]):
3636         (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
3637         (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
3638         (-[KWQAccObject accessibilityAttributeValue:]):
3639         (-[KWQAccObject accessibilityParameterizedAttributeNames]):
3640         (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
3641         (-[KWQAccObject getSelectedTextMarkerRange]):
3642         (-[KWQAccObject doAXLineForTextMarker:]):
3643         (-[KWQAccObject doAXTextMarkerRangeForLine:]):
3644         (-[KWQAccObject doAXStringForTextMarkerRange:]):
3645         (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
3646         (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
3647         (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
3648         (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
3649         (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
3650         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
3651         (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
3652         (-[KWQAccObject accessibilityFocusedUIElement]):
3653         (-[KWQAccObject clearChildren]):
3654         (-[KWQAccObject accObjectID]):
3655         (-[KWQAccObject setAccObjectID:]):
3656         (-[KWQAccObject removeAccObjectID]):
3657         * kwq/KWQAccObjectCache.h:
3658         * kwq/KWQAccObjectCache.mm:
3659         (KWQAccObjectCache::KWQAccObjectCache):
3660         (KWQAccObjectCache::~KWQAccObjectCache):
3661         (KWQAccObjectCache::getAccObjectID):
3662         (KWQAccObjectCache::removeAccObjectID):
3663         (KWQAccObjectCache::textMarkerForVisiblePosition):
3664         (KWQAccObjectCache::visiblePositionForTextMarker):
3665
3666 2004-12-19  Darin Adler  <darin@apple.com>
3667
3668         * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added nil check.
3669
3670 2004-12-19  Darin Adler  <darin@apple.com>
3671
3672         Reviewed by Kevin.
3673
3674         - a garbage collection fix
3675
3676         * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added a more-extensive comment and fixed the BUILDING_ON_PANTHER
3677         #ifndef to use #if (in practice, either is OK).
3678         * kwq/KWQKURL.mm: (KURL::getNSURL): Use KWQCFAutorelease instead of autorelease.
3679
3680 2004-12-17  David Hyatt  <hyatt@apple.com>
3681
3682         Fix for 3923255, specified percentage heights of divs with overflow auto inside tables not honored.
3683         
3684         Reviewed by kocienda
3685
3686         * khtml/rendering/render_box.cpp:
3687         (RenderBox::calcPercentageHeight):
3688         * khtml/rendering/render_table.cpp:
3689         (RenderTableSection::layoutRows):
3690
3691 2004-12-17  David Harrison  <harrison@apple.com>
3692
3693         Reviewed by Ken Kocienda.
3694
3695         <rdar://problem/3924930> REGRESSION: triple click does not select to end of line
3696         
3697         * khtml/editing/visible_units.cpp:
3698         (khtml::endOfParagraph):
3699         When includeLineBreak is true, allow traversal to next node after enclosingBlockFlowElement.
3700
3701 2004-12-17  Ken Kocienda  <kocienda@apple.com>
3702
3703         Reviewed by Vicki
3704
3705         * khtml/editing/htmlediting.cpp:
3706         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Missed deleting some now-obsolete expcetion
3707         codes when I added the createBreakElement() function.
3708
3709 2004-12-17  Richard Williamson   <rjw@apple.com>
3710
3711         Set the floor of max cacheable object size to 40K.  This restores
3712         the long standing floor.  Lower floor deleteriously impacts the PLT.
3713         Reviewed by Hyatt.
3714
3715         * khtml/khtml_part.cpp:
3716         (KHTMLPart::checkCompleted):
3717         * khtml/misc/loader.cpp:
3718         (Cache::setSize):
3719
3720 2004-12-17  Ken Kocienda  <kocienda@apple.com>
3721
3722         Reviewed by Hyatt
3723
3724         Fix for this bug:
3725         
3726         <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
3727
3728         * khtml/editing/htmlediting.cpp:
3729         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Stop merging nodes when a <br> is hit.
3730         Formerly checked only for block boundary.
3731
3732 2004-12-17  David Harrison  <harrison@apple.com>
3733
3734         Reviewed by Darin.
3735
3736                 Add KWQCFAutorelease for autoreleasing CF objects.
3737         * kwq/KWQFoundationExtras.h:
3738         (KWQCFAutorelease):
3739         New.
3740
3741 2004-12-17  David Harrison  <harrison@apple.com>
3742
3743         Reviewed by Darin.
3744
3745                 Fix GC compatibility in getNSString.
3746
3747         * kwq/KWQString.mm:
3748         (QString::getNSString):
3749                 Use NSString allocator instead of CFString, so that autorelease works under GC.
3750
3751 2004-12-17  Ken Kocienda  <kocienda@apple.com>
3752
3753         Reviewed by Hyatt
3754
3755         Fix for this bug:
3756         
3757         <rdar://problem/3890973> REGRESSION (Mail): Deleting reorders remaining text
3758
3759         * khtml/editing/htmlediting.cpp:
3760         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Added check to ensure that moving content will not
3761         move it after the <body> element.
3762
3763 2004-12-17  Ken Kocienda  <kocienda@apple.com>
3764
3765         Reviewed by me
3766         
3767         Added new layout tests covering cases from recent bug fixes.
3768
3769         * layout-tests/editing/inserting/insert-div-018-expected.txt: Added.
3770         * layout-tests/editing/inserting/insert-div-018.html: Added.
3771         * layout-tests/editing/inserting/insert-div-019-expected.txt: Added.
3772         * layout-tests/editing/inserting/insert-div-019.html: Added.
3773         * layout-tests/editing/inserting/insert-div-020-expected.txt: Added.
3774         * layout-tests/editing/inserting/insert-div-020.html: Added.
3775         * layout-tests/editing/inserting/insert-div-021-expected.txt: Added.
3776         * layout-tests/editing/inserting/insert-div-021.html: Added.
3777
3778 2004-12-17  Ken Kocienda  <kocienda@apple.com>
3779
3780         Reviewed by me
3781
3782         Changes in layout resulting from giving <p> elements no margin rather than 0.1em margin.
3783
3784         * layout-tests/editing/inserting/insert-div-013-expected.txt
3785         * layout-tests/editing/inserting/insert-div-014-expected.txt
3786
3787 2004-12-17  Ken Kocienda  <kocienda@apple.com>
3788
3789         Reviewed by John
3790
3791         Fix for this bug:
3792         
3793         <rdar://problem/3925317> Increase quote in email and with cursor below the quote the new line appears above the quote
3794
3795         * khtml/editing/htmlediting.cpp:
3796         (khtml::InsertParagraphSeparatorCommand::doApply):
3797         * khtml/editing/visible_position.cpp: Refine rules for whether to use the starting node or the starting
3798         block as the reference node for the insertion of the new block.
3799         (khtml::isLastVisiblePositionInBlock): Tweak rules again. Descendants of following blocks should answer true.
3800         I worked this all out on the whiteboard this time. This should be the last tweak.
3801
3802 2004-12-17  Kevin Decker  <kdecker@apple.com>
3803
3804         Reviewed by Ken.
3805
3806         Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs
3807
3808         * khtml/xml/xml_tokenizer.cpp:
3809         (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.
3810
3811 2004-12-16  Ken Kocienda  <kocienda@apple.com>
3812
3813         Reviewed by Chris
3814
3815         Fix for this bug:
3816         
3817         <rdar://problem/3924888> REGRESSION (Mail): Hitting return key at end of line does not insert visible newline
3818
3819         * khtml/editing/htmlediting.cpp:
3820         (khtml::InsertParagraphSeparatorCommand::doApply): Tweaked code I added just before to fix 3924486, so that
3821         it checks the downstream node for the starting position.
3822
3823 2004-12-16  Ken Kocienda  <kocienda@apple.com>
3824
3825         Reviewed by Chris
3826
3827         Added new createBreakElement() function that makes creating a <br> element a one-liner.
3828         Converted all the code that used to call the DocumentImpl, and dealt with the exceptionCode,
3829         over to this new helper.
3830
3831         * khtml/editing/htmlediting.cpp:
3832         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Now uses new helper function.
3833         (khtml::InsertLineBreakCommand::doApply): Ditto.
3834         (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
3835         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
3836         (khtml::ReplaceSelectionCommand::doApply): Ditto.
3837         (khtml::createBreakElement): New helper.
3838         * khtml/editing/htmlediting.h: Ditto.
3839
3840 2004-12-16  David Hyatt  <hyatt@apple.com>
3841
3842         Fix a bug where&