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