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