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