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