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