1 2005-05-05 Darin Adler <darin@apple.com>
3 Reviewed by Dave Hyatt.
5 - fixed <rdar://problem/4109564> REGRESSION (Atlanta): maps.google.com doesn't always center California correctly
7 * khtml/ecma/kjs_events.cpp: (offsetFromTarget): Fix two places that said X where they should say Y.
9 2005-05-05 David Harrison <harrison@apple.com>
11 Restore fixed setEndingSelection. Fixed method was ifdef'd out
12 because change was at end of Tiger development, but method is
13 unused. You just can never be _too_ safe.
15 * khtml/editing/htmlediting.cpp:
16 (khtml::EditCommandPtr::setEndingSelection):
18 2005-05-02 Maciej Stachowiak <mjs@apple.com>
22 - renamed NodeBaseImpl to ContainerNodeImpl
24 * khtml/ecma/kjs_dom.cpp:
25 (DOMNodeProtoFunc::tryCall): Avoid use of NodeBaseImpl and avoid
26 use of obsolete checkNoOwner call, use isAncestor instead.
27 * khtml/html/html_elementimpl.cpp:
28 (HTMLElementImpl::setOuterText): Avoid gratuitous use of
30 * khtml/xml/dom_nodeimpl.cpp:
31 (NodeBaseImpl::checkNoOwner): Removed.
33 Ther rest is all just simple renaming.
35 * khtml/xml/dom_docimpl.cpp:
36 (DocumentImpl::DocumentImpl):
37 (DocumentImpl::attach):
38 (DocumentImpl::detach):
39 (DocumentFragmentImpl::DocumentFragmentImpl):
40 * khtml/xml/dom_docimpl.h:
41 * khtml/xml/dom_elementimpl.cpp:
43 (ElementImpl::ElementImpl):
44 (ElementImpl::insertedIntoDocument):
45 (ElementImpl::removedFromDocument):
46 (ElementImpl::attach):
48 * khtml/xml/dom_elementimpl.h:
49 * khtml/xml/dom_nodeimpl.cpp:
50 (ContainerNodeImpl::ContainerNodeImpl):
51 (ContainerNodeImpl::~ContainerNodeImpl):
52 (ContainerNodeImpl::firstChild):
53 (ContainerNodeImpl::lastChild):
54 (ContainerNodeImpl::insertBefore):
55 (ContainerNodeImpl::replaceChild):
56 (ContainerNodeImpl::removeChild):
57 (ContainerNodeImpl::removeChildren):
58 (ContainerNodeImpl::appendChild):
59 (ContainerNodeImpl::hasChildNodes):
60 (ContainerNodeImpl::setFirstChild):
61 (ContainerNodeImpl::setLastChild):
62 (ContainerNodeImpl::checkSameDocument):
63 (ContainerNodeImpl::checkIsChild):
64 (ContainerNodeImpl::addChild):
65 (ContainerNodeImpl::attach):
66 (ContainerNodeImpl::detach):
67 (ContainerNodeImpl::insertedIntoDocument):
68 (ContainerNodeImpl::removedFromDocument):
69 (ContainerNodeImpl::cloneChildNodes):
70 (ContainerNodeImpl::getElementsByTagNameNS):
71 (ContainerNodeImpl::getUpperLeftCorner):
72 (ContainerNodeImpl::getLowerRightCorner):
73 (ContainerNodeImpl::getRect):
74 (ContainerNodeImpl::setFocus):
75 (ContainerNodeImpl::setActive):
76 (ContainerNodeImpl::childNodeCount):
77 (ContainerNodeImpl::childNode):
78 (ContainerNodeImpl::dispatchChildInsertedEvents):
79 (ContainerNodeImpl::dispatchChildRemovalEvents):
80 * khtml/xml/dom_nodeimpl.h:
81 * khtml/xml/dom_xmlimpl.cpp:
82 (DOM::EntityImpl::EntityImpl):
83 (DOM::EntityReferenceImpl::EntityReferenceImpl):
84 (DOM::NotationImpl::NotationImpl):
85 (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
86 * khtml/xml/dom_xmlimpl.h:
88 2005-05-04 Vicki Murley <vicki@apple.com>
92 - fix mismatched parentheses in one of the ifdefs
94 * khtml/html/html_headimpl.cpp:
95 (HTMLTitleElementImpl::childrenChanged):
97 2005-05-04 Darin Adler <darin@apple.com>
99 Reviewed by Dave Hyatt.
101 - fixed build rules to match other projects
103 * WebCore.pbproj/project.pbxproj: Set deployment target to 10.3 in the build styles.
104 When built without a build style (by Apple B&I) we want to get the target from the
105 environment. But when built with a build style (by Safari engineers and others), we want
108 * Makefile.am: Took out extra parameters that make command-line building different from
109 Xcode building. Now that this is fixed, you should not get a full rebuild if you switch
110 from command line to Xcode or back.
112 2005-05-04 Vicki Murley <vicki@apple.com>
116 - fixed <rdar://problem/3986228> Not able to load additional script blocks dynamically
118 Run scripts when they're inserted into the document. Use createdByParser bit to make sure
119 that scripts aren't run twice, once while parsing and again when inserting.
121 * khtml/html/html_headimpl.cpp:
122 (HTMLScriptElementImpl::HTMLScriptElementImpl):
123 (HTMLScriptElementImpl::~HTMLScriptElementImpl):
124 (HTMLScriptElementImpl::insertedIntoDocument):
125 (HTMLScriptElementImpl::removedFromDocument):
126 (HTMLScriptElementImpl::notifyFinished):
127 * khtml/html/html_headimpl.h:
128 (DOM::HTMLScriptElementImpl::setCreatedByParser):
129 * khtml/html/htmlparser.cpp:
130 (KHTMLParser::getElement):
131 * khtml/xml/xml_tokenizer.cpp:
132 (khtml::XMLTokenizer::startElement):
134 2005-05-03 David Hyatt <hyatt@apple.com>
136 Normalize all our custom properties in our implementation to be -khtml (remove all the -apple).
138 Make sure that -apple, -khtml, and -moz are all able to be used. -apple and -moz just map to -khtml.
140 Add support for automatically converting -khtml-opacity to opacity (for legacy Safari 1.1 compat).
144 * khtml/css/css_computedstyle.cpp:
146 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
147 * khtml/css/cssparser.cpp:
148 (CSSParser::parseValue):
149 * khtml/css/cssproperties.in:
150 * khtml/css/cssstyleselector.cpp:
151 (khtml::CSSStyleSelector::applyDeclarations):
152 (khtml::CSSStyleSelector::applyProperty):
153 * khtml/css/parser.y:
154 * khtml/ecma/kjs_css.cpp:
157 2005-05-03 Darin Adler <darin@apple.com>
161 * WebCore.pbproj/project.pbxproj: Fix some SYMROOTS that should have been SYMROOT.
163 2005-05-03 David Hyatt <hyatt@apple.com>
165 Fix for 4098281, news.com missing a bunch of content. Make sure not to apply strict SGML parsing
166 when stripping comments out of scripts.
168 New test is comments-in-script.html
170 * khtml/html/htmltokenizer.cpp:
171 (khtml::HTMLTokenizer::parseComment):
173 2005-05-03 David Hyatt <hyatt@apple.com>
175 Remove unused notification to avoid ERROR messages spewing on the acid2 test.
179 * khtml/khtml_part.cpp:
180 (KHTMLPart::processObjectRequest):
181 * khtml/rendering/render_frames.cpp:
182 (RenderPartObject::updateWidget):
183 * khtml/rendering/render_frames.h:
185 2005-05-03 Darin Adler <darin@apple.com>
187 Reviewed by Dave Hyatt.
188 No new layout tests needed.
190 - eliminated the bogus kMin/kMax macros that we had in addition to inline functions
193 * kwq/KWQKGlobal.h: Remove the kMin/kMax macros.
195 * khtml/css/cssstyleselector.cpp:
196 (khtml::CSSStyleSelector::applyProperty): Change type of constant so both sides
198 (khtml::CSSStyleSelector::fontSizeForKeyword): Ditto.
199 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseEntity): Ditto.
201 - remove unused parameter to dirtyLinesFromChangedChild for clarity
203 * khtml/rendering/render_object.h: Don't take the parameter.
204 * khtml/rendering/render_object.cpp: (RenderObject::dirtyLinesFromChangedChild): Ditto.
206 * khtml/rendering/render_flow.h: Don't take the parameter.
207 * khtml/rendering/render_flow.cpp:
208 (RenderFlow::detach): Don't pass the parameter.
209 (RenderFlow::dirtyLinesFromChangedChild): Don't take the parameter.
211 * khtml/rendering/render_text.cpp: (RenderText::detach): Don't pass the parameter.
213 - convert DOM::NodeImpl into an abstract base class by making a couple of functions
214 pure virtual for clarity
216 * khtml/xml/dom_nodeimpl.h: Made nodeName and nodeType pure virtual.
217 * khtml/xml/dom_nodeimpl.cpp: Remove bodies of nodeName and nodeType.
219 2005-05-03 David Hyatt <hyatt@apple.com>
221 Fix for object element to support fallback content. WIth this change Safari passes the Acid2 test.
225 * khtml/css/html4.css:
226 * khtml/html/html_objectimpl.cpp:
227 (HTMLObjectElementImpl::HTMLObjectElementImpl):
228 (HTMLObjectElementImpl::parseHTMLAttribute):
229 (HTMLObjectElementImpl::rendererIsNeeded):
230 (HTMLObjectElementImpl::createRenderer):
231 (HTMLObjectElementImpl::attach):
232 (HTMLObjectElementImpl::detach):
233 (HTMLObjectElementImpl::recalcStyle):
234 (HTMLObjectElementImpl::childrenChanged):
235 (HTMLObjectElementImpl::isURLAttribute):
236 (HTMLObjectElementImpl::isImageType):
237 (HTMLObjectElementImpl::renderFallbackContent):
238 * khtml/html/html_objectimpl.h:
239 * khtml/khtml_part.cpp:
240 (KHTMLPart::requestObject):
241 (KHTMLPart::selectFrameElementInParentIfFullySelected):
242 (KHTMLPart::handleFallbackContent):
243 * khtml/khtml_part.h:
244 * khtml/khtmlpart_p.h:
245 (khtml::ChildFrame::ChildFrame):
246 * khtml/rendering/render_frames.cpp:
247 (RenderPartObject::RenderPartObject):
248 (RenderPartObject::updateWidget):
249 * khtml/rendering/render_frames.h:
250 (khtml::RenderPart::hasFallbackContent):
251 * khtml/rendering/render_replaced.cpp:
252 (RenderReplaced::RenderReplaced):
253 * kwq/KWQKHTMLPart.mm:
254 (KWQKHTMLPart::createPart):
255 * kwq/WebCoreBridge.h:
256 * kwq/WebCoreBridge.mm:
257 (-[WebCoreBridge mainResourceError]):
259 2005-05-01 Darin Adler <darin@apple.com>
261 - move to Xcode native targets and stop checking in generated files
263 * WebCore.pbproj/project.pbxproj: Updated to use native targets and generate all the generated
264 files, so we don't have to check them in any more.
265 * Info.plist: Added. Native targets use a separate file for this.
267 * Makefile.am: Removed rule to generate WebCore-combined.exp since this is now handled by the
268 Xcode project. Removed the code to remove the embedded copy of the framework since we don't
269 do that any more. Removed timestamp cleaning rules since we don't use those any more.
271 * WebCore-tests.exp: Removed symbols that aren't really needed. The native target gives an
272 error when you mention a nonexistent symbol, so we can't have them any more.
274 * khtml/css/parser_wrapper.cpp: Added. Shell used to compile parser.cpp since we can't add
275 a generated file easily to the list of files to be compiled.
277 * .cvsignore: Removed various timestamp files.
279 * WebCore-combined.exp: Removed.
280 * force-clean-timestamp: Removed.
281 * force-js-clean-timestamp: Removed.
282 * khtml/.cvsignore: Removed.
283 * khtml/Makefile.am: Removed.
284 * khtml/css/.cvsignore: Removed.
285 * khtml/css/Makefile.am: Removed.
286 * khtml/css/cssproperties.c: Removed.
287 * khtml/css/cssproperties.h: Removed.
288 * khtml/css/cssvalues.c: Removed.
289 * khtml/css/cssvalues.h: Removed.
290 * khtml/css/parser.cpp: Removed.
291 * khtml/css/parser.h: Removed.
292 * khtml/css/tokenizer.cpp: Removed.
293 * khtml/ecma/.cvsignore: Removed.
294 * khtml/ecma/Makefile.am: Removed.
295 * khtml/ecma/kjs_css.lut.h: Removed.
296 * khtml/ecma/kjs_dom.lut.h: Removed.
297 * khtml/ecma/kjs_events.lut.h: Removed.
298 * khtml/ecma/kjs_html.lut.h: Removed.
299 * khtml/ecma/kjs_navigator.lut.h: Removed.
300 * khtml/ecma/kjs_range.lut.h: Removed.
301 * khtml/ecma/kjs_traversal.lut.h: Removed.
302 * khtml/ecma/kjs_views.lut.h: Removed.
303 * khtml/ecma/kjs_window.lut.h: Removed.
304 * khtml/ecma/xmlhttprequest.lut.h: Removed.
305 * khtml/ecma/xmlserializer.lut.h: Removed.
306 * khtml/html/.cvsignore: Removed.
307 * khtml/html/Makefile.am: Removed.
308 * khtml/html/doctypes.cpp: Removed.
309 * khtml/html/kentities.c: Removed.
310 * khtml/misc/.cvsignore: Removed.
311 * khtml/misc/Makefile.am: Removed.
312 * khtml/misc/htmlattrs.c: Removed.
313 * khtml/misc/htmlattrs.h: Removed.
314 * khtml/misc/htmltags.c: Removed.
315 * khtml/misc/htmltags.h: Removed.
316 * kwq/.cvsignore: Removed.
317 * kwq/KWQCharsetData.c: Removed.
318 * kwq/KWQColorData.c: Removed.
319 * kwq/Makefile.am: Removed.
321 2005-05-02 Darin Adler <darin@apple.com>
324 Added two layout tests for regression testing.
326 - redid frameElement (fix for 4091082 below)
328 The first version lacked a security check, and was also broken.
330 * khtml/ecma/kjs_window.cpp:
331 (frameElement): Refactored into separate function; added isSafeScript check.
332 (Window::get): Call the new frameElement function.
334 * layout-tests/fast/frames/frameElement-frame.html: Added.
335 * layout-tests/fast/frames/frameElement-frame-expected.txt: Added.
336 * layout-tests/fast/frames/frameElement-iframe.html: Added.
337 * layout-tests/fast/frames/frameElement-iframe-expected.txt: Added.
338 * layout-tests/fast/frames/resources/frameElement-contents.html: Added.
340 2005-05-02 David Harrison <harrison@apple.com>
344 Fix isStartOfEditableContent and isEndOfEditableContent to return actual, rather than inverted, answers.
345 No Radar. Found this when trying to use isEndOfEditableContent() in some new code.
347 * khtml/editing/visible_units.cpp:
348 (khtml::isStartOfEditableContent):
349 (khtml::isEndOfEditableContent):
352 2005-04-29 Darin Adler <darin@apple.com>
354 Reviewed by David Harrison.
356 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Turn newlines into \n for better dumping.
358 2005-04-29 David Harrison <harrison@apple.com>
362 <rdar://problem/4083333> When deleting link at end of sentence, entire sentence gets deleted
364 * khtml/editing/htmlediting.cpp:
365 (khtml::DeleteSelectionCommand::initializePositionData):
366 Work around bug #4103339 (whose real fix is somewhat risky), so this fix can get into a software update.
368 (khtml::DeleteSelectionCommand::handleGeneralDelete):
369 Add isAncestor check when comparing m_downstreamEnd.node() and m_startNode.
371 * layout-tests/editing/deleting/delete-4083333-fix-expected.txt: Added.
372 * layout-tests/editing/deleting/delete-4083333-fix.html: Added.
374 2005-04-29 Darin Adler <darin@apple.com>
376 Reviewed by Dave Harrison.
378 - changed layout tests to dump more minimal information about caret and selection
380 * kwq/KWQRenderTreeDebug.cpp:
381 (nodePosition): Changed name; now does position relative to document.
382 (writeSelection): Removed upstream/downstream code and changed format slightly.
384 * layout-tests/editing/*-expected.txt: Regenerated in new format.
386 2005-04-29 Darin Adler <darin@apple.com>
388 Reviewed by Chris Blumenberg.
389 Added two layout tests for regression testing.
391 - fixed <rdar://problem/4097849> REGRESSION (162-163): importNode creates non-HTML elements, thus style attributes (and some others) don't work
393 * khtml/xml/dom_docimpl.cpp:
394 (DocumentImpl::importNode): Reorganized and partly rewrote this. The change that fixes the bug at
395 hand is to explicitly use XHTML_NAMESPACE for HTML elements, since the old way of getting the namespace
396 will return the null string for HTML elements, and createElementNS will not create an HTML element
397 if passed a null string for the namespace.
398 (DocumentImpl::processHttpEquiv): Removed some bogus getDocument() calls -- no need to call getDocument()
399 in a document object.
400 (DocumentImpl::attrName): Ditto.
401 (DocumentImpl::tagName): Ditto.
402 (DocumentImpl::setFocusNode): Ditto.
404 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::cloneNode): Moved the actual cloning here
405 from ElementImpl::cloneNode, because XMLElementImpl already had its own version, and in here
406 we can use createHTMLElement, which will work properly even in an XML document, and is also slightly
409 * khtml/xml/dom_nodeimpl.h: Added a namespaceURI method function to go along with localName.
410 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::namespaceURI): Added. Returns null string to be consistent
411 with localName (only works on certain types of elements as documented).
412 * khtml/xml/dom_elementimpl.h: Removed ElementImpl::cloneNode (see above). Added an override of
413 namespaceURI for XMLElementImpl.
414 * khtml/xml/dom_elementimpl.cpp: (XMLElementImpl::namespaceURI): Added. Returns the namespace
415 (consistent with localName).
417 * layout-tests/fast/dom/importNodeHTML.html: Added. Tests both importNode and cloneNode (for comparison).
418 * layout-tests/fast/dom/importNodeHTML-expected.txt: Added.
419 * layout-tests/fast/dom/importNodeXML.xhtml: Added. XML version of the same test as above. Tests a different
420 code path, so useful to have.
421 * layout-tests/fast/dom/importNodeXML-expected.txt: Added.
423 2005-04-28 Darin Adler <darin@apple.com>
425 Reviewed by Dave Harrison.
427 - fixed problems preventing us from compiling with gcc 4.0
429 * WebCore.pbproj/project.pbxproj: Removed -fobjc-exceptions because I can't figure out an easy
430 way to pass it only when compiling Objective-C/C++. Removed -Wmissing-prototypes from
431 WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
433 * khtml/css/parser.y: Changed some rules that were using a float to pass around an enum to use an
434 int instead to avoid a warning.
435 * khtml/css/parser.cpp: Regenerated.
436 * khtml/css/parser.h: Regenerated.
438 * khtml/ecma/kjs_dom.cpp: (DOMTextProtoFunc::tryCall): Rearranged a return statement to avoid an incorrect
440 * khtml/ecma/kjs_html.cpp: (KJS::Context2DFunction::tryCall): Initialized a couple of variables to avoid
441 an incorrect warning.
442 * khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::evaluate): Rearranged how we exit from the function to avoid
444 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Changed some %d to %ld where the
445 parameters where long ints.
446 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
447 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
448 * kwq/DOMEvents.mm: (-[DOMMouseEvent initMouseEvent:::::::::::::::]): Rearranged code to avoid a cast
449 that was causing an incorrect warning.
451 (createObjCDOMNode): Broke out as a separate function.
452 (KJS::ScriptInterpreter::createObjcInstanceForValue): Rearranged code to avoid a namespace collision with
453 KJS::DOMNode and the Objective-C DOMNode class.
454 * kwq/KWQFileButton.mm: Made fields of KWQFileButtonAdapter public to avoid an error, new to gcc 4.0,
455 about accessing protected Objective-C fields.
456 * kwq/KWQKHTMLPart.mm:
457 (KWQKHTMLPart::matchLabelsAgainstElement): Rearranged a return statement to avoid an incorrect warning.
458 (KWQKHTMLPart::imageFromRect): Rearranged how this function does its exception handling to avoid a
459 "may be clobbered" warning.
460 * kwq/KWQKJavaAppletWidget.mm: Fixed incorrect import that said "KHTMLView.h" instead of "khtmlview.h".
461 * kwq/KWQObject.mm: Made fields of KWQObjectTimerTarget public to avoid an error, new to gcc 4.0,
462 about accessing protected Objective-C fields.
463 * kwq/WebCoreBridge.mm: (partHasSelection): Used [bridge part] instead of getting directly at instance
464 variable to avoid an error, new to gcc 4.0, about accessing protected Objective-C fields.
466 * WebCore-combined.exp: Regenerated.
467 * WebCore-tests.exp: Added some additional symbols needed by the tests under gcc 4.0.
469 2005-04-28 Darin Adler <darin@apple.com>
471 * WebCore.pbproj/project.pbxproj: Add back the main_thread_malloc files, rolled out by accident.
473 2005-04-27 Adele Peterson <adele@apple.com>
475 Rolling out fix for <rdar://problem/4097849> because the following layout tests were failing:
477 fast/css/namespaces/001
478 fast/css/namespaces/002
479 fast/css/namespaces/004
480 fast/css/namespaces/005
481 fast/css/namespaces/006
485 * khtml/html/html_documentimpl.cpp:
486 * khtml/html/html_documentimpl.h:
487 * khtml/html/html_elementimpl.cpp:
488 (HTMLElementImpl::namespaceURI):
489 * khtml/xml/dom_docimpl.cpp:
490 (DocumentImpl::importNode):
491 (DocumentImpl::createElementNS):
492 (DocumentImpl::createHTMLElement):
493 (DocumentImpl::attrId):
494 (DocumentImpl::tagId):
495 * khtml/xml/dom_docimpl.h:
497 2005-04-27 John Sullivan <sullivan@apple.com>
501 Experimental prototype of user-resizable textareas. All the new code is guarded by
502 #if ALLOW_RESIZING_TEXTAREAS, which is false unless you remove a comment and rebuild.
504 This code allows you to press near the bottom-right corner of any textarea and drag
505 to resize the textarea on the page. It works correctly with textareas in left-aligned
506 or centered blocks, but is weird in right-aligned blocks. It also does something
507 sensible if the width is specified as a % (in that case, you can resize vertically only).
508 The user-created-size survives resizing the window and survives the back/forward cache.
509 It does not survive reloading the page.
511 This complete-lack-of-affordance UI is obviously not shippable, but this proof of concept
512 code could lead to a real user feature.
514 * kwq/KWQTextArea.mm:
515 (-[KWQTextArea getNumColumns:andNumRows:forSize:]):
516 new method that determines cols and rows for a given textarea frame size
517 (-[KWQTextAreaTextView _trackResizeFromMouseDown:]):
518 new method that tracks a drag and does a live resize-and-relayout
519 (-[KWQTextAreaTextView mouseDown:]):
520 if the mouse down is in the bottom-right corner, call _trackResizeFromMouseDown:
522 2005-04-27 John Sullivan <sullivan@apple.com>
526 - fixed problem with mouse wheel patch where alt and shift keys were switched
528 * khtml/xml/dom2_eventsimpl.h:
529 use the order cntl, alt, shift, meta in KeyboardEventImpl constructors to match
530 superclass. This isn't necessary to fix the bug, but is better for clarity.
532 * khtml/xml/dom2_eventsimpl.cpp:
533 (KeyboardEventImpl::KeyboardEventImpl):
534 switch parameter order to match superclass. Then pass the parameters to superclass's
535 constructor in the right order.
536 (KeyboardEventImpl::initKeyboardEvent):
537 Pass parameters to superclass's constructor in the right order.
539 2005-04-26 Adele Peterson <adele@apple.com>
541 Fixed by Darin, reviewed by me.
543 Fix for <rdar://problem/4084029> designMode doesn't allow editing when iframe src = "" or = about:blank
545 This change will add an HTML element for empty documents. Now that there will be an HTMLDocument in this case,
546 a body will also be created (see rdar://problem/3758785). This was preventing frames with empty documents from
549 * khtml/html/htmlparser.cpp: (KHTMLParser::finished):
551 Updated these tests to expect the HTML and BODY elements
552 * layout-tests/fast/flexbox/016-expected.txt:
553 * layout-tests/fast/frames/001-expected.txt:
554 * layout-tests/fast/frames/002-expected.txt:
555 * layout-tests/fast/frames/contentWindow_Frame-expected.txt:
556 * layout-tests/fast/frames/contentWindow_iFrame-expected.txt:
557 * layout-tests/fast/frames/empty-frame-src-expected.txt:
559 2005-04-26 Maciej Stachowiak <mjs@apple.com>
561 New test case for <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
563 * layout-tests/fast/js/string-from-char-code-expected.txt: Added.
564 * layout-tests/fast/js/string-from-char-code.html: Added.
566 2005-04-26 Darin Adler <darin@apple.com>
570 - fixed <rdar://problem/3655817> please add support for mouse wheel events and the onmousewheel handler
574 - need to test behavior of Windows IE with horizontal scroll wheeling; we currently send a distinct event
575 for that relatively obscure case, which means the event handlers won't fire at all; might be incorrect
576 - overflow scrolling is done after all DOM event handling, but ideally should be done in the overflowing
577 element's default event handler; not important in practice
578 - frame scrolling is done after all DOM event handling, but probably should be done in a default event handler;
579 not sure about this, but it's probably not important in practice and definitely not required
583 * khtml/ecma/kjs_events.h: Added DOMWheelEvent.
584 * khtml/ecma/kjs_events.cpp:
585 (KJS::getDOMEvent): Added a case for wheel event. To be forward looking, I use the event's impl pointer
586 instead of a C++ DOM wrapper. Eventually it will all work this way.
587 (offsetFromTarget): Added. Factored out code to compute offsetX/Y for an event.
588 (DOMMouseEvent::getValueProperty): Changed to call offsetFromTarget for offsetX/Y.
589 (DOMWheelEvent::DOMWheelEvent): Added.
590 (DOMWheelEvent::tryGet): Added.
591 (DOMWheelEvent::getValueProperty): Added.
592 (DOMWheelEventProtoFunc::tryCall): Added. Nothing at the moment, but might get contents later.
594 * khtml/ecma/kjs_dom.h: Added OnMouseWheel to the enum with the list of properties.
595 * khtml/ecma/kjs_dom.cpp: Added onmousewheel as a property of DOM nodes.
596 (DOMNode::getValueProperty): Return the mouse wheel event handler.
597 (DOMNode::putValue): Set the mouse wheel event handler.
599 * khtml/ecma/kjs_window.cpp: Added onmousewheel as a property of the window.
600 (Window::get): Return the mouse wheel event handler.
601 (Window::put): Set the mouse wheel event handler.
603 * khtml/ecma/kjs_window.h: Added OnWindowMouseWheel to the enum with the list of properties.
604 (Other properties distinguish the window handler by lower-casing the initial letter, way too subtle,
605 so I did this one a good way.)
607 * khtml/dom/dom2_events.h: Made the constructors for Event and UIEvent public. There's no good reason
608 for them to be private, and I had to use the UIEvent one in the JavaScript implementation.
612 * khtml/xml/dom2_eventsimpl.h: Added events for mouse wheel and horizontal mouse wheel.
613 Added isWheelEvent function to EventImpl.
614 (DOM::UIEventWithKeyStateImpl): Added. Base class shared by mouse, wheel, and keyboard events.
615 (DOM::MouseRelatedEventImpl): Added. Base class shared by mouse and wheel events.
616 (DOM::WheelEventImpl): Added.
618 * khtml/xml/dom2_eventsimpl.cpp: Added "mousewheel" to list of event names and a placeholder for
619 the horizontal mouse wheel.
620 (EventImpl::isWheelEvent): Added. Returns false.
621 (MouseRelatedEventImpl::MouseRelatedEventImpl): Added. Factored out what's shared between mouse
622 events and wheel events to avoid duplicated code.
623 (MouseRelatedEventImpl::computeLayerPos): Moved to MouseRelatedWheelEventImpl.
624 (MouseEventImpl::MouseEventImpl): Changed since MouseRelatedWheelEventImpl is now the base class
625 so we can share more code with wheel events.
626 (KeyboardEventImpl::KeyboardEventImpl): Changed since UIEventWithKeyStateImpl is now the base class
627 so we can share more code with mouse and wheel events.
628 (WheelEventImpl::WheelEventImpl): Added.
629 (WheelEventImpl::isWheelEvent): Added. Returns true.
631 * khtml/misc/htmlattrs.in: Added "onmousewheel" attribute name.
632 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Added parsing of the
633 "onmousewheel" atribute, consistent with other event handler attributes.
637 * kwq/WebCoreBridge.h: Renamed scrollOverflowWithScrollWheelEvent to sendScrollWheelEvent.
638 * kwq/WebCoreBridge.mm: (-[WebCoreBridge sendScrollWheelEvent:]): Renamed.
640 * kwq/KWQEvent.h: Added Wheel as an event type value.
641 (QWheelEvent::QWheelEvent): Added.
643 (positionForEvent): Updated to know that wheel events have valid positions in them.
644 (orientationForEvent): Added.
645 (deltaForEvent): Added.
646 (QWheelEvent::QWheelEvent): Added.
648 * kwq/KWQKHTMLPart.h: Renamed scrollOverflowWithScrollWheelEvent to wheelEvent.
649 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::wheelEvent): Renamed and added code to construct a QWheelEvent
650 and send it along to KHTMLView::viewportWheelEvent, consistent with how mouse events work.
652 * khtml/khtmlview.cpp: (KHTMLView::viewportWheelEvent): Do a hit test to figure out which node to
653 send the event to, and then call dispatchWheelEvent.
655 * khtml/xml/dom_nodeimpl.h: Added dispatchWheelEvent.
656 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchWheelEvent): Added.
660 * khtml/ecma/kjs_dom.lut.h: Regenerated.
661 * khtml/ecma/kjs_events.lut.h: Regenerated.
662 * khtml/ecma/kjs_window.lut.h: Regenerated.
663 * khtml/misc/htmlattrs.c: Regenerated.
664 * khtml/misc/htmlattrs.h: Regenerated.
666 2005-04-26 David Harrison <harrison@apple.com>
668 Reviewed by Darin, Maciej.
670 <rdar://problem/4075576> Deleting text in new message borks content
672 Fixed by removing the methods that attempted to preserve the position. The idea
673 of preserving position is a very recent one, and turned out to not actually address
674 the problem it was intended to fix (see below). Further, is unclear how the position
675 could be preserved in a form that could be properly used later on. Therefore,
676 removing the code to work like before is the preferred alternative for this software
677 update. I've written <rdar://problem/4099839> to cover the bug that position
678 preservation was supposed to fix (but did not). Added layout tests for
679 both this bug and 4099839. Also, updated existing tests with correct expected results
680 (delete-at-paragraph-boundaries-003 and 004).
682 * khtml/editing/htmlediting.cpp:
683 (khtml::CompositeEditCommand::removeFullySelectedNode):
684 (khtml::CompositeEditCommand::removeChildrenInRange):
685 (khtml::DeleteSelectionCommand::handleGeneralDelete):
686 * khtml/editing/htmlediting.h:
687 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
688 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
689 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-007-expected.txt: Added.
690 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-007.html: Added.
691 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-008-expected.txt: Added.
692 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-008.html: Added.
693 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-009-expected.txt: Added.
694 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-009.html: Added.
695 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-010-expected.txt: Added.
696 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-010.html: Added.
698 2005-04-26 Darin Adler <darin@apple.com>
700 - fixed development builds
702 * khtml/misc/main_thread_malloc.h: Use inlines instead of macros for allocation functions.
704 2005-04-25 David Hyatt <hyatt@apple.com>
706 Fix for 4097842, changing 1st line of a url that wraps doesn't update the second line. Make sure to
707 update line break info for the last dirty line so that when a clean line tries to figure out where it
708 started, it will get an accurate position taking into account the updated string. By doing this, the code
709 will be able to properly distinguish between the old and new positions and not accidentally assume they are
714 * khtml/rendering/render_text.cpp:
715 (RenderText::setTextWithOffset):
717 2005-04-26 Darin Adler <darin@apple.com>
721 - fixed <rdar://problem/4098826> Bezier curves broken in new Safari canvas object (last two parameters parsed incorrectly)
723 * khtml/ecma/kjs_html.cpp: (KJS::Context2DFunction::tryCall): Fixed incorrect argument indices.
724 Thanks to Brian Campbell who figured out what was wrong.
726 2005-04-17 Maciej Stachowiak <mjs@apple.com>
730 - use single-threaded malloc in places where malloc is hot for an
731 8% speed improvement on cvs-base
733 * ForwardingHeaders/misc/fast_malloc.h: Added.
734 * WebCore.pbproj/project.pbxproj:
735 * khtml/css/css_base.h:
736 * khtml/css/css_ruleimpl.h:
737 * khtml/css/css_valueimpl.h:
738 * khtml/css/cssstyleselector.h:
739 * khtml/misc/arena.cpp:
743 * khtml/misc/main_thread_malloc.cpp: Added.
744 * khtml/misc/main_thread_malloc.h: Added.
745 * khtml/rendering/render_style.h:
746 * khtml/xml/dom2_eventsimpl.h:
747 * khtml/xml/dom2_rangeimpl.h:
748 * khtml/xml/dom2_traversalimpl.h:
749 * khtml/xml/dom2_viewsimpl.h:
750 * khtml/xml/dom_docimpl.h:
751 * khtml/xml/dom_elementimpl.cpp:
752 (NamedAttrMapImpl::NamedAttrMapImpl):
753 (NamedAttrMapImpl::clearAttributes):
754 (NamedAttrMapImpl::operator=):
755 (NamedAttrMapImpl::addAttribute):
756 (NamedAttrMapImpl::removeAttribute):
757 * khtml/xml/dom_elementimpl.h:
758 * khtml/xml/dom_nodeimpl.h:
759 * khtml/xml/dom_stringimpl.h:
760 * kwq/KWQFontFamily.h:
761 * kwq/KWQListImpl.mm:
766 (QString::setBufferFromCFString):
769 2005-04-25 John Sullivan <sullivan@apple.com>
771 Reviewed by Dave Harrison.
773 - fixed <rdar://problem/4098731> [DOMHTMLTextAreaElement cols] returns wrong value (usually zero)
776 (-[DOMHTMLTextAreaElement cols]):
777 use ATTR_COLS instead of ATTR_ACCESSKEY (D'oh!)
778 (-[DOMHTMLTextAreaElement setCols:]):
781 2005-04-25 Darin Adler <darin@apple.com>
785 - fixed <rdar://problem/4097849> REGRESSION (162-163): importNode creates non-HTML elements, thus style attributes (and some others) don't work
787 * khtml/xml/dom_docimpl.h: Add virtual functions HTMLElementNamespace and isHTMLNamespace.
788 * khtml/xml/dom_docimpl.cpp:
789 (DocumentImpl::importNode): Rearranged this function and fixed the following problems: 1) made sure to ref node while attributes are
790 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
791 the source document, not the destination document; 3) removed unneeded getDocument() call which just returns this; 4) fixed error
792 handling for cases where an exception happens while processing the children.
793 (DocumentImpl::HTMLElementNamespace): Added. Returns XHTML_NAMESPACE.
794 (DocumentImpl::isHTMLNamespace): Added. Returns true for any namespace that matches XHTML_NAMESPACE (case insensitive).
795 (DocumentImpl::createElementNS): Changed to call isHTMLNamespace, which will cause it to accept the null namespace in an HTML document.
796 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.
797 (DocumentImpl::createHTMLElement): Pass in HTMLElementNamespace() rather than 0 to tagId.
798 (DocumentImpl::attrId): Use isHTMLNamespace instead of allowing the null namespace explicitly.
799 (DocumentImpl::tagId): Ditto.
801 * khtml/html/html_documentimpl.h: Add overrides for HTMLElementNamespace and isHTMLNamespace.
802 * khtml/html/html_documentimpl.cpp:
803 (HTMLDocumentImpl::HTMLElementNamespace): Added. Returns 0 so we use the null string for HTML elements inside HTML documents (as before).
804 (HTMLDocumentImpl::isHTMLNamespace): Added. Allows 0, and then calls base class to check for the actual XHTML namespace. Thus, we allow
805 both no namespace at all and the XHTML namespace inside HTML documents.
807 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::namespaceURI): Changed to call HTMLElementNamespace rather than checking
808 isHTMLDocument. Same result as before, but better division of responsibilities.
810 2005-04-25 Darin Adler <darin@apple.com>
814 - fixed <rdar://problem/4091956> JavaScript drop handlers don't receive more than one dropped item
816 * kwq/KWQClipboard.mm:
817 (cocoaTypeFromMIMEType): Remove some use of compare -- less efficient than a simpler "==" check.
818 Fixed non-GC-safe code to use KWQCFAutorelease instead.
819 (MIMETypeFromCocoaType): Use fromCFString instead of fromNSString to avoid a cast.
820 (KWQClipboard::getData): Rearrange so that we'll use filenames if both filenames and a URL are present, since
821 filenames can accomodate multiple items. Fix bug where we'd return multiple filenames when the type requested
822 is "URL". Fixed loop that computed the count over and over again for the loop termination condition. Check
823 that the data for NSFilenamesPboardType is an NSArray instead of assuming it is.
824 (KWQClipboard::setData): Use isEqualToString: instead of == when comparing types.
826 2005-04-22 David Hyatt <hyatt@apple.com>
828 Fix for 4096878, drop shadow effect not displayed correctly on tbray.org/ongoing/. Block minmaxwidth was
829 broken when negative margins were used and did not properly decrease the max width.
833 * khtml/rendering/render_block.cpp:
834 (khtml::RenderBlock::calcBlockMinMaxWidth):
835 * layout-tests/fast/block/float/034-expected.txt: Added.
836 * layout-tests/fast/block/float/034.html: Added.
837 * layout-tests/fast/block/float/035-expected.txt: Added.
838 * layout-tests/fast/block/float/035.html: Added.
840 2005-04-22 David Hyatt <hyatt@apple.com>
842 Remove some dead code from css_valueimpl. It wasn't used at all.
844 * khtml/css/css_valueimpl.cpp:
845 * khtml/css/css_valueimpl.h:
847 2005-04-22 Darin Adler <darin@apple.com>
849 * khtml/ecma/kjs_html.h: Removed unnecessary bogus class name qualifiers.
851 2005-04-22 David Hyatt <hyatt@apple.com>
853 Fix for 4096681, fix regression in how the list-style property is parsed. It no longer parses when it hits
854 a url in the property value list now, because the list pointer did not get advanced. This fixes alistapart.com.
858 * khtml/css/cssparser.cpp:
859 (CSSParser::parseValue):
860 * layout-tests/fast/lists/009-expected.txt: Added.
861 * layout-tests/fast/lists/009.html: Added.
862 * layout-tests/fast/lists/resources/listmark.gif: Added.
864 2005-04-22 Darin Adler <darin@apple.com>
868 - fixed <rdar://problem/4091082> Google Suggest no longer works due to lack of "frameElement"
870 * khtml/ecma/kjs_window.h: Added FrameElement.
871 * khtml/ecma/kjs_window.cpp: (Window::get): Added "frameElement".
872 * khtml/ecma/kjs_window.lut.h: Regenerated.
874 2005-04-22 Darin Adler <darin@apple.com>
878 - a small editing-related code cleanup
880 * khtml/rendering/render_text.h: Added positionForOffset and made offsetForPosition const.
881 * khtml/rendering/render_text.cpp:
882 (InlineTextBox::offsetForPosition): Made const.
883 (InlineTextBox::positionForOffset): Added. Moved code here from caretRect.
884 (RenderText::caretRect): Call positionForOffset instead of doing the work here.
886 2005-04-21 David Hyatt <hyatt@apple.com>
888 Fix for 4095839, wrong background image used on flechtwerk.de. Make sure that the global mapped
889 attribute cache hashed background attributes into per-document buckets.
891 * khtml/html/html_baseimpl.cpp:
892 (HTMLBodyElementImpl::mapToEntry):
893 * khtml/html/html_elementimpl.h:
895 * khtml/html/html_tableimpl.cpp:
896 (HTMLTableElementImpl::mapToEntry):
897 (HTMLTablePartElementImpl::mapToEntry):
898 * khtml/xml/dom_docimpl.cpp:
899 (DocumentImpl::DocumentImpl):
900 * khtml/xml/dom_docimpl.h:
901 (DOM::DocumentImpl::docID):
903 2005-04-21 Vicki Murley <vicki@apple.com>
905 - layout test for 4065447, outerHTML on images
907 * layout-tests/fast/dynamic/outerHTML-img-expected.txt: Added.
908 * layout-tests/fast/dynamic/outerHTML-img.html: Added.
910 2005-04-20 Vicki Murley <vicki@apple.com>
914 - fixed <rdar://problem/4065447> support outerHTML on IMG elements
916 * khtml/html/html_elementimpl.cpp:
917 (HTMLElementImpl::setOuterHTML):
919 2005-04-18 David Hyatt <hyatt@apple.com>
921 Fix min-height so that when it resolves to auto it does not use the box's intrinsic height.
923 * khtml/rendering/render_box.cpp:
924 (RenderBox::calcHeight):
925 (RenderBox::calcHeightUsing):
927 2005-04-18 David Hyatt <hyatt@apple.com>
929 Back out fix for 4032346, since it is causing garbled image content on many sites.
931 The bug tracking the fix is 4069093.
933 (khtml::RenderBlock::matchedEndLine):
935 2005-04-18 David Hyatt <hyatt@apple.com>
937 Fix the smile in the Acid2 test. Floats should not grow to contain other floats unless height is auto. Otherwise
938 the float should use the specified height.
940 Also fix row 14 of the Acid2 test. Although ambiguous, just modify the table cell baseline alignment code to align
941 to the bottom of the cell's content height if no suitable baseline could be found.
943 * khtml/rendering/render_block.cpp:
944 (khtml::RenderBlock::layoutBlock):
945 * khtml/rendering/render_block.h:
946 (khtml::RenderBlock::firstRootBox):
947 (khtml::RenderBlock::lastRootBox):
948 * khtml/rendering/render_table.cpp:
949 (RenderTableSection::calcRowHeight):
950 (RenderTableCell::baselinePosition):
952 2005-04-15 David Hyatt <hyatt@apple.com>
954 Make sure empty tables honor CSS-specified heights when they have no rows or sections. This is done only
955 in strict mode, since it is not compatible with WinIE.
957 * khtml/rendering/render_table.cpp:
958 (RenderTable::layout):
960 2005-04-15 David Hyatt <hyatt@apple.com>
962 Fix for row 13 of the Acid2 test. Change HTML comment parsing in strict mode to do proper SGML parsing,
963 checking for pairs of -- and only being willing to close the comment if every -- is paired up.
965 * khtml/html/htmltokenizer.cpp:
966 (khtml::HTMLTokenizer::parseComment):
968 2005-04-12 Maciej Stachowiak <mjs@apple.com>
972 - use custom single-threaded malloc for all non-GC JavaScriptCore
973 allocations, for a 9.1% speedup on JavaScript iBench
975 * khtml/ecma/kjs_binding.cpp:
977 * khtml/ecma/kjs_proxy.cpp:
978 (KJSProxyImpl::evaluate):
980 2005-04-15 David Hyatt <hyatt@apple.com>
982 Fix the six pixel gap between rows nine and ten of the Acid2 test. Make sure that percentage heights that
983 resolve to auto are properly treated as though they have auto height by the self-collapsing block check (as per
984 section 8.3.1, paragraph 7 of the CSS2.1 spec).
986 * khtml/rendering/render_block.cpp:
987 (khtml::RenderBlock::isSelfCollapsingBlock):
989 2005-04-15 David Hyatt <hyatt@apple.com>
991 The Acid2 test and the reference rendering both make use of overflow:hidden on the <html> element. Turns out
992 the CSS2.1 wording for this behavior has been revised (based off WinIE/Mozilla behavior). Change our behavior
993 to match and make <html> overflow apply to the viewport.
995 * khtml/khtmlview.cpp:
996 (KHTMLView::applyOverflowToViewport):
999 * khtml/rendering/render_box.cpp:
1000 (RenderBox::setStyle):
1002 2005-04-14 David Hyatt <hyatt@apple.com>
1004 3258403 and 3258402 can now be fixed. min/max-width/height support is now complete. This patch makes them
1005 work for positioned elements and enables us to pass row one of the Acid2 test.
1007 * khtml/rendering/render_box.cpp:
1008 (RenderBox::calcAbsoluteHorizontal):
1009 (RenderBox::calcAbsoluteHorizontalValues):
1010 (RenderBox::calcAbsoluteVertical):
1011 (RenderBox::calcAbsoluteVerticalValues):
1012 * khtml/rendering/render_box.h:
1014 2005-04-12 David Hyatt <hyatt@apple.com>
1016 Working on the Acid2 test, Row 1.
1018 Improve checkChild for the DTD so that it knows what mode a document is in. This allows it to adhere more
1019 strictly to the actual DTD in strict mode and almost strict mode.
1021 Change the <table>-inside-<p> check so that <table> is disallowed inside <p> in
1022 strict mode and almost strict mode. This matches Firefox behavior, which allows <table>
1023 inside <p> only in quirks mode.
1025 * khtml/html/dtd.cpp:
1028 * khtml/html/htmlparser.cpp:
1029 (KHTMLParser::insertNode):
1030 * khtml/html/htmltokenizer.cpp:
1031 (khtml::HTMLTokenizer::parseTag):
1032 * khtml/xml/dom_elementimpl.cpp:
1033 (ElementImpl::childAllowed):
1035 2005-04-12 Vicki Murley <vicki@apple.com>
1039 - fixed <rdar://problem/3760895> Request for including an implementation of the elementFromPoint function
1041 * khtml/dom/dom_doc.cpp:
1042 (DOM::Document::elementFromPoint):
1043 * khtml/dom/dom_doc.h:
1044 * khtml/ecma/kjs_dom.cpp:
1045 (DOMDocumentProtoFunc::tryCall):
1046 * khtml/ecma/kjs_dom.h:
1047 (KJS::DOMDocument::):
1048 * khtml/ecma/kjs_dom.lut.h:
1050 * khtml/xml/dom_docimpl.cpp:
1051 (DocumentImpl::elementFromPoint):
1052 * khtml/xml/dom_docimpl.h:
1054 2005-04-12 David Hyatt <hyatt@apple.com>
1056 Beginning of work to support the Acid2 CSS test put forward by the Web Standards Project. Fix
1057 our handling of the rel attribute on <link> elements to do a proper tokenization so that stylesheets
1058 can be recognized even when other keywords are present in the rel attribute.
1060 * khtml/html/html_headimpl.cpp:
1061 (HTMLLinkElementImpl::HTMLLinkElementImpl):
1062 (HTMLLinkElementImpl::parseHTMLAttribute):
1063 (HTMLLinkElementImpl::tokenizeRelAttribute):
1064 (HTMLLinkElementImpl::process):
1065 * khtml/html/html_headimpl.h:
1067 2005-04-12 John Sullivan <sullivan@apple.com>
1069 - fixed these two bugs (I also fixed these on the experimental-ui-branch)
1070 <rdar://problem/3154293> Find Next should not scroll page if the next target is already visible
1071 <rdar://problem/3121828> scrollToVisible on find cuts off the left part of the view due to needless horiz. scroll
1075 * kwq/KWQKHTMLPart.mm:
1076 (KWQKHTMLPart::jumpToSelection):
1077 Trey had written code to address these issues, but left it commented out due to other
1078 problems. The other problems no longer occur, so I uncommented Trey's code, and then
1079 discovered that I could make it behave more like TextEdit with many fewer lines of
1082 2005-04-08 David Harrison <harrison@apple.com>
1084 Reviewed by Dave Hyatt.
1086 <rdar://problem/4084106> Remove NSAccessibilityForegroundColorTextAttributeWrapper
1088 * kwq/KWQAccObject.mm:
1089 (AXAttributeStringSetStyle):
1090 Use NSAccessibilityForegroundColorTextAttribute directly.
1092 2005-04-05 David Hyatt <hyatt@apple.com>
1094 Fix for 4077106, make sure that mouse wheeling in overflow sections uses 40 rather than 10 as the base line
1099 * khtml/rendering/render_layer.cpp:
1100 (RenderLayer::positionScrollbars):
1101 * kwq/KWQScrollBar.mm:
1102 (QScrollBar::scroll):
1104 2005-04-04 Vicki Murley <vicki@apple.com>
1108 - fixed <rdar://problem/3871669> no focus or blur methods on HTML button elements
1110 * khtml/dom/html_form.cpp:
1111 (HTMLButtonElement::focus):
1112 (HTMLButtonElement::blur):
1113 * khtml/dom/html_form.h:
1114 * khtml/ecma/kjs_html.cpp:
1115 (KJS::HTMLElementFunction::tryCall):
1116 * khtml/ecma/kjs_html.h:
1117 (KJS::HTMLElement::):
1118 * khtml/ecma/kjs_html.lut.h:
1120 * khtml/html/html_formimpl.cpp:
1121 (DOM::HTMLButtonElementImpl::blur):
1122 (DOM::HTMLButtonElementImpl::focus):
1123 * khtml/html/html_formimpl.h:
1127 2005-03-28 David Harrison <harrison@apple.com>
1131 <rdar://problem/4069161> REGRESSION (8A416-8A419): Safari crash bringing up context menu for non-HTML content in a frame
1133 * kwq/KWQAccObject.mm:
1134 (-[KWQAccObject rendererForView:]):
1135 Nil-check node variable instead of rechecking document variable.
1139 2005-03-27 Darin Adler <darin@apple.com>
1141 Reviewed by me, fix by Kida-san.
1143 - fixed <rdar://problem/4067474> 8A424: Safari immediately quit by Cmd+Ctrll+'D'
1145 * kwq/WebCoreBridge.mm: (-[WebCoreBridge convertToNSRange:DOM::]):
1150 2005-03-24 Richard Williamson <rjw@apple.com>
1152 Fixed <rdar://problem/4052683> After adding/removing stocks from Stocks Widget, stock areas went blank
1154 The request was being collected before firing it's load handler.
1155 We now gc protect the request while it's loading.
1159 * khtml/ecma/xmlhttprequest.cpp:
1160 (KJS::XMLHttpRequest::send):
1161 (KJS::XMLHttpRequest::abort):
1162 (KJS::XMLHttpRequest::slotFinished):
1163 (KJS::XMLHttpRequestProtoFunc::tryCall):
1167 2005-03-23 Darin Adler <darin@apple.com>
1169 Further fix for 4053515.
1171 Covered cases where text position doesn't lie inside a
1174 Reviewed by Richard.
1176 * khtml/editing/visible_text.cpp:
1177 (khtml::TextIterator::setRangeFromLocationAndLength):
1179 2005-03-23 Richard Williamson <rjw@apple.com>
1181 Fixed <rdar://problem/4053515> REGRESSION (Mail): Kotoeri input method reconversion does not work in WebViews
1183 We now use actual document NSRanges to represent both marked text
1184 ranges and selection ranges.
1188 * khtml/editing/visible_text.cpp:
1189 (khtml::TextIterator::rangeLength):
1190 (khtml::TextIterator::setRangeFromLocationAndLength):
1191 * khtml/editing/visible_text.h:
1192 * kwq/WebCoreBridge.h:
1193 * kwq/WebCoreBridge.mm:
1194 (-[WebCoreBridge convertToNSRange:DOM::]):
1195 (-[WebCoreBridge DOM::convertToDOMRange:]):
1196 (-[WebCoreBridge selectNSRange:]):
1197 (-[WebCoreBridge markedTextDOMRange]):
1198 (-[WebCoreBridge markedTextNSRange]):
1200 2005-03-22 Kevin Decker <kdecker@apple.com>
1204 Fixed <rdar://problem/4062336> REGRESSION (406-407): HTML submenus not working at hrweb.apple.com after going back
1206 Rolled out the fix for <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
1208 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.
1210 * khtml/khtml_part.cpp:
1211 (KHTMLPart::closeURL):
1212 * khtml/xml/dom_docimpl.cpp:
1213 (DocumentImpl::detach):
1217 2005-03-22 Vicki Murley <vicki@apple.com>
1219 - roll the fix for <rdar://problem/4060266> back in, since its
1222 * khtml/editing/visible_text.cpp:
1223 (khtml::TextIterator::handleTextBox):
1225 2005-03-22 Vicki Murley <vicki@apple.com>
1227 - roll out the fix for <rdar://problem/4060266> since it was denied by CCC
1229 * khtml/editing/visible_text.cpp:
1230 (khtml::TextIterator::handleTextBox):
1232 2005-03-22 David Harrison <harrison@apple.com>
1236 <rdar://problem/4060266> Double-clicking in Dictionary.app doesn't work for some words (coming just after style change)
1238 * khtml/editing/visible_text.cpp:
1239 (khtml::TextIterator::handleTextBox):
1240 Complete the check of whether to emit space for collapsed space.
1242 2005-03-22 David Harrison <harrison@apple.com>
1246 <rdar://problem/4061443> REGRESSION (8A420-8A421): Pasting in the Stickies widget is broken again
1248 * khtml/editing/htmlediting.cpp:
1249 (khtml::positionBeforeContainingSpecialElement):
1250 (khtml::positionAfterContainingSpecialElement):
1251 Return unchanged Position rather than a null or non-editable one.
1255 2005-03-20 Ken Kocienda <kocienda@apple.com>
1259 I made an error in this test earlier. It was not testing what I intended. Fixed.
1261 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt
1262 * layout-tests/editing/unsupported-content/list-delete-001.html
1266 * layout-tests/editing/unsupported-content/table-delete-001-expected.txt: Added.
1267 * layout-tests/editing/unsupported-content/table-delete-001.html: Added.
1268 * layout-tests/editing/unsupported-content/table-delete-002-expected.txt: Added.
1269 * layout-tests/editing/unsupported-content/table-delete-002.html: Added.
1270 * layout-tests/editing/unsupported-content/table-delete-003-expected.txt: Added.
1271 * layout-tests/editing/unsupported-content/table-delete-003.html: Added.
1272 * layout-tests/editing/unsupported-content/table-type-after-expected.txt: Added.
1273 * layout-tests/editing/unsupported-content/table-type-after.html: Added.
1274 * layout-tests/editing/unsupported-content/table-type-before-expected.txt: Added.
1275 * layout-tests/editing/unsupported-content/table-type-before.html: Added.
1277 2005-03-20 Darin Adler <darin@apple.com>
1281 - fixed <rdar://problem/3923903> REGRESSION (164-165): Repro Safari crash in khtml::RenderLayer::scrollToOffset
1283 * khtml/rendering/render_layer.cpp: (RenderLayer::scrollToOffset): Check canvas for nil.
1285 2005-03-20 David Harrison <harrison@apple.com>
1289 <rdar://problem/4055127> Dictionary pop-up panel misplaced at beginning of text blocks (breaks double-clicking in Dictionary.app)
1291 SimplifiedBackwardsTextIterator::advance() needed to not limit to textnodes
1292 when checking whether moving back across block boundaries
1294 VisibleUnits previousBoundary() needed to INIT_DOWN when creating result VisiblePosition
1296 All editing tests pass.
1298 * khtml/editing/visible_text.cpp:
1299 (khtml::SimplifiedBackwardsTextIterator::advance):
1300 * khtml/editing/visible_units.cpp:
1301 (khtml::previousBoundary):
1303 2005-03-20 Darin Adler <darin@apple.com>
1305 Reviewed by Harrison.
1307 - 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
1309 * khtml/khtml_part.h: Added selectFrameElementInParentIfFullySelected.
1310 * khtml/khtml_part.cpp:
1312 (KHTMLPart::setFocusNodeIfNeeded): Changed to not set focus to a frame; was not what this function was
1313 intended to do, and caused trouble when trying to select a frame element.
1314 (KHTMLPart::khtmlMouseReleaseEvent): Call selectFrameElementInParentIfFullySelected.
1315 (KHTMLPart::selectAll): Call selectFrameElementInParentIfFullySelected.
1316 (KHTMLPart::selectFrameElementInParentIfFullySelected): Added. Selects the frame element in the parent
1317 if a frame is entirely selected, which makes it easier to delete or replace the frame and is consistent
1318 with the changes Maciej made recently for other elements.
1320 * kwq/WebCoreBridge.mm:
1321 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Call selectFrameElementInParentIfFullySelected.
1322 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Call selectFrameElementInParentIfFullySelected.
1324 2005-03-20 Darin Adler <darin@apple.com>
1326 Reviewed by me, code change by Ken.
1328 - fixed <rdar://problem/4059852> Deleting from first element of list makes content jump to wrong place
1330 * khtml/editing/htmlediting.cpp:
1331 (khtml::isListStructureNode): Added.
1332 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Check for list nodes as well as table nodes.
1334 2005-03-20 Ken Kocienda <kocienda@apple.com>
1338 Added tests to cover new "unsupported content" editing code.
1340 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt: Added.
1341 * layout-tests/editing/unsupported-content/list-delete-001.html: Added.
1342 * layout-tests/editing/unsupported-content/list-delete-002-expected.txt: Added.
1343 * layout-tests/editing/unsupported-content/list-delete-002.html: Added.
1344 * layout-tests/editing/unsupported-content/list-delete-003-expected.txt: Added.
1345 * layout-tests/editing/unsupported-content/list-delete-003.html: Added.
1346 * layout-tests/editing/unsupported-content/list-type-after-expected.txt: Added.
1347 * layout-tests/editing/unsupported-content/list-type-after.html: Added.
1348 * layout-tests/editing/unsupported-content/list-type-before-expected.txt: Added.
1349 * layout-tests/editing/unsupported-content/list-type-before.html: Added.
1351 2005-03-20 Ken Kocienda <kocienda@apple.com>
1357 <rdar://problem/4059578> Entire list deleted, and caret disappears, when delete key hit at end of list
1359 The problem is that a new case in the delete code did not consider when the
1360 downstream end node of the selection might be an ancestor of the upstream start
1361 node. That is the case in this bug. The downstream end is the body element, and
1362 this line of code would delete all the children of the downstream end:
1363 removeChildrenInRangePreservingPosition(m_downstreamEnd.node(), 0,
1364 m_downstreamEnd.offset(), m_upstreamStart);
1366 The fix is to check for this "is ancestor" case, and do some tree logic to find
1367 the right offset of the downstream end node for the call to
1368 removeChildrenInRangePreservingPosition().
1370 * khtml/editing/htmlediting.cpp:
1371 (khtml::DeleteSelectionCommand::handleGeneralDelete): Fixed as described.
1373 2005-03-19 Ken Kocienda <kocienda@apple.com>
1379 <rdar://problem/4059384> Cannot place insertion point correctly in editable text that avoids floating elements
1381 Note: I strongly suspect this bug blocks a complete solution to this other Tiger/P2:
1382 <rdar://problem/4055748> AX: Dictionary pop-up panel shows at wrong place on specific parts of particular pages
1384 * khtml/rendering/render_text.cpp:
1385 (RenderText::caretRect): Change the y-coordinate used to calculate the available width for a line. Height is wrong.
1386 Top of the box containing the text where the click is done is correct. Also, add in the x-offset for the start
1387 of the text box when calculating the available width. If this text box is avoiding a float at the y-coordinate
1388 for the relevant box, failure to add in the amount of float-avoidance will make the text at the coordinates
1389 greater than end-of-line minus float-avoidance ineligible for caret placement.
1391 2005-03-19 Darin Adler <darin@apple.com>
1395 - fixed <rdar://problem/4057594> REGRESSION (125-406): Unrepro crash in HTMLTokenizer::allDataProcessed after hitting Back button
1397 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::allDataProcessed):
1398 To get the part safely after calling end, save a guarded pointer to the view.
1399 The old way could end trying to call a virtual function a part that was destroyed.
1401 2005-03-19 Maciej Stachowiak <mjs@apple.com>
1405 <rdar://problem/4053506> Pasting Tables and Cells in Mail does not allow editing before or after
1406 <rdar://problem/4005954> REGRESSION (Mail): After copy/paste of content containing list element cannot go back to entering text at left side of page
1408 * khtml/editing/htmlediting.cpp:
1409 (khtml::maxDeepOffset):
1410 (khtml::CompositeEditCommand::removeFullySelectedNodePreservingPosition):
1411 (khtml::CompositeEditCommand::removeChildrenInRangePreservingPosition):
1412 (khtml::CompositeEditCommand::removeNodePreservingPosition):
1413 (khtml::CompositeEditCommand::insertBlockPlaceholder):
1414 (khtml::CompositeEditCommand::appendBlockPlaceholder):
1415 (khtml::CompositeEditCommand::forceBlockPlaceholder):
1416 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
1417 (khtml::isSpecialElement):
1418 (khtml::isFirstVisiblePositionInSpecialElementInFragment):
1419 (khtml::positionBeforePossibleContainingSpecialElement):
1420 (khtml::positionAfterPossibleContainingSpecialElement):
1421 (khtml::ApplyStyleCommand::applyInlineStyle):
1422 (khtml::DeleteSelectionCommand::initializePositionData):
1423 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
1424 (khtml::DeleteSelectionCommand::handleGeneralDelete):
1425 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
1426 (khtml::DeleteSelectionCommand::doApply):
1427 (khtml::InsertParagraphSeparatorCommand::doApply):
1428 (khtml::ReplacementFragment::ReplacementFragment):
1429 (khtml::ReplaceSelectionCommand::doApply):
1430 * khtml/editing/htmlediting.h:
1431 * khtml/editing/visible_position.cpp:
1432 (khtml::isRenderedBR):
1433 (khtml::VisiblePosition::initDownstream):
1434 (khtml::isLastVisiblePositionInBlock):
1435 * khtml/rendering/render_line.cpp:
1436 (khtml::RootInlineBox::closestLeafChildForXPos):
1437 * khtml/xml/dom_nodeimpl.cpp:
1438 (NodeImpl::isBlockFlowOrTable):
1439 (NodeImpl::isEditableBlock):
1440 (NodeImpl::enclosingBlockFlowOrTableElement):
1441 * khtml/xml/dom_nodeimpl.h:
1442 * khtml/xml/dom_position.cpp:
1443 (DOM::Position::upstream):
1444 (DOM::Position::downstream):
1445 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
1446 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
1447 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
1448 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
1449 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt:
1451 2005-03-19 John Sullivan <sullivan@apple.com>
1455 - fixed <rdar://problem/4058740> Crash (nil-deref) editing Mail reply
1456 message in KWQKHTMLPart::fontForSelection (MailViewer-723)
1458 * kwq/KWQKHTMLPart.mm:
1459 (KWQKHTMLPart::fontForSelection):
1460 Add nil check to loop. It shouldn't be necessary, but this crash trace seems to be
1461 running into it. We're not completely certain, but the check is harmless at worst.
1465 2005-03-18 David Harrison <harrison@apple.com>
1469 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
1471 Also changed WebKit.
1473 * kwq/KWQAccObject.mm:
1474 (-[KWQAccObject rendererForView:]):
1475 New to cover both the WebCore and WebKit NSViews.
1477 (-[KWQAccObject _accessibilityParentForSubview:]):
1478 Use rendererForView.
1480 * kwq/WebCoreFrameView.h:
1481 Add WebCoreBridgeHolder protocol to get access to WebKit NSViews.
1483 2005-03-18 David Harrison <harrison@apple.com>
1485 Reviewed by Darin, Ken.
1487 <rdar://problem/3735625> AX: add AXPress action if an element has an onclick handler
1489 * khtml/dom/html_form.cpp:
1490 (HTMLInputElement::click):
1491 * khtml/html/html_elementimpl.cpp:
1492 (HTMLElementImpl::click):
1493 (HTMLElementImpl::accessKeyAction):
1494 * khtml/html/html_elementimpl.h:
1495 * khtml/html/html_formimpl.cpp:
1496 (DOM::HTMLFormElementImpl::submitClick):
1497 (DOM::HTMLButtonElementImpl::click):
1498 (DOM::HTMLButtonElementImpl::accessKeyAction):
1499 (DOM::HTMLInputElementImpl::click):
1500 (DOM::HTMLInputElementImpl::accessKeyAction):
1501 (DOM::HTMLInputElementImpl::defaultEventHandler):
1502 (DOM::HTMLLabelElementImpl::accessKeyAction):
1503 (DOM::HTMLSelectElementImpl::accessKeyAction):
1504 (DOM::HTMLTextAreaElementImpl::accessKeyAction):
1505 * khtml/html/html_formimpl.h:
1506 * khtml/html/html_inlineimpl.cpp:
1507 (HTMLAnchorElementImpl::defaultEventHandler):
1508 (HTMLAnchorElementImpl::accessKeyAction):
1509 * khtml/html/html_inlineimpl.h:
1510 * khtml/rendering/render_form.cpp:
1511 (RenderFileButton::click):
1512 * khtml/rendering/render_form.h:
1513 * khtml/xml/dom_docimpl.cpp:
1514 (DocumentImpl::defaultEventHandler):
1515 * khtml/xml/dom_elementimpl.h:
1516 (DOM::ElementImpl::accessKeyAction):
1518 (-[DOMHTMLInputElement click]):
1522 * kwq/KWQFileButton.h:
1523 * kwq/KWQFileButton.mm:
1524 (KWQFileButton::click):
1526 Add accessKeyAction parameter about whether to limit to HTMLElementImpl subclasses that JavaScript wants, or to apply to others as well.
1528 Add click() parameter about whether to send the mousedown and mouseup events in addition to the click event.
1530 * kwq/KWQAccObject.mm:
1531 (-[KWQAccObject mouseButtonListener]):
1532 Locate a mousedown, mouseup, or click handler in the current element and its ancestors.
1534 (-[KWQAccObject actionElement]):
1535 (-[KWQAccObject accessibilityIsIgnored]):
1536 (-[KWQAccObject accessibilityPerformAction:]):
1537 Consider mouseButtonListener.
1539 2005-03-18 John Sullivan <sullivan@apple.com>
1543 - fixed <rdar://problem/4002164> maps that include start and end
1544 location don't print right from maps.google.com
1546 I thought I checked this in yesterday but a ChangeLog conflict aborted my checkin
1547 without me noticing.
1549 * khtml/rendering/render_style.cpp:
1550 (RenderStyle::diff):
1551 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
1553 * khtml/rendering/render_style.h:
1554 (khtml::RenderStyle::InheritedFlags::operator==):
1555 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
1556 (khtml::RenderStyle::setBitDefaults):
1558 (khtml::RenderStyle::forceBackgroundsToWhite):
1559 ditto, and method name changed too
1560 (khtml::RenderStyle::setForceBackgroundsToWhite):
1563 * khtml/rendering/render_text.cpp:
1564 (InlineTextBox::paint):
1565 updated for name change; also, compare text against white instead of current bg color
1566 because we no longer actually modify the bg color (previously we would always set
1567 the bg color to white, so the result is the same)
1569 * khtml/xml/dom_docimpl.cpp:
1570 (DocumentImpl::recalcStyle):
1571 updated for name change
1573 * kwq/WebCoreBridge.mm:
1574 (-[WebCoreBridge styleSheetForPrinting]):
1576 (-[WebCoreBridge reapplyStylesForDeviceType:]):
1577 removed the code that called styleSheetForPrinting; we no longer use a stylesheet
1580 * khtml/rendering/render_box.cpp:
1581 (RenderBox::paintBackgroundExtended):
1582 If forceBackgroundsToWhite flag is set, convert background images and
1583 background colors to white background color with no background image.
1585 2005-03-18 Ken Kocienda <kocienda@apple.com>
1591 <rdar://problem/4056718> Pasting quotes the entire message
1593 * khtml/editing/htmlediting.cpp:
1594 (khtml::ReplaceSelectionCommand::doApply): After pasting, nodes are moved to the block containing
1595 the end of the pasted content in certain cases. This move logic used to stop once it moved all the
1596 siblings of the node following the last node of the pasted-in content. This means that block elements
1597 could get moved, and if the pasted-in content included a mail blockquote, this could result in
1598 one quote level getting added. The fix is to stop the move of nodes once a <br>, block element, or
1599 <table> is seen. This only affected one of the many test cases we have for such scenarios, and
1600 the change to that result makes sense given the code change.
1601 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: This test result changed in a way that
1602 adequately tests the behavior change, so I did not add a new test.
1604 2005-03-17 Ken Kocienda <kocienda@apple.com>
1606 Reviewed by Harrison
1610 <rdar://problem/4051809> 8A413: Cursor-up in a mail message sometimes gets stuck (with specific reproducible case)
1612 * khtml/rendering/render_text.cpp:
1613 (RenderText::positionForCoordinates): Consider two lines: line-above and line-below. If the caret position in line-below
1614 was at an x coordinate between half way through the x coordinate of the last character on the line-above and the
1615 end of that same character, this bug would happen since the positioning code would assume that it could create a
1616 VisiblePosition with a DOWNSTREAM affinity. Now, I check to see if the character position on the line-above is the
1617 last character on that line, and if it is, I use UPSTREAM as the affinity.
1621 2005-03-17 David Harrison <harrison@apple.com>
1623 Reviewed by Darin, Ken.
1625 * khtml/editing/htmlediting.cpp:
1626 (khtml::EditCommandPtr::setEndingSelection):
1627 Fixed typo so that it calls setEndingSelection rather than setStartingSelection.
1628 Commented out this unused method, tho, since this is late in Tiger. Proved unused by successful build after temporarily removing method declaration or implemenation.
1630 2005-03-16 Kevin Decker <kdecker@apple.com>
1634 Fixed <rdar://problem/4046665> REGRESSION (403-405): mypage.apple.com login does not work (hits assertion in Development build)
1636 * kwq/WebCoreBridge.mm:
1637 (-[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="">
1639 2005-03-16 Darin Adler <darin@apple.com>
1643 - fixed <rdar://problem/4045203> REGRESSION (125-188): Redundant JS imports crash Safari
1645 * khtml/html/htmltokenizer.h: Take inWRite bool out of NDEBUG ifdef.
1646 * khtml/html/htmltokenizer.cpp:
1647 (khtml::HTMLTokenizer::HTMLTokenizer): Take inWrite bool management code out of NDEBUG ifdef.
1648 (khtml::HTMLTokenizer::write): Ditto. Don't call end if inWrite is true, since it will be called
1649 when you return to the body of the outer write() call.
1650 (khtml::HTMLTokenizer::allDataProcessed): Don't call end() if inWrite is true for the same reason.
1651 (khtml::HTMLTokenizer::finish): Ditto.
1653 * kwq/KWQWidget.mm: (QWidget::getOuterView): Removed bogus assertion that has been vexing us of late.
1655 2005-03-16 David Harrison <harrison@apple.com>
1657 Reviewed by me (written by Patti Yeh).
1659 * kwq/KWQAccObject.mm:
1660 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
1661 Use LeftWordIfOnBoundary instead of RightWordIfOnBoundary.
1663 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
1664 Use RightWordIfOnBoundary instead of LeftWordIfOnBoundary.
1666 2005-03-16 David Harrison <harrison@apple.com>
1670 <rdar://problem/4054590> AX: Dictionary panel does not work when page is scrolled on Safari
1672 * kwq/KWQAccObject.mm:
1673 (-[KWQAccObject doAXTextMarkerForPosition:]):
1674 Add in the view's contentsX and contentsY to the point.
1676 2005-03-16 David Harrison <harrison@apple.com>
1680 <rdar://problem/4048506> Deleting from beginning of editable div deletes other document elements
1682 Also changed WebKit.
1684 * khtml/editing/visible_units.h:
1685 * khtml/editing/visible_units.cpp:
1686 (khtml::startOfEditableContent):
1687 (khtml::endOfEditableContent):
1688 (khtml::inSameEditableContent):
1689 (khtml::isStartOfEditableContent):
1690 (khtml::isEndOfEditableContent):
1693 * kwq/WebCoreBridge.h:
1694 * kwq/WebCoreBridge.mm:
1695 (-[WebCoreBridge canDeleteRange:]):
1698 2005-03-16 Ken Kocienda <kocienda@apple.com>
1704 <rdar://problem/4042935> undo doesn't work properly during inline input
1706 * kwq/WebCoreBridge.h: Declare new method below.
1707 * kwq/WebCoreBridge.mm:
1708 (-[WebCoreBridge replaceMarkedTextWithText:]): New method. Wraps calls to TypingCommand::deleteKeyPressed and
1709 TypingCommand::insertText to map the way that international text input works onto the typing undo system.
1711 2005-03-16 David Harrison <harrison@apple.com>
1715 <rdar://problem/4044336> REGRESSION (8A398-8A409): Option-Delete also deletes space to left of deleted word
1717 * khtml/editing/htmlediting.cpp:
1718 (khtml::DeleteSelectionCommand::initializePositionData):
1719 - skip smart delete if the selection to delete already starts or ends with whitespace
1721 * khtml/khtml_part.cpp:
1722 (KHTMLPart::handleMousePressEventDoubleClick):
1723 - preserve selection on double-click when range is already selected
1725 * khtml/xml/dom_position.cpp:
1726 (DOM::Position::leadingWhitespacePosition):
1727 (DOM::Position::trailingWhitespacePosition):
1728 - fix considerNonCollapsibleWhitespace action (logic was reversed)
1729 - add non-breaking space to the non-collapsable ones
1731 * kwq/WebCoreBridge.mm:
1732 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
1733 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
1734 - these methods do not set the selection, so remove calls to setSelectionGranularity
1736 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
1737 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]):
1738 - set the granularity back to character
1739 - the one exception is that we need to keep word granularity
1740 to preserve smart delete behavior when extending by word
1742 2005-03-15 Maciej Stachowiak <mjs@apple.com>
1746 <rdar://problem/4053266> Pressing return a few times right after a link makes the new blank lines part of the link
1748 * khtml/editing/htmlediting.cpp:
1749 (khtml::InsertLineBreakCommand::doApply): Use
1750 positionOutsideContainingSpecialElement in the right two places.
1751 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1753 - move all these helper functions higher in the file
1755 * khtml/editing/htmlediting.cpp:
1756 (khtml::isSpecialElement):
1757 (khtml::isFirstVisiblePositionInSpecialElement):
1758 (khtml::positionBeforeNode):
1759 (khtml::positionBeforeContainingSpecialElement):
1760 (khtml::maxRangeOffset):
1761 (khtml::isLastVisiblePositionInSpecialElement):
1762 (khtml::positionAfterNode):
1763 (khtml::positionAfterContainingSpecialElement):
1764 (khtml::positionOutsideContainingSpecialElement):
1766 2005-03-14 Maciej Stachowiak <mjs@apple.com>
1770 <rdar://problem/4049925> Pasting right after a link makes pasted content part of the link (without visible style change)
1772 * khtml/editing/htmlediting.cpp:
1773 (khtml::positionOutsideContainingSpecialElement): made a helper
1774 function that computes a position outside the outermost containing
1775 special element if the passed in position is right at the start or
1777 (khtml::InsertTextCommand::prepareForTextInsertion): use new helper here
1778 (khtml::ReplaceSelectionCommand::doApply): use it here too: this is the fix
1779 (khtml::positionBeforeNode): made static
1780 (khtml::positionBeforeContainingSpecialElement): made static
1781 (khtml::positionAfterNode): made static
1782 (khtml::positionAfterContainingSpecialElement): made static
1784 2005-03-15 Richard Williamson <rjw@apple.com>
1786 Fixed <rdar://problem/4053658> Crash getting direction at maps.google.com
1788 Add non nil style() check.
1790 Reviewed by Dave Harrison.
1792 * khtml/rendering/render_table.cpp:
1793 (RenderTableCell::collapsedRightBorder):
1795 2005-03-15 Kevin Decker <kdecker@apple.com>
1799 Fixed: <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
1801 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().
1803 This fixes a recent regression from:
1805 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
1807 * khtml/khtml_part.cpp:
1808 (KHTMLPart::closeURL): After dispatching event handlers, go ahead and remove them from the DOM.
1809 * khtml/xml/dom_docimpl.cpp:
1810 (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.
1812 2005-03-15 Ken Kocienda <kocienda@apple.com>
1818 <rdar://problem/4052642> Each delete keystroke is in its own undo group; not included in undo group with other typing
1820 Calling -[WebCore setSelectedDOMRange:range affinity:] had the result of "closing" any active set of typing
1821 keystrokes grouped together in a single undo operation. A change on 27 Jan in WebKit to change the way delete
1822 keystrokes are handled made this feature regress. Previous to that change, the backwards delete
1823 key went through separate code that is no longer in the tree that did not set the selection in the way
1826 The solution is to add an extra argument to the set-selection call. The WebCoreBridge now offers this method:
1827 -[WebCore setSelectedDOMRange:range affinity:closeTyping:]. Now, callers must indicate whether setting the
1828 selection will act to close typing or not.
1830 * kwq/WebCoreBridge.h: Changed header accordingly to change method shown below.
1831 * kwq/WebCoreBridge.mm:
1832 (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Added closeTyping argument to this method.
1834 2005-03-15 John Sullivan <sullivan@apple.com>
1838 - fixed <rdar://problem/4052246> crash in KWQKHTMLPart::createPart() trying to display local file in frame
1840 * kwq/KWQKHTMLPart.mm:
1841 (KWQKHTMLPart::createPart):
1842 Check part for nil before trying to ref. This was probably a longstanding code flaw revealed by
1843 the recent security fix.
1845 2005-03-15 Kevin Decker <kdecker@apple.com>
1847 Reviewed by Ken and Maciej.
1849 New fix for <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
1851 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.
1853 * khtml/html/htmltokenizer.cpp:
1854 (khtml::HTMLTokenizer::HTMLTokenizer): Initialize loadStopped to false.
1855 (khtml::HTMLTokenizer::write): Go ahead and bail out if loadStopped is true.
1856 (khtml::HTMLTokenizer::processToken):
1857 * 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.
1858 * khtml/khtml_part.cpp:
1859 (KHTMLPart::closeURL): Notify the tokenizer to stop parsing.
1860 * khtml/xml/xml_tokenizer.cpp:
1861 (khtml::XMLTokenizer::XMLTokenizer): Initialize loadStopped to false.
1862 * khtml/xml/xml_tokenizer.h:
1863 (khtml::Tokenizer::stopParsing): Added.
1865 2005-03-14 David Harrison <harrison@apple.com>
1867 Reviewed by Darin, Maciej.
1869 <rdar://problem/4046103> REGRESSION (Mail): clicking after style change sets insertion point incorrectly
1871 Also fixes crash by adding nil check.
1873 * khtml/editing/htmlediting.cpp:
1874 (khtml::MoveSelectionCommand::doApply):
1875 Check the node for nil.
1877 * khtml/khtml_part.cpp:
1878 (KHTMLPart::khtmlMouseReleaseEvent):
1879 Use the node from the event rather than from the selection.
1881 2005-03-14 Darin Adler <darin@apple.com>
1883 Reviewed by Harrison.
1885 - fixed <rdar://problem/4049776> Seed: Mail: Disable spellcheck leaves red artifacts
1887 * khtml/xml/dom_docimpl.cpp:
1888 (DocumentImpl::DocumentImpl): Set markers list to be "auto-delete" so they don't all leak.
1889 (DocumentImpl::removeMarker): Remove markers list for a node when the last marker is removed
1890 for that node. Otherwise, we can have empty marker lists for each node forever until the
1892 (DocumentImpl::removeAllMarkers): Added code to dirty the markers.
1893 (DocumentImpl::shiftMarkers): Remove unneeded empty check.
1895 * kwq/WebCoreBridge.h: Added unmarkAllMisspellings for WebKit.
1896 * kwq/WebCoreBridge.mm: (-[WebCoreBridge unmarkAllMisspellings]): Added. Calls removeAllMarkers.
1898 2005-03-14 Richard Williamson <rjw@apple.com>
1900 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
1902 A document may be deleted as a consequence of handling an event,
1903 as was the case with Acrobat.app. Ensure that the document is still valid
1904 before passing the event on for further handling.
1906 * khtml/xml/dom_nodeimpl.cpp:
1907 (NodeImpl::dispatchUIEvent):
1909 2005-03-14 Ken Kocienda <kocienda@apple.com>
1913 Added a couple of comments about setChanged() to this code based on my experiences with 4047028.
1915 * khtml/css/css_valueimpl.cpp:
1916 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties)
1917 (DOM::CSSMutableStyleDeclarationImpl::merge)
1919 2005-03-14 Ken Kocienda <kocienda@apple.com>
1925 <rdar://problem/4047028> Changing quote levels on stylized text causes it to be sent as colored (Blue). Tiger8A410
1927 * khtml/css/css_valueimpl.cpp:
1928 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): This function now calls setChanged() at the
1929 end of its loop if any properties were removed. This makes the style system update correctly in response
1930 to changes made by this function. The code to paste removes style from the pasted content in a
1931 preliminary step, and the fact that the style system did not update properly left unwanted color
1932 declarations in the document.
1934 2005-03-14 Vicki Murley <vicki@apple.com>
1936 - roll out this change for now, since it was denied by CCC
1938 2005-03-11 David Harrison <harrison@apple.com>
1942 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
1944 * kwq/KWQKHTMLPart.mm:
1945 (KWQKHTMLPart::advanceToNextMisspelling):
1946 (KWQKHTMLPart::markMisspellings):
1949 2005-03-14 Ken Kocienda <kocienda@apple.com>
1955 <rdar://problem/4050403> Mail crashes after pasting and deleting the content of one Excel cell
1957 * khtml/editing/htmlediting.cpp:
1958 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add some null checks to the code. This fixes the crash, although
1959 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
1960 the document that cannot be removed (this is actually an empty table). This is undesirable, however, work Maciej is
1961 doing to fix the general-case problem of trying to edit constructs we do not handle well in editing should fix this
1962 particular case, making the deletion of this "blank line" possible. Maciej is doing this work as part of this bug:
1963 <rdar://problem/4036051> Hard to select (and thus delete) an IFRAME in an editable WebView
1965 2005-03-14 Ken Kocienda <kocienda@apple.com>
1971 <rdar://problem/4029632> Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
1973 The problem is that removeInlineStyle() can remove nodes, and if either the start or end node of the
1974 selection at the time of the call to removeInlineStyle() was in a node that got removed, bad things
1975 would happen. The fix is described below.
1977 * khtml/editing/htmlediting.cpp:
1978 (khtml::maxRangeOffset): Moved this static function to a different place in the file so the code below can use it.
1979 (khtml::ApplyStyleCommand::applyInlineStyle): Calling removeInlineStyle() now has the side effect of
1980 setting the command's ending selection. Now resets start and end using the ending selection after the call to
1981 removeInlineStyle() as it is done elsewhere in this function.
1982 (khtml::ApplyStyleCommand::removeInlineStyle): Track the removal of the start or end node based on
1983 the positions passed in. If either the start or the end node is removed as part of style removal,
1984 set an appropriate replacement start or end that is still in the document.
1988 2005-03-14 Ken Kocienda <kocienda@apple.com>
1992 I need to roll out Kevin's change to fix 3667701. It breaks contextual fragments, and hence breaks
1993 paste in editing (among other things).
1995 * khtml/html/htmltokenizer.cpp: Roll out recent change.
1996 (khtml::HTMLTokenizer::write)
1997 * khtml/html/htmltokenizer.h: Ditto.
1999 2005-03-13 Darin Adler <darin@apple.com>
2001 Reviewed by Ken and Maciej.
2003 - fixed <rdar://problem/4049040> REGRESSION (403-405): security check prevents user stylesheet from loading (Dictionary.app doesn't work at all!)
2005 * kwq/WebCoreBridge.mm: (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Changed to give "applewebdata:"
2006 documents the same privileges to open local files that "file:" documents have.
2008 2005-03-13 Kevin Decker <kdecker@apple.com>
2012 Fixed: <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
2014 The problem here was that the tokenizer would continue to receive chunks of data from the loader already
2015 after the view and part had been destroyed. Situations like this could arise when clicking on another link
2016 while still loading the current view, or during self test where we rapidly open, load, and close browser
2019 * khtml/html/htmltokenizer.cpp:
2020 (khtml::HTMLTokenizer::write): Simple nil check against the view.
2021 * khtml/html/htmltokenizer.h: Changed the view pointer from a standard pointer to a QGuardedPtr. The tokenizer's
2022 handle to the view will now automatically nil-out and never dangle.
2024 2005-03-13 Darin Adler <darin@apple.com>
2026 Reviewed by John and Ken.
2028 - fixed <rdar://problem/4044347> REGRESSION (Mail): Control-K in particular message moves insertion point to previous line
2030 Tweaked the deleting code, and added three new deleting layout tests to confirm the new code works.
2032 * khtml/editing/htmlediting.cpp:
2033 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Removed special case with comment that said it was
2034 for the case where a "selection contains only a BR right after a block ended". This code was being triggered in
2035 more cases than just that one, and in all the cases I tested, the general delete code works fine.
2036 (khtml::DeleteSelectionCommand::handleGeneralDelete): Changed the code that decides whether to delete an entire
2037 block to understand the case where the end block is outside the start block, but contains the start block.
2038 In that case, we want to delete the entire block. Not deleting the block was causing us to delete just the <br>,
2039 and not the enclosing <div> in the case in the bug.
2041 * layout-tests/editing/deleting/delete-line-015-expected.txt: Added.
2042 * layout-tests/editing/deleting/delete-line-015.html: Added.
2043 * layout-tests/editing/deleting/delete-line-016-expected.txt: Added.
2044 * layout-tests/editing/deleting/delete-line-016.html: Added.
2045 * layout-tests/editing/deleting/delete-line-017-expected.txt: Added.
2046 * layout-tests/editing/deleting/delete-line-017.html: Added.
2047 * layout-tests/editing/style/smoosh-styles-002-expected.txt: Updated to improved results. With the code change, the deletion
2048 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
2049 we delete both of those.
2051 2005-03-13 Darin Adler <darin@apple.com>
2053 - fixed <rdar://problem/4049172> REGRESSION (403-405): Gmail: text box in "Invite a friend" section overlaps other sections
2055 Rolled out fix for <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
2057 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth): Back to previous version of this file.
2059 2005-03-12 Maciej Stachowiak <mjs@apple.com>
2063 <rdar://problem/4046144> RSS pages leave a hole in local file security policy (need to revert feed: exemption)
2065 * kwq/WebCoreBridge.mm:
2066 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Revert
2067 emergency workaround for Safari RSS, now that a new Syndication
2070 2005-03-11 Maciej Stachowiak <mjs@apple.com>
2074 <rdar://problem/4026787> text typed after a link (pasted or Mail Link to this Page) is part of the link, underlined and colored blue
2076 The concept of this change is every time you type at the very
2077 start or very end of a link (even if nested in further inner
2078 elements), the typed text goes outside the link instead of inside.
2080 * khtml/editing/htmlediting.cpp:
2081 (khtml::InsertTextCommand::prepareForTextInsertion): Check whether
2082 we are at the first visible position or last visible position of a
2083 special element. For now this only includes HTML A elements that
2084 are links (i.e. they have an href).
2085 (khtml::isSpecialElement): Helper function that identifies special
2086 elements (for now only links).
2087 (khtml::isFirstVisiblePositionInSpecialElement): Checks if a given DOM
2088 position is equivalent to the first visible position in some containing
2089 editable special element.
2090 (khtml::positionBeforeNode): Returns the DOM position immediately
2092 (khtml::positionBeforeContainingSpecialElement): Gives a DOM
2093 position immediately before the outermost editable containing
2094 special element where the passed-in position is equivalent to the
2095 first visible position.
2096 (khtml::maxRangeOffset): Helper to get the maximum allowed
2097 range/position offset for a node, does the right thing based on
2098 whether the node would use a character offset or child offset.
2099 (khtml::isLastVisiblePositionInSpecialElement): Similar to above,
2100 but for end of node instead of start.
2101 (khtml::positionAfterNode): Ditto.
2102 (khtml::positionAfterContainingSpecialElement): Ditto.
2104 Some layout tests changed - I looked over all the diffs and found
2105 that the only changes were "junk nodes" like empty spans and text
2106 nodes moving from one spot in the tree to another. These changes
2107 are all harmless and do not affect layout or future editing.
2109 * layout-tests/editing/inserting/typing-003-expected.txt:
2110 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
2111 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
2112 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
2113 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
2114 * layout-tests/editing/style/remove-underline-expected.txt:
2115 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt:
2116 * layout-tests/editing/style/remove-underline-in-bold-expected.txt:
2117 * layout-tests/editing/style/typing-style-003-expected.txt:
2118 * layout-tests/editing/style/unbold-in-bold-expected.txt:
2119 * layout-tests/editing/style/underline-expected.txt:
2121 2005-03-11 Adele Amchan <adele@apple.com>
2123 backing out fix for <rdar://problem/4021711> REGRESSION (125-188): blank pages when browsing forum at cooperativeresearch.org - cached external script problem
2125 This caused the following regressions (that we know of):
2126 <rdar://problem/4047445> REGRESSION (Safari-400-403?): Some or all page contents sometimes don't appear (macworld.com)
2127 <rdar://problem/4046153> 8a409: Problem loading Citibank page in Safari 2 (403)
2128 <rdar://problem/4047801> REGRESSION (402-403): .Mac homepage links don't work
2130 * khtml/html/htmltokenizer.cpp:
2131 (khtml::HTMLTokenizer::scriptHandler):
2133 2005-03-11 David Harrison <harrison@apple.com>
2137 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
2139 * kwq/KWQKHTMLPart.mm:
2140 (KWQKHTMLPart::advanceToNextMisspelling):
2141 (KWQKHTMLPart::markMisspellings):
2144 2005-03-11 Ken Kocienda <kocienda@apple.com>
2148 * ForwardingHeaders/editing/visible_units.h: Added.
2150 2005-03-11 Ken Kocienda <kocienda@apple.com>
2156 <rdar://problem/4045521> Hitting return key with full line selected does not add blank line as it should
2158 * khtml/editing/htmlediting.cpp:
2159 (khtml::InsertParagraphSeparatorCommand::doApply): Removed some "special-case" code from this
2160 function that would look for a selection that started and ended in a different block, and would
2161 then bail right after the deletion of the selection without inserting a paragraph separator.
2162 This was just wrong. So, the code change is removal only. When the general-case code runs instead
2163 of the erroneous special-case code, the bug goes away.
2167 * layout-tests/editing/inserting/return-key-with-selection-001-expected.txt: Added.
2168 * layout-tests/editing/inserting/return-key-with-selection-001.html: Added.
2169 * layout-tests/editing/inserting/return-key-with-selection-002-expected.txt: Added.
2170 * layout-tests/editing/inserting/return-key-with-selection-002.html: Added.
2171 * layout-tests/editing/inserting/return-key-with-selection-003-expected.txt: Added.
2172 * layout-tests/editing/inserting/return-key-with-selection-003.html: Added.
2174 2005-03-11 David Harrison <harrison@apple.com>
2178 <rdar://problem/4009446> AX: kAXTextMarkerForPositionParameterizedAttribute not working correctly (required for Dictionary pop-up)
2180 * kwq/KWQAccObject.mm:
2181 (-[KWQAccObject accessibilityAttributeValue:]):
2184 (-[KWQAccObject doAXTextMarkerForPosition:]):
2187 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
2188 Use the selection's document instead of the top document, to accommodate frames, etc.
2190 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
2191 Fixed parameter processing to look for NSValue instead of AXValue.
2193 2005-03-11 Ken Kocienda <kocienda@apple.com>
2195 Reviewed by Harrison
2199 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
2201 This was fixed, then regressed with Harrison's fix for this bug:
2203 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
2205 * khtml/editing/htmlediting.cpp:
2206 (khtml::ReplaceSelectionCommand::doApply): My now addresses both problems in a way that they no longer
2209 2005-03-10 Ken Kocienda <kocienda@apple.com>
2215 <rdar://problem/4045511> Copying and pasting end-of-paragraph selection puts insertion point in wrong place
2216 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
2218 The copy/paste code before this patch had no notion of a "logical newline" at the start of the selection. We have
2219 had a similar notion for "logical newline" at the end of the selection for quite some time. To fix these bugs, we
2220 need to introduce the same idea for selection starts.
2222 * khtml/editing/htmlediting.cpp:
2223 (khtml::ReplacementFragment::ReplacementFragment): Process the "logical newline" at start as we write it out
2224 in markup. Set the bit we added to this object to signify we have such a newline.
2225 (khtml::ReplaceSelectionCommand::doApply): Many, many changes to introduce the new "logical newline" at start concept.
2226 I also tried to simply the code that sets the start position for inserting content to be pasted. I also improved a
2227 weakness in the smart-paste code. Now, we check before and after the paste for whether we need to add a leading or
2228 trailing space. The code previous to this patch only did a "before" check, with the result that we sometimes added
2229 a second space. In other words, the code did not realize that DOM changes done by pasting could cause formerly
2230 unrendered whitespace to become rendered. Also moved line placeholder clean up code to its own function.
2231 (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): New helper that further refines the notion
2232 of when we can remove a line placeholder. The definition is now, "If a line placeholder is at the visible start
2233 and visible end of its line, keep it; otherwise remove it".
2234 * khtml/editing/htmlediting.h: Declare new functions. Rework inlines in ReplacementFragment class to account for
2235 addition of new "logical newline" at start concept.
2236 (khtml::ReplacementFragment::hasInterchangeNewlineAtStart): New accessor.
2237 (khtml::ReplacementFragment::hasInterchangeNewlineAtEnd): Renamed from hasInterchangeNewline(), since before we
2238 only had a bit for the end, hence we did not need to distinguish it from the start.
2239 * khtml/editing/markup.cpp:
2240 (khtml::createMarkup): Added code to detect and write out markup for cases where we have a "logical newline" at start.
2241 * khtml/xml/dom2_rangeimpl.cpp:
2242 (DOM::RangeImpl::startPosition): New helper.
2243 (DOM::RangeImpl::endPosition): Ditto.
2244 * khtml/xml/dom2_rangeimpl.h: Declare new helpers.
2247 * layout-tests/editing/pasteboard/paste-line-endings-001-expected.txt: Added.
2248 * layout-tests/editing/pasteboard/paste-line-endings-001.html: Added.
2249 * layout-tests/editing/pasteboard/paste-line-endings-002-expected.txt: Added.
2250 * layout-tests/editing/pasteboard/paste-line-endings-002.html: Added.
2251 * layout-tests/editing/pasteboard/paste-line-endings-003-expected.txt: Added.
2252 * layout-tests/editing/pasteboard/paste-line-endings-003.html: Added.
2253 * layout-tests/editing/pasteboard/paste-line-endings-004-expected.txt: Added.
2254 * layout-tests/editing/pasteboard/paste-line-endings-004.html: Added.
2255 * layout-tests/editing/pasteboard/paste-line-endings-005-expected.txt: Added.
2256 * layout-tests/editing/pasteboard/paste-line-endings-005.html: Added.
2257 * layout-tests/editing/pasteboard/paste-line-endings-006-expected.txt: Added.
2258 * layout-tests/editing/pasteboard/paste-line-endings-006.html: Added.
2259 * layout-tests/editing/pasteboard/paste-line-endings-007-expected.txt: Added.
2260 * layout-tests/editing/pasteboard/paste-line-endings-007.html: Added.
2261 * layout-tests/editing/pasteboard/paste-line-endings-008-expected.txt: Added.
2262 * layout-tests/editing/pasteboard/paste-line-endings-008.html: Added.
2263 * layout-tests/editing/pasteboard/paste-line-endings-009-expected.txt: Added.
2264 * layout-tests/editing/pasteboard/paste-line-endings-009.html: Added.
2265 * layout-tests/editing/pasteboard/paste-line-endings-010-expected.txt: Added.
2266 * layout-tests/editing/pasteboard/paste-line-endings-010.html: Added.
2270 2005-03-10 Darin Adler <darin@apple.com>
2272 Reviewed by Richard.
2274 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
2276 * khtml/rendering/render_text.cpp: (getCharacterBreakIterator): Set boolean "got iterator" to true.
2278 2005-03-10 Darin Adler <darin@apple.com>
2282 - fixed <rdar://problem/4042867> "Bigger" changes the font size of too much text when the selection is on a style-change boundary
2284 * khtml/editing/htmlediting.cpp: (khtml::ApplyStyleCommand::applyRelativeFontStyleChange):
2285 Advance out of the starting text node if we're at the end of it.
2287 2005-03-10 Darin Adler <darin@apple.com>
2289 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Fixed assertion for nested calls to write.
2291 2005-03-10 David Harrison <harrison@apple.com>
2295 <rdar://problem/4032346> REGRESSION (Mail): changing 1st line of a URL that wraps to two lines doesn't always update 2nd line
2297 * khtml/rendering/bidi.cpp:
2298 (khtml::RenderBlock::matchedEndLine):
2299 Look at first clean line in case line wrap implicitly dirtied it.
2301 2005-03-10 Maciej Stachowiak <mjs@apple.com>
2305 <rdar://problem/4046018> REGRESSION (TOT): RSS pages don't display anything
2307 * kwq/WebCoreBridge.mm:
2308 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Exempt
2309 feed: and feeds: pages from the local file security check.
2311 2005-03-10 Darin Adler <darin@apple.com>
2313 Change written by Steve Peters, reviewed by me.
2315 - fixed <rdar://problem/4045924> improve compareBoundaryPoints to make style changes faster
2317 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints):
2318 Do early outs in a couple of the loops to make things faster.
2320 2005-03-10 Jens Alfke <jens@apple.com>
2324 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.
2326 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.
2328 This ensures that the applet will get loaded even if there is no explicit </applet> tag.
2330 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.
2332 * khtml/html/html_objectimpl.cpp:
2333 (HTMLAppletElementImpl::closeRenderer):
2334 * khtml/html/html_objectimpl.h:
2335 * khtml/html/htmlparser.cpp:
2336 (KHTMLParser::insertNode):
2337 (KHTMLParser::processCloseTag):
2338 (KHTMLParser::popOneBlock):
2339 * khtml/xml/dom_nodeimpl.h:
2340 (DOM::NodeImpl::closeRenderer):
2342 2005-03-10 Ken Kocienda <kocienda@apple.com>
2348 <rdar://problem/4024929> REGRESSION (Mail): Pasting text with multiple reply levels removes one level instead of all
2350 The code to figure out which node to use to merge into an existing line did not drill into the first inline element
2351 as needed to make the feature work as user expect. Instead, it looked at the first node, and if it was a block, it
2352 skipped that node. This worked for some cases (including the important "paste-as-quotation" case) but obviously
2353 doesn't work for content quoted more than once.
2355 Now, mergeStartNode() will look for the first node in pasted content that is not a block. It will now also look
2356 for nodes specially marked by Mail as a node added to make "Paste As Quotation" work. It won't skip those.
2358 NOTE: This change will break Mail's "Paste As Quotation" feature for TOT WebKit users, but this is only a temporary
2359 problem that will exist until we sync up with Mail's pending change to mark nodes as needed in its pasteAsQuotation:
2362 * khtml/editing/html_interchange.h: Add ApplePasteAsQuotation constant used to check for "marked" blockquotes.
2363 * khtml/editing/htmlediting.cpp:
2364 (khtml::ReplacementFragment::mergeStartNode): Look for first node that is either not a block or is marked as
2365 an ApplePasteAsQuotation node.
2366 (khtml::isMailPasteAsQuotationNode): New helper that looks for nodes marked with ApplePasteAsQuotation.
2367 * khtml/editing/htmlediting.h: Updated header for new function.
2369 This test result changed is an acceptable way.
2371 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
2372 * layout-tests/editing/pasteboard/paste-text-013.html
2374 NOTE: This change causes a regression in this layout test:
2376 * layout-tests/editing/pasteboard/paste-text-013.html
2378 This problem will need to be fixed separately, and this bug has been filed to track this problem:
2379 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
2381 2005-03-09 Maciej Stachowiak <mjs@apple.com>
2383 Reviewed by Richard.
2385 <rdar://problem/4040776> Dashboard (Weather widget) is a memory hog
2387 Change things around so the event listeners for XMLHttpRequest
2388 mark their JS listener objects instead of holding a hard
2389 reference, to avoid an unbreakable reference cycle.
2391 * khtml/ecma/kjs_events.cpp:
2392 (JSAbstractEventListener::JSAbstractEventListener):
2393 (JSAbstractEventListener::~JSAbstractEventListener):
2394 (JSAbstractEventListener::handleEvent):
2395 (JSAbstractEventListener::eventListenerType):
2396 (JSUnprotectedEventListener::JSUnprotectedEventListener):
2397 (JSUnprotectedEventListener::~JSUnprotectedEventListener):
2398 (JSUnprotectedEventListener::listenerObj):
2399 (JSUnprotectedEventListener::windowObj):
2400 (JSUnprotectedEventListener::mark):
2401 (JSEventListener::JSEventListener):
2402 (JSEventListener::~JSEventListener):
2403 (JSEventListener::listenerObj):
2404 (JSEventListener::windowObj):
2405 (JSLazyEventListener::JSLazyEventListener):
2406 * khtml/ecma/kjs_events.h:
2407 * khtml/ecma/kjs_html.h:
2408 * khtml/ecma/kjs_window.cpp:
2409 (Window::getJSEventListener):
2410 (Window::getJSUnprotectedEventListener):
2411 * khtml/ecma/kjs_window.h:
2412 * khtml/ecma/xmlhttprequest.cpp:
2413 (KJS::XMLHttpRequest::putValue):
2414 (KJS::XMLHttpRequest::mark):
2415 * khtml/ecma/xmlhttprequest.h:
2416 * khtml/khtml_part.h:
2418 2005-03-06 Maciej Stachowiak <mjs@apple.com>
2422 <rdar://problem/4005575> Arbitrary file disclosure vulnerability due to ability to load local html from remote content
2424 * khtml/ecma/kjs_html.cpp:
2425 (KJS::HTMLDocument::putValue):
2426 * khtml/ecma/kjs_window.cpp:
2428 (WindowFunc::tryCall):
2430 (LocationFunc::tryCall):
2431 * khtml/khtml_part.cpp:
2433 (KHTMLPart::scheduleLocationChange):
2434 (KHTMLPart::slotRedirect):
2435 (KHTMLPart::processObjectRequest):
2436 * khtml/khtml_part.h:
2437 * khtml/khtmlpart_p.h:
2438 * kwq/KWQKHTMLPart.mm:
2439 (KWQKHTMLPart::openURLRequest):
2440 (KWQKHTMLPart::urlSelected):
2441 (KWQKHTMLPart::createPart):
2442 * kwq/KWQKHTMLPartBrowserExtension.mm:
2443 (KHTMLPartBrowserExtension::createNewWindow):
2444 * kwq/WebCoreBridge.h:
2445 * kwq/WebCoreBridge.mm:
2446 (hasCaseInsensitivePrefix):
2447 (-[WebCoreBridge didNotOpenURL:pageCache:]):
2448 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]):
2450 2005-03-09 Richard Williamson <rjw@apple.com>
2452 Fixed <rdar://problem/4032938> Safari: text layout for MS P Gothic font is corrupted
2454 Remove our hacked special case now we have our own cache of
2455 which fonts are fixed pitch.
2460 (QFont::isFixedPitch):
2462 2005-03-09 David Harrison <harrison@apple.com>
2466 <rdar://problem/4037141> REGRESSION (Mail): Pasting deletes preceding blank lines with certain steps
2468 * khtml/editing/htmlediting.cpp:
2469 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
2470 Add check for anonymous text after blocks.
2472 2005-03-08 Ken Kocienda <kocienda@apple.com>
2478 <rdar://problem/4039661> crash in ApplyStyleCommand::applyBlockStyle pasting contents of webpage into Mail or Blot
2479 <rdar://problem/4039672> hang in moveParagraphContentsToNewBlockIfNecessary after pasting contents of webpage into Blot
2481 * khtml/editing/htmlediting.cpp:
2482 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Fix for 4039672. Iteration needs to do
2483 a traverseNextSibling(), not a traverseNextNode(). The latter might iterate into a child that already got moved, and
2484 the code can infinite loop as a result.
2485 (khtml::ApplyStyleCommand::applyBlockStyle): Fix for 4039661. This function iterates over a set of nodes to apply
2486 block styles. Before, the iteration would go from the start to the end of the selection, and apply block styles
2487 as it went. However, the act of applying style could confuse the iteration. Now I iterate and store the relevant
2488 nodes in QPtrList before doing any style manipulation, and then iterate that set of nodes.
2490 2005-03-08 Darin Adler <darin@apple.com>
2492 Change written by Hyatt, reviewed by me.
2494 - fixed <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
2496 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth):
2497 Only use a minWidth of 0 for images with a percentage value. Other replaced elements aren't scalable
2498 so their minWidth should be their calculated width. This has been wrong all along, but it's a relatively
2499 safe change because it only affects replaced elements' min-width.
2501 2005-03-08 David Harrison <harrison@apple.com>
2505 <rdar://problem/4039006> REGRESSION (Mail): Command-left-arrow goes to the start of the wrong line in particular message
2507 * khtml/editing/visible_units.cpp:
2508 (khtml::startOfLine):
2509 Use firstLeafChild() instead of firstChild().
2511 2005-03-08 Richard Williamson <rjw@apple.com>
2513 Fixed by Tom Madden.
2515 Fixed <rdar://problem/4038586> 8A402: Osaka-Mono text overlaps when typing with input method
2517 We weren't clearing the "all ascii" flag when setting text on
2520 Reviewed by Richard Williamson.
2522 * khtml/rendering/render_text.cpp:
2523 (RenderText::setText):
2525 2005-03-08 Darin Adler <darin@apple.com>
2527 Reviewed by Ken and Maciej.
2529 - fixed <rdar://problem/3988809> REGRESSION (Mail): wide space characters are turned into plain old spaces when typed or pasted
2531 Changed the few places where it matters to use a "collapsible whitespace" concept instead of
2532 the general whitespace concept. This means treating only ' ' and '\n' specially instead of
2533 including other space characters, which matches what the space-collapsing logic does in RenderText,
2534 although it really needs to behave differently based on whitespace mode.
2536 * khtml/editing/visible_text.h: (khtml::isCollapsibleWhitespace): Added. This returns true only for
2537 ' ' and '\n' since they are the only characters collapsed once text is in the DOM. But really it
2538 can't do the job ignoring white-space mode, so some day it must go.
2540 * khtml/editing/html_interchange.cpp: (convertHTMLTextToInterchangeFormat): Changed to use
2541 isCollapsibleWhitespace and removed unnecessary calls to latin1().
2543 * khtml/editing/htmlediting.cpp:
2544 (khtml::isNBSP): Removed unnecessary creation/destruction of QChar each time this is called.
2545 (khtml::nextCharacterIsCollapsibleWhitespace): Renamed from isWS and changed to use isCollapsibleWhitespace.
2546 (khtml::DeleteSelectionCommand::fixupWhitespace): Use isCollapsibleWhitespace instead of isWS,
2547 since we only want to do our NBSP tricks for collapsible whitespace.
2548 (khtml::InsertTextCommand::input): Changed use of isTab to instead say == "\t" since that does the
2549 same thing and is arguably just as clear. Changed use of isWS to == " " since the input text can't
2550 include any "\n" characters, and really a plain old space is the only collapsible thing that can
2551 be passed in. Use isCollapsibleWhitespace instead of isWS since we want to do NBSP tricks only for
2552 collapsible whitespace, not all whitespace.
2553 (khtml::InsertTextCommand::insertSpace): Use isCollapsibleWhitespace instead of isWS since we want
2554 to do NBSP tricks only for collapsible whitespace, not all whitespace.
2555 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
2557 * khtml/xml/dom_position.h: Changed treatNBSPAsWhiteSpace parameters to considerNonCollapsibleWhitespace
2558 parameters. The most common callers are only interested in collapsible whitespace, and the smart copy
2559 and paste callers want to include all whitespace, including non-breaking spaces and all the Unicode spaces.
2560 * khtml/xml/dom_position.cpp:
2561 (DOM::Position::leadingWhitespacePosition): Rename the parameter, and use either QChar::isSpace or
2562 isCollapsibleWhitespace depending on the boolean passed in.
2563 (DOM::Position::trailingWhitespacePosition): Ditto.
2565 2005-03-07 John Sullivan <sullivan@apple.com>
2569 - <rdar://problem/4040868> REGRESSION (Mail, 403-403+): Drag and drop deletes text,
2570 many other bad editing problems
2572 * khtml/rendering/render_text.cpp:
2573 (RenderText::caretMaxOffset):
2574 A "-" should have been a "+" in this method that was tweaked an hour ago. Editing
2575 was completely horked.
2577 2005-03-07 Richard Williamson <rjw@apple.com>
2579 Additional nil check from fix for 4040749.
2581 * khtml/rendering/render_box.cpp:
2582 (RenderBox::setStyle):
2584 2005-03-07 Richard Williamson <rjw@apple.com>
2586 Additional nil check from fix for 4040749.
2588 * khtml/rendering/render_layer.cpp:
2589 (RenderLayer::updateLayerPosition):
2591 2005-03-07 David Harrison <harrison@apple.com>
2595 <rdar://problem/4033202> REGRESSION (Mail): Can't arrow up at a particular spot in a particular Mail message
2597 Doublecheck that new position is really on a different line, because the VisiblePosition constructor does not.
2598 Filed <rdar://problem/4040763> for that problem.
2600 * khtml/editing/visible_units.cpp:
2601 (khtml::previousLinePosition):
2603 2005-03-07 Richard Williamson <rjw@apple.com>
2605 Fixed <rdar://problem/4040749> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
2607 When layers are dynamically created/removed as a result of changing opacity they weren't being correctly
2608 sized and positioned. This happens whenever opacity goes from < 1 to 1.
2612 * khtml/rendering/render_box.cpp:
2613 (RenderBox::setStyle):
2614 * khtml/rendering/render_layer.cpp:
2615 (RenderLayer::updateLayerPosition):
2617 2005-03-07 Christy Warren <kali@apple.com>
2621 * khtml/rendering/render_text.cpp:
2622 (RenderText::caretMinOffset): modified to handle BIDI case by checking all text boxes for min offset
2623 (RenderText::caretMaxOffset): modified to handle BIDI case by checking all text boxes for max offset
2625 2005-03-07 David Harrison <harrison@apple.com>
2629 <rdar://problem/4029225> REGRESSION (Mail): Crash if hit return after dragging in attachment - DeleteSelectionCommand::initializePositionData
2631 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.
2632 Filed <rdar://problem/4040358> RenderBR height() is not accurate.
2634 * khtml/editing/htmlediting.cpp:
2635 (khtml::ReplaceSelectionCommand::doApply):
2636 When height is 0, double check that the placeholder is the first position on the line.
2640 2005-03-07 Ken Kocienda <kocienda@apple.com>
2646 <rdar://problem/4040136> Expose SPI for WebCore's functions to create document fragments from plain text and markup strings
2648 * kwq/DOMHTML.mm: Add two new SPI functions.
2649 (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:])
2650 (-[DOMHTMLDocument _createDocumentFragmentWithText:])
2651 * kwq/DOMPrivate.h: Declare the new SPI here, a privately-exported header, so Mail can make use of it.
2653 2005-03-07 Ken Kocienda <kocienda@apple.com>
2659 <rdar://problem/4039676> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date
2661 * khtml/editing/htmlediting.cpp:
2662 (khtml::ReplaceSelectionCommand::doApply): Code to "eat" a <br> element, that was creating an otherwise empty line, was running
2663 when it should not. If the content being pasted in does not end in a "logical" newline itself, then the <br> already
2664 in the content needs to be preserved. A simple one-line change now sees to this.
2666 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: This test now has an extra, but harmless,
2667 <br> at the end of a paragraph. This makes sense given the code change.
2670 * layout-tests/editing/pasteboard/paste-text-018-expected.txt: Added.
2671 * layout-tests/editing/pasteboard/paste-text-018.html: Added.
2673 2005-03-07 Ken Kocienda <kocienda@apple.com>
2679 <rdar://problem/4035648> REGRESSION (Mail): line feed in source HTML file causes bad copy/paste behavior
2681 The createMarkup() function in markup.cpp iterates over the nodes in a range,
2682 and does some bookkeeping to figure out when to add close tags to the markup.
2683 Some code added at the start of the loop to prevent markup from being written
2684 for unrendered nodes short-circuited the rest of the loop, and so prevented
2685 the close-tag-writing code from running when it should.
2687 This is why the "plain" text wound up inside of the bold tag in the example
2688 above. The addition of the unrendered return character caused an incorrect
2689 delay in the close tag for the bold element from being written out, with the
2690 result being that it wound up including additional content.
2692 The fix is to add checks for node renderers throughout the loop at the points
2693 where markup is written out for each node. This allows the additional close
2694 tag logic to run as needed.
2696 All layout tests pass with this change.
2698 * khtml/editing/markup.cpp:
2699 (khtml::createMarkup)
2703 * layout-tests/editing/pasteboard/paste-4035648-fix-expected.txt: Added.
2704 * layout-tests/editing/pasteboard/paste-4035648-fix.html: Added.
2706 2005-03-06 Christy Warren <kali@appple.com>
2710 * khtml/rendering/render_text.cpp:
2711 (lastRendererOnPrevLine): helper for RenderText::caretRect
2712 (RenderText::caretRect): added code to properly handle bidi ordered text boxes
2714 2005-03-06 Christy Warren <kali@apple.com>
2718 * khtml/editing/visible_position.cpp: Eliminated code that cuts off searching through the text boxes based on an assumption that breaks under bidi
2719 (khtml::VisiblePosition::isCandidate):
2720 * kwq/KWQFontMetrics.mm:
2721 (QFontMetrics::checkSelectionPoint): Made the initialization of the WebCoreStyle honor the reversed flag
2723 2005-03-05 John Sullivan <sullivan@apple.com>
2727 - fixed <rdar://problem/4038417> Mail crashed in StyleChange::checkForLegacyHTMLStyleChange
2728 when composing a reply
2730 * khtml/editing/htmlediting.cpp:
2731 (khtml::StyleChange::checkForLegacyHTMLStyleChange):
2732 Added missing nil check.
2734 2005-03-05 Darin Adler <darin@apple.com>
2738 - fixed <rdar://problem/4038478> Crash in renderer viewing RSS feed at feed://wvs.topleftpixel.com/index.rdf
2740 * khtml/xml/dom_docimpl.cpp: (widgetForNode): Check for nil before going from node to renderer.
2742 2005-03-05 Darin Adler <darin@apple.com>
2744 Reviewed by Richard.
2746 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
2748 * khtml/rendering/render_text.cpp:
2749 (getCharacterBreakIterator): Added. Helper that sets up an iterator for the passed-in text.
2750 Shares a single global iterator (fast, albeit not thread-safe).
2751 (RenderText::previousOffset): Changed to call getCharacterBreakIterator.
2752 (RenderText::nextOffset): Ditto.
2754 2005-03-05 Ken Kocienda <kocienda@apple.com>
2760 <rdar://problem/4038267> REGRESSION (Mail): Crash copying and pasting end of paragraph
2762 Code to handle content that has a "logical" newline at the end of the pasted content, and the code
2763 to adjust the selection at the end of the paste operation made an assumption that at least one
2764 node had been inserted by the paste command. This is not necessarily true in the case where the sole content
2765 in the pasted content is one of these "logical" newlines. Adjust some code around so that we don't deref
2766 null, but still adjust the selection correctly for this case. In each of the two functions below, some
2767 null checks have been added, and some code has been rearranged a little bit to continue on through
2768 the end of completeHTMLReplacement, even if no nodes have been inserted. The patch looks bigger and more
2769 complicated than the conceptual change.
2771 * khtml/editing/htmlediting.cpp:
2772 (khtml::ReplaceSelectionCommand::doApply)
2773 (khtml::ReplaceSelectionCommand::completeHTMLReplacement)
2775 * layout-tests/editing/pasteboard/paste-4038267-fix-expected.txt: Added.
2776 * layout-tests/editing/pasteboard/paste-4038267-fix.html: Added.
2778 2005-03-05 Darin Adler <darin@apple.com>
2782 - fixed <rdar://problem/4025918> images copied from Safari with relative src URLs aren't pasted into Mail messages (KURL resolves base URLs incorrectly)
2784 * kwq/KWQKURL.mm: (KURL::KURL): Add a slash at the start of the path if a relative part is adding
2785 a path onto a URL that has "pre-path" bits like host name, but no path yet. This doesn't come up
2786 for http because in that case we add a trailing "/" as part of canonicalization.
2788 2005-03-04 John Sullivan <sullivan@apple.com>
2792 - fixed <rdar://problem/4033705> REGRESSION (Mail): Copy/Paste from Excel
2793 crashes Mail in KWQKHTMLPart::fontForSelection(bool*) const + 232
2795 * kwq/KWQKHTMLPart.mm:
2796 (KWQKHTMLPart::fontForSelection):
2797 Check for nil startNode, not just nil renderer.
2799 2005-03-04 David Harrison <harrison@apple.com>
2801 Reviewed by Ken, Richard.
2803 <rdar://problem/3996383> REGRESSION (Mail): Deleting all of first line also deletes line ending
2805 Problem was the placeholder check was based on 0 height block, but the block in this
2806 case is the BODY, which has other content even though the paragraph is gone.
2808 * khtml/editing/htmlediting.cpp:
2809 (khtml::CompositeEditCommand::insertBlockPlaceholder):
2810 Now does insert instead of append!
2812 (khtml::CompositeEditCommand::appendBlockPlaceholder):
2813 New. Actually does append.
2815 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
2816 Renamed from insertBlockPlaceholderIfNeeded because it can insert or append. Also accepts "force insert" flag.
2818 (khtml::CompositeEditCommand::removeBlockPlaceholder):
2819 Renamed for succinctness from removeBlockPlaceholderIfNeeded.
2821 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
2822 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
2823 Use renamed methods.
2825 (khtml::DeleteSelectionCommand::doApply):
2826 Use addBlockPlaceholderIfNeeded "force insert" flag if deleting whole paragraphs did not leave an empty one.
2828 (khtml::InsertParagraphSeparatorCommand::doApply):
2829 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
2830 (khtml::InsertTextCommand::input):
2831 Use renamed methods.
2833 * khtml/editing/htmlediting.h:
2834 Renamed and new methods per above.
2837 2005-03-04 Chris Blumenberg <cblu@apple.com>
2839 Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after pasting attachment at end of message
2843 * khtml/editing/visible_units.cpp:
2844 (khtml::endOfParagraph): don't consider text nodes that have no rendered characters
2846 2005-03-04 Richard Williamson <rjw@apple.com>
2848 Fixed <rdar://problem/4034764> REGRESSION(125-188)Viewing text/plain page and going back/forward corrupts HTML pages (google.com)
2850 The parse mode wasn't be restored to the document when going
2855 * kwq/KWQKHTMLPart.mm:
2856 (KWQKHTMLPart::openURLFromPageCache):
2857 * kwq/KWQPageState.h:
2858 * kwq/KWQPageState.mm:
2859 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]):
2861 2005-03-04 Ken Kocienda <kocienda@apple.com>
2865 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Shame on me!
2866 I landed my last fix without running layout tests. This one changes in a subtle, but
2869 2005-03-04 Ken Kocienda <kocienda@apple.com>
2871 Reviewed by Harrison
2875 <rdar://problem/4032543> REGRESSION (Mail): Mail hangs when quoted text is pasted twice
2877 This code change fixes the bug in a non-obvious way. The root cause of the problem was
2878 that a VisiblePosition created using an affinity originating in Mail code caused
2879 two VisiblePosition objects that should have been equal to differ only in their
2880 affinities, which in turn caused us to run a code path that should not have run.
2882 * khtml/editing/visible_position.cpp:
2883 (khtml::VisiblePosition::VisiblePosition): Added copy constructor.
2884 (khtml::VisiblePosition::next): Factored out inline code that used to be here into new
2885 setAffinityUsingLinePosition() function.
2886 (khtml::isEqualIgnoringAffinity): New helper to handle cases when affinity in equality check does
2887 not matter. However, we want to know about such cases where a VisiblePosition differs only by affinity,
2888 and the code will assert in development when this happens.
2889 (khtml::isNotEqualIgnoringAffinity): Ditto, but not. :)
2890 (khtml::setAffinityUsingLinePosition): New helper function mentioned above. This will "correct"
2891 upstream affinity to downstream if the affinity does not make a difference for the position.
2892 * khtml/editing/visible_position.h:
2893 * khtml/editing/visible_range.h: Wacky bug. The operator== for this class took VisiblePosition classes!
2894 * khtml/editing/visible_units.cpp:
2895 (khtml::isStartOfParagraph): Now performs equality check without regard to affinity.
2896 (khtml::isEndOfParagraph): Ditto.
2897 (khtml::isStartOfBlock): Ditto.
2898 (khtml::isEndOfBlock): Ditto.
2899 * kwq/WebCoreBridge.mm:
2900 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Adjusts the affinity using setAffinityUsingLinePosition()
2903 2005-03-04 Darin Adler <darin@apple.com>
2907 - fixed <rdar://problem/4036817> REGRESSION: ctrl-y broken when a line + carriage return cut
2909 * khtml/editing/htmlediting.h: Added insertTextRunWithoutNewlines.
2910 * khtml/editing/htmlediting.cpp:
2911 (khtml::InsertTextCommand::input): Added assertion to make sure strings with newlines don't get
2913 (khtml::TypingCommand::insertText): Added. Takes the name of the old function, but is a new
2914 level that breaks runs into lines and inserts each one separately.
2915 (khtml::TypingCommand::insertTextRunWithoutNewlines): Renamed old insertText to this.
2917 * khtml/dom/dom_string.h: Made substring be a const member function.
2918 * khtml/dom/dom_string.cpp: (DOM::DOMString::substring): Made this const.
2920 2005-03-04 Darin Adler <darin@apple.com>
2924 - fixed <rdar://problem/4020413> REGRESSION (Mail): can't use fonts with names that start with "#" in Mail (Korean fonts)
2926 * khtml/css/css_valueimpl.cpp:
2927 (DOM::isLegalIdentifier): Added. Commented out and not used.
2928 (DOM::quoteStringIfNeeded): Quotes the string if needed. For now only if it starts with "#".
2929 (DOM::CSSPrimitiveValueImpl::cssText): Call quoteStringIfNeeded when asked for cssText for an arbitrary string, since we
2930 need text you can re-parse.
2931 (DOM::FontFamilyValueImpl::cssText): Ditto.
2933 * khtml/editing/markup.cpp:
2934 (khtml::startMarkup): Added comments about lack of quoting for attributes.
2935 (khtml::createMarkup): Ditto.
2937 2005-03-04 Adele Amchan <adele@apple.com>
2941 Fix for <rdar://problem/4021711> REGRESSION(125-188) blank pages when browsing forum at cooperativeresearch.org - cached external script problem
2943 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::scriptHandler): set flag needToRefCachedScript so we can make sure
2944 notifyFinished is called after pendingSrc is set up with the right data from the cached script
2946 2005-03-04 Ken Kocienda <kocienda@apple.com>
2952 <rdar://problem/4029632> Tiger 8A398:- Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
2954 * khtml/editing/htmlediting.cpp:
2955 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): VisiblePosition constructor
2956 was failing to yield a position for a node just pasted into the document since a layout was needed
2957 for the calculation to come out right. Layout added. Crash gone.
2961 2005-03-03 Chris Blumenberg <cblu@apple.com>
2963 Fixed: <rdar://problem/3992803> Cannot navigate through list items with the keyboard, you're stuck in the same <li> block unless you click out
2965 Reviewed by harrison.
2967 * khtml/rendering/render_line.cpp:
2968 (khtml::RootInlineBox::closestLeafChildForXPos): avoid returning list markers when possible. Also improved heuristic for returning the best InlineBox given the passed X position.
2971 2005-03-03 Ken Kocienda <kocienda@apple.com>
2977 <rdar://problem/4035198> Pasting text with different styles does not get reproducible results
2979 I had a good idea yesterday to improve the way we "fixup" styles after
2980 pasting, but i chose a poor data structure to do it, a map of
2981 nodes-to-styles. In the fixup step, I iterated over the map elements and
2982 did the fixup. However, since the order in which the items would come
2983 out of the map is indeterminate, we got unpredictable results.
2985 So, the concept was good, but the implementation was flawed. I have
2986 fixed this mapping to be a list instead, so the order that nodes are
2987 evaluated in the fixup step is document order. This works nicely.
2989 * khtml/editing/htmlediting.cpp:
2990 (khtml::ReplacementFragment::~ReplacementFragment): No longer need to explicity deref nodes and
2991 styles saved away for later fixup. This is now handled by the new NodeDesiredStyle class.
2992 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls computeAndStoreNodeDesiredStyle,
2993 function renamed from mapDesiredStyleForNode.
2994 Now accepts a QValueList<NodeDesiredStyle> in place of the old map.
2995 (khtml::NodeDesiredStyle::NodeDesiredStyle): New class that represents a node-to-style mapping.
2996 (khtml::NodeDesiredStyle::~NodeDesiredStyle): Ditto.
2997 (khtml::NodeDesiredStyle::operator=): Ditto.
2998 (khtml::ReplaceSelectionCommand::doApply): Now calls computeAndStoreNodeDesiredStyle,
2999 function renamed from mapDesiredStyleForNode.
3000 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Now operates on a QValueList<NodeDesiredStyle> in
3001 place of the old map.
3002 (khtml::computeAndStoreNodeDesiredStyle): Renamed from mapDesiredStyleForNode. Now operates on a
3003 QValueList<NodeDesiredStyle> in place of the old map.
3004 * khtml/editing/htmlediting.h:
3005 (khtml::NodeDesiredStyle): New class that represents a node-to-style mapping.
3006 (khtml::ReplacementFragment::desiredStyles): Now returns a QValueList<NodeDesiredStyle> in place of the old map.
3008 * layout-tests/editing/style/typing-style-003-expected.txt: Results changed in an acceptable way.
3010 2005-03-02 Darin Adler <darin@apple.com>
3014 - fixed <rdar://problem/4029741> REGRESSION (188-189): <input type=text> are cleared when you hide/show them
3016 * khtml/html/html_formimpl.h: Added detach functions for both input and text area elements, since
3017 both have m_valueMatchesRenderer flags.
3018 * khtml/html/html_formimpl.cpp:
3019 (DOM::HTMLInputElementImpl::detach): Set m_valueMatchesRenderer to false, since the renderer is going away.
3020 (DOM::HTMLTextAreaElementImpl::detach): Ditto.
3022 2005-03-02 Ken Kocienda <kocienda@apple.com>
3028 <rdar://problem/4006151> in reply, caret moves to next line after toggling bold style then typing
3030 * khtml/editing/htmlediting.cpp:
3031 (khtml::ApplyStyleCommand::applyInlineStyle): Defer cleaning up empty style until the end of the
3032 function. In some situations, the render tree can get confused when we do this removal up front.
3033 I wish I understood the reasons more deeply, but this bit of code shuffling seems harmless, and
3036 2005-03-02 Darin Adler <darin@apple.com>
3040 - fixed <rdar://problem/4024966> crash happened twice in [KWQTextField setHasFocus:] + 0xe8
3042 Added more nil checks to the widget implementations. Anywhere a widget pointer is used, do a nil check,
3043 rather than relying on high level assumptions about which calls can and can't destroy the HTML element
3044 (and hence the widget). The case in the bug seems to be a case where scrolling destroyed the element.
3045 We can't be sure this fixes the bug, but we can be relatively sure we didn't introduce any new problems,
3046 because this just avoids nil-dereferencing.
3049 (-[KWQButton becomeFirstResponder]):
3050 (-[KWQButton nextKeyView]):
3051 (-[KWQButton previousKeyView]):
3052 * kwq/KWQListBox.mm:
3053 (-[KWQTableView mouseDown:]):
3054 (-[KWQTableView becomeFirstResponder]):
3055 (-[KWQTableView numberOfRowsInTableView:]):
3056 (-[KWQTableView tableViewSelectionDidChange:]):
3057 (-[KWQTableView tableView:shouldSelectRow:]):
3058 (-[KWQTableView selectionShouldChangeInTableView:]):
3059 * kwq/KWQScrollBar.mm:
3060 (-[KWQScrollBar scroll:]):
3062 (-[KWQSlider mouseDown:]):
3063 (-[KWQSlider slide:]):
3064 (-[KWQSlider becomeFirstResponder]):
3065 (-[KWQSlider nextKeyView]):
3066 (-[KWQSlider previousKeyView]):
3067 * kwq/KWQTextArea.mm:
3068 (-[KWQTextAreaTextView becomeFirstResponder]):
3069 (-[KWQTextAreaTextView resignFirstResponder]):
3070 (-[KWQTextAreaTextView mouseDown:]):
3071 * kwq/KWQTextField.mm:
3072 (-[KWQTextFieldController action:]):
3073 (-[KWQTextFieldController controlTextDidEndEditing:]):
3074 (-[KWQTextFieldController controlTextDidChange:]):
3075 (-[KWQTextFieldController textView:didHandleEvent:]):
3076 (-[KWQTextFieldController setHasFocus:]):
3078 2005-03-02 Richard Williamson <rjw@apple.com>
3080 Fixed <rdar://problem/4031483> Leak (RenderObject::createInlineBox) reproducible with Stock widget
3082 We were leaking inline block line boxes. Argh!
3086 * khtml/rendering/render_flow.cpp:
3087 (RenderFlow::dirtyLineBoxes):
3088 * khtml/rendering/render_line.cpp:
3089 (khtml::InlineBox::deleteLine):
3091 2005-03-02 Chris Blumenberg <cblu@apple.com>
3093 Fixed: <rdar://problem/3976872> REGRESSION (Mail): Pasted plain text doesn't get the proper style if pasted into newlines
3095 Reviewed by kocienda.
3097 * khtml/editing/htmlediting.cpp:
3098 (khtml::EditCommand::styleAtPosition): new, factored out from calculateStyleBeforeInsertion
3099 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): call styleAtPosition
3100 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): clear new m_insertionStyle ivar
3101 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): deref new m_insertionStyle ivar
3102 (khtml::ReplaceSelectionCommand::doApply): store the style so it later be applied when matching style
3103 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply style from m_insertionStyle when matching style
3104 * khtml/editing/htmlediting.h:
3106 2005-03-02 Maciej Stachowiak <mjs@apple.com>
3110 <rdar://problem/4031718> REGRESSION (401-401+): Safari reproducible crash setting up scope in JSLazyEventListener::parseCode authenticating to bugweb
3112 * khtml/ecma/kjs_events.cpp:
3113 (JSLazyEventListener::parseCode): If originalNode is NULL, don't
3114 mess with the scope chain.
3116 * khtml/html/html_baseimpl.cpp:
3117 (HTMLBodyElementImpl::parseHTMLAttribute): For handlers that are
3118 delcared on body but set on the document, pass NULL to avoid
3119 swizzling the scope chain. It turns out that this is what browsers
3120 do, and it finesses the crash.
3122 2005-03-02 David Harrison <harrison@apple.com>
3126 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
3128 * khtml/editing/htmlediting.cpp:
3129 (khtml::ReplaceSelectionCommand::doApply):
3131 2005-03-02 Ken Kocienda <kocienda@apple.com>
3136 <rdar://problem/4020574> REGRESSION (Mail): copy/paste first part of reply-quoted text alters downstream style
3138 The problem was that the operation to move nodes following the newly-pasted nodes did not preserve the
3139 style of these moved nodes. I have generalized some of the functions that compute and preserve styles
3140 for nodes and then apply these styles after a DOM operation.
3142 * khtml/editing/htmlediting.cpp:
3143 (khtml::ReplacementFragment::~ReplacementFragment): Call new derefNodesAndStylesInMap() helper function
3144 in place of old code that had this deref'ing inline.
3145 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls new mapDesiredStyleForNode() helper
3146 function place of old code that had this style computation inline.
3147 (khtml::ReplacementFragment::removeStyleNodes): Updated comment for new helper name.
3148 (khtml::ReplaceSelectionCommand::doApply): Now calls new helpers in place of helpers whose names were changed,
3149 or in place of pre-refactored inline code.
3150 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Renamed from applyStyleToInsertedNodes(). Now generalized
3151 to take the map of nodes to use for the fixup. This makes it possible to call this code with different maps,
3152 and that is needed to fix the bug.
3153 (khtml::mapDesiredStyleForNode): New helper function to compute the inheritable styles for a given node
3154 and map this style to the given node in the given map. This function now also includes the code that was
3155 in the removeBlockquoteColorsIfNeeded(). This latter helper has now been removed.
3156 (khtml::derefNodesAndStylesInMap): Simple helper to deref map members.
3157 * khtml/editing/htmlediting.h:
3158 (khtml::ReplacementFragment::desiredStyles): New helper to return map of nodes-to-desiredStyles.
3160 2005-03-01 Ken Kocienda <kocienda@apple.com>
3166 <rdar://problem/4011358> REGRESSION(Mail): after dragging text to mail message and deleting, typing or dragging new text doesn't work
3168 * khtml/editing/visible_position.cpp:
3169 (khtml::VisiblePosition::isCandidate): Insertion point disappearing was due to a failed
3170 check here after deleting all the content in the body element. The special "empty block"
3171 needs to add check for DOM children. A block may have straggling anonymous render children in
3172 some cases, and so the check needs to be (!DOM-kids || !render-kids).
3174 Also, I botched the last checkin trying to split these two patches in my tree. Wrong layout tests
3175 got checked in, I checked in a conflict marker in the Changelog, etc. I fixed everything with this checkin.
3177 2005-03-01 Ken Kocienda <kocienda@apple.com>
3181 Improved fix for this bug:
3183 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
3185 Maciej and I discussed this situation at length, and we came up with a better fix than I did earlier.
3187 * khtml/editing/htmlediting.cpp:
3188 (khtml::InsertParagraphSeparatorCommand::doApply): Simplify one special case so that it only handles the
3189 "last in block" situation. Remove special case for "downstream node is in different block" and handle
3190 this case with a little bit of special code in the general insertion case.
3192 Results studied to make sure there were no problems.
3194 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt
3195 * layout-tests/editing/inserting/insert-div-001-expected.txt
3196 * layout-tests/editing/inserting/insert-div-002-expected.txt
3197 * layout-tests/editing/inserting/insert-div-004-expected.txt
3198 * layout-tests/editing/inserting/insert-div-005-expected.txt
3199 * layout-tests/editing/inserting/insert-div-009-expected.txt
3200 * layout-tests/editing/inserting/insert-div-014-expected.txt
3201 * layout-tests/editing/inserting/insert-div-018-expected.txt
3202 * layout-tests/editing/inserting/insert-div-024-expected.txt
3203 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
3204 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
3205 * layout-tests/editing/pasteboard/paste-text-015-expected.txt
3206 * layout-tests/editing/style/block-style-004-expected.txt
3207 * layout-tests/editing/style/block-style-005-expected.txt
3208 * layout-tests/editing/style/block-style-006-expected.txt
3212 * layout-tests/editing/inserting/insert-div-027.html
3213 * layout-tests/editing/inserting/insert-div-027-expected.txt
3215 2005-03-01 David Hyatt <hyatt@apple.com>
3217 Fix for 4030890, regression with <sup> on Google. Fix some bogus != comparison checks in verticalPositionHint.
3221 (RenderObject::getVerticalPosition):
3223 2005-03-01 Chris Blumenberg <cblu@apple.com>
3225 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
3229 * khtml/editing/htmlediting.cpp:
3230 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
3231 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
3232 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
3233 * layout-tests/editing/deleting/smart-delete-001.html: Added.
3234 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
3235 * layout-tests/editing/deleting/smart-delete-002.html: Added.
3237 2005-03-01 Richard Williamson <rjw@apple.com>
3239 Fixed <rdar://problem/4029772> Weather widgets use a lot of memory (more that other widgets)
3241 The string objects created by KWQHeaderStringFromDictionary() leaked.
3243 Reviewed by John Louch.
3246 (KWQHeaderStringFromDictionary):
3248 2005-03-01 Jens Alfke <jens@apple.com>
3252 <rdar://problem/4004531> Simple Sun Signed Applet throws exceptions; doesn't run
3253 Two fixes for the way we extract the parameter-y goodness from <object> tags.
3255 * khtml/rendering/render_frames.cpp:
3256 (RenderPartObject::updateWidget):
3258 2005-03-01 Richard Williamson <rjw@apple.com>
3260 Fixed <rdar://problem/3990258> REGRESSION (125.12-181): top of picture that spans two pages is cut off on print from Safari
3262 The problem was due to incorrect "object truncation" in RenderFlow::paintLines.
3263 We attempt to push objects down if they don't fit on a page at
3264 paint time. If the attempt to push object down failed we just
3265 didn't paint at all.
3269 * khtml/rendering/render_flow.cpp:
3270 (RenderFlow::paintLines):
3272 2005-03-01 Chris Blumenberg <cblu@apple.com>
3274 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
3278 * khtml/editing/htmlediting.cpp:
3279 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
3280 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
3281 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
3282 * layout-tests/editing/deleting/smart-delete-001.html: Added.
3283 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
3284 * layout-tests/editing/deleting/smart-delete-002.html: Added.
3286 2005-03-01 Ken Kocienda <kocienda@apple.com>
3292 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
3294 * khtml/editing/htmlediting.cpp:
3295 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
3297 2005-03-01 Maciej Stachowiak <mjs@apple.com>
3301 <rdar://problem/4003774> REGRESSION(125-181): JavaScript problems @ Yankee/Dixie quiz
3303 Reworked how scopes are set up for event handlers to match other
3304 browser. This includes the following changes:
3306 - Special scope entries are set up at the time the event handler
3307 is created, not at the time it fires.
3309 - Special scope is only set up for event handlers set in the html
3310 source through an html attribute, not for handlers set using
3311 addEventHandler or setting JS properties like onclick through
3314 - Special scope is based on the DOM node on which the handler is
3315 an attribute, not the event target.
3317 This fixes the regression while allowing the fix to
3318 <rdar://problem/3798453> (DIG: getting variable with same name as
3319 DOM element attribute gets attribute value instead) to keep
3322 * khtml/ecma/kjs_events.cpp:
3323 (JSEventListener::handleEvent):
3324 (JSLazyEventListener::JSLazyEventListener):
3325 (JSLazyEventListener::parseCode):
3326 * khtml/ecma/kjs_events.h:
3327 * khtml/ecma/kjs_proxy.cpp:
3328 (KJSProxyImpl::createHTMLEventHandler):
3329 * khtml/ecma/kjs_proxy.h:
3330 * khtml/ecma/kjs_window.cpp:
3331 (Window::getJSLazyEventListener):
3332 * khtml/ecma/kjs_window.h:
3333 * khtml/html/html_baseimpl.cpp:
3334 (HTMLBodyElementImpl::parseHTMLAttribute):
3335 (HTMLFrameElementImpl::parseHTMLAttribute):
3336 (HTMLFrameSetElementImpl::parseHTMLAttribute):
3337 * khtml/html/html_elementimpl.cpp:
3338 (HTMLElementImpl::parseHTMLAttribute):
3339 * khtml/html/html_formimpl.cpp:
3340 (DOM::HTMLFormElementImpl::parseHTMLAttribute):
3341 (DOM::HTMLButtonElementImpl::parseHTMLAttribute):
3342 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
3343 (DOM::HTMLLabelElementImpl::parseHTMLAttribute):
3344 (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
3345 (DOM::HTMLTextAreaElementImpl::parseHTMLAttribute):
3346 * khtml/html/html_imageimpl.cpp:
3347 (HTMLImageElementImpl::parseHTMLAttribute):
3348 * khtml/html/html_objectimpl.cpp:
3349 (HTMLObjectElementImpl::parseHTMLAttribute):
3350 * khtml/khtml_part.cpp:
3351 (KHTMLPart::createHTMLEventListener):
3352 * khtml/khtml_part.h:
3353 * khtml/xml/dom_docimpl.cpp:
3354 (DocumentImpl::createHTMLEventListener):
3355 * khtml/xml/dom_docimpl.h:
3359 2005-03-01 Chris Blumenberg <cblu@apple.com>
3361 Backed out my patch since the tree was closed.
3363 * khtml/editing/htmlediting.cpp:
3364 (khtml::DeleteSelectionCommand::initializePositionData):
3365 * khtml/editing/jsediting.cpp:
3367 2005-03-01 Chris Blumenberg <cblu@apple.com>
3369 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
3373 * khtml/editing/htmlediting.cpp:
3374 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
3375 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
3376 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
3377 * layout-tests/editing/deleting/smart-delete-001.html: Added.
3378 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
3379 * layout-tests/editing/deleting/smart-delete-002.html: Added.
3381 2005-03-01 Ken Kocienda <kocienda@apple.com>
3387 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
3389 * khtml/editing/htmlediting.cpp:
3390 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
3392 2005-03-01 David Harrison <harrison@apple.com>
3396 <rdar://problem/3915560> Mail would like an SPI to enable "smart" text paste/drop
3398 * kwq/WebCoreBridge.h:
3399 * kwq/WebCoreBridge.mm:
3400 (-[WebCoreBridge smartDeleteRangeForProposedRange:]):
3401 (-[WebCoreBridge smartInsertForString:replacingRange:beforeString:afterString:]):
3404 2005-03-01 Chris Blumenberg <cblu@apple.com>
3406 Fixed: <rdar://problem/4030404> selection granularity should be set when extending selection via JS
3408 Reviewed by kocienda.
3410 * khtml/ecma/kjs_window.cpp:
3411 (SelectionFunc::tryCall): set the granularity on the part. This will allow us to write smart paste layout tests.
3412 * layout-tests/editing/pasteboard/smart-paste-001-expected.txt: Added.
3413 * layout-tests/editing/pasteboard/smart-paste-001.html: Added.
3414 * layout-tests/editing/pasteboard/smart-paste-002-expected.txt: Added.
3415 * layout-tests/editing/pasteboard/smart-paste-002.html: Added.
3416 * layout-tests/editing/pasteboard/smart-paste-003-expected.txt: Added.
3417 * layout-tests/editing/pasteboard/smart-paste-003.html: Added.
3418 * layout-tests/editing/pasteboard/smart-paste-004-expected.txt: Added.
3419 * layout-tests/editing/pasteboard/smart-paste-004.html: Added.
3420 * layout-tests/editing/pasteboard/smart-paste-005-expected.txt: Added.
3421 * layout-tests/editing/pasteboard/smart-paste-005.html: Added.
3422 * layout-tests/editing/pasteboard/smart-paste-006-expected.txt: Added.
3423 * layout-tests/editing/pasteboard/smart-paste-006.html: Added.
3424 * layout-tests/editing/pasteboard/smart-paste-007-expected.txt: Added.
3425 * layout-tests/editing/pasteboard/smart-paste-007.html: Added.
3427 2005-03-01 Chris Blumenberg <cblu@apple.com>
3429 Fixed: <rdar://problem/4029934> smart paste with plain text can add too many spaces
3431 Reviewed by kocienda.
3433 * khtml/editing/htmlediting.cpp:
3434 (khtml::ReplaceSelectionCommand::doApply): pass true for treatNBSPAsWhitespace to leadingWhitespacePosition and trailingWhitespacePosition
3435 * khtml/xml/dom_position.cpp:
3436 (DOM::isWS): take treatNBSPAsWhitespace param
3437 (DOM::Position::leadingWhitespacePosition): ditto
3438 (DOM::Position::trailingWhitespacePosition): ditto
3439 * khtml/xml/dom_position.h:
3441 2005-03-01 Ken Kocienda <kocienda@apple.com>
3447 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
3449 * khtml/editing/htmlediting.cpp:
3450 (khtml::InsertParagraphSeparatorCommand::doApply): Look for the upstream-most block to insert after
3451 when at the visible end of a block. This helps to avoid some undesirable sequences of markup which
3452 Dave says will be vary hard to render. Changing the command in this way avoids the "limitations"
3453 of the render tree by not asking it to render markup we do not want to make anyway.
3455 All these tests change, but either in insignificant ways, or for the better.
3457 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt:
3458 * layout-tests/editing/inserting/insert-div-001-expected.txt:
3459 * layout-tests/editing/inserting/insert-div-002-expected.txt:
3460 * layout-tests/editing/inserting/insert-div-004-expected.txt:
3461 * layout-tests/editing/inserting/insert-div-005-expected.txt:
3462 * layout-tests/editing/inserting/insert-div-009-expected.txt:
3463 * layout-tests/editing/inserting/insert-div-024-expected.txt:
3464 * layout-tests/editing/pasteboard/paste-text-011-expected.txt:
3465 * layout-tests/editing/pasteboard/paste-text-013-expected.txt:
3466 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
3467 * layout-tests/editing/style/block-style-004-expected.txt:
3468 * layout-tests/editing/style/block-style-005-expected.txt:
3469 * layout-tests/editing/style/block-style-006-expected.txt:
3470 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
3471 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
3472 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
3473 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
3475 New test to check specific problem mentioned in the bug.
3477 * layout-tests/editing/inserting/insert-div-026-expected.txt: Added.
3478 * layout-tests/editing/inserting/insert-div-026.html: Added.
3480 2005-02-28 Maciej Stachowiak <mjs@apple.com>
3484 <rdar://problem/4002864> REGRESSION(125-146) getElementById in onload fails in a test case involving external resources
3486 Moved management of elementById hashtable from attach/detach to
3487 insertedIntoDocument/removedFromDocument, to avoid being thrown
3488 off by temporary detaches due to style recalcs.
3490 * khtml/xml/dom_elementimpl.cpp:
3491 (ElementImpl::insertedIntoDocument):
3492 (ElementImpl::removedFromDocument):
3493 (ElementImpl::attach):
3494 (ElementImpl::updateId):
3495 * khtml/xml/dom_elementimpl.h:
3497 Make sure that insertedIntoDocument is called before firing any
3500 * khtml/xml/dom_nodeimpl.cpp:
3501 (NodeBaseImpl::dispatchChildInsertedEvents):
3503 2005-02-28 David Hyatt <hyatt@apple.com>
3505 Fix for 4028999, safari crashes when resetting if mallocsribble is on. Clip rects were being cleared using dead
3506 render objects. Change the ordering.
3510 * khtml/rendering/render_box.cpp:
3511 (RenderBox::detach):
3512 * khtml/rendering/render_layer.cpp:
3513 (RenderLayer::~RenderLayer):
3515 2005-02-28 Chris Blumenberg <cblu@apple.com>
3517 Fixed: <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
3519 Reviewed by kocienda.
3521 * khtml/editing/htmlediting.cpp:
3522 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Call updateLayout so caretMinOffset and caretMaxOffset return correct values.
3524 2005-02-28 John Sullivan <sullivan@apple.com>
3528 - WebCore part of fix for <rdar://problem/4023490> REGRESSION (125-185): Tabbing through links
3529 on frameset page gets stuck at end (tivofaq.com)
3531 * kwq/WebCoreBridge.h:
3532 add nextValidKeyViewOutsideWebFrameViews (code is in WebKit)
3534 2005-02-28 Ken Kocienda <kocienda@apple.com>
3540 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
3542 * khtml/css/css_computedstyle.cpp: inheritableProperties array now defined in css_valueimpl.cpp.
3543 * khtml/css/css_valueimpl.cpp: Define inheritableProperties array here.
3544 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Use new name for blockProperties, and use the new
3545 constant for the number of items in the array.
3546 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
3547 (DOM::CSSMutableStyleDeclarationImpl::removeInheritableProperties): New function.
3548 * khtml/css/css_valueimpl.h: Declare inheritableProperties array and numInheritableProperties extern so they
3549 can be defined in css_valueimpl.cpp and used in css_computedstyle.cpp.
3550 * khtml/editing/htmlediting.cpp:
3551 (khtml::ReplacementFragment::removeStyleNodes): This code was misguided, and removed too much style from HTML
3552 elements. Now, it removes from HTML elements only the styles that we replace later with a call to applyStyle().
3553 Also, add ID_B to list of inline "style" nodes we are willing to remove. Leaving it off was an oversight.
3555 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: ID_B fix made this result change, without any
3556 visible change in the test.
3560 * layout-tests/editing/style/smoosh-styles-003.html
3561 * layout-tests/editing/style/smoosh-styles-003-expected.txt
3563 2005-02-28 Richard Williamson <rjw@apple.com>
3565 Fixed <rdar://problem/4026985> CrashTracer: ...14 crashes at com.apple.WebCore: -[KWQPageState invalidate] + 32
3567 Added more nil checking and ASSERTS.
3568 Without a reproducible case this is hard to definitively resolve.
3570 Reviewed by John Sullivan.
3572 * kwq/KWQPageState.mm:
3573 (-[KWQPageState invalidate]):
3575 2005-02-28 Richard Williamson <rjw@apple.com>
3577 Fixed <rdar://problem/4027702> 3.5% performance regression btwn Safari-188 and Safari-400
3579 I inadvertently checked in some debugging code that disabled
3580 style sharing. Backed out that change.
3582 * khtml/css/cssstyleselector.cpp:
3583 (khtml::CSSStyleSelector::styleForElement):
3585 2005-02-28 Chris Blumenberg <cblu@apple.com>
3587 Fixed: <rdar://problem/4026639> www.bmw.ca configurator does not work with Safari
3591 * khtml/ecma/kjs_html.cpp:
3592 (KJS::HTMLElement::tryGet): when frameset.<name of frame child> is called, return the window object of the frame child
3594 2005-02-28 Ken Kocienda <kocienda@apple.com>
3600 <rdar://problem/4026906> Paste of HTML table content can break table structure
3602 * khtml/editing/htmlediting.cpp:
3603 (khtml::ReplacementFragment::pruneEmptyNodes): Call new isProbablyTableStructureNode() function to prevent
3604 removal of empty table structure nodes.
3605 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
3606 (khtml::isProbablyTableStructureNode): New helper function.
3607 * khtml/editing/htmlediting.h: Declare new helper.
3609 2005-02-28 Chris Blumenberg <cblu@apple.com>
3611 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
3613 Reviewed by kocienda.
3615 * khtml/editing/htmlediting.cpp:
3616 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): ref and deref the element while it is "floating"
3617 (khtml::ReplacementFragment::insertFragmentForTestRendering): ditto
3618 (khtml::floatRefdElement): new, keeps an element alive while its ref count is 0
3619 (khtml::createDefaultParagraphElement): removed commented out code
3620 (khtml::createBlockPlaceholderElement): ref the element and return it as "floating"
3621 (khtml::createFontElement): ditto
3622 (khtml::createStyleSpanElement): ditto
3623 * khtml/editing/htmlediting.h:
3625 2005-02-27 Maciej Stachowiak <mjs@apple.com>
3629 <rdar://problem/3993557> REGRESSION (125-180-ish): getElementsByTagName no longer works with namespace designations
3631 * khtml/xml/dom_nodeimpl.cpp:
3632 (NodeBaseImpl::getElementsByTagNameNS): When no namespace is specified, find elements
3633 of the specified name in any namespace to match Mozilla and earlier Safari behavior.
3635 2005-02-25 Darin Adler <darin@apple.com>
3639 - fixed <rdar://problem/4025618> Crash while searching at hollywoodvideo.com
3641 * khtml/html/html_formimpl.h: Added valueWithDefault.
3642 * khtml/html/html_formimpl.cpp:
3643 (DOM::HTMLInputElementImpl::appendFormData): Call valueWithDefault instead of going at the render object
3644 to try to get the default value; there may be no render object if this is display:none.
3645 (DOM::HTMLInputElementImpl::valueWithDefault): Added. Knows about the defaults for "submit" and "reset"
3646 buttons; otherwise just returns the value as-is.
3648 * khtml/rendering/render_form.h: Removed the defaultLabel member functions.
3649 * khtml/rendering/render_form.cpp:
3650 (RenderSubmitButton::rawText): Call valueWithDefault instead of using defaultLabel function here on
3651 the render side. The DOM needs to know how to deal with the default anyway for form submission.
3652 (RenderSubmitButton::defaultLabel): Removed.
3653 (RenderResetButton::defaultLabel): Removed.
3654 (RenderPushButton::defaultLabel): Removed.
3656 2005-02-25 Darin Adler <darin@apple.com>
3660 - fixed <rdar://problem/4025088> window onblur and onfocus don't fire when text field has focus
3662 * kwq/KWQKHTMLPart.h: Added setWindowHasFocus function and m_windowHasFocus data member.
3663 * kwq/KWQKHTMLPart.mm:
3664 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Took out the code that sends the focus and blur events.
3665 (KWQKHTMLPart::setWindowHasFocus): Put that code here instead.
3667 * kwq/WebCoreBridge.h: Added setWindowHasFocus: method to the bridge.
3668 * kwq/WebCoreBridge.mm: (-[WebCoreBridge setWindowHasFocus:]): Added. Calls method on the part.
3670 2005-02-25 Darin Adler <darin@apple.com>
3674 - re-fixed <rdar://problem/3665430> horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode
3676 * kwq/KWQTextArea.mm: (-[KWQTextArea _updateTextViewWidth]): Don't change the text view width
3677 to match the text area's width in the "wrap" case.
3679 2005-02-25 Ken Kocienda <kocienda@apple.com>
3685 <rdar://problem/4021518> 8A394 Mail crashes during paste: khtml::RootInlineBox::closestLeafChildForXPos
3687 * khtml/editing/visible_units.cpp:
3688 (khtml::previousLinePosition): Adding an updateLayout call at the start of the function fixes the crash, since
3689 we caught line boxes in a not-completely-updated state.
3690 (khtml::nextLinePosition): Ditto.
3692 2005-02-25 David Hyatt <hyatt@apple.com>
3694 Fix for 4010774, make sure to avoid an O(N^2) algorithm in nextRenderer() that is triggered when large
3695 DOM subtrees are inserted into documents via one insert/append call.
3697 Reviewed by kocienda
3699 * khtml/xml/dom_nodeimpl.cpp:
3700 (NodeImpl::nextRenderer):
3702 2005-02-25 Richard Williamson <rjw@apple.com>
3704 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
3706 Second pass at fixing 3382926 w/o causing layout regressions. Same concept:
3707 if directionality of text's element is RTL and first character has neutral directionality
3708 then set the initial directionality to RTL.
3712 * khtml/rendering/bidi.cpp:
3713 (khtml::RenderBlock::bidiReorderLine):
3714 (khtml::RenderBlock::determineStartPosition):
3718 2005-02-25 Ken Kocienda <kocienda@apple.com>
3722 Roll out Chris' change to fix this bug:
3724 <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
3726 That code change is responsible for all these new crashers:
3728 <rdar://problem/4025177> crash copying safari.apple.com into Blot document
3729 <rdar://problem/4025184> crash in DOM::NodeImpl::parentNode copying "New!" from google.com to Blot
3730 <rdar://problem/4025214> crash in DOM::NodeImpl::getRect loading paste-match-style-001.html
3732 Since we wish to close the tree for a build right now, I am rolling out rather than investigating.
3734 * khtml/editing/htmlediting.cpp:
3735 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded)
3736 (khtml::ReplacementFragment::insertFragmentForTestRendering)
3737 (khtml::createDefaultParagraphElement)
3738 (khtml::createBlockPlaceholderElement)
3739 (khtml::createFontElement)
3740 (khtml::createStyleSpanElement)
3741 * khtml/editing/htmlediting.h
3743 2005-02-25 Ken Kocienda <kocienda@apple.com>
3749 <rdar://problem/4020108> Pasting text into message makes Mail crash reproducibly
3751 Note that, even with this fix, development build will crash until this bug is fixed:
3752 <rdar://problem/4024996> Applying block styles can cause assertion failure in inline style removal
3754 This will not crash deployment builds, so I am going to land.
3756 * khtml/editing/htmlediting.cpp:
3757 (khtml::ApplyStyleCommand::applyBlockStyle): Applying block styles can make the loop to reach beyondEnd
3758 fail since the structure of the document can change. Cache the next node first before operating on it,
3761 2005-02-25 Vicki Murley <vicki@apple.com>
3763 - recommit this change, since rolling it out did NOT fix the performance regression!
3765 2005-02-23 Darin Adler <darin@apple.com>
3769 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
3771 The key was to change things around so that we don't push text from the DOM to the widget
3772 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
3773 during the blur process.
3775 * khtml/html/html_formimpl.cpp:
3776 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
3777 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
3778 new value is set here.
3779 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
3781 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
3782 to true, and also sends out the input event. It's better to have this here than in the renderer code.
3783 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
3784 m_dirtyvalue) and m_valueMatchesRenderer as false.
3785 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
3786 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
3787 where the value came from.
3788 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
3789 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
3790 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
3792 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
3793 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
3794 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
3796 * khtml/rendering/render_form.cpp:
3797 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
3799 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
3801 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
3802 (RenderTextArea::handleFocusOut): Ditto.
3803 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
3804 DOM if valueMatchesRenderer is true.
3805 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
3807 2005-02-25 Chris Blumenberg <cblu@apple.com>
3809 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
3813 * khtml/editing/htmlediting.cpp:
3814 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
3815 (khtml::ReplacementFragment::insertFragmentForTestRendering):
3816 (khtml::floatRefdElement):
3817 (khtml::createDefaultParagraphElement):
3818 (khtml::createBlockPlaceholderElement):
3819 (khtml::createFontElement):
3820 (khtml::createStyleSpanElement):
3821 * khtml/editing/htmlediting.h:
3823 2005-02-25 Darin Adler <darin@apple.com>
3825 * kwq/character-sets.txt: Checked in updated file. This new file has no effect, because none of the
3826 changes affect character sets that we support, but it's good to have the latest file in here, and
3827 completely safe because I checked that the generated files have not changed.
3829 2005-02-25 Vicki Murley <vicki@apple.com>
3833 - back out this change, since it causes a 3.5% performance regression
3835 2005-02-23 Darin Adler <darin@apple.com>
3839 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
3841 The key was to change things around so that we don't push text from the DOM to the widget
3842 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
3843 during the blur process.
3845 * khtml/html/html_formimpl.cpp:
3846 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
3847 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
3848 new value is set here.
3849 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
3851 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
3852 to true, and also sends out the input event. It's better to have this here than in the renderer code.
3853 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
3854 m_dirtyvalue) and m_valueMatchesRenderer as false.
3855 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
3856 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
3857 where the value came from.
3858 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
3859 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
3860 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
3862 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
3863 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
3864 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
3866 * khtml/rendering/render_form.cpp:
3867 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
3869 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
3871 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
3872 (RenderTextArea::handleFocusOut): Ditto.