1 2005-05-02 David Harrison <harrison@apple.com>
5 Fix isStartOfEditableContent and isEndOfEditableContent to return actual, rather than inverted, answers.
6 No Radar. Found this when trying to use isEndOfEditableContent() in some new code.
8 * khtml/editing/visible_units.cpp:
9 (khtml::isStartOfEditableContent):
10 (khtml::isEndOfEditableContent):
13 2005-04-29 Darin Adler <darin@apple.com>
15 Reviewed by David Harrison.
17 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Turn newlines into \n for better dumping.
19 2005-04-29 David Harrison <harrison@apple.com>
23 <rdar://problem/4083333> When deleting link at end of sentence, entire sentence gets deleted
25 * khtml/editing/htmlediting.cpp:
26 (khtml::DeleteSelectionCommand::initializePositionData):
27 Work around bug #4103339 (whose real fix is somewhat risky), so this fix can get into a software update.
29 (khtml::DeleteSelectionCommand::handleGeneralDelete):
30 Add isAncestor check when comparing m_downstreamEnd.node() and m_startNode.
32 * layout-tests/editing/deleting/delete-4083333-fix-expected.txt: Added.
33 * layout-tests/editing/deleting/delete-4083333-fix.html: Added.
35 2005-04-29 Darin Adler <darin@apple.com>
37 Reviewed by Dave Harrison.
39 - changed layout tests to dump more minimal information about caret and selection
41 * kwq/KWQRenderTreeDebug.cpp:
42 (nodePosition): Changed name; now does position relative to document.
43 (writeSelection): Removed upstream/downstream code and changed format slightly.
45 * layout-tests/editing/*-expected.txt: Regenerated in new format.
47 2005-04-29 Darin Adler <darin@apple.com>
49 Reviewed by Chris Blumenberg.
50 Added two layout tests for regression testing.
52 - fixed <rdar://problem/4097849> REGRESSION (162-163): importNode creates non-HTML elements, thus style attributes (and some others) don't work
54 * khtml/xml/dom_docimpl.cpp:
55 (DocumentImpl::importNode): Reorganized and partly rewrote this. The change that fixes the bug at
56 hand is to explicitly use XHTML_NAMESPACE for HTML elements, since the old way of getting the namespace
57 will return the null string for HTML elements, and createElementNS will not create an HTML element
58 if passed a null string for the namespace.
59 (DocumentImpl::processHttpEquiv): Removed some bogus getDocument() calls -- no need to call getDocument()
61 (DocumentImpl::attrName): Ditto.
62 (DocumentImpl::tagName): Ditto.
63 (DocumentImpl::setFocusNode): Ditto.
65 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::cloneNode): Moved the actual cloning here
66 from ElementImpl::cloneNode, because XMLElementImpl already had its own version, and in here
67 we can use createHTMLElement, which will work properly even in an XML document, and is also slightly
70 * khtml/xml/dom_nodeimpl.h: Added a namespaceURI method function to go along with localName.
71 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::namespaceURI): Added. Returns null string to be consistent
72 with localName (only works on certain types of elements as documented).
73 * khtml/xml/dom_elementimpl.h: Removed ElementImpl::cloneNode (see above). Added an override of
74 namespaceURI for XMLElementImpl.
75 * khtml/xml/dom_elementimpl.cpp: (XMLElementImpl::namespaceURI): Added. Returns the namespace
76 (consistent with localName).
78 * layout-tests/fast/dom/importNodeHTML.html: Added. Tests both importNode and cloneNode (for comparison).
79 * layout-tests/fast/dom/importNodeHTML-expected.txt: Added.
80 * layout-tests/fast/dom/importNodeXML.xhtml: Added. XML version of the same test as above. Tests a different
81 code path, so useful to have.
82 * layout-tests/fast/dom/importNodeXML-expected.txt: Added.
84 2005-04-28 Darin Adler <darin@apple.com>
86 Reviewed by Dave Harrison.
88 - fixed problems preventing us from compiling with gcc 4.0
90 * WebCore.pbproj/project.pbxproj: Removed -fobjc-exceptions because I can't figure out an easy
91 way to pass it only when compiling Objective-C/C++. Removed -Wmissing-prototypes from
92 WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
94 * khtml/css/parser.y: Changed some rules that were using a float to pass around an enum to use an
95 int instead to avoid a warning.
96 * khtml/css/parser.cpp: Regenerated.
97 * khtml/css/parser.h: Regenerated.
99 * khtml/ecma/kjs_dom.cpp: (DOMTextProtoFunc::tryCall): Rearranged a return statement to avoid an incorrect
101 * khtml/ecma/kjs_html.cpp: (KJS::Context2DFunction::tryCall): Initialized a couple of variables to avoid
102 an incorrect warning.
103 * khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::evaluate): Rearranged how we exit from the function to avoid
105 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Changed some %d to %ld where the
106 parameters where long ints.
107 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
108 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
109 * kwq/DOMEvents.mm: (-[DOMMouseEvent initMouseEvent:::::::::::::::]): Rearranged code to avoid a cast
110 that was causing an incorrect warning.
112 (createObjCDOMNode): Broke out as a separate function.
113 (KJS::ScriptInterpreter::createObjcInstanceForValue): Rearranged code to avoid a namespace collision with
114 KJS::DOMNode and the Objective-C DOMNode class.
115 * kwq/KWQFileButton.mm: Made fields of KWQFileButtonAdapter public to avoid an error, new to gcc 4.0,
116 about accessing protected Objective-C fields.
117 * kwq/KWQKHTMLPart.mm:
118 (KWQKHTMLPart::matchLabelsAgainstElement): Rearranged a return statement to avoid an incorrect warning.
119 (KWQKHTMLPart::imageFromRect): Rearranged how this function does its exception handling to avoid a
120 "may be clobbered" warning.
121 * kwq/KWQKJavaAppletWidget.mm: Fixed incorrect import that said "KHTMLView.h" instead of "khtmlview.h".
122 * kwq/KWQObject.mm: Made fields of KWQObjectTimerTarget public to avoid an error, new to gcc 4.0,
123 about accessing protected Objective-C fields.
124 * kwq/WebCoreBridge.mm: (partHasSelection): Used [bridge part] instead of getting directly at instance
125 variable to avoid an error, new to gcc 4.0, about accessing protected Objective-C fields.
127 * WebCore-combined.exp: Regenerated.
128 * WebCore-tests.exp: Added some additional symbols needed by the tests under gcc 4.0.
130 2005-04-28 Darin Adler <darin@apple.com>
132 * WebCore.pbproj/project.pbxproj: Add back the main_thread_malloc files, rolled out by accident.
134 2005-04-27 Adele Peterson <adele@apple.com>
136 Rolling out fix for <rdar://problem/4097849> because the following layout tests were failing:
138 fast/css/namespaces/001
139 fast/css/namespaces/002
140 fast/css/namespaces/004
141 fast/css/namespaces/005
142 fast/css/namespaces/006
146 * khtml/html/html_documentimpl.cpp:
147 * khtml/html/html_documentimpl.h:
148 * khtml/html/html_elementimpl.cpp:
149 (HTMLElementImpl::namespaceURI):
150 * khtml/xml/dom_docimpl.cpp:
151 (DocumentImpl::importNode):
152 (DocumentImpl::createElementNS):
153 (DocumentImpl::createHTMLElement):
154 (DocumentImpl::attrId):
155 (DocumentImpl::tagId):
156 * khtml/xml/dom_docimpl.h:
158 2005-04-27 John Sullivan <sullivan@apple.com>
162 Experimental prototype of user-resizable textareas. All the new code is guarded by
163 #if ALLOW_RESIZING_TEXTAREAS, which is false unless you remove a comment and rebuild.
165 This code allows you to press near the bottom-right corner of any textarea and drag
166 to resize the textarea on the page. It works correctly with textareas in left-aligned
167 or centered blocks, but is weird in right-aligned blocks. It also does something
168 sensible if the width is specified as a % (in that case, you can resize vertically only).
169 The user-created-size survives resizing the window and survives the back/forward cache.
170 It does not survive reloading the page.
172 This complete-lack-of-affordance UI is obviously not shippable, but this proof of concept
173 code could lead to a real user feature.
175 * kwq/KWQTextArea.mm:
176 (-[KWQTextArea getNumColumns:andNumRows:forSize:]):
177 new method that determines cols and rows for a given textarea frame size
178 (-[KWQTextAreaTextView _trackResizeFromMouseDown:]):
179 new method that tracks a drag and does a live resize-and-relayout
180 (-[KWQTextAreaTextView mouseDown:]):
181 if the mouse down is in the bottom-right corner, call _trackResizeFromMouseDown:
183 2005-04-27 John Sullivan <sullivan@apple.com>
187 - fixed problem with mouse wheel patch where alt and shift keys were switched
189 * khtml/xml/dom2_eventsimpl.h:
190 use the order cntl, alt, shift, meta in KeyboardEventImpl constructors to match
191 superclass. This isn't necessary to fix the bug, but is better for clarity.
193 * khtml/xml/dom2_eventsimpl.cpp:
194 (KeyboardEventImpl::KeyboardEventImpl):
195 switch parameter order to match superclass. Then pass the parameters to superclass's
196 constructor in the right order.
197 (KeyboardEventImpl::initKeyboardEvent):
198 Pass parameters to superclass's constructor in the right order.
200 2005-04-26 Adele Peterson <adele@apple.com>
202 Fixed by Darin, reviewed by me.
204 Fix for <rdar://problem/4084029> designMode doesn't allow editing when iframe src = "" or = about:blank
206 This change will add an HTML element for empty documents. Now that there will be an HTMLDocument in this case,
207 a body will also be created (see rdar://problem/3758785). This was preventing frames with empty documents from
210 * khtml/html/htmlparser.cpp: (KHTMLParser::finished):
212 Updated these tests to expect the HTML and BODY elements
213 * layout-tests/fast/flexbox/016-expected.txt:
214 * layout-tests/fast/frames/001-expected.txt:
215 * layout-tests/fast/frames/002-expected.txt:
216 * layout-tests/fast/frames/contentWindow_Frame-expected.txt:
217 * layout-tests/fast/frames/contentWindow_iFrame-expected.txt:
218 * layout-tests/fast/frames/empty-frame-src-expected.txt:
220 2005-04-26 Maciej Stachowiak <mjs@apple.com>
222 New test case for <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
224 * layout-tests/fast/js/string-from-char-code-expected.txt: Added.
225 * layout-tests/fast/js/string-from-char-code.html: Added.
227 2005-04-26 Darin Adler <darin@apple.com>
231 - fixed <rdar://problem/3655817> please add support for mouse wheel events and the onmousewheel handler
235 - need to test behavior of Windows IE with horizontal scroll wheeling; we currently send a distinct event
236 for that relatively obscure case, which means the event handlers won't fire at all; might be incorrect
237 - overflow scrolling is done after all DOM event handling, but ideally should be done in the overflowing
238 element's default event handler; not important in practice
239 - frame scrolling is done after all DOM event handling, but probably should be done in a default event handler;
240 not sure about this, but it's probably not important in practice and definitely not required
244 * khtml/ecma/kjs_events.h: Added DOMWheelEvent.
245 * khtml/ecma/kjs_events.cpp:
246 (KJS::getDOMEvent): Added a case for wheel event. To be forward looking, I use the event's impl pointer
247 instead of a C++ DOM wrapper. Eventually it will all work this way.
248 (offsetFromTarget): Added. Factored out code to compute offsetX/Y for an event.
249 (DOMMouseEvent::getValueProperty): Changed to call offsetFromTarget for offsetX/Y.
250 (DOMWheelEvent::DOMWheelEvent): Added.
251 (DOMWheelEvent::tryGet): Added.
252 (DOMWheelEvent::getValueProperty): Added.
253 (DOMWheelEventProtoFunc::tryCall): Added. Nothing at the moment, but might get contents later.
255 * khtml/ecma/kjs_dom.h: Added OnMouseWheel to the enum with the list of properties.
256 * khtml/ecma/kjs_dom.cpp: Added onmousewheel as a property of DOM nodes.
257 (DOMNode::getValueProperty): Return the mouse wheel event handler.
258 (DOMNode::putValue): Set the mouse wheel event handler.
260 * khtml/ecma/kjs_window.cpp: Added onmousewheel as a property of the window.
261 (Window::get): Return the mouse wheel event handler.
262 (Window::put): Set the mouse wheel event handler.
264 * khtml/ecma/kjs_window.h: Added OnWindowMouseWheel to the enum with the list of properties.
265 (Other properties distinguish the window handler by lower-casing the initial letter, way too subtle,
266 so I did this one a good way.)
268 * khtml/dom/dom2_events.h: Made the constructors for Event and UIEvent public. There's no good reason
269 for them to be private, and I had to use the UIEvent one in the JavaScript implementation.
273 * khtml/xml/dom2_eventsimpl.h: Added events for mouse wheel and horizontal mouse wheel.
274 Added isWheelEvent function to EventImpl.
275 (DOM::UIEventWithKeyStateImpl): Added. Base class shared by mouse, wheel, and keyboard events.
276 (DOM::MouseRelatedEventImpl): Added. Base class shared by mouse and wheel events.
277 (DOM::WheelEventImpl): Added.
279 * khtml/xml/dom2_eventsimpl.cpp: Added "mousewheel" to list of event names and a placeholder for
280 the horizontal mouse wheel.
281 (EventImpl::isWheelEvent): Added. Returns false.
282 (MouseRelatedEventImpl::MouseRelatedEventImpl): Added. Factored out what's shared between mouse
283 events and wheel events to avoid duplicated code.
284 (MouseRelatedEventImpl::computeLayerPos): Moved to MouseRelatedWheelEventImpl.
285 (MouseEventImpl::MouseEventImpl): Changed since MouseRelatedWheelEventImpl is now the base class
286 so we can share more code with wheel events.
287 (KeyboardEventImpl::KeyboardEventImpl): Changed since UIEventWithKeyStateImpl is now the base class
288 so we can share more code with mouse and wheel events.
289 (WheelEventImpl::WheelEventImpl): Added.
290 (WheelEventImpl::isWheelEvent): Added. Returns true.
292 * khtml/misc/htmlattrs.in: Added "onmousewheel" attribute name.
293 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Added parsing of the
294 "onmousewheel" atribute, consistent with other event handler attributes.
298 * kwq/WebCoreBridge.h: Renamed scrollOverflowWithScrollWheelEvent to sendScrollWheelEvent.
299 * kwq/WebCoreBridge.mm: (-[WebCoreBridge sendScrollWheelEvent:]): Renamed.
301 * kwq/KWQEvent.h: Added Wheel as an event type value.
302 (QWheelEvent::QWheelEvent): Added.
304 (positionForEvent): Updated to know that wheel events have valid positions in them.
305 (orientationForEvent): Added.
306 (deltaForEvent): Added.
307 (QWheelEvent::QWheelEvent): Added.
309 * kwq/KWQKHTMLPart.h: Renamed scrollOverflowWithScrollWheelEvent to wheelEvent.
310 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::wheelEvent): Renamed and added code to construct a QWheelEvent
311 and send it along to KHTMLView::viewportWheelEvent, consistent with how mouse events work.
313 * khtml/khtmlview.cpp: (KHTMLView::viewportWheelEvent): Do a hit test to figure out which node to
314 send the event to, and then call dispatchWheelEvent.
316 * khtml/xml/dom_nodeimpl.h: Added dispatchWheelEvent.
317 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchWheelEvent): Added.
321 * khtml/ecma/kjs_dom.lut.h: Regenerated.
322 * khtml/ecma/kjs_events.lut.h: Regenerated.
323 * khtml/ecma/kjs_window.lut.h: Regenerated.
324 * khtml/misc/htmlattrs.c: Regenerated.
325 * khtml/misc/htmlattrs.h: Regenerated.
327 2005-04-26 David Harrison <harrison@apple.com>
329 Reviewed by Darin, Maciej.
331 <rdar://problem/4075576> Deleting text in new message borks content
333 Fixed by removing the methods that attempted to preserve the position. The idea
334 of preserving position is a very recent one, and turned out to not actually address
335 the problem it was intended to fix (see below). Further, is unclear how the position
336 could be preserved in a form that could be properly used later on. Therefore,
337 removing the code to work like before is the preferred alternative for this software
338 update. I've written <rdar://problem/4099839> to cover the bug that position
339 preservation was supposed to fix (but did not). Added layout tests for
340 both this bug and 4099839. Also, updated existing tests with correct expected results
341 (delete-at-paragraph-boundaries-003 and 004).
343 * khtml/editing/htmlediting.cpp:
344 (khtml::CompositeEditCommand::removeFullySelectedNode):
345 (khtml::CompositeEditCommand::removeChildrenInRange):
346 (khtml::DeleteSelectionCommand::handleGeneralDelete):
347 * khtml/editing/htmlediting.h:
348 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
349 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
350 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-007-expected.txt: Added.
351 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-007.html: Added.
352 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-008-expected.txt: Added.
353 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-008.html: Added.
354 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-009-expected.txt: Added.
355 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-009.html: Added.
356 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-010-expected.txt: Added.
357 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-010.html: Added.
359 2005-04-26 Darin Adler <darin@apple.com>
361 - fixed development builds
363 * khtml/misc/main_thread_malloc.h: Use inlines instead of macros for allocation functions.
365 2005-04-25 David Hyatt <hyatt@apple.com>
367 Fix for 4097842, changing 1st line of a url that wraps doesn't update the second line. Make sure to
368 update line break info for the last dirty line so that when a clean line tries to figure out where it
369 started, it will get an accurate position taking into account the updated string. By doing this, the code
370 will be able to properly distinguish between the old and new positions and not accidentally assume they are
375 * khtml/rendering/render_text.cpp:
376 (RenderText::setTextWithOffset):
378 2005-04-26 Darin Adler <darin@apple.com>
382 - fixed <rdar://problem/4098826> Bezier curves broken in new Safari canvas object (last two parameters parsed incorrectly)
384 * khtml/ecma/kjs_html.cpp: (KJS::Context2DFunction::tryCall): Fixed incorrect argument indices.
385 Thanks to Brian Campbell who figured out what was wrong.
387 2005-04-17 Maciej Stachowiak <mjs@apple.com>
391 - use single-threaded malloc in places where malloc is hot for an
392 8% speed improvement on cvs-base
394 * ForwardingHeaders/misc/fast_malloc.h: Added.
395 * WebCore.pbproj/project.pbxproj:
396 * khtml/css/css_base.h:
397 * khtml/css/css_ruleimpl.h:
398 * khtml/css/css_valueimpl.h:
399 * khtml/css/cssstyleselector.h:
400 * khtml/misc/arena.cpp:
404 * khtml/misc/main_thread_malloc.cpp: Added.
405 * khtml/misc/main_thread_malloc.h: Added.
406 * khtml/rendering/render_style.h:
407 * khtml/xml/dom2_eventsimpl.h:
408 * khtml/xml/dom2_rangeimpl.h:
409 * khtml/xml/dom2_traversalimpl.h:
410 * khtml/xml/dom2_viewsimpl.h:
411 * khtml/xml/dom_docimpl.h:
412 * khtml/xml/dom_elementimpl.cpp:
413 (NamedAttrMapImpl::NamedAttrMapImpl):
414 (NamedAttrMapImpl::clearAttributes):
415 (NamedAttrMapImpl::operator=):
416 (NamedAttrMapImpl::addAttribute):
417 (NamedAttrMapImpl::removeAttribute):
418 * khtml/xml/dom_elementimpl.h:
419 * khtml/xml/dom_nodeimpl.h:
420 * khtml/xml/dom_stringimpl.h:
421 * kwq/KWQFontFamily.h:
422 * kwq/KWQListImpl.mm:
427 (QString::setBufferFromCFString):
430 2005-04-25 John Sullivan <sullivan@apple.com>
432 Reviewed by Dave Harrison.
434 - fixed <rdar://problem/4098731> [DOMHTMLTextAreaElement cols] returns wrong value (usually zero)
437 (-[DOMHTMLTextAreaElement cols]):
438 use ATTR_COLS instead of ATTR_ACCESSKEY (D'oh!)
439 (-[DOMHTMLTextAreaElement setCols:]):
442 2005-04-25 Darin Adler <darin@apple.com>
446 - fixed <rdar://problem/4097849> REGRESSION (162-163): importNode creates non-HTML elements, thus style attributes (and some others) don't work
448 * khtml/xml/dom_docimpl.h: Add virtual functions HTMLElementNamespace and isHTMLNamespace.
449 * khtml/xml/dom_docimpl.cpp:
450 (DocumentImpl::importNode): Rearranged this function and fixed the following problems: 1) made sure to ref node while attributes are
451 being set on it so it doesn't get destroyed; 2) fixed code to get namespace from the element we are importing to use the IDs from
452 the source document, not the destination document; 3) removed unneeded getDocument() call which just returns this; 4) fixed error
453 handling for cases where an exception happens while processing the children.
454 (DocumentImpl::HTMLElementNamespace): Added. Returns XHTML_NAMESPACE.
455 (DocumentImpl::isHTMLNamespace): Added. Returns true for any namespace that matches XHTML_NAMESPACE (case insensitive).
456 (DocumentImpl::createElementNS): Changed to call isHTMLNamespace, which will cause it to accept the null namespace in an HTML document.
457 This is the change that fixes the bug. Also fixed the code path to do a little less wasteful work in the non-XHTML case.
458 (DocumentImpl::createHTMLElement): Pass in HTMLElementNamespace() rather than 0 to tagId.
459 (DocumentImpl::attrId): Use isHTMLNamespace instead of allowing the null namespace explicitly.
460 (DocumentImpl::tagId): Ditto.
462 * khtml/html/html_documentimpl.h: Add overrides for HTMLElementNamespace and isHTMLNamespace.
463 * khtml/html/html_documentimpl.cpp:
464 (HTMLDocumentImpl::HTMLElementNamespace): Added. Returns 0 so we use the null string for HTML elements inside HTML documents (as before).
465 (HTMLDocumentImpl::isHTMLNamespace): Added. Allows 0, and then calls base class to check for the actual XHTML namespace. Thus, we allow
466 both no namespace at all and the XHTML namespace inside HTML documents.
468 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::namespaceURI): Changed to call HTMLElementNamespace rather than checking
469 isHTMLDocument. Same result as before, but better division of responsibilities.
471 2005-04-25 Darin Adler <darin@apple.com>
475 - fixed <rdar://problem/4091956> JavaScript drop handlers don't receive more than one dropped item
477 * kwq/KWQClipboard.mm:
478 (cocoaTypeFromMIMEType): Remove some use of compare -- less efficient than a simpler "==" check.
479 Fixed non-GC-safe code to use KWQCFAutorelease instead.
480 (MIMETypeFromCocoaType): Use fromCFString instead of fromNSString to avoid a cast.
481 (KWQClipboard::getData): Rearrange so that we'll use filenames if both filenames and a URL are present, since
482 filenames can accomodate multiple items. Fix bug where we'd return multiple filenames when the type requested
483 is "URL". Fixed loop that computed the count over and over again for the loop termination condition. Check
484 that the data for NSFilenamesPboardType is an NSArray instead of assuming it is.
485 (KWQClipboard::setData): Use isEqualToString: instead of == when comparing types.
487 2005-04-22 David Hyatt <hyatt@apple.com>
489 Fix for 4096878, drop shadow effect not displayed correctly on tbray.org/ongoing/. Block minmaxwidth was
490 broken when negative margins were used and did not properly decrease the max width.
494 * khtml/rendering/render_block.cpp:
495 (khtml::RenderBlock::calcBlockMinMaxWidth):
496 * layout-tests/fast/block/float/034-expected.txt: Added.
497 * layout-tests/fast/block/float/034.html: Added.
498 * layout-tests/fast/block/float/035-expected.txt: Added.
499 * layout-tests/fast/block/float/035.html: Added.
501 2005-04-22 David Hyatt <hyatt@apple.com>
503 Remove some dead code from css_valueimpl. It wasn't used at all.
505 * khtml/css/css_valueimpl.cpp:
506 * khtml/css/css_valueimpl.h:
508 2005-04-22 Darin Adler <darin@apple.com>
510 * khtml/ecma/kjs_html.h: Removed unnecessary bogus class name qualifiers.
512 2005-04-22 David Hyatt <hyatt@apple.com>
514 Fix for 4096681, fix regression in how the list-style property is parsed. It no longer parses when it hits
515 a url in the property value list now, because the list pointer did not get advanced. This fixes alistapart.com.
519 * khtml/css/cssparser.cpp:
520 (CSSParser::parseValue):
521 * layout-tests/fast/lists/009-expected.txt: Added.
522 * layout-tests/fast/lists/009.html: Added.
523 * layout-tests/fast/lists/resources/listmark.gif: Added.
525 2005-04-22 Darin Adler <darin@apple.com>
529 - fixed <rdar://problem/4091082> Google Suggest no longer works due to lack of "frameElement"
531 * khtml/ecma/kjs_window.h: Added FrameElement.
532 * khtml/ecma/kjs_window.cpp: (Window::get): Added "frameElement".
533 * khtml/ecma/kjs_window.lut.h: Regenerated.
535 2005-04-22 Darin Adler <darin@apple.com>
539 - a small editing-related code cleanup
541 * khtml/rendering/render_text.h: Added positionForOffset and made offsetForPosition const.
542 * khtml/rendering/render_text.cpp:
543 (InlineTextBox::offsetForPosition): Made const.
544 (InlineTextBox::positionForOffset): Added. Moved code here from caretRect.
545 (RenderText::caretRect): Call positionForOffset instead of doing the work here.
547 2005-04-21 David Hyatt <hyatt@apple.com>
549 Fix for 4095839, wrong background image used on flechtwerk.de. Make sure that the global mapped
550 attribute cache hashed background attributes into per-document buckets.
552 * khtml/html/html_baseimpl.cpp:
553 (HTMLBodyElementImpl::mapToEntry):
554 * khtml/html/html_elementimpl.h:
556 * khtml/html/html_tableimpl.cpp:
557 (HTMLTableElementImpl::mapToEntry):
558 (HTMLTablePartElementImpl::mapToEntry):
559 * khtml/xml/dom_docimpl.cpp:
560 (DocumentImpl::DocumentImpl):
561 * khtml/xml/dom_docimpl.h:
562 (DOM::DocumentImpl::docID):
564 2005-04-21 Vicki Murley <vicki@apple.com>
566 - layout test for 4065447, outerHTML on images
568 * layout-tests/fast/dynamic/outerHTML-img-expected.txt: Added.
569 * layout-tests/fast/dynamic/outerHTML-img.html: Added.
571 2005-04-20 Vicki Murley <vicki@apple.com>
575 - fixed <rdar://problem/4065447> support outerHTML on IMG elements
577 * khtml/html/html_elementimpl.cpp:
578 (HTMLElementImpl::setOuterHTML):
580 2005-04-18 David Hyatt <hyatt@apple.com>
582 Fix min-height so that when it resolves to auto it does not use the box's intrinsic height.
584 * khtml/rendering/render_box.cpp:
585 (RenderBox::calcHeight):
586 (RenderBox::calcHeightUsing):
588 2005-04-18 David Hyatt <hyatt@apple.com>
590 Back out fix for 4032346, since it is causing garbled image content on many sites.
592 The bug tracking the fix is 4069093.
594 (khtml::RenderBlock::matchedEndLine):
596 2005-04-18 David Hyatt <hyatt@apple.com>
598 Fix the smile in the Acid2 test. Floats should not grow to contain other floats unless height is auto. Otherwise
599 the float should use the specified height.
601 Also fix row 14 of the Acid2 test. Although ambiguous, just modify the table cell baseline alignment code to align
602 to the bottom of the cell's content height if no suitable baseline could be found.
604 * khtml/rendering/render_block.cpp:
605 (khtml::RenderBlock::layoutBlock):
606 * khtml/rendering/render_block.h:
607 (khtml::RenderBlock::firstRootBox):
608 (khtml::RenderBlock::lastRootBox):
609 * khtml/rendering/render_table.cpp:
610 (RenderTableSection::calcRowHeight):
611 (RenderTableCell::baselinePosition):
613 2005-04-15 David Hyatt <hyatt@apple.com>
615 Make sure empty tables honor CSS-specified heights when they have no rows or sections. This is done only
616 in strict mode, since it is not compatible with WinIE.
618 * khtml/rendering/render_table.cpp:
619 (RenderTable::layout):
621 2005-04-15 David Hyatt <hyatt@apple.com>
623 Fix for row 13 of the Acid2 test. Change HTML comment parsing in strict mode to do proper SGML parsing,
624 checking for pairs of -- and only being willing to close the comment if every -- is paired up.
626 * khtml/html/htmltokenizer.cpp:
627 (khtml::HTMLTokenizer::parseComment):
629 2005-04-12 Maciej Stachowiak <mjs@apple.com>
633 - use custom single-threaded malloc for all non-GC JavaScriptCore
634 allocations, for a 9.1% speedup on JavaScript iBench
636 * khtml/ecma/kjs_binding.cpp:
638 * khtml/ecma/kjs_proxy.cpp:
639 (KJSProxyImpl::evaluate):
641 2005-04-15 David Hyatt <hyatt@apple.com>
643 Fix the six pixel gap between rows nine and ten of the Acid2 test. Make sure that percentage heights that
644 resolve to auto are properly treated as though they have auto height by the self-collapsing block check (as per
645 section 8.3.1, paragraph 7 of the CSS2.1 spec).
647 * khtml/rendering/render_block.cpp:
648 (khtml::RenderBlock::isSelfCollapsingBlock):
650 2005-04-15 David Hyatt <hyatt@apple.com>
652 The Acid2 test and the reference rendering both make use of overflow:hidden on the <html> element. Turns out
653 the CSS2.1 wording for this behavior has been revised (based off WinIE/Mozilla behavior). Change our behavior
654 to match and make <html> overflow apply to the viewport.
656 * khtml/khtmlview.cpp:
657 (KHTMLView::applyOverflowToViewport):
660 * khtml/rendering/render_box.cpp:
661 (RenderBox::setStyle):
663 2005-04-14 David Hyatt <hyatt@apple.com>
665 3258403 and 3258402 can now be fixed. min/max-width/height support is now complete. This patch makes them
666 work for positioned elements and enables us to pass row one of the Acid2 test.
668 * khtml/rendering/render_box.cpp:
669 (RenderBox::calcAbsoluteHorizontal):
670 (RenderBox::calcAbsoluteHorizontalValues):
671 (RenderBox::calcAbsoluteVertical):
672 (RenderBox::calcAbsoluteVerticalValues):
673 * khtml/rendering/render_box.h:
675 2005-04-12 David Hyatt <hyatt@apple.com>
677 Working on the Acid2 test, Row 1.
679 Improve checkChild for the DTD so that it knows what mode a document is in. This allows it to adhere more
680 strictly to the actual DTD in strict mode and almost strict mode.
682 Change the <table>-inside-<p> check so that <table> is disallowed inside <p> in
683 strict mode and almost strict mode. This matches Firefox behavior, which allows <table>
684 inside <p> only in quirks mode.
686 * khtml/html/dtd.cpp:
689 * khtml/html/htmlparser.cpp:
690 (KHTMLParser::insertNode):
691 * khtml/html/htmltokenizer.cpp:
692 (khtml::HTMLTokenizer::parseTag):
693 * khtml/xml/dom_elementimpl.cpp:
694 (ElementImpl::childAllowed):
696 2005-04-12 Vicki Murley <vicki@apple.com>
700 - fixed <rdar://problem/3760895> Request for including an implementation of the elementFromPoint function
702 * khtml/dom/dom_doc.cpp:
703 (DOM::Document::elementFromPoint):
704 * khtml/dom/dom_doc.h:
705 * khtml/ecma/kjs_dom.cpp:
706 (DOMDocumentProtoFunc::tryCall):
707 * khtml/ecma/kjs_dom.h:
708 (KJS::DOMDocument::):
709 * khtml/ecma/kjs_dom.lut.h:
711 * khtml/xml/dom_docimpl.cpp:
712 (DocumentImpl::elementFromPoint):
713 * khtml/xml/dom_docimpl.h:
715 2005-04-12 David Hyatt <hyatt@apple.com>
717 Beginning of work to support the Acid2 CSS test put forward by the Web Standards Project. Fix
718 our handling of the rel attribute on <link> elements to do a proper tokenization so that stylesheets
719 can be recognized even when other keywords are present in the rel attribute.
721 * khtml/html/html_headimpl.cpp:
722 (HTMLLinkElementImpl::HTMLLinkElementImpl):
723 (HTMLLinkElementImpl::parseHTMLAttribute):
724 (HTMLLinkElementImpl::tokenizeRelAttribute):
725 (HTMLLinkElementImpl::process):
726 * khtml/html/html_headimpl.h:
728 2005-04-12 John Sullivan <sullivan@apple.com>
730 - fixed these two bugs (I also fixed these on the experimental-ui-branch)
731 <rdar://problem/3154293> Find Next should not scroll page if the next target is already visible
732 <rdar://problem/3121828> scrollToVisible on find cuts off the left part of the view due to needless horiz. scroll
736 * kwq/KWQKHTMLPart.mm:
737 (KWQKHTMLPart::jumpToSelection):
738 Trey had written code to address these issues, but left it commented out due to other
739 problems. The other problems no longer occur, so I uncommented Trey's code, and then
740 discovered that I could make it behave more like TextEdit with many fewer lines of
743 2005-04-08 David Harrison <harrison@apple.com>
745 Reviewed by Dave Hyatt.
747 <rdar://problem/4084106> Remove NSAccessibilityForegroundColorTextAttributeWrapper
749 * kwq/KWQAccObject.mm:
750 (AXAttributeStringSetStyle):
751 Use NSAccessibilityForegroundColorTextAttribute directly.
753 2005-04-05 David Hyatt <hyatt@apple.com>
755 Fix for 4077106, make sure that mouse wheeling in overflow sections uses 40 rather than 10 as the base line
760 * khtml/rendering/render_layer.cpp:
761 (RenderLayer::positionScrollbars):
762 * kwq/KWQScrollBar.mm:
763 (QScrollBar::scroll):
765 2005-04-04 Vicki Murley <vicki@apple.com>
769 - fixed <rdar://problem/3871669> no focus or blur methods on HTML button elements
771 * khtml/dom/html_form.cpp:
772 (HTMLButtonElement::focus):
773 (HTMLButtonElement::blur):
774 * khtml/dom/html_form.h:
775 * khtml/ecma/kjs_html.cpp:
776 (KJS::HTMLElementFunction::tryCall):
777 * khtml/ecma/kjs_html.h:
778 (KJS::HTMLElement::):
779 * khtml/ecma/kjs_html.lut.h:
781 * khtml/html/html_formimpl.cpp:
782 (DOM::HTMLButtonElementImpl::blur):
783 (DOM::HTMLButtonElementImpl::focus):
784 * khtml/html/html_formimpl.h:
788 2005-03-28 David Harrison <harrison@apple.com>
792 <rdar://problem/4069161> REGRESSION (8A416-8A419): Safari crash bringing up context menu for non-HTML content in a frame
794 * kwq/KWQAccObject.mm:
795 (-[KWQAccObject rendererForView:]):
796 Nil-check node variable instead of rechecking document variable.
800 2005-03-27 Darin Adler <darin@apple.com>
802 Reviewed by me, fix by Kida-san.
804 - fixed <rdar://problem/4067474> 8A424: Safari immediately quit by Cmd+Ctrll+'D'
806 * kwq/WebCoreBridge.mm: (-[WebCoreBridge convertToNSRange:DOM::]):
811 2005-03-24 Richard Williamson <rjw@apple.com>
813 Fixed <rdar://problem/4052683> After adding/removing stocks from Stocks Widget, stock areas went blank
815 The request was being collected before firing it's load handler.
816 We now gc protect the request while it's loading.
820 * khtml/ecma/xmlhttprequest.cpp:
821 (KJS::XMLHttpRequest::send):
822 (KJS::XMLHttpRequest::abort):
823 (KJS::XMLHttpRequest::slotFinished):
824 (KJS::XMLHttpRequestProtoFunc::tryCall):
828 2005-03-23 Darin Adler <darin@apple.com>
830 Further fix for 4053515.
832 Covered cases where text position doesn't lie inside a
837 * khtml/editing/visible_text.cpp:
838 (khtml::TextIterator::setRangeFromLocationAndLength):
840 2005-03-23 Richard Williamson <rjw@apple.com>
842 Fixed <rdar://problem/4053515> REGRESSION (Mail): Kotoeri input method reconversion does not work in WebViews
844 We now use actual document NSRanges to represent both marked text
845 ranges and selection ranges.
849 * khtml/editing/visible_text.cpp:
850 (khtml::TextIterator::rangeLength):
851 (khtml::TextIterator::setRangeFromLocationAndLength):
852 * khtml/editing/visible_text.h:
853 * kwq/WebCoreBridge.h:
854 * kwq/WebCoreBridge.mm:
855 (-[WebCoreBridge convertToNSRange:DOM::]):
856 (-[WebCoreBridge DOM::convertToDOMRange:]):
857 (-[WebCoreBridge selectNSRange:]):
858 (-[WebCoreBridge markedTextDOMRange]):
859 (-[WebCoreBridge markedTextNSRange]):
861 2005-03-22 Kevin Decker <kdecker@apple.com>
865 Fixed <rdar://problem/4062336> REGRESSION (406-407): HTML submenus not working at hrweb.apple.com after going back
867 Rolled out the fix for <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
869 We clearly need a better solution to 4041374. We can't indiscriminately remove event listeners in closeURL() after-all. Since event listeners are registered in a <script> tag, which is evaluated and executed at page load time, this becomes a problem since we don't reevaluate a page's <script> that is in the back/forward cache. Thus once you leave the page, the listeners are gone for good. This is the problem.
871 * khtml/khtml_part.cpp:
872 (KHTMLPart::closeURL):
873 * khtml/xml/dom_docimpl.cpp:
874 (DocumentImpl::detach):
878 2005-03-22 Vicki Murley <vicki@apple.com>
880 - roll the fix for <rdar://problem/4060266> back in, since its
883 * khtml/editing/visible_text.cpp:
884 (khtml::TextIterator::handleTextBox):
886 2005-03-22 Vicki Murley <vicki@apple.com>
888 - roll out the fix for <rdar://problem/4060266> since it was denied by CCC
890 * khtml/editing/visible_text.cpp:
891 (khtml::TextIterator::handleTextBox):
893 2005-03-22 David Harrison <harrison@apple.com>
897 <rdar://problem/4060266> Double-clicking in Dictionary.app doesn't work for some words (coming just after style change)
899 * khtml/editing/visible_text.cpp:
900 (khtml::TextIterator::handleTextBox):
901 Complete the check of whether to emit space for collapsed space.
903 2005-03-22 David Harrison <harrison@apple.com>
907 <rdar://problem/4061443> REGRESSION (8A420-8A421): Pasting in the Stickies widget is broken again
909 * khtml/editing/htmlediting.cpp:
910 (khtml::positionBeforeContainingSpecialElement):
911 (khtml::positionAfterContainingSpecialElement):
912 Return unchanged Position rather than a null or non-editable one.
916 2005-03-20 Ken Kocienda <kocienda@apple.com>
920 I made an error in this test earlier. It was not testing what I intended. Fixed.
922 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt
923 * layout-tests/editing/unsupported-content/list-delete-001.html
927 * layout-tests/editing/unsupported-content/table-delete-001-expected.txt: Added.
928 * layout-tests/editing/unsupported-content/table-delete-001.html: Added.
929 * layout-tests/editing/unsupported-content/table-delete-002-expected.txt: Added.
930 * layout-tests/editing/unsupported-content/table-delete-002.html: Added.
931 * layout-tests/editing/unsupported-content/table-delete-003-expected.txt: Added.
932 * layout-tests/editing/unsupported-content/table-delete-003.html: Added.
933 * layout-tests/editing/unsupported-content/table-type-after-expected.txt: Added.
934 * layout-tests/editing/unsupported-content/table-type-after.html: Added.
935 * layout-tests/editing/unsupported-content/table-type-before-expected.txt: Added.
936 * layout-tests/editing/unsupported-content/table-type-before.html: Added.
938 2005-03-20 Darin Adler <darin@apple.com>
942 - fixed <rdar://problem/3923903> REGRESSION (164-165): Repro Safari crash in khtml::RenderLayer::scrollToOffset
944 * khtml/rendering/render_layer.cpp: (RenderLayer::scrollToOffset): Check canvas for nil.
946 2005-03-20 David Harrison <harrison@apple.com>
950 <rdar://problem/4055127> Dictionary pop-up panel misplaced at beginning of text blocks (breaks double-clicking in Dictionary.app)
952 SimplifiedBackwardsTextIterator::advance() needed to not limit to textnodes
953 when checking whether moving back across block boundaries
955 VisibleUnits previousBoundary() needed to INIT_DOWN when creating result VisiblePosition
957 All editing tests pass.
959 * khtml/editing/visible_text.cpp:
960 (khtml::SimplifiedBackwardsTextIterator::advance):
961 * khtml/editing/visible_units.cpp:
962 (khtml::previousBoundary):
964 2005-03-20 Darin Adler <darin@apple.com>
966 Reviewed by Harrison.
968 - fixed <rdar://problem/4059914> when you select all of a frame's content, need to select the frame in the parent document so it can be easily deleted
970 * khtml/khtml_part.h: Added selectFrameElementInParentIfFullySelected.
971 * khtml/khtml_part.cpp:
973 (KHTMLPart::setFocusNodeIfNeeded): Changed to not set focus to a frame; was not what this function was
974 intended to do, and caused trouble when trying to select a frame element.
975 (KHTMLPart::khtmlMouseReleaseEvent): Call selectFrameElementInParentIfFullySelected.
976 (KHTMLPart::selectAll): Call selectFrameElementInParentIfFullySelected.
977 (KHTMLPart::selectFrameElementInParentIfFullySelected): Added. Selects the frame element in the parent
978 if a frame is entirely selected, which makes it easier to delete or replace the frame and is consistent
979 with the changes Maciej made recently for other elements.
981 * kwq/WebCoreBridge.mm:
982 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Call selectFrameElementInParentIfFullySelected.
983 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Call selectFrameElementInParentIfFullySelected.
985 2005-03-20 Darin Adler <darin@apple.com>
987 Reviewed by me, code change by Ken.
989 - fixed <rdar://problem/4059852> Deleting from first element of list makes content jump to wrong place
991 * khtml/editing/htmlediting.cpp:
992 (khtml::isListStructureNode): Added.
993 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Check for list nodes as well as table nodes.
995 2005-03-20 Ken Kocienda <kocienda@apple.com>
999 Added tests to cover new "unsupported content" editing code.
1001 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt: Added.
1002 * layout-tests/editing/unsupported-content/list-delete-001.html: Added.
1003 * layout-tests/editing/unsupported-content/list-delete-002-expected.txt: Added.
1004 * layout-tests/editing/unsupported-content/list-delete-002.html: Added.
1005 * layout-tests/editing/unsupported-content/list-delete-003-expected.txt: Added.
1006 * layout-tests/editing/unsupported-content/list-delete-003.html: Added.
1007 * layout-tests/editing/unsupported-content/list-type-after-expected.txt: Added.
1008 * layout-tests/editing/unsupported-content/list-type-after.html: Added.
1009 * layout-tests/editing/unsupported-content/list-type-before-expected.txt: Added.
1010 * layout-tests/editing/unsupported-content/list-type-before.html: Added.
1012 2005-03-20 Ken Kocienda <kocienda@apple.com>
1018 <rdar://problem/4059578> Entire list deleted, and caret disappears, when delete key hit at end of list
1020 The problem is that a new case in the delete code did not consider when the
1021 downstream end node of the selection might be an ancestor of the upstream start
1022 node. That is the case in this bug. The downstream end is the body element, and
1023 this line of code would delete all the children of the downstream end:
1024 removeChildrenInRangePreservingPosition(m_downstreamEnd.node(), 0,
1025 m_downstreamEnd.offset(), m_upstreamStart);
1027 The fix is to check for this "is ancestor" case, and do some tree logic to find
1028 the right offset of the downstream end node for the call to
1029 removeChildrenInRangePreservingPosition().
1031 * khtml/editing/htmlediting.cpp:
1032 (khtml::DeleteSelectionCommand::handleGeneralDelete): Fixed as described.
1034 2005-03-19 Ken Kocienda <kocienda@apple.com>
1040 <rdar://problem/4059384> Cannot place insertion point correctly in editable text that avoids floating elements
1042 Note: I strongly suspect this bug blocks a complete solution to this other Tiger/P2:
1043 <rdar://problem/4055748> AX: Dictionary pop-up panel shows at wrong place on specific parts of particular pages
1045 * khtml/rendering/render_text.cpp:
1046 (RenderText::caretRect): Change the y-coordinate used to calculate the available width for a line. Height is wrong.
1047 Top of the box containing the text where the click is done is correct. Also, add in the x-offset for the start
1048 of the text box when calculating the available width. If this text box is avoiding a float at the y-coordinate
1049 for the relevant box, failure to add in the amount of float-avoidance will make the text at the coordinates
1050 greater than end-of-line minus float-avoidance ineligible for caret placement.
1052 2005-03-19 Darin Adler <darin@apple.com>
1056 - fixed <rdar://problem/4057594> REGRESSION (125-406): Unrepro crash in HTMLTokenizer::allDataProcessed after hitting Back button
1058 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::allDataProcessed):
1059 To get the part safely after calling end, save a guarded pointer to the view.
1060 The old way could end trying to call a virtual function a part that was destroyed.
1062 2005-03-19 Maciej Stachowiak <mjs@apple.com>
1066 <rdar://problem/4053506> Pasting Tables and Cells in Mail does not allow editing before or after
1067 <rdar://problem/4005954> REGRESSION (Mail): After copy/paste of content containing list element cannot go back to entering text at left side of page
1069 * khtml/editing/htmlediting.cpp:
1070 (khtml::maxDeepOffset):
1071 (khtml::CompositeEditCommand::removeFullySelectedNodePreservingPosition):
1072 (khtml::CompositeEditCommand::removeChildrenInRangePreservingPosition):
1073 (khtml::CompositeEditCommand::removeNodePreservingPosition):
1074 (khtml::CompositeEditCommand::insertBlockPlaceholder):
1075 (khtml::CompositeEditCommand::appendBlockPlaceholder):
1076 (khtml::CompositeEditCommand::forceBlockPlaceholder):
1077 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
1078 (khtml::isSpecialElement):
1079 (khtml::isFirstVisiblePositionInSpecialElementInFragment):
1080 (khtml::positionBeforePossibleContainingSpecialElement):
1081 (khtml::positionAfterPossibleContainingSpecialElement):
1082 (khtml::ApplyStyleCommand::applyInlineStyle):
1083 (khtml::DeleteSelectionCommand::initializePositionData):
1084 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
1085 (khtml::DeleteSelectionCommand::handleGeneralDelete):
1086 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
1087 (khtml::DeleteSelectionCommand::doApply):
1088 (khtml::InsertParagraphSeparatorCommand::doApply):
1089 (khtml::ReplacementFragment::ReplacementFragment):
1090 (khtml::ReplaceSelectionCommand::doApply):
1091 * khtml/editing/htmlediting.h:
1092 * khtml/editing/visible_position.cpp:
1093 (khtml::isRenderedBR):
1094 (khtml::VisiblePosition::initDownstream):
1095 (khtml::isLastVisiblePositionInBlock):
1096 * khtml/rendering/render_line.cpp:
1097 (khtml::RootInlineBox::closestLeafChildForXPos):
1098 * khtml/xml/dom_nodeimpl.cpp:
1099 (NodeImpl::isBlockFlowOrTable):
1100 (NodeImpl::isEditableBlock):
1101 (NodeImpl::enclosingBlockFlowOrTableElement):
1102 * khtml/xml/dom_nodeimpl.h:
1103 * khtml/xml/dom_position.cpp:
1104 (DOM::Position::upstream):
1105 (DOM::Position::downstream):
1106 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
1107 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
1108 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
1109 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
1110 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt:
1112 2005-03-19 John Sullivan <sullivan@apple.com>
1116 - fixed <rdar://problem/4058740> Crash (nil-deref) editing Mail reply
1117 message in KWQKHTMLPart::fontForSelection (MailViewer-723)
1119 * kwq/KWQKHTMLPart.mm:
1120 (KWQKHTMLPart::fontForSelection):
1121 Add nil check to loop. It shouldn't be necessary, but this crash trace seems to be
1122 running into it. We're not completely certain, but the check is harmless at worst.
1126 2005-03-18 David Harrison <harrison@apple.com>
1130 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
1132 Also changed WebKit.
1134 * kwq/KWQAccObject.mm:
1135 (-[KWQAccObject rendererForView:]):
1136 New to cover both the WebCore and WebKit NSViews.
1138 (-[KWQAccObject _accessibilityParentForSubview:]):
1139 Use rendererForView.
1141 * kwq/WebCoreFrameView.h:
1142 Add WebCoreBridgeHolder protocol to get access to WebKit NSViews.
1144 2005-03-18 David Harrison <harrison@apple.com>
1146 Reviewed by Darin, Ken.
1148 <rdar://problem/3735625> AX: add AXPress action if an element has an onclick handler
1150 * khtml/dom/html_form.cpp:
1151 (HTMLInputElement::click):
1152 * khtml/html/html_elementimpl.cpp:
1153 (HTMLElementImpl::click):
1154 (HTMLElementImpl::accessKeyAction):
1155 * khtml/html/html_elementimpl.h:
1156 * khtml/html/html_formimpl.cpp:
1157 (DOM::HTMLFormElementImpl::submitClick):
1158 (DOM::HTMLButtonElementImpl::click):
1159 (DOM::HTMLButtonElementImpl::accessKeyAction):
1160 (DOM::HTMLInputElementImpl::click):
1161 (DOM::HTMLInputElementImpl::accessKeyAction):
1162 (DOM::HTMLInputElementImpl::defaultEventHandler):
1163 (DOM::HTMLLabelElementImpl::accessKeyAction):
1164 (DOM::HTMLSelectElementImpl::accessKeyAction):
1165 (DOM::HTMLTextAreaElementImpl::accessKeyAction):
1166 * khtml/html/html_formimpl.h:
1167 * khtml/html/html_inlineimpl.cpp:
1168 (HTMLAnchorElementImpl::defaultEventHandler):
1169 (HTMLAnchorElementImpl::accessKeyAction):
1170 * khtml/html/html_inlineimpl.h:
1171 * khtml/rendering/render_form.cpp:
1172 (RenderFileButton::click):
1173 * khtml/rendering/render_form.h:
1174 * khtml/xml/dom_docimpl.cpp:
1175 (DocumentImpl::defaultEventHandler):
1176 * khtml/xml/dom_elementimpl.h:
1177 (DOM::ElementImpl::accessKeyAction):
1179 (-[DOMHTMLInputElement click]):
1183 * kwq/KWQFileButton.h:
1184 * kwq/KWQFileButton.mm:
1185 (KWQFileButton::click):
1187 Add accessKeyAction parameter about whether to limit to HTMLElementImpl subclasses that JavaScript wants, or to apply to others as well.
1189 Add click() parameter about whether to send the mousedown and mouseup events in addition to the click event.
1191 * kwq/KWQAccObject.mm:
1192 (-[KWQAccObject mouseButtonListener]):
1193 Locate a mousedown, mouseup, or click handler in the current element and its ancestors.
1195 (-[KWQAccObject actionElement]):
1196 (-[KWQAccObject accessibilityIsIgnored]):
1197 (-[KWQAccObject accessibilityPerformAction:]):
1198 Consider mouseButtonListener.
1200 2005-03-18 John Sullivan <sullivan@apple.com>
1204 - fixed <rdar://problem/4002164> maps that include start and end
1205 location don't print right from maps.google.com
1207 I thought I checked this in yesterday but a ChangeLog conflict aborted my checkin
1208 without me noticing.
1210 * khtml/rendering/render_style.cpp:
1211 (RenderStyle::diff):
1212 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
1214 * khtml/rendering/render_style.h:
1215 (khtml::RenderStyle::InheritedFlags::operator==):
1216 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
1217 (khtml::RenderStyle::setBitDefaults):
1219 (khtml::RenderStyle::forceBackgroundsToWhite):
1220 ditto, and method name changed too
1221 (khtml::RenderStyle::setForceBackgroundsToWhite):
1224 * khtml/rendering/render_text.cpp:
1225 (InlineTextBox::paint):
1226 updated for name change; also, compare text against white instead of current bg color
1227 because we no longer actually modify the bg color (previously we would always set
1228 the bg color to white, so the result is the same)
1230 * khtml/xml/dom_docimpl.cpp:
1231 (DocumentImpl::recalcStyle):
1232 updated for name change
1234 * kwq/WebCoreBridge.mm:
1235 (-[WebCoreBridge styleSheetForPrinting]):
1237 (-[WebCoreBridge reapplyStylesForDeviceType:]):
1238 removed the code that called styleSheetForPrinting; we no longer use a stylesheet
1241 * khtml/rendering/render_box.cpp:
1242 (RenderBox::paintBackgroundExtended):
1243 If forceBackgroundsToWhite flag is set, convert background images and
1244 background colors to white background color with no background image.
1246 2005-03-18 Ken Kocienda <kocienda@apple.com>
1252 <rdar://problem/4056718> Pasting quotes the entire message
1254 * khtml/editing/htmlediting.cpp:
1255 (khtml::ReplaceSelectionCommand::doApply): After pasting, nodes are moved to the block containing
1256 the end of the pasted content in certain cases. This move logic used to stop once it moved all the
1257 siblings of the node following the last node of the pasted-in content. This means that block elements
1258 could get moved, and if the pasted-in content included a mail blockquote, this could result in
1259 one quote level getting added. The fix is to stop the move of nodes once a <br>, block element, or
1260 <table> is seen. This only affected one of the many test cases we have for such scenarios, and
1261 the change to that result makes sense given the code change.
1262 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: This test result changed in a way that
1263 adequately tests the behavior change, so I did not add a new test.
1265 2005-03-17 Ken Kocienda <kocienda@apple.com>
1267 Reviewed by Harrison
1271 <rdar://problem/4051809> 8A413: Cursor-up in a mail message sometimes gets stuck (with specific reproducible case)
1273 * khtml/rendering/render_text.cpp:
1274 (RenderText::positionForCoordinates): Consider two lines: line-above and line-below. If the caret position in line-below
1275 was at an x coordinate between half way through the x coordinate of the last character on the line-above and the
1276 end of that same character, this bug would happen since the positioning code would assume that it could create a
1277 VisiblePosition with a DOWNSTREAM affinity. Now, I check to see if the character position on the line-above is the
1278 last character on that line, and if it is, I use UPSTREAM as the affinity.
1282 2005-03-17 David Harrison <harrison@apple.com>
1284 Reviewed by Darin, Ken.
1286 * khtml/editing/htmlediting.cpp:
1287 (khtml::EditCommandPtr::setEndingSelection):
1288 Fixed typo so that it calls setEndingSelection rather than setStartingSelection.
1289 Commented out this unused method, tho, since this is late in Tiger. Proved unused by successful build after temporarily removing method declaration or implemenation.
1291 2005-03-16 Kevin Decker <kdecker@apple.com>
1295 Fixed <rdar://problem/4046665> REGRESSION (403-405): mypage.apple.com login does not work (hits assertion in Development build)
1297 * kwq/WebCoreBridge.mm:
1298 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Check always came back false when callers would send a nil NSURL to this method. Now we allow the empty url cases, eg., <frame src="">
1300 2005-03-16 Darin Adler <darin@apple.com>
1304 - fixed <rdar://problem/4045203> REGRESSION (125-188): Redundant JS imports crash Safari
1306 * khtml/html/htmltokenizer.h: Take inWRite bool out of NDEBUG ifdef.
1307 * khtml/html/htmltokenizer.cpp:
1308 (khtml::HTMLTokenizer::HTMLTokenizer): Take inWrite bool management code out of NDEBUG ifdef.
1309 (khtml::HTMLTokenizer::write): Ditto. Don't call end if inWrite is true, since it will be called
1310 when you return to the body of the outer write() call.
1311 (khtml::HTMLTokenizer::allDataProcessed): Don't call end() if inWrite is true for the same reason.
1312 (khtml::HTMLTokenizer::finish): Ditto.
1314 * kwq/KWQWidget.mm: (QWidget::getOuterView): Removed bogus assertion that has been vexing us of late.
1316 2005-03-16 David Harrison <harrison@apple.com>
1318 Reviewed by me (written by Patti Yeh).
1320 * kwq/KWQAccObject.mm:
1321 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
1322 Use LeftWordIfOnBoundary instead of RightWordIfOnBoundary.
1324 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
1325 Use RightWordIfOnBoundary instead of LeftWordIfOnBoundary.
1327 2005-03-16 David Harrison <harrison@apple.com>
1331 <rdar://problem/4054590> AX: Dictionary panel does not work when page is scrolled on Safari
1333 * kwq/KWQAccObject.mm:
1334 (-[KWQAccObject doAXTextMarkerForPosition:]):
1335 Add in the view's contentsX and contentsY to the point.
1337 2005-03-16 David Harrison <harrison@apple.com>
1341 <rdar://problem/4048506> Deleting from beginning of editable div deletes other document elements
1343 Also changed WebKit.
1345 * khtml/editing/visible_units.h:
1346 * khtml/editing/visible_units.cpp:
1347 (khtml::startOfEditableContent):
1348 (khtml::endOfEditableContent):
1349 (khtml::inSameEditableContent):
1350 (khtml::isStartOfEditableContent):
1351 (khtml::isEndOfEditableContent):
1354 * kwq/WebCoreBridge.h:
1355 * kwq/WebCoreBridge.mm:
1356 (-[WebCoreBridge canDeleteRange:]):
1359 2005-03-16 Ken Kocienda <kocienda@apple.com>
1365 <rdar://problem/4042935> undo doesn't work properly during inline input
1367 * kwq/WebCoreBridge.h: Declare new method below.
1368 * kwq/WebCoreBridge.mm:
1369 (-[WebCoreBridge replaceMarkedTextWithText:]): New method. Wraps calls to TypingCommand::deleteKeyPressed and
1370 TypingCommand::insertText to map the way that international text input works onto the typing undo system.
1372 2005-03-16 David Harrison <harrison@apple.com>
1376 <rdar://problem/4044336> REGRESSION (8A398-8A409): Option-Delete also deletes space to left of deleted word
1378 * khtml/editing/htmlediting.cpp:
1379 (khtml::DeleteSelectionCommand::initializePositionData):
1380 - skip smart delete if the selection to delete already starts or ends with whitespace
1382 * khtml/khtml_part.cpp:
1383 (KHTMLPart::handleMousePressEventDoubleClick):
1384 - preserve selection on double-click when range is already selected
1386 * khtml/xml/dom_position.cpp:
1387 (DOM::Position::leadingWhitespacePosition):
1388 (DOM::Position::trailingWhitespacePosition):
1389 - fix considerNonCollapsibleWhitespace action (logic was reversed)
1390 - add non-breaking space to the non-collapsable ones
1392 * kwq/WebCoreBridge.mm:
1393 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
1394 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
1395 - these methods do not set the selection, so remove calls to setSelectionGranularity
1397 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
1398 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]):
1399 - set the granularity back to character
1400 - the one exception is that we need to keep word granularity
1401 to preserve smart delete behavior when extending by word
1403 2005-03-15 Maciej Stachowiak <mjs@apple.com>
1407 <rdar://problem/4053266> Pressing return a few times right after a link makes the new blank lines part of the link
1409 * khtml/editing/htmlediting.cpp:
1410 (khtml::InsertLineBreakCommand::doApply): Use
1411 positionOutsideContainingSpecialElement in the right two places.
1412 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1414 - move all these helper functions higher in the file
1416 * khtml/editing/htmlediting.cpp:
1417 (khtml::isSpecialElement):
1418 (khtml::isFirstVisiblePositionInSpecialElement):
1419 (khtml::positionBeforeNode):
1420 (khtml::positionBeforeContainingSpecialElement):
1421 (khtml::maxRangeOffset):
1422 (khtml::isLastVisiblePositionInSpecialElement):
1423 (khtml::positionAfterNode):
1424 (khtml::positionAfterContainingSpecialElement):
1425 (khtml::positionOutsideContainingSpecialElement):
1427 2005-03-14 Maciej Stachowiak <mjs@apple.com>
1431 <rdar://problem/4049925> Pasting right after a link makes pasted content part of the link (without visible style change)
1433 * khtml/editing/htmlediting.cpp:
1434 (khtml::positionOutsideContainingSpecialElement): made a helper
1435 function that computes a position outside the outermost containing
1436 special element if the passed in position is right at the start or
1438 (khtml::InsertTextCommand::prepareForTextInsertion): use new helper here
1439 (khtml::ReplaceSelectionCommand::doApply): use it here too: this is the fix
1440 (khtml::positionBeforeNode): made static
1441 (khtml::positionBeforeContainingSpecialElement): made static
1442 (khtml::positionAfterNode): made static
1443 (khtml::positionAfterContainingSpecialElement): made static
1445 2005-03-15 Richard Williamson <rjw@apple.com>
1447 Fixed <rdar://problem/4053658> Crash getting direction at maps.google.com
1449 Add non nil style() check.
1451 Reviewed by Dave Harrison.
1453 * khtml/rendering/render_table.cpp:
1454 (RenderTableCell::collapsedRightBorder):
1456 2005-03-15 Kevin Decker <kdecker@apple.com>
1460 Fixed: <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
1462 The reason why UNLOAD_EVENT wouldn't dispatch was because the code would delete all event listeners at the detach() phase which is prior to closeURL().
1464 This fixes a recent regression from:
1466 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
1468 * khtml/khtml_part.cpp:
1469 (KHTMLPart::closeURL): After dispatching event handlers, go ahead and remove them from the DOM.
1470 * khtml/xml/dom_docimpl.cpp:
1471 (DocumentImpl::detach): Took out the call to removeAllEventListenersFromAllNodes(). If we remove all event listeners here then when KHTMLPart::closeURL() checks for even listeners, it will never have any because they'll already be gone.
1473 2005-03-15 Ken Kocienda <kocienda@apple.com>
1479 <rdar://problem/4052642> Each delete keystroke is in its own undo group; not included in undo group with other typing
1481 Calling -[WebCore setSelectedDOMRange:range affinity:] had the result of "closing" any active set of typing
1482 keystrokes grouped together in a single undo operation. A change on 27 Jan in WebKit to change the way delete
1483 keystrokes are handled made this feature regress. Previous to that change, the backwards delete
1484 key went through separate code that is no longer in the tree that did not set the selection in the way
1487 The solution is to add an extra argument to the set-selection call. The WebCoreBridge now offers this method:
1488 -[WebCore setSelectedDOMRange:range affinity:closeTyping:]. Now, callers must indicate whether setting the
1489 selection will act to close typing or not.
1491 * kwq/WebCoreBridge.h: Changed header accordingly to change method shown below.
1492 * kwq/WebCoreBridge.mm:
1493 (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Added closeTyping argument to this method.
1495 2005-03-15 John Sullivan <sullivan@apple.com>
1499 - fixed <rdar://problem/4052246> crash in KWQKHTMLPart::createPart() trying to display local file in frame
1501 * kwq/KWQKHTMLPart.mm:
1502 (KWQKHTMLPart::createPart):
1503 Check part for nil before trying to ref. This was probably a longstanding code flaw revealed by
1504 the recent security fix.
1506 2005-03-15 Kevin Decker <kdecker@apple.com>
1508 Reviewed by Ken and Maciej.
1510 New fix for <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
1512 The tokenizer has buffers which mean parsing can continue even after loading is supposed to be stopped. If the loading process was aborted, the tokenizer should abort, too.
1514 * khtml/html/htmltokenizer.cpp:
1515 (khtml::HTMLTokenizer::HTMLTokenizer): Initialize loadStopped to false.
1516 (khtml::HTMLTokenizer::write): Go ahead and bail out if loadStopped is true.
1517 (khtml::HTMLTokenizer::processToken):
1518 * khtml/html/htmltokenizer.h: Added loadStopped flag. Changed the view pointer from a standard pointer to a QGuardedPtr. This fixes the crash. Now the tokenizer's handle to the view will now automatically nil-out and never dangle.
1519 * khtml/khtml_part.cpp:
1520 (KHTMLPart::closeURL): Notify the tokenizer to stop parsing.
1521 * khtml/xml/xml_tokenizer.cpp:
1522 (khtml::XMLTokenizer::XMLTokenizer): Initialize loadStopped to false.
1523 * khtml/xml/xml_tokenizer.h:
1524 (khtml::Tokenizer::stopParsing): Added.
1526 2005-03-14 David Harrison <harrison@apple.com>
1528 Reviewed by Darin, Maciej.
1530 <rdar://problem/4046103> REGRESSION (Mail): clicking after style change sets insertion point incorrectly
1532 Also fixes crash by adding nil check.
1534 * khtml/editing/htmlediting.cpp:
1535 (khtml::MoveSelectionCommand::doApply):
1536 Check the node for nil.
1538 * khtml/khtml_part.cpp:
1539 (KHTMLPart::khtmlMouseReleaseEvent):
1540 Use the node from the event rather than from the selection.
1542 2005-03-14 Darin Adler <darin@apple.com>
1544 Reviewed by Harrison.
1546 - fixed <rdar://problem/4049776> Seed: Mail: Disable spellcheck leaves red artifacts
1548 * khtml/xml/dom_docimpl.cpp:
1549 (DocumentImpl::DocumentImpl): Set markers list to be "auto-delete" so they don't all leak.
1550 (DocumentImpl::removeMarker): Remove markers list for a node when the last marker is removed
1551 for that node. Otherwise, we can have empty marker lists for each node forever until the
1553 (DocumentImpl::removeAllMarkers): Added code to dirty the markers.
1554 (DocumentImpl::shiftMarkers): Remove unneeded empty check.
1556 * kwq/WebCoreBridge.h: Added unmarkAllMisspellings for WebKit.
1557 * kwq/WebCoreBridge.mm: (-[WebCoreBridge unmarkAllMisspellings]): Added. Calls removeAllMarkers.
1559 2005-03-14 Richard Williamson <rjw@apple.com>
1561 Fixed <rdar://problem/4027928> Tiger_8A394:Acrobat crashes while tried to remove the subscription errors by clicking on "Would you like to remove the subscription" from Tracker details view pane
1563 A document may be deleted as a consequence of handling an event,
1564 as was the case with Acrobat.app. Ensure that the document is still valid
1565 before passing the event on for further handling.
1567 * khtml/xml/dom_nodeimpl.cpp:
1568 (NodeImpl::dispatchUIEvent):
1570 2005-03-14 Ken Kocienda <kocienda@apple.com>
1574 Added a couple of comments about setChanged() to this code based on my experiences with 4047028.
1576 * khtml/css/css_valueimpl.cpp:
1577 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties)
1578 (DOM::CSSMutableStyleDeclarationImpl::merge)
1580 2005-03-14 Ken Kocienda <kocienda@apple.com>
1586 <rdar://problem/4047028> Changing quote levels on stylized text causes it to be sent as colored (Blue). Tiger8A410
1588 * khtml/css/css_valueimpl.cpp:
1589 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): This function now calls setChanged() at the
1590 end of its loop if any properties were removed. This makes the style system update correctly in response
1591 to changes made by this function. The code to paste removes style from the pasted content in a
1592 preliminary step, and the fact that the style system did not update properly left unwanted color
1593 declarations in the document.
1595 2005-03-14 Vicki Murley <vicki@apple.com>
1597 - roll out this change for now, since it was denied by CCC
1599 2005-03-11 David Harrison <harrison@apple.com>
1603 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
1605 * kwq/KWQKHTMLPart.mm:
1606 (KWQKHTMLPart::advanceToNextMisspelling):
1607 (KWQKHTMLPart::markMisspellings):
1610 2005-03-14 Ken Kocienda <kocienda@apple.com>
1616 <rdar://problem/4050403> Mail crashes after pasting and deleting the content of one Excel cell
1618 * khtml/editing/htmlediting.cpp:
1619 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add some null checks to the code. This fixes the crash, although
1620 following the steps described in the bug by John Sullivan on 3/14/05 at 10:49 AM will leave us with a "blank line" in
1621 the document that cannot be removed (this is actually an empty table). This is undesirable, however, work Maciej is
1622 doing to fix the general-case problem of trying to edit constructs we do not handle well in editing should fix this
1623 particular case, making the deletion of this "blank line" possible. Maciej is doing this work as part of this bug:
1624 <rdar://problem/4036051> Hard to select (and thus delete) an IFRAME in an editable WebView
1626 2005-03-14 Ken Kocienda <kocienda@apple.com>
1632 <rdar://problem/4029632> Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
1634 The problem is that removeInlineStyle() can remove nodes, and if either the start or end node of the
1635 selection at the time of the call to removeInlineStyle() was in a node that got removed, bad things
1636 would happen. The fix is described below.
1638 * khtml/editing/htmlediting.cpp:
1639 (khtml::maxRangeOffset): Moved this static function to a different place in the file so the code below can use it.
1640 (khtml::ApplyStyleCommand::applyInlineStyle): Calling removeInlineStyle() now has the side effect of
1641 setting the command's ending selection. Now resets start and end using the ending selection after the call to
1642 removeInlineStyle() as it is done elsewhere in this function.
1643 (khtml::ApplyStyleCommand::removeInlineStyle): Track the removal of the start or end node based on
1644 the positions passed in. If either the start or the end node is removed as part of style removal,
1645 set an appropriate replacement start or end that is still in the document.
1649 2005-03-14 Ken Kocienda <kocienda@apple.com>
1653 I need to roll out Kevin's change to fix 3667701. It breaks contextual fragments, and hence breaks
1654 paste in editing (among other things).
1656 * khtml/html/htmltokenizer.cpp: Roll out recent change.
1657 (khtml::HTMLTokenizer::write)
1658 * khtml/html/htmltokenizer.h: Ditto.
1660 2005-03-13 Darin Adler <darin@apple.com>
1662 Reviewed by Ken and Maciej.
1664 - fixed <rdar://problem/4049040> REGRESSION (403-405): security check prevents user stylesheet from loading (Dictionary.app doesn't work at all!)
1666 * kwq/WebCoreBridge.mm: (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Changed to give "applewebdata:"
1667 documents the same privileges to open local files that "file:" documents have.
1669 2005-03-13 Kevin Decker <kdecker@apple.com>
1673 Fixed: <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
1675 The problem here was that the tokenizer would continue to receive chunks of data from the loader already
1676 after the view and part had been destroyed. Situations like this could arise when clicking on another link
1677 while still loading the current view, or during self test where we rapidly open, load, and close browser
1680 * khtml/html/htmltokenizer.cpp:
1681 (khtml::HTMLTokenizer::write): Simple nil check against the view.
1682 * khtml/html/htmltokenizer.h: Changed the view pointer from a standard pointer to a QGuardedPtr. The tokenizer's
1683 handle to the view will now automatically nil-out and never dangle.
1685 2005-03-13 Darin Adler <darin@apple.com>
1687 Reviewed by John and Ken.
1689 - fixed <rdar://problem/4044347> REGRESSION (Mail): Control-K in particular message moves insertion point to previous line
1691 Tweaked the deleting code, and added three new deleting layout tests to confirm the new code works.
1693 * khtml/editing/htmlediting.cpp:
1694 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Removed special case with comment that said it was
1695 for the case where a "selection contains only a BR right after a block ended". This code was being triggered in
1696 more cases than just that one, and in all the cases I tested, the general delete code works fine.
1697 (khtml::DeleteSelectionCommand::handleGeneralDelete): Changed the code that decides whether to delete an entire
1698 block to understand the case where the end block is outside the start block, but contains the start block.
1699 In that case, we want to delete the entire block. Not deleting the block was causing us to delete just the <br>,
1700 and not the enclosing <div> in the case in the bug.
1702 * layout-tests/editing/deleting/delete-line-015-expected.txt: Added.
1703 * layout-tests/editing/deleting/delete-line-015.html: Added.
1704 * layout-tests/editing/deleting/delete-line-016-expected.txt: Added.
1705 * layout-tests/editing/deleting/delete-line-016.html: Added.
1706 * layout-tests/editing/deleting/delete-line-017-expected.txt: Added.
1707 * layout-tests/editing/deleting/delete-line-017.html: Added.
1708 * layout-tests/editing/style/smoosh-styles-002-expected.txt: Updated to improved results. With the code change, the deletion
1709 now deletes more than it used to. The old results had an empty text node and <h1> element that were both 0-sized, and now
1710 we delete both of those.
1712 2005-03-13 Darin Adler <darin@apple.com>
1714 - fixed <rdar://problem/4049172> REGRESSION (403-405): Gmail: text box in "Invite a friend" section overlaps other sections
1716 Rolled out fix for <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
1718 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth): Back to previous version of this file.
1720 2005-03-12 Maciej Stachowiak <mjs@apple.com>
1724 <rdar://problem/4046144> RSS pages leave a hole in local file security policy (need to revert feed: exemption)
1726 * kwq/WebCoreBridge.mm:
1727 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Revert
1728 emergency workaround for Safari RSS, now that a new Syndication
1731 2005-03-11 Maciej Stachowiak <mjs@apple.com>
1735 <rdar://problem/4026787> text typed after a link (pasted or Mail Link to this Page) is part of the link, underlined and colored blue
1737 The concept of this change is every time you type at the very
1738 start or very end of a link (even if nested in further inner
1739 elements), the typed text goes outside the link instead of inside.
1741 * khtml/editing/htmlediting.cpp:
1742 (khtml::InsertTextCommand::prepareForTextInsertion): Check whether
1743 we are at the first visible position or last visible position of a
1744 special element. For now this only includes HTML A elements that
1745 are links (i.e. they have an href).
1746 (khtml::isSpecialElement): Helper function that identifies special
1747 elements (for now only links).
1748 (khtml::isFirstVisiblePositionInSpecialElement): Checks if a given DOM
1749 position is equivalent to the first visible position in some containing
1750 editable special element.
1751 (khtml::positionBeforeNode): Returns the DOM position immediately
1753 (khtml::positionBeforeContainingSpecialElement): Gives a DOM
1754 position immediately before the outermost editable containing
1755 special element where the passed-in position is equivalent to the
1756 first visible position.
1757 (khtml::maxRangeOffset): Helper to get the maximum allowed
1758 range/position offset for a node, does the right thing based on
1759 whether the node would use a character offset or child offset.
1760 (khtml::isLastVisiblePositionInSpecialElement): Similar to above,
1761 but for end of node instead of start.
1762 (khtml::positionAfterNode): Ditto.
1763 (khtml::positionAfterContainingSpecialElement): Ditto.
1765 Some layout tests changed - I looked over all the diffs and found
1766 that the only changes were "junk nodes" like empty spans and text
1767 nodes moving from one spot in the tree to another. These changes
1768 are all harmless and do not affect layout or future editing.
1770 * layout-tests/editing/inserting/typing-003-expected.txt:
1771 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
1772 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
1773 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
1774 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
1775 * layout-tests/editing/style/remove-underline-expected.txt:
1776 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt:
1777 * layout-tests/editing/style/remove-underline-in-bold-expected.txt:
1778 * layout-tests/editing/style/typing-style-003-expected.txt:
1779 * layout-tests/editing/style/unbold-in-bold-expected.txt:
1780 * layout-tests/editing/style/underline-expected.txt:
1782 2005-03-11 Adele Amchan <adele@apple.com>
1784 backing out fix for <rdar://problem/4021711> REGRESSION (125-188): blank pages when browsing forum at cooperativeresearch.org - cached external script problem
1786 This caused the following regressions (that we know of):
1787 <rdar://problem/4047445> REGRESSION (Safari-400-403?): Some or all page contents sometimes don't appear (macworld.com)
1788 <rdar://problem/4046153> 8a409: Problem loading Citibank page in Safari 2 (403)
1789 <rdar://problem/4047801> REGRESSION (402-403): .Mac homepage links don't work
1791 * khtml/html/htmltokenizer.cpp:
1792 (khtml::HTMLTokenizer::scriptHandler):
1794 2005-03-11 David Harrison <harrison@apple.com>
1798 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
1800 * kwq/KWQKHTMLPart.mm:
1801 (KWQKHTMLPart::advanceToNextMisspelling):
1802 (KWQKHTMLPart::markMisspellings):
1805 2005-03-11 Ken Kocienda <kocienda@apple.com>
1809 * ForwardingHeaders/editing/visible_units.h: Added.
1811 2005-03-11 Ken Kocienda <kocienda@apple.com>
1817 <rdar://problem/4045521> Hitting return key with full line selected does not add blank line as it should
1819 * khtml/editing/htmlediting.cpp:
1820 (khtml::InsertParagraphSeparatorCommand::doApply): Removed some "special-case" code from this
1821 function that would look for a selection that started and ended in a different block, and would
1822 then bail right after the deletion of the selection without inserting a paragraph separator.
1823 This was just wrong. So, the code change is removal only. When the general-case code runs instead
1824 of the erroneous special-case code, the bug goes away.
1828 * layout-tests/editing/inserting/return-key-with-selection-001-expected.txt: Added.
1829 * layout-tests/editing/inserting/return-key-with-selection-001.html: Added.
1830 * layout-tests/editing/inserting/return-key-with-selection-002-expected.txt: Added.
1831 * layout-tests/editing/inserting/return-key-with-selection-002.html: Added.
1832 * layout-tests/editing/inserting/return-key-with-selection-003-expected.txt: Added.
1833 * layout-tests/editing/inserting/return-key-with-selection-003.html: Added.
1835 2005-03-11 David Harrison <harrison@apple.com>
1839 <rdar://problem/4009446> AX: kAXTextMarkerForPositionParameterizedAttribute not working correctly (required for Dictionary pop-up)
1841 * kwq/KWQAccObject.mm:
1842 (-[KWQAccObject accessibilityAttributeValue:]):
1845 (-[KWQAccObject doAXTextMarkerForPosition:]):
1848 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
1849 Use the selection's document instead of the top document, to accommodate frames, etc.
1851 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
1852 Fixed parameter processing to look for NSValue instead of AXValue.
1854 2005-03-11 Ken Kocienda <kocienda@apple.com>
1856 Reviewed by Harrison
1860 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
1862 This was fixed, then regressed with Harrison's fix for this bug:
1864 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
1866 * khtml/editing/htmlediting.cpp:
1867 (khtml::ReplaceSelectionCommand::doApply): My now addresses both problems in a way that they no longer
1870 2005-03-10 Ken Kocienda <kocienda@apple.com>
1876 <rdar://problem/4045511> Copying and pasting end-of-paragraph selection puts insertion point in wrong place
1877 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
1879 The copy/paste code before this patch had no notion of a "logical newline" at the start of the selection. We have
1880 had a similar notion for "logical newline" at the end of the selection for quite some time. To fix these bugs, we
1881 need to introduce the same idea for selection starts.
1883 * khtml/editing/htmlediting.cpp:
1884 (khtml::ReplacementFragment::ReplacementFragment): Process the "logical newline" at start as we write it out
1885 in markup. Set the bit we added to this object to signify we have such a newline.
1886 (khtml::ReplaceSelectionCommand::doApply): Many, many changes to introduce the new "logical newline" at start concept.
1887 I also tried to simply the code that sets the start position for inserting content to be pasted. I also improved a
1888 weakness in the smart-paste code. Now, we check before and after the paste for whether we need to add a leading or
1889 trailing space. The code previous to this patch only did a "before" check, with the result that we sometimes added
1890 a second space. In other words, the code did not realize that DOM changes done by pasting could cause formerly
1891 unrendered whitespace to become rendered. Also moved line placeholder clean up code to its own function.
1892 (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): New helper that further refines the notion
1893 of when we can remove a line placeholder. The definition is now, "If a line placeholder is at the visible start
1894 and visible end of its line, keep it; otherwise remove it".
1895 * khtml/editing/htmlediting.h: Declare new functions. Rework inlines in ReplacementFragment class to account for
1896 addition of new "logical newline" at start concept.
1897 (khtml::ReplacementFragment::hasInterchangeNewlineAtStart): New accessor.
1898 (khtml::ReplacementFragment::hasInterchangeNewlineAtEnd): Renamed from hasInterchangeNewline(), since before we
1899 only had a bit for the end, hence we did not need to distinguish it from the start.
1900 * khtml/editing/markup.cpp:
1901 (khtml::createMarkup): Added code to detect and write out markup for cases where we have a "logical newline" at start.
1902 * khtml/xml/dom2_rangeimpl.cpp:
1903 (DOM::RangeImpl::startPosition): New helper.
1904 (DOM::RangeImpl::endPosition): Ditto.
1905 * khtml/xml/dom2_rangeimpl.h: Declare new helpers.
1908 * layout-tests/editing/pasteboard/paste-line-endings-001-expected.txt: Added.
1909 * layout-tests/editing/pasteboard/paste-line-endings-001.html: Added.
1910 * layout-tests/editing/pasteboard/paste-line-endings-002-expected.txt: Added.
1911 * layout-tests/editing/pasteboard/paste-line-endings-002.html: Added.
1912 * layout-tests/editing/pasteboard/paste-line-endings-003-expected.txt: Added.
1913 * layout-tests/editing/pasteboard/paste-line-endings-003.html: Added.
1914 * layout-tests/editing/pasteboard/paste-line-endings-004-expected.txt: Added.
1915 * layout-tests/editing/pasteboard/paste-line-endings-004.html: Added.
1916 * layout-tests/editing/pasteboard/paste-line-endings-005-expected.txt: Added.
1917 * layout-tests/editing/pasteboard/paste-line-endings-005.html: Added.
1918 * layout-tests/editing/pasteboard/paste-line-endings-006-expected.txt: Added.
1919 * layout-tests/editing/pasteboard/paste-line-endings-006.html: Added.
1920 * layout-tests/editing/pasteboard/paste-line-endings-007-expected.txt: Added.
1921 * layout-tests/editing/pasteboard/paste-line-endings-007.html: Added.
1922 * layout-tests/editing/pasteboard/paste-line-endings-008-expected.txt: Added.
1923 * layout-tests/editing/pasteboard/paste-line-endings-008.html: Added.
1924 * layout-tests/editing/pasteboard/paste-line-endings-009-expected.txt: Added.
1925 * layout-tests/editing/pasteboard/paste-line-endings-009.html: Added.
1926 * layout-tests/editing/pasteboard/paste-line-endings-010-expected.txt: Added.
1927 * layout-tests/editing/pasteboard/paste-line-endings-010.html: Added.
1931 2005-03-10 Darin Adler <darin@apple.com>
1933 Reviewed by Richard.
1935 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
1937 * khtml/rendering/render_text.cpp: (getCharacterBreakIterator): Set boolean "got iterator" to true.
1939 2005-03-10 Darin Adler <darin@apple.com>
1943 - fixed <rdar://problem/4042867> "Bigger" changes the font size of too much text when the selection is on a style-change boundary
1945 * khtml/editing/htmlediting.cpp: (khtml::ApplyStyleCommand::applyRelativeFontStyleChange):
1946 Advance out of the starting text node if we're at the end of it.
1948 2005-03-10 Darin Adler <darin@apple.com>
1950 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Fixed assertion for nested calls to write.
1952 2005-03-10 David Harrison <harrison@apple.com>
1956 <rdar://problem/4032346> REGRESSION (Mail): changing 1st line of a URL that wraps to two lines doesn't always update 2nd line
1958 * khtml/rendering/bidi.cpp:
1959 (khtml::RenderBlock::matchedEndLine):
1960 Look at first clean line in case line wrap implicitly dirtied it.
1962 2005-03-10 Maciej Stachowiak <mjs@apple.com>
1966 <rdar://problem/4046018> REGRESSION (TOT): RSS pages don't display anything
1968 * kwq/WebCoreBridge.mm:
1969 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Exempt
1970 feed: and feeds: pages from the local file security check.
1972 2005-03-10 Darin Adler <darin@apple.com>
1974 Change written by Steve Peters, reviewed by me.
1976 - fixed <rdar://problem/4045924> improve compareBoundaryPoints to make style changes faster
1978 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints):
1979 Do early outs in a couple of the loops to make things faster.
1981 2005-03-10 Jens Alfke <jens@apple.com>
1985 Fixes <rdar://problem/4040848> "REGR: Sun security-check demo applet does not load". My earlier fix for 3603191 deferred loading the applet until the </applet> tag is reached, so all <param>s will be available. Unfortunately that meant that if the </applet> tag was missing, the applet would never load at all. So instead, the loading needs to happen when the ID_APPLET tag is popped from the parser stack for any reason.
1987 I've restored the old NodeImpl::closeRenderer() method. Except it's now virtual, with a no-op base implementation, and is overridden by HTMLAppletElementImpl, replacing its setAllParamsAvailable method that I added a few weeks ago when fixing 3603191.
1989 This ensures that the applet will get loaded even if there is no explicit </applet> tag.
1991 The changes to htmlparser.cpp back out my earlier change and restore the lines that were deleted on 8/3/04 when the old closeRenderer was removed.
1993 * khtml/html/html_objectimpl.cpp:
1994 (HTMLAppletElementImpl::closeRenderer):
1995 * khtml/html/html_objectimpl.h:
1996 * khtml/html/htmlparser.cpp:
1997 (KHTMLParser::insertNode):
1998 (KHTMLParser::processCloseTag):
1999 (KHTMLParser::popOneBlock):
2000 * khtml/xml/dom_nodeimpl.h:
2001 (DOM::NodeImpl::closeRenderer):
2003 2005-03-10 Ken Kocienda <kocienda@apple.com>
2009 <rdar://problem/4024929> REGRESSION (Mail): Pasting text with multiple reply levels removes one level instead of all
2011 The code to figure out which node to use to merge into an existing line did not drill into the first inline element
2012 as needed to make the feature work as user expect. Instead, it looked at the first node, and if it was a block, it
2013 skipped that node. This worked for some cases (including the important "paste-as-quotation" case) but obviously
2014 doesn't work for content quoted more than once.
2016 Now, mergeStartNode() will look for the first node in pasted content that is not a block. It will now also look
2017 for nodes specially marked by Mail as a node added to make "Paste As Quotation" work. It won't skip those.
2019 NOTE: This change will break Mail's "Paste As Quotation" feature for TOT WebKit users, but this is only a temporary
2020 problem that will exist until we sync up with Mail's pending change to mark nodes as needed in its pasteAsQuotation:
2023 * khtml/editing/html_interchange.h: Add ApplePasteAsQuotation constant used to check for "marked" blockquotes.
2024 * khtml/editing/htmlediting.cpp:
2025 (khtml::ReplacementFragment::mergeStartNode): Look for first node that is either not a block or is marked as
2026 an ApplePasteAsQuotation node.
2027 (khtml::isMailPasteAsQuotationNode): New helper that looks for nodes marked with ApplePasteAsQuotation.
2028 * khtml/editing/htmlediting.h: Updated header for new function.
2030 This test result changed is an acceptable way.
2032 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
2033 * layout-tests/editing/pasteboard/paste-text-013.html
2035 NOTE: This change causes a regression in this layout test:
2037 * layout-tests/editing/pasteboard/paste-text-013.html
2039 This problem will need to be fixed separately, and this bug has been filed to track this problem:
2040 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
2042 2005-03-09 Maciej Stachowiak <mjs@apple.com>
2044 Reviewed by Richard.
2046 <rdar://problem/4040776> Dashboard (Weather widget) is a memory hog
2048 Change things around so the event listeners for XMLHttpRequest
2049 mark their JS listener objects instead of holding a hard
2050 reference, to avoid an unbreakable reference cycle.
2052 * khtml/ecma/kjs_events.cpp:
2053 (JSAbstractEventListener::JSAbstractEventListener):
2054 (JSAbstractEventListener::~JSAbstractEventListener):
2055 (JSAbstractEventListener::handleEvent):
2056 (JSAbstractEventListener::eventListenerType):
2057 (JSUnprotectedEventListener::JSUnprotectedEventListener):
2058 (JSUnprotectedEventListener::~JSUnprotectedEventListener):
2059 (JSUnprotectedEventListener::listenerObj):
2060 (JSUnprotectedEventListener::windowObj):
2061 (JSUnprotectedEventListener::mark):
2062 (JSEventListener::JSEventListener):
2063 (JSEventListener::~JSEventListener):
2064 (JSEventListener::listenerObj):
2065 (JSEventListener::windowObj):
2066 (JSLazyEventListener::JSLazyEventListener):
2067 * khtml/ecma/kjs_events.h:
2068 * khtml/ecma/kjs_html.h:
2069 * khtml/ecma/kjs_window.cpp:
2070 (Window::getJSEventListener):
2071 (Window::getJSUnprotectedEventListener):
2072 * khtml/ecma/kjs_window.h:
2073 * khtml/ecma/xmlhttprequest.cpp:
2074 (KJS::XMLHttpRequest::putValue):
2075 (KJS::XMLHttpRequest::mark):
2076 * khtml/ecma/xmlhttprequest.h:
2077 * khtml/khtml_part.h:
2079 2005-03-06 Maciej Stachowiak <mjs@apple.com>
2083 <rdar://problem/4005575> Arbitrary file disclosure vulnerability due to ability to load local html from remote content
2085 * khtml/ecma/kjs_html.cpp:
2086 (KJS::HTMLDocument::putValue):
2087 * khtml/ecma/kjs_window.cpp:
2089 (WindowFunc::tryCall):
2091 (LocationFunc::tryCall):
2092 * khtml/khtml_part.cpp:
2094 (KHTMLPart::scheduleLocationChange):
2095 (KHTMLPart::slotRedirect):
2096 (KHTMLPart::processObjectRequest):
2097 * khtml/khtml_part.h:
2098 * khtml/khtmlpart_p.h:
2099 * kwq/KWQKHTMLPart.mm:
2100 (KWQKHTMLPart::openURLRequest):
2101 (KWQKHTMLPart::urlSelected):
2102 (KWQKHTMLPart::createPart):
2103 * kwq/KWQKHTMLPartBrowserExtension.mm:
2104 (KHTMLPartBrowserExtension::createNewWindow):
2105 * kwq/WebCoreBridge.h:
2106 * kwq/WebCoreBridge.mm:
2107 (hasCaseInsensitivePrefix):
2108 (-[WebCoreBridge didNotOpenURL:pageCache:]):
2109 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]):
2111 2005-03-09 Richard Williamson <rjw@apple.com>
2113 Fixed <rdar://problem/4032938> Safari: text layout for MS P Gothic font is corrupted
2115 Remove our hacked special case now we have our own cache of
2116 which fonts are fixed pitch.
2121 (QFont::isFixedPitch):
2123 2005-03-09 David Harrison <harrison@apple.com>
2127 <rdar://problem/4037141> REGRESSION (Mail): Pasting deletes preceding blank lines with certain steps
2129 * khtml/editing/htmlediting.cpp:
2130 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
2131 Add check for anonymous text after blocks.
2133 2005-03-08 Ken Kocienda <kocienda@apple.com>
2139 <rdar://problem/4039661> crash in ApplyStyleCommand::applyBlockStyle pasting contents of webpage into Mail or Blot
2140 <rdar://problem/4039672> hang in moveParagraphContentsToNewBlockIfNecessary after pasting contents of webpage into Blot
2142 * khtml/editing/htmlediting.cpp:
2143 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Fix for 4039672. Iteration needs to do
2144 a traverseNextSibling(), not a traverseNextNode(). The latter might iterate into a child that already got moved, and
2145 the code can infinite loop as a result.
2146 (khtml::ApplyStyleCommand::applyBlockStyle): Fix for 4039661. This function iterates over a set of nodes to apply
2147 block styles. Before, the iteration would go from the start to the end of the selection, and apply block styles
2148 as it went. However, the act of applying style could confuse the iteration. Now I iterate and store the relevant
2149 nodes in QPtrList before doing any style manipulation, and then iterate that set of nodes.
2151 2005-03-08 Darin Adler <darin@apple.com>
2153 Change written by Hyatt, reviewed by me.
2155 - fixed <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
2157 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth):
2158 Only use a minWidth of 0 for images with a percentage value. Other replaced elements aren't scalable
2159 so their minWidth should be their calculated width. This has been wrong all along, but it's a relatively
2160 safe change because it only affects replaced elements' min-width.
2162 2005-03-08 David Harrison <harrison@apple.com>
2166 <rdar://problem/4039006> REGRESSION (Mail): Command-left-arrow goes to the start of the wrong line in particular message
2168 * khtml/editing/visible_units.cpp:
2169 (khtml::startOfLine):
2170 Use firstLeafChild() instead of firstChild().
2172 2005-03-08 Richard Williamson <rjw@apple.com>
2174 Fixed by Tom Madden.
2176 Fixed <rdar://problem/4038586> 8A402: Osaka-Mono text overlaps when typing with input method
2178 We weren't clearing the "all ascii" flag when setting text on
2181 Reviewed by Richard Williamson.
2183 * khtml/rendering/render_text.cpp:
2184 (RenderText::setText):
2186 2005-03-08 Darin Adler <darin@apple.com>
2188 Reviewed by Ken and Maciej.
2190 - fixed <rdar://problem/3988809> REGRESSION (Mail): wide space characters are turned into plain old spaces when typed or pasted
2192 Changed the few places where it matters to use a "collapsible whitespace" concept instead of
2193 the general whitespace concept. This means treating only ' ' and '\n' specially instead of
2194 including other space characters, which matches what the space-collapsing logic does in RenderText,
2195 although it really needs to behave differently based on whitespace mode.
2197 * khtml/editing/visible_text.h: (khtml::isCollapsibleWhitespace): Added. This returns true only for
2198 ' ' and '\n' since they are the only characters collapsed once text is in the DOM. But really it
2199 can't do the job ignoring white-space mode, so some day it must go.
2201 * khtml/editing/html_interchange.cpp: (convertHTMLTextToInterchangeFormat): Changed to use
2202 isCollapsibleWhitespace and removed unnecessary calls to latin1().
2204 * khtml/editing/htmlediting.cpp:
2205 (khtml::isNBSP): Removed unnecessary creation/destruction of QChar each time this is called.
2206 (khtml::nextCharacterIsCollapsibleWhitespace): Renamed from isWS and changed to use isCollapsibleWhitespace.
2207 (khtml::DeleteSelectionCommand::fixupWhitespace): Use isCollapsibleWhitespace instead of isWS,
2208 since we only want to do our NBSP tricks for collapsible whitespace.
2209 (khtml::InsertTextCommand::input): Changed use of isTab to instead say == "\t" since that does the
2210 same thing and is arguably just as clear. Changed use of isWS to == " " since the input text can't
2211 include any "\n" characters, and really a plain old space is the only collapsible thing that can
2212 be passed in. Use isCollapsibleWhitespace instead of isWS since we want to do NBSP tricks only for
2213 collapsible whitespace, not all whitespace.
2214 (khtml::InsertTextCommand::insertSpace): Use isCollapsibleWhitespace instead of isWS since we want
2215 to do NBSP tricks only for collapsible whitespace, not all whitespace.
2216 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
2218 * khtml/xml/dom_position.h: Changed treatNBSPAsWhiteSpace parameters to considerNonCollapsibleWhitespace
2219 parameters. The most common callers are only interested in collapsible whitespace, and the smart copy
2220 and paste callers want to include all whitespace, including non-breaking spaces and all the Unicode spaces.
2221 * khtml/xml/dom_position.cpp:
2222 (DOM::Position::leadingWhitespacePosition): Rename the parameter, and use either QChar::isSpace or
2223 isCollapsibleWhitespace depending on the boolean passed in.
2224 (DOM::Position::trailingWhitespacePosition): Ditto.
2226 2005-03-07 John Sullivan <sullivan@apple.com>
2230 - <rdar://problem/4040868> REGRESSION (Mail, 403-403+): Drag and drop deletes text,
2231 many other bad editing problems
2233 * khtml/rendering/render_text.cpp:
2234 (RenderText::caretMaxOffset):
2235 A "-" should have been a "+" in this method that was tweaked an hour ago. Editing
2236 was completely horked.
2238 2005-03-07 Richard Williamson <rjw@apple.com>
2240 Additional nil check from fix for 4040749.
2242 * khtml/rendering/render_box.cpp:
2243 (RenderBox::setStyle):
2245 2005-03-07 Richard Williamson <rjw@apple.com>
2247 Additional nil check from fix for 4040749.
2249 * khtml/rendering/render_layer.cpp:
2250 (RenderLayer::updateLayerPosition):
2252 2005-03-07 David Harrison <harrison@apple.com>
2256 <rdar://problem/4033202> REGRESSION (Mail): Can't arrow up at a particular spot in a particular Mail message
2258 Doublecheck that new position is really on a different line, because the VisiblePosition constructor does not.
2259 Filed <rdar://problem/4040763> for that problem.
2261 * khtml/editing/visible_units.cpp:
2262 (khtml::previousLinePosition):
2264 2005-03-07 Richard Williamson <rjw@apple.com>
2266 Fixed <rdar://problem/4040749> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
2268 When layers are dynamically created/removed as a result of changing opacity they weren't being correctly
2269 sized and positioned. This happens whenever opacity goes from < 1 to 1.
2273 * khtml/rendering/render_box.cpp:
2274 (RenderBox::setStyle):
2275 * khtml/rendering/render_layer.cpp:
2276 (RenderLayer::updateLayerPosition):
2278 2005-03-07 Christy Warren <kali@apple.com>
2282 * khtml/rendering/render_text.cpp:
2283 (RenderText::caretMinOffset): modified to handle BIDI case by checking all text boxes for min offset
2284 (RenderText::caretMaxOffset): modified to handle BIDI case by checking all text boxes for max offset
2286 2005-03-07 David Harrison <harrison@apple.com>
2290 <rdar://problem/4029225> REGRESSION (Mail): Crash if hit return after dragging in attachment - DeleteSelectionCommand::initializePositionData
2292 Work around the fact that the height() of a BR is 0 if there are no text elements on the line, even if there are replaced elements.
2293 Filed <rdar://problem/4040358> RenderBR height() is not accurate.
2295 * khtml/editing/htmlediting.cpp:
2296 (khtml::ReplaceSelectionCommand::doApply):
2297 When height is 0, double check that the placeholder is the first position on the line.
2301 2005-03-07 Ken Kocienda <kocienda@apple.com>
2307 <rdar://problem/4040136> Expose SPI for WebCore's functions to create document fragments from plain text and markup strings
2309 * kwq/DOMHTML.mm: Add two new SPI functions.
2310 (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:])
2311 (-[DOMHTMLDocument _createDocumentFragmentWithText:])
2312 * kwq/DOMPrivate.h: Declare the new SPI here, a privately-exported header, so Mail can make use of it.
2314 2005-03-07 Ken Kocienda <kocienda@apple.com>
2320 <rdar://problem/4039676> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date
2322 * khtml/editing/htmlediting.cpp:
2323 (khtml::ReplaceSelectionCommand::doApply): Code to "eat" a <br> element, that was creating an otherwise empty line, was running
2324 when it should not. If the content being pasted in does not end in a "logical" newline itself, then the <br> already
2325 in the content needs to be preserved. A simple one-line change now sees to this.
2327 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: This test now has an extra, but harmless,
2328 <br> at the end of a paragraph. This makes sense given the code change.
2331 * layout-tests/editing/pasteboard/paste-text-018-expected.txt: Added.
2332 * layout-tests/editing/pasteboard/paste-text-018.html: Added.
2334 2005-03-07 Ken Kocienda <kocienda@apple.com>
2340 <rdar://problem/4035648> REGRESSION (Mail): line feed in source HTML file causes bad copy/paste behavior
2342 The createMarkup() function in markup.cpp iterates over the nodes in a range,
2343 and does some bookkeeping to figure out when to add close tags to the markup.
2344 Some code added at the start of the loop to prevent markup from being written
2345 for unrendered nodes short-circuited the rest of the loop, and so prevented
2346 the close-tag-writing code from running when it should.
2348 This is why the "plain" text wound up inside of the bold tag in the example
2349 above. The addition of the unrendered return character caused an incorrect
2350 delay in the close tag for the bold element from being written out, with the
2351 result being that it wound up including additional content.
2353 The fix is to add checks for node renderers throughout the loop at the points
2354 where markup is written out for each node. This allows the additional close
2355 tag logic to run as needed.
2357 All layout tests pass with this change.
2359 * khtml/editing/markup.cpp:
2360 (khtml::createMarkup)
2364 * layout-tests/editing/pasteboard/paste-4035648-fix-expected.txt: Added.
2365 * layout-tests/editing/pasteboard/paste-4035648-fix.html: Added.
2367 2005-03-06 Christy Warren <kali@appple.com>
2371 * khtml/rendering/render_text.cpp:
2372 (lastRendererOnPrevLine): helper for RenderText::caretRect
2373 (RenderText::caretRect): added code to properly handle bidi ordered text boxes
2375 2005-03-06 Christy Warren <kali@apple.com>
2379 * khtml/editing/visible_position.cpp: Eliminated code that cuts off searching through the text boxes based on an assumption that breaks under bidi
2380 (khtml::VisiblePosition::isCandidate):
2381 * kwq/KWQFontMetrics.mm:
2382 (QFontMetrics::checkSelectionPoint): Made the initialization of the WebCoreStyle honor the reversed flag
2384 2005-03-05 John Sullivan <sullivan@apple.com>
2388 - fixed <rdar://problem/4038417> Mail crashed in StyleChange::checkForLegacyHTMLStyleChange
2389 when composing a reply
2391 * khtml/editing/htmlediting.cpp:
2392 (khtml::StyleChange::checkForLegacyHTMLStyleChange):
2393 Added missing nil check.
2395 2005-03-05 Darin Adler <darin@apple.com>
2399 - fixed <rdar://problem/4038478> Crash in renderer viewing RSS feed at feed://wvs.topleftpixel.com/index.rdf
2401 * khtml/xml/dom_docimpl.cpp: (widgetForNode): Check for nil before going from node to renderer.
2403 2005-03-05 Darin Adler <darin@apple.com>
2405 Reviewed by Richard.
2407 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
2409 * khtml/rendering/render_text.cpp:
2410 (getCharacterBreakIterator): Added. Helper that sets up an iterator for the passed-in text.
2411 Shares a single global iterator (fast, albeit not thread-safe).
2412 (RenderText::previousOffset): Changed to call getCharacterBreakIterator.
2413 (RenderText::nextOffset): Ditto.
2415 2005-03-05 Ken Kocienda <kocienda@apple.com>
2421 <rdar://problem/4038267> REGRESSION (Mail): Crash copying and pasting end of paragraph
2423 Code to handle content that has a "logical" newline at the end of the pasted content, and the code
2424 to adjust the selection at the end of the paste operation made an assumption that at least one
2425 node had been inserted by the paste command. This is not necessarily true in the case where the sole content
2426 in the pasted content is one of these "logical" newlines. Adjust some code around so that we don't deref
2427 null, but still adjust the selection correctly for this case. In each of the two functions below, some
2428 null checks have been added, and some code has been rearranged a little bit to continue on through
2429 the end of completeHTMLReplacement, even if no nodes have been inserted. The patch looks bigger and more
2430 complicated than the conceptual change.
2432 * khtml/editing/htmlediting.cpp:
2433 (khtml::ReplaceSelectionCommand::doApply)
2434 (khtml::ReplaceSelectionCommand::completeHTMLReplacement)
2436 * layout-tests/editing/pasteboard/paste-4038267-fix-expected.txt: Added.
2437 * layout-tests/editing/pasteboard/paste-4038267-fix.html: Added.
2439 2005-03-05 Darin Adler <darin@apple.com>
2443 - fixed <rdar://problem/4025918> images copied from Safari with relative src URLs aren't pasted into Mail messages (KURL resolves base URLs incorrectly)
2445 * kwq/KWQKURL.mm: (KURL::KURL): Add a slash at the start of the path if a relative part is adding
2446 a path onto a URL that has "pre-path" bits like host name, but no path yet. This doesn't come up
2447 for http because in that case we add a trailing "/" as part of canonicalization.
2449 2005-03-04 John Sullivan <sullivan@apple.com>
2453 - fixed <rdar://problem/4033705> REGRESSION (Mail): Copy/Paste from Excel
2454 crashes Mail in KWQKHTMLPart::fontForSelection(bool*) const + 232
2456 * kwq/KWQKHTMLPart.mm:
2457 (KWQKHTMLPart::fontForSelection):
2458 Check for nil startNode, not just nil renderer.
2460 2005-03-04 David Harrison <harrison@apple.com>
2462 Reviewed by Ken, Richard.
2464 <rdar://problem/3996383> REGRESSION (Mail): Deleting all of first line also deletes line ending
2466 Problem was the placeholder check was based on 0 height block, but the block in this
2467 case is the BODY, which has other content even though the paragraph is gone.
2469 * khtml/editing/htmlediting.cpp:
2470 (khtml::CompositeEditCommand::insertBlockPlaceholder):
2471 Now does insert instead of append!
2473 (khtml::CompositeEditCommand::appendBlockPlaceholder):
2474 New. Actually does append.
2476 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
2477 Renamed from insertBlockPlaceholderIfNeeded because it can insert or append. Also accepts "force insert" flag.
2479 (khtml::CompositeEditCommand::removeBlockPlaceholder):
2480 Renamed for succinctness from removeBlockPlaceholderIfNeeded.
2482 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
2483 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
2484 Use renamed methods.
2486 (khtml::DeleteSelectionCommand::doApply):
2487 Use addBlockPlaceholderIfNeeded "force insert" flag if deleting whole paragraphs did not leave an empty one.
2489 (khtml::InsertParagraphSeparatorCommand::doApply):
2490 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
2491 (khtml::InsertTextCommand::input):
2492 Use renamed methods.
2494 * khtml/editing/htmlediting.h:
2495 Renamed and new methods per above.
2498 2005-03-04 Chris Blumenberg <cblu@apple.com>
2500 Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after pasting attachment at end of message
2504 * khtml/editing/visible_units.cpp:
2505 (khtml::endOfParagraph): don't consider text nodes that have no rendered characters
2507 2005-03-04 Richard Williamson <rjw@apple.com>
2509 Fixed <rdar://problem/4034764> REGRESSION(125-188)Viewing text/plain page and going back/forward corrupts HTML pages (google.com)
2511 The parse mode wasn't be restored to the document when going
2516 * kwq/KWQKHTMLPart.mm:
2517 (KWQKHTMLPart::openURLFromPageCache):
2518 * kwq/KWQPageState.h:
2519 * kwq/KWQPageState.mm:
2520 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]):
2522 2005-03-04 Ken Kocienda <kocienda@apple.com>
2526 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Shame on me!
2527 I landed my last fix without running layout tests. This one changes in a subtle, but
2530 2005-03-04 Ken Kocienda <kocienda@apple.com>
2532 Reviewed by Harrison
2536 <rdar://problem/4032543> REGRESSION (Mail): Mail hangs when quoted text is pasted twice
2538 This code change fixes the bug in a non-obvious way. The root cause of the problem was
2539 that a VisiblePosition created using an affinity originating in Mail code caused
2540 two VisiblePosition objects that should have been equal to differ only in their
2541 affinities, which in turn caused us to run a code path that should not have run.
2543 * khtml/editing/visible_position.cpp:
2544 (khtml::VisiblePosition::VisiblePosition): Added copy constructor.
2545 (khtml::VisiblePosition::next): Factored out inline code that used to be here into new
2546 setAffinityUsingLinePosition() function.
2547 (khtml::isEqualIgnoringAffinity): New helper to handle cases when affinity in equality check does
2548 not matter. However, we want to know about such cases where a VisiblePosition differs only by affinity,
2549 and the code will assert in development when this happens.
2550 (khtml::isNotEqualIgnoringAffinity): Ditto, but not. :)
2551 (khtml::setAffinityUsingLinePosition): New helper function mentioned above. This will "correct"
2552 upstream affinity to downstream if the affinity does not make a difference for the position.
2553 * khtml/editing/visible_position.h:
2554 * khtml/editing/visible_range.h: Wacky bug. The operator== for this class took VisiblePosition classes!
2555 * khtml/editing/visible_units.cpp:
2556 (khtml::isStartOfParagraph): Now performs equality check without regard to affinity.
2557 (khtml::isEndOfParagraph): Ditto.
2558 (khtml::isStartOfBlock): Ditto.
2559 (khtml::isEndOfBlock): Ditto.
2560 * kwq/WebCoreBridge.mm:
2561 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Adjusts the affinity using setAffinityUsingLinePosition()
2564 2005-03-04 Darin Adler <darin@apple.com>
2568 - fixed <rdar://problem/4036817> REGRESSION: ctrl-y broken when a line + carriage return cut
2570 * khtml/editing/htmlediting.h: Added insertTextRunWithoutNewlines.
2571 * khtml/editing/htmlediting.cpp:
2572 (khtml::InsertTextCommand::input): Added assertion to make sure strings with newlines don't get
2574 (khtml::TypingCommand::insertText): Added. Takes the name of the old function, but is a new
2575 level that breaks runs into lines and inserts each one separately.
2576 (khtml::TypingCommand::insertTextRunWithoutNewlines): Renamed old insertText to this.
2578 * khtml/dom/dom_string.h: Made substring be a const member function.
2579 * khtml/dom/dom_string.cpp: (DOM::DOMString::substring): Made this const.
2581 2005-03-04 Darin Adler <darin@apple.com>
2585 - fixed <rdar://problem/4020413> REGRESSION (Mail): can't use fonts with names that start with "#" in Mail (Korean fonts)
2587 * khtml/css/css_valueimpl.cpp:
2588 (DOM::isLegalIdentifier): Added. Commented out and not used.
2589 (DOM::quoteStringIfNeeded): Quotes the string if needed. For now only if it starts with "#".
2590 (DOM::CSSPrimitiveValueImpl::cssText): Call quoteStringIfNeeded when asked for cssText for an arbitrary string, since we
2591 need text you can re-parse.
2592 (DOM::FontFamilyValueImpl::cssText): Ditto.
2594 * khtml/editing/markup.cpp:
2595 (khtml::startMarkup): Added comments about lack of quoting for attributes.
2596 (khtml::createMarkup): Ditto.
2598 2005-03-04 Adele Amchan <adele@apple.com>
2602 Fix for <rdar://problem/4021711> REGRESSION(125-188) blank pages when browsing forum at cooperativeresearch.org - cached external script problem
2604 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::scriptHandler): set flag needToRefCachedScript so we can make sure
2605 notifyFinished is called after pendingSrc is set up with the right data from the cached script
2607 2005-03-04 Ken Kocienda <kocienda@apple.com>
2613 <rdar://problem/4029632> Tiger 8A398:- Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
2615 * khtml/editing/htmlediting.cpp:
2616 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): VisiblePosition constructor
2617 was failing to yield a position for a node just pasted into the document since a layout was needed
2618 for the calculation to come out right. Layout added. Crash gone.
2622 2005-03-03 Chris Blumenberg <cblu@apple.com>
2624 Fixed: <rdar://problem/3992803> Cannot navigate through list items with the keyboard, you're stuck in the same <li> block unless you click out
2626 Reviewed by harrison.
2628 * khtml/rendering/render_line.cpp:
2629 (khtml::RootInlineBox::closestLeafChildForXPos): avoid returning list markers when possible. Also improved heuristic for returning the best InlineBox given the passed X position.
2632 2005-03-03 Ken Kocienda <kocienda@apple.com>
2638 <rdar://problem/4035198> Pasting text with different styles does not get reproducible results
2640 I had a good idea yesterday to improve the way we "fixup" styles after
2641 pasting, but i chose a poor data structure to do it, a map of
2642 nodes-to-styles. In the fixup step, I iterated over the map elements and
2643 did the fixup. However, since the order in which the items would come
2644 out of the map is indeterminate, we got unpredictable results.
2646 So, the concept was good, but the implementation was flawed. I have
2647 fixed this mapping to be a list instead, so the order that nodes are
2648 evaluated in the fixup step is document order. This works nicely.
2650 * khtml/editing/htmlediting.cpp:
2651 (khtml::ReplacementFragment::~ReplacementFragment): No longer need to explicity deref nodes and
2652 styles saved away for later fixup. This is now handled by the new NodeDesiredStyle class.
2653 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls computeAndStoreNodeDesiredStyle,
2654 function renamed from mapDesiredStyleForNode.
2655 Now accepts a QValueList<NodeDesiredStyle> in place of the old map.
2656 (khtml::NodeDesiredStyle::NodeDesiredStyle): New class that represents a node-to-style mapping.
2657 (khtml::NodeDesiredStyle::~NodeDesiredStyle): Ditto.
2658 (khtml::NodeDesiredStyle::operator=): Ditto.
2659 (khtml::ReplaceSelectionCommand::doApply): Now calls computeAndStoreNodeDesiredStyle,
2660 function renamed from mapDesiredStyleForNode.
2661 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Now operates on a QValueList<NodeDesiredStyle> in
2662 place of the old map.
2663 (khtml::computeAndStoreNodeDesiredStyle): Renamed from mapDesiredStyleForNode. Now operates on a
2664 QValueList<NodeDesiredStyle> in place of the old map.
2665 * khtml/editing/htmlediting.h:
2666 (khtml::NodeDesiredStyle): New class that represents a node-to-style mapping.
2667 (khtml::ReplacementFragment::desiredStyles): Now returns a QValueList<NodeDesiredStyle> in place of the old map.
2669 * layout-tests/editing/style/typing-style-003-expected.txt: Results changed in an acceptable way.
2671 2005-03-02 Darin Adler <darin@apple.com>
2675 - fixed <rdar://problem/4029741> REGRESSION (188-189): <input type=text> are cleared when you hide/show them
2677 * khtml/html/html_formimpl.h: Added detach functions for both input and text area elements, since
2678 both have m_valueMatchesRenderer flags.
2679 * khtml/html/html_formimpl.cpp:
2680 (DOM::HTMLInputElementImpl::detach): Set m_valueMatchesRenderer to false, since the renderer is going away.
2681 (DOM::HTMLTextAreaElementImpl::detach): Ditto.
2683 2005-03-02 Ken Kocienda <kocienda@apple.com>
2689 <rdar://problem/4006151> in reply, caret moves to next line after toggling bold style then typing
2691 * khtml/editing/htmlediting.cpp:
2692 (khtml::ApplyStyleCommand::applyInlineStyle): Defer cleaning up empty style until the end of the
2693 function. In some situations, the render tree can get confused when we do this removal up front.
2694 I wish I understood the reasons more deeply, but this bit of code shuffling seems harmless, and
2697 2005-03-02 Darin Adler <darin@apple.com>
2701 - fixed <rdar://problem/4024966> crash happened twice in [KWQTextField setHasFocus:] + 0xe8
2703 Added more nil checks to the widget implementations. Anywhere a widget pointer is used, do a nil check,
2704 rather than relying on high level assumptions about which calls can and can't destroy the HTML element
2705 (and hence the widget). The case in the bug seems to be a case where scrolling destroyed the element.
2706 We can't be sure this fixes the bug, but we can be relatively sure we didn't introduce any new problems,
2707 because this just avoids nil-dereferencing.
2710 (-[KWQButton becomeFirstResponder]):
2711 (-[KWQButton nextKeyView]):
2712 (-[KWQButton previousKeyView]):
2713 * kwq/KWQListBox.mm:
2714 (-[KWQTableView mouseDown:]):
2715 (-[KWQTableView becomeFirstResponder]):
2716 (-[KWQTableView numberOfRowsInTableView:]):
2717 (-[KWQTableView tableViewSelectionDidChange:]):
2718 (-[KWQTableView tableView:shouldSelectRow:]):
2719 (-[KWQTableView selectionShouldChangeInTableView:]):
2720 * kwq/KWQScrollBar.mm:
2721 (-[KWQScrollBar scroll:]):
2723 (-[KWQSlider mouseDown:]):
2724 (-[KWQSlider slide:]):
2725 (-[KWQSlider becomeFirstResponder]):
2726 (-[KWQSlider nextKeyView]):
2727 (-[KWQSlider previousKeyView]):
2728 * kwq/KWQTextArea.mm:
2729 (-[KWQTextAreaTextView becomeFirstResponder]):
2730 (-[KWQTextAreaTextView resignFirstResponder]):
2731 (-[KWQTextAreaTextView mouseDown:]):
2732 * kwq/KWQTextField.mm:
2733 (-[KWQTextFieldController action:]):
2734 (-[KWQTextFieldController controlTextDidEndEditing:]):
2735 (-[KWQTextFieldController controlTextDidChange:]):
2736 (-[KWQTextFieldController textView:didHandleEvent:]):
2737 (-[KWQTextFieldController setHasFocus:]):
2739 2005-03-02 Richard Williamson <rjw@apple.com>
2741 Fixed <rdar://problem/4031483> Leak (RenderObject::createInlineBox) reproducible with Stock widget
2743 We were leaking inline block line boxes. Argh!
2747 * khtml/rendering/render_flow.cpp:
2748 (RenderFlow::dirtyLineBoxes):
2749 * khtml/rendering/render_line.cpp:
2750 (khtml::InlineBox::deleteLine):
2752 2005-03-02 Chris Blumenberg <cblu@apple.com>
2754 Fixed: <rdar://problem/3976872> REGRESSION (Mail): Pasted plain text doesn't get the proper style if pasted into newlines
2756 Reviewed by kocienda.
2758 * khtml/editing/htmlediting.cpp:
2759 (khtml::EditCommand::styleAtPosition): new, factored out from calculateStyleBeforeInsertion
2760 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): call styleAtPosition
2761 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): clear new m_insertionStyle ivar
2762 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): deref new m_insertionStyle ivar
2763 (khtml::ReplaceSelectionCommand::doApply): store the style so it later be applied when matching style
2764 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply style from m_insertionStyle when matching style
2765 * khtml/editing/htmlediting.h:
2767 2005-03-02 Maciej Stachowiak <mjs@apple.com>
2771 <rdar://problem/4031718> REGRESSION (401-401+): Safari reproducible crash setting up scope in JSLazyEventListener::parseCode authenticating to bugweb
2773 * khtml/ecma/kjs_events.cpp:
2774 (JSLazyEventListener::parseCode): If originalNode is NULL, don't
2775 mess with the scope chain.
2777 * khtml/html/html_baseimpl.cpp:
2778 (HTMLBodyElementImpl::parseHTMLAttribute): For handlers that are
2779 delcared on body but set on the document, pass NULL to avoid
2780 swizzling the scope chain. It turns out that this is what browsers
2781 do, and it finesses the crash.
2783 2005-03-02 David Harrison <harrison@apple.com>
2787 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
2789 * khtml/editing/htmlediting.cpp:
2790 (khtml::ReplaceSelectionCommand::doApply):
2792 2005-03-02 Ken Kocienda <kocienda@apple.com>
2797 <rdar://problem/4020574> REGRESSION (Mail): copy/paste first part of reply-quoted text alters downstream style
2799 The problem was that the operation to move nodes following the newly-pasted nodes did not preserve the
2800 style of these moved nodes. I have generalized some of the functions that compute and preserve styles
2801 for nodes and then apply these styles after a DOM operation.
2803 * khtml/editing/htmlediting.cpp:
2804 (khtml::ReplacementFragment::~ReplacementFragment): Call new derefNodesAndStylesInMap() helper function
2805 in place of old code that had this deref'ing inline.
2806 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls new mapDesiredStyleForNode() helper
2807 function place of old code that had this style computation inline.
2808 (khtml::ReplacementFragment::removeStyleNodes): Updated comment for new helper name.
2809 (khtml::ReplaceSelectionCommand::doApply): Now calls new helpers in place of helpers whose names were changed,
2810 or in place of pre-refactored inline code.
2811 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Renamed from applyStyleToInsertedNodes(). Now generalized
2812 to take the map of nodes to use for the fixup. This makes it possible to call this code with different maps,
2813 and that is needed to fix the bug.
2814 (khtml::mapDesiredStyleForNode): New helper function to compute the inheritable styles for a given node
2815 and map this style to the given node in the given map. This function now also includes the code that was
2816 in the removeBlockquoteColorsIfNeeded(). This latter helper has now been removed.
2817 (khtml::derefNodesAndStylesInMap): Simple helper to deref map members.
2818 * khtml/editing/htmlediting.h:
2819 (khtml::ReplacementFragment::desiredStyles): New helper to return map of nodes-to-desiredStyles.
2821 2005-03-01 Ken Kocienda <kocienda@apple.com>
2827 <rdar://problem/4011358> REGRESSION(Mail): after dragging text to mail message and deleting, typing or dragging new text doesn't work
2829 * khtml/editing/visible_position.cpp:
2830 (khtml::VisiblePosition::isCandidate): Insertion point disappearing was due to a failed
2831 check here after deleting all the content in the body element. The special "empty block"
2832 needs to add check for DOM children. A block may have straggling anonymous render children in
2833 some cases, and so the check needs to be (!DOM-kids || !render-kids).
2835 Also, I botched the last checkin trying to split these two patches in my tree. Wrong layout tests
2836 got checked in, I checked in a conflict marker in the Changelog, etc. I fixed everything with this checkin.
2838 2005-03-01 Ken Kocienda <kocienda@apple.com>
2842 Improved fix for this bug:
2844 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
2846 Maciej and I discussed this situation at length, and we came up with a better fix than I did earlier.
2848 * khtml/editing/htmlediting.cpp:
2849 (khtml::InsertParagraphSeparatorCommand::doApply): Simplify one special case so that it only handles the
2850 "last in block" situation. Remove special case for "downstream node is in different block" and handle
2851 this case with a little bit of special code in the general insertion case.
2853 Results studied to make sure there were no problems.
2855 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt
2856 * layout-tests/editing/inserting/insert-div-001-expected.txt
2857 * layout-tests/editing/inserting/insert-div-002-expected.txt
2858 * layout-tests/editing/inserting/insert-div-004-expected.txt
2859 * layout-tests/editing/inserting/insert-div-005-expected.txt
2860 * layout-tests/editing/inserting/insert-div-009-expected.txt
2861 * layout-tests/editing/inserting/insert-div-014-expected.txt
2862 * layout-tests/editing/inserting/insert-div-018-expected.txt
2863 * layout-tests/editing/inserting/insert-div-024-expected.txt
2864 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
2865 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
2866 * layout-tests/editing/pasteboard/paste-text-015-expected.txt
2867 * layout-tests/editing/style/block-style-004-expected.txt
2868 * layout-tests/editing/style/block-style-005-expected.txt
2869 * layout-tests/editing/style/block-style-006-expected.txt
2873 * layout-tests/editing/inserting/insert-div-027.html
2874 * layout-tests/editing/inserting/insert-div-027-expected.txt
2876 2005-03-01 David Hyatt <hyatt@apple.com>
2878 Fix for 4030890, regression with <sup> on Google. Fix some bogus != comparison checks in verticalPositionHint.
2882 (RenderObject::getVerticalPosition):
2884 2005-03-01 Chris Blumenberg <cblu@apple.com>
2886 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
2890 * khtml/editing/htmlediting.cpp:
2891 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
2892 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
2893 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
2894 * layout-tests/editing/deleting/smart-delete-001.html: Added.
2895 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
2896 * layout-tests/editing/deleting/smart-delete-002.html: Added.
2898 2005-03-01 Richard Williamson <rjw@apple.com>
2900 Fixed <rdar://problem/4029772> Weather widgets use a lot of memory (more that other widgets)
2902 The string objects created by KWQHeaderStringFromDictionary() leaked.
2904 Reviewed by John Louch.
2907 (KWQHeaderStringFromDictionary):
2909 2005-03-01 Jens Alfke <jens@apple.com>
2913 <rdar://problem/4004531> Simple Sun Signed Applet throws exceptions; doesn't run
2914 Two fixes for the way we extract the parameter-y goodness from <object> tags.
2916 * khtml/rendering/render_frames.cpp:
2917 (RenderPartObject::updateWidget):
2919 2005-03-01 Richard Williamson <rjw@apple.com>
2921 Fixed <rdar://problem/3990258> REGRESSION (125.12-181): top of picture that spans two pages is cut off on print from Safari
2923 The problem was due to incorrect "object truncation" in RenderFlow::paintLines.
2924 We attempt to push objects down if they don't fit on a page at
2925 paint time. If the attempt to push object down failed we just
2926 didn't paint at all.
2930 * khtml/rendering/render_flow.cpp:
2931 (RenderFlow::paintLines):
2933 2005-03-01 Chris Blumenberg <cblu@apple.com>
2935 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
2939 * khtml/editing/htmlediting.cpp:
2940 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
2941 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
2942 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
2943 * layout-tests/editing/deleting/smart-delete-001.html: Added.
2944 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
2945 * layout-tests/editing/deleting/smart-delete-002.html: Added.
2947 2005-03-01 Ken Kocienda <kocienda@apple.com>
2953 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
2955 * khtml/editing/htmlediting.cpp:
2956 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
2958 2005-03-01 Maciej Stachowiak <mjs@apple.com>
2962 <rdar://problem/4003774> REGRESSION(125-181): JavaScript problems @ Yankee/Dixie quiz
2964 Reworked how scopes are set up for event handlers to match other
2965 browser. This includes the following changes:
2967 - Special scope entries are set up at the time the event handler
2968 is created, not at the time it fires.
2970 - Special scope is only set up for event handlers set in the html
2971 source through an html attribute, not for handlers set using
2972 addEventHandler or setting JS properties like onclick through
2975 - Special scope is based on the DOM node on which the handler is
2976 an attribute, not the event target.
2978 This fixes the regression while allowing the fix to
2979 <rdar://problem/3798453> (DIG: getting variable with same name as
2980 DOM element attribute gets attribute value instead) to keep
2983 * khtml/ecma/kjs_events.cpp:
2984 (JSEventListener::handleEvent):
2985 (JSLazyEventListener::JSLazyEventListener):
2986 (JSLazyEventListener::parseCode):
2987 * khtml/ecma/kjs_events.h:
2988 * khtml/ecma/kjs_proxy.cpp:
2989 (KJSProxyImpl::createHTMLEventHandler):
2990 * khtml/ecma/kjs_proxy.h:
2991 * khtml/ecma/kjs_window.cpp:
2992 (Window::getJSLazyEventListener):
2993 * khtml/ecma/kjs_window.h:
2994 * khtml/html/html_baseimpl.cpp:
2995 (HTMLBodyElementImpl::parseHTMLAttribute):
2996 (HTMLFrameElementImpl::parseHTMLAttribute):
2997 (HTMLFrameSetElementImpl::parseHTMLAttribute):
2998 * khtml/html/html_elementimpl.cpp:
2999 (HTMLElementImpl::parseHTMLAttribute):
3000 * khtml/html/html_formimpl.cpp:
3001 (DOM::HTMLFormElementImpl::parseHTMLAttribute):
3002 (DOM::HTMLButtonElementImpl::parseHTMLAttribute):
3003 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
3004 (DOM::HTMLLabelElementImpl::parseHTMLAttribute):
3005 (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
3006 (DOM::HTMLTextAreaElementImpl::parseHTMLAttribute):
3007 * khtml/html/html_imageimpl.cpp:
3008 (HTMLImageElementImpl::parseHTMLAttribute):
3009 * khtml/html/html_objectimpl.cpp:
3010 (HTMLObjectElementImpl::parseHTMLAttribute):
3011 * khtml/khtml_part.cpp:
3012 (KHTMLPart::createHTMLEventListener):
3013 * khtml/khtml_part.h:
3014 * khtml/xml/dom_docimpl.cpp:
3015 (DocumentImpl::createHTMLEventListener):
3016 * khtml/xml/dom_docimpl.h:
3020 2005-03-01 Chris Blumenberg <cblu@apple.com>
3022 Backed out my patch since the tree was closed.
3024 * khtml/editing/htmlediting.cpp:
3025 (khtml::DeleteSelectionCommand::initializePositionData):
3026 * khtml/editing/jsediting.cpp:
3028 2005-03-01 Chris Blumenberg <cblu@apple.com>
3030 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
3034 * khtml/editing/htmlediting.cpp:
3035 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
3036 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
3037 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
3038 * layout-tests/editing/deleting/smart-delete-001.html: Added.
3039 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
3040 * layout-tests/editing/deleting/smart-delete-002.html: Added.
3042 2005-03-01 Ken Kocienda <kocienda@apple.com>
3048 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
3050 * khtml/editing/htmlediting.cpp:
3051 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
3053 2005-03-01 David Harrison <harrison@apple.com>
3057 <rdar://problem/3915560> Mail would like an SPI to enable "smart" text paste/drop
3059 * kwq/WebCoreBridge.h:
3060 * kwq/WebCoreBridge.mm:
3061 (-[WebCoreBridge smartDeleteRangeForProposedRange:]):
3062 (-[WebCoreBridge smartInsertForString:replacingRange:beforeString:afterString:]):
3065 2005-03-01 Chris Blumenberg <cblu@apple.com>
3067 Fixed: <rdar://problem/4030404> selection granularity should be set when extending selection via JS
3069 Reviewed by kocienda.
3071 * khtml/ecma/kjs_window.cpp:
3072 (SelectionFunc::tryCall): set the granularity on the part. This will allow us to write smart paste layout tests.
3073 * layout-tests/editing/pasteboard/smart-paste-001-expected.txt: Added.
3074 * layout-tests/editing/pasteboard/smart-paste-001.html: Added.
3075 * layout-tests/editing/pasteboard/smart-paste-002-expected.txt: Added.
3076 * layout-tests/editing/pasteboard/smart-paste-002.html: Added.
3077 * layout-tests/editing/pasteboard/smart-paste-003-expected.txt: Added.
3078 * layout-tests/editing/pasteboard/smart-paste-003.html: Added.
3079 * layout-tests/editing/pasteboard/smart-paste-004-expected.txt: Added.
3080 * layout-tests/editing/pasteboard/smart-paste-004.html: Added.
3081 * layout-tests/editing/pasteboard/smart-paste-005-expected.txt: Added.
3082 * layout-tests/editing/pasteboard/smart-paste-005.html: Added.
3083 * layout-tests/editing/pasteboard/smart-paste-006-expected.txt: Added.
3084 * layout-tests/editing/pasteboard/smart-paste-006.html: Added.
3085 * layout-tests/editing/pasteboard/smart-paste-007-expected.txt: Added.
3086 * layout-tests/editing/pasteboard/smart-paste-007.html: Added.
3088 2005-03-01 Chris Blumenberg <cblu@apple.com>
3090 Fixed: <rdar://problem/4029934> smart paste with plain text can add too many spaces
3092 Reviewed by kocienda.
3094 * khtml/editing/htmlediting.cpp:
3095 (khtml::ReplaceSelectionCommand::doApply): pass true for treatNBSPAsWhitespace to leadingWhitespacePosition and trailingWhitespacePosition
3096 * khtml/xml/dom_position.cpp:
3097 (DOM::isWS): take treatNBSPAsWhitespace param
3098 (DOM::Position::leadingWhitespacePosition): ditto
3099 (DOM::Position::trailingWhitespacePosition): ditto
3100 * khtml/xml/dom_position.h:
3102 2005-03-01 Ken Kocienda <kocienda@apple.com>
3108 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
3110 * khtml/editing/htmlediting.cpp:
3111 (khtml::InsertParagraphSeparatorCommand::doApply): Look for the upstream-most block to insert after
3112 when at the visible end of a block. This helps to avoid some undesirable sequences of markup which
3113 Dave says will be vary hard to render. Changing the command in this way avoids the "limitations"
3114 of the render tree by not asking it to render markup we do not want to make anyway.
3116 All these tests change, but either in insignificant ways, or for the better.
3118 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt:
3119 * layout-tests/editing/inserting/insert-div-001-expected.txt:
3120 * layout-tests/editing/inserting/insert-div-002-expected.txt:
3121 * layout-tests/editing/inserting/insert-div-004-expected.txt:
3122 * layout-tests/editing/inserting/insert-div-005-expected.txt:
3123 * layout-tests/editing/inserting/insert-div-009-expected.txt:
3124 * layout-tests/editing/inserting/insert-div-024-expected.txt:
3125 * layout-tests/editing/pasteboard/paste-text-011-expected.txt:
3126 * layout-tests/editing/pasteboard/paste-text-013-expected.txt:
3127 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
3128 * layout-tests/editing/style/block-style-004-expected.txt:
3129 * layout-tests/editing/style/block-style-005-expected.txt:
3130 * layout-tests/editing/style/block-style-006-expected.txt:
3131 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
3132 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
3133 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
3134 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
3136 New test to check specific problem mentioned in the bug.
3138 * layout-tests/editing/inserting/insert-div-026-expected.txt: Added.
3139 * layout-tests/editing/inserting/insert-div-026.html: Added.
3141 2005-02-28 Maciej Stachowiak <mjs@apple.com>
3145 <rdar://problem/4002864> REGRESSION(125-146) getElementById in onload fails in a test case involving external resources
3147 Moved management of elementById hashtable from attach/detach to
3148 insertedIntoDocument/removedFromDocument, to avoid being thrown
3149 off by temporary detaches due to style recalcs.
3151 * khtml/xml/dom_elementimpl.cpp:
3152 (ElementImpl::insertedIntoDocument):
3153 (ElementImpl::removedFromDocument):
3154 (ElementImpl::attach):
3155 (ElementImpl::updateId):
3156 * khtml/xml/dom_elementimpl.h:
3158 Make sure that insertedIntoDocument is called before firing any
3161 * khtml/xml/dom_nodeimpl.cpp:
3162 (NodeBaseImpl::dispatchChildInsertedEvents):
3164 2005-02-28 David Hyatt <hyatt@apple.com>
3166 Fix for 4028999, safari crashes when resetting if mallocsribble is on. Clip rects were being cleared using dead
3167 render objects. Change the ordering.
3171 * khtml/rendering/render_box.cpp:
3172 (RenderBox::detach):
3173 * khtml/rendering/render_layer.cpp:
3174 (RenderLayer::~RenderLayer):
3176 2005-02-28 Chris Blumenberg <cblu@apple.com>
3178 Fixed: <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
3180 Reviewed by kocienda.
3182 * khtml/editing/htmlediting.cpp:
3183 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Call updateLayout so caretMinOffset and caretMaxOffset return correct values.
3185 2005-02-28 John Sullivan <sullivan@apple.com>
3189 - WebCore part of fix for <rdar://problem/4023490> REGRESSION (125-185): Tabbing through links
3190 on frameset page gets stuck at end (tivofaq.com)
3192 * kwq/WebCoreBridge.h:
3193 add nextValidKeyViewOutsideWebFrameViews (code is in WebKit)
3195 2005-02-28 Ken Kocienda <kocienda@apple.com>
3201 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
3203 * khtml/css/css_computedstyle.cpp: inheritableProperties array now defined in css_valueimpl.cpp.
3204 * khtml/css/css_valueimpl.cpp: Define inheritableProperties array here.
3205 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Use new name for blockProperties, and use the new
3206 constant for the number of items in the array.
3207 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
3208 (DOM::CSSMutableStyleDeclarationImpl::removeInheritableProperties): New function.
3209 * khtml/css/css_valueimpl.h: Declare inheritableProperties array and numInheritableProperties extern so they
3210 can be defined in css_valueimpl.cpp and used in css_computedstyle.cpp.
3211 * khtml/editing/htmlediting.cpp:
3212 (khtml::ReplacementFragment::removeStyleNodes): This code was misguided, and removed too much style from HTML
3213 elements. Now, it removes from HTML elements only the styles that we replace later with a call to applyStyle().
3214 Also, add ID_B to list of inline "style" nodes we are willing to remove. Leaving it off was an oversight.
3216 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: ID_B fix made this result change, without any
3217 visible change in the test.
3221 * layout-tests/editing/style/smoosh-styles-003.html
3222 * layout-tests/editing/style/smoosh-styles-003-expected.txt
3224 2005-02-28 Richard Williamson <rjw@apple.com>
3226 Fixed <rdar://problem/4026985> CrashTracer: ...14 crashes at com.apple.WebCore: -[KWQPageState invalidate] + 32
3228 Added more nil checking and ASSERTS.
3229 Without a reproducible case this is hard to definitively resolve.
3231 Reviewed by John Sullivan.
3233 * kwq/KWQPageState.mm:
3234 (-[KWQPageState invalidate]):
3236 2005-02-28 Richard Williamson <rjw@apple.com>
3238 Fixed <rdar://problem/4027702> 3.5% performance regression btwn Safari-188 and Safari-400
3240 I inadvertently checked in some debugging code that disabled
3241 style sharing. Backed out that change.
3243 * khtml/css/cssstyleselector.cpp:
3244 (khtml::CSSStyleSelector::styleForElement):
3246 2005-02-28 Chris Blumenberg <cblu@apple.com>
3248 Fixed: <rdar://problem/4026639> www.bmw.ca configurator does not work with Safari
3252 * khtml/ecma/kjs_html.cpp:
3253 (KJS::HTMLElement::tryGet): when frameset.<name of frame child> is called, return the window object of the frame child
3255 2005-02-28 Ken Kocienda <kocienda@apple.com>
3261 <rdar://problem/4026906> Paste of HTML table content can break table structure
3263 * khtml/editing/htmlediting.cpp:
3264 (khtml::ReplacementFragment::pruneEmptyNodes): Call new isProbablyTableStructureNode() function to prevent
3265 removal of empty table structure nodes.
3266 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
3267 (khtml::isProbablyTableStructureNode): New helper function.
3268 * khtml/editing/htmlediting.h: Declare new helper.
3270 2005-02-28 Chris Blumenberg <cblu@apple.com>
3272 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
3274 Reviewed by kocienda.
3276 * khtml/editing/htmlediting.cpp:
3277 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): ref and deref the element while it is "floating"
3278 (khtml::ReplacementFragment::insertFragmentForTestRendering): ditto
3279 (khtml::floatRefdElement): new, keeps an element alive while its ref count is 0
3280 (khtml::createDefaultParagraphElement): removed commented out code
3281 (khtml::createBlockPlaceholderElement): ref the element and return it as "floating"
3282 (khtml::createFontElement): ditto
3283 (khtml::createStyleSpanElement): ditto
3284 * khtml/editing/htmlediting.h:
3286 2005-02-27 Maciej Stachowiak <mjs@apple.com>
3290 <rdar://problem/3993557> REGRESSION (125-180-ish): getElementsByTagName no longer works with namespace designations
3292 * khtml/xml/dom_nodeimpl.cpp:
3293 (NodeBaseImpl::getElementsByTagNameNS): When no namespace is specified, find elements
3294 of the specified name in any namespace to match Mozilla and earlier Safari behavior.
3296 2005-02-25 Darin Adler <darin@apple.com>
3300 - fixed <rdar://problem/4025618> Crash while searching at hollywoodvideo.com
3302 * khtml/html/html_formimpl.h: Added valueWithDefault.
3303 * khtml/html/html_formimpl.cpp:
3304 (DOM::HTMLInputElementImpl::appendFormData): Call valueWithDefault instead of going at the render object
3305 to try to get the default value; there may be no render object if this is display:none.
3306 (DOM::HTMLInputElementImpl::valueWithDefault): Added. Knows about the defaults for "submit" and "reset"
3307 buttons; otherwise just returns the value as-is.
3309 * khtml/rendering/render_form.h: Removed the defaultLabel member functions.
3310 * khtml/rendering/render_form.cpp:
3311 (RenderSubmitButton::rawText): Call valueWithDefault instead of using defaultLabel function here on
3312 the render side. The DOM needs to know how to deal with the default anyway for form submission.
3313 (RenderSubmitButton::defaultLabel): Removed.
3314 (RenderResetButton::defaultLabel): Removed.
3315 (RenderPushButton::defaultLabel): Removed.
3317 2005-02-25 Darin Adler <darin@apple.com>