1 2005-05-06 Maciej Stachowiak <mjs@apple.com>
3 Reviewed by Dave Harrison.
5 - make StayInBlock vs DoNotStayInBlock explicit in all calls to
6 upstream/downstream, in preparation for phasing out the
7 DoNotStayInBlock variant.
9 * khtml/editing/htmlediting.cpp:
10 (khtml::ApplyStyleCommand::nodeFullySelected):
11 (khtml::ApplyStyleCommand::nodeFullyUnselected):
12 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
13 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
14 (khtml::InsertTextCommand::insertSpace):
15 (khtml::ReplaceSelectionCommand::doApply):
16 * khtml/editing/markup.cpp:
17 (khtml::createMarkup):
18 * khtml/editing/selection.cpp:
19 (khtml::Selection::debugPosition):
20 * khtml/xml/dom_position.h:
22 2005-05-06 David Harrison <harrison@apple.com>
24 Reviewed by Maciej, Darin.
26 <rdar://problem/4103339> VisiblePosition and PositionIterator iterators do not return positions in order
28 * WebCore.pbproj/project.pbxproj:
29 Removed dom_positioniterator.h and dom_positioniterator.cpp.
31 * khtml/editing/htmlediting.cpp:
32 Removed unused include of dom_positioniterator.h and "using" of PositionIterator.
34 * khtml/editing/selection.cpp:
35 Removed unused include of dom_positioniterator.h.
37 * khtml/editing/visible_position.h:
38 * khtml/editing/visible_position.cpp:
39 (khtml::VisiblePosition::previousVisiblePosition):
40 (khtml::VisiblePosition::nextVisiblePosition):
41 (khtml::VisiblePosition::downstreamDeepEquivalent):
42 Use Position::next(), Position::previous(), Position::atStart(), Position::atEnd() instead of duplicated code.
44 * khtml/xml/dom_nodeimpl.h:
45 * khtml/xml/dom_nodeimpl.cpp:
46 (NodeImpl::maxDeepOffset):
47 Added to support Position::next(), Position::previous(), Position::atStart(), Position::atEnd()
49 * khtml/xml/dom_position.h:
50 * khtml/xml/dom_position.cpp:
51 (DOM::Position::previous):
52 (DOM::Position::next):
53 (DOM::Position::atStart):
54 (DOM::Position::atEnd):
55 Moved here, replacing VisiblePosition's duplicate and PositionIterator. Fixed to
56 return positions in order and not skip positions.
58 (DOM::Position::previousCharacterPosition):
59 (DOM::Position::nextCharacterPosition):
60 Use Position::next(), Position::previous(), Position::atStart(), Position::atEnd() instead of PositionIterator.
63 (DOM::Position::upstream):
64 (DOM::Position::downstream):
65 Use Position::next(), Position::previous(), Position::atStart(), Position::atEnd() instead of PositionIterator.
67 * khtml/xml/dom_positioniterator.cpp: Removed.
68 * khtml/xml/dom_positioniterator.h: Removed.
69 Removed in favor of Position::next(), Position::previous(), Position::atStart(), Position::atEnd()
71 2005-05-05 Maciej Stachowiak <mjs@apple.com>
75 <rdar://problem/4058167> Unit Converter and Weather widgets crashed in KJS::Collector::markCurrentThreadConservatively
77 Avoid possibly allocating new prototype objects as parameters to
78 superclass constructors - there may be an allocated but
79 uninitilized object so this is a bad time to allocate. Instead,
80 set the prototype in the constructor body, since the object is
81 happily allocated by then.
83 * khtml/ecma/kjs_binding.h:
84 * khtml/ecma/kjs_css.cpp:
85 (DOMCSSStyleDeclaration::DOMCSSStyleDeclaration):
86 (DOMMediaList::DOMMediaList):
87 (DOMCSSStyleSheet::DOMCSSStyleSheet):
88 (DOMCSSPrimitiveValue::DOMCSSPrimitiveValue):
89 (DOMCSSValueList::DOMCSSValueList):
90 * khtml/ecma/kjs_css.h:
91 (KJS::DOMStyleSheet::DOMStyleSheet):
92 (KJS::DOMCSSValue::DOMCSSValue):
93 * khtml/ecma/kjs_dom.cpp:
95 (DOMDocument::DOMDocument):
96 (DOMElement::DOMElement):
97 (DOMDOMImplementation::DOMDOMImplementation):
98 (DOMNamedNodeMap::DOMNamedNodeMap):
99 (DOMNamedNodesCollection::DOMNamedNodesCollection):
100 (DOMCharacterData::DOMCharacterData):
102 * khtml/ecma/kjs_dom.h:
103 (KJS::NodeConstructor::NodeConstructor):
104 (KJS::DOMExceptionConstructor::DOMExceptionConstructor):
105 * khtml/ecma/kjs_events.cpp:
106 (DOMEvent::DOMEvent):
107 (Clipboard::Clipboard):
108 * khtml/ecma/kjs_html.cpp:
109 (HTMLCollection::HTMLCollection):
110 * khtml/ecma/kjs_range.cpp:
111 (DOMRange::DOMRange):
112 * khtml/ecma/kjs_traversal.cpp:
113 (DOMNodeIterator::DOMNodeIterator):
114 (DOMNodeFilter::DOMNodeFilter):
115 (DOMTreeWalker::DOMTreeWalker):
116 * khtml/ecma/xmlhttprequest.cpp:
117 (KJS::XMLHttpRequest::XMLHttpRequest):
118 * khtml/ecma/xmlserializer.cpp:
119 (KJS::XMLSerializer::XMLSerializer):
121 2005-05-06 Darin Adler <darin@apple.com>
125 - make building multiple trees with make work better
127 * Makefile.am: Set up Xcode build directory before invoking xcodebuild.
129 2005-05-05 David Hyatt <hyatt@apple.com>
131 Eliminate the FOUCS on wired.com. innerWidth and innerHeight on window should not do a layout that ignores
132 pending stylesheets, since even if stylesheets are loading the correct window dimensions can be determined with
135 The radar # is 4109888.
139 * khtml/ecma/kjs_window.cpp:
141 (Window::updateLayout):
142 * khtml/ecma/kjs_window.h:
144 2005-05-05 David Hyatt <hyatt@apple.com>
146 Fix for 4109667, sIFR flash replacement technique often malfunctions. This bug occurs when the plugin
147 widget update causes the onload for the document to fire. Because you can be in the middle of a style
148 recalc when doing an attach (in response to a stylesheet load), the onload fires in the middle of the attach
149 process when the tree is in a bogus state.
151 The fix is to add a bit to the document that tells style recalc that the implicitClose() method was invoked
152 during the style recalc process and the code has been patched so that when this situation occurs, the close is
153 deferred until after the style recalc has finished.
155 Reviewed by John Sullivan
157 * khtml/xml/dom_docimpl.cpp:
158 (DocumentImpl::DocumentImpl):
159 (DocumentImpl::recalcStyle):
160 (DocumentImpl::implicitClose):
161 * khtml/xml/dom_docimpl.h:
162 * layout-tests/fast/dynamic/flash-replacement-test.html: Added.
164 2005-05-05 Darin Adler <darin@apple.com>
166 Reviewed by Dave Hyatt.
168 - fixed <rdar://problem/4109564> REGRESSION (Atlanta): maps.google.com doesn't always center California correctly
170 * khtml/ecma/kjs_events.cpp: (offsetFromTarget): Fix two places that said X where they should say Y.
172 2005-05-05 David Harrison <harrison@apple.com>
174 Restore fixed setEndingSelection. Fixed method was ifdef'd out
175 because change was at end of Tiger development, but method is
176 unused. You just can never be _too_ safe.
178 * khtml/editing/htmlediting.cpp:
179 (khtml::EditCommandPtr::setEndingSelection):
182 2005-05-02 Maciej Stachowiak <mjs@apple.com>
186 - renamed NodeBaseImpl to ContainerNodeImpl
188 * khtml/ecma/kjs_dom.cpp:
189 (DOMNodeProtoFunc::tryCall): Avoid use of NodeBaseImpl and avoid
190 use of obsolete checkNoOwner call, use isAncestor instead.
191 * khtml/html/html_elementimpl.cpp:
192 (HTMLElementImpl::setOuterText): Avoid gratuitous use of
194 * khtml/xml/dom_nodeimpl.cpp:
195 (NodeBaseImpl::checkNoOwner): Removed.
197 Ther rest is all just simple renaming.
199 * khtml/xml/dom_docimpl.cpp:
200 (DocumentImpl::DocumentImpl):
201 (DocumentImpl::attach):
202 (DocumentImpl::detach):
203 (DocumentFragmentImpl::DocumentFragmentImpl):
204 * khtml/xml/dom_docimpl.h:
205 * khtml/xml/dom_elementimpl.cpp:
206 (AttrImpl::AttrImpl):
207 (ElementImpl::ElementImpl):
208 (ElementImpl::insertedIntoDocument):
209 (ElementImpl::removedFromDocument):
210 (ElementImpl::attach):
212 * khtml/xml/dom_elementimpl.h:
213 * khtml/xml/dom_nodeimpl.cpp:
214 (ContainerNodeImpl::ContainerNodeImpl):
215 (ContainerNodeImpl::~ContainerNodeImpl):
216 (ContainerNodeImpl::firstChild):
217 (ContainerNodeImpl::lastChild):
218 (ContainerNodeImpl::insertBefore):
219 (ContainerNodeImpl::replaceChild):
220 (ContainerNodeImpl::removeChild):
221 (ContainerNodeImpl::removeChildren):
222 (ContainerNodeImpl::appendChild):
223 (ContainerNodeImpl::hasChildNodes):
224 (ContainerNodeImpl::setFirstChild):
225 (ContainerNodeImpl::setLastChild):
226 (ContainerNodeImpl::checkSameDocument):
227 (ContainerNodeImpl::checkIsChild):
228 (ContainerNodeImpl::addChild):
229 (ContainerNodeImpl::attach):
230 (ContainerNodeImpl::detach):
231 (ContainerNodeImpl::insertedIntoDocument):
232 (ContainerNodeImpl::removedFromDocument):
233 (ContainerNodeImpl::cloneChildNodes):
234 (ContainerNodeImpl::getElementsByTagNameNS):
235 (ContainerNodeImpl::getUpperLeftCorner):
236 (ContainerNodeImpl::getLowerRightCorner):
237 (ContainerNodeImpl::getRect):
238 (ContainerNodeImpl::setFocus):
239 (ContainerNodeImpl::setActive):
240 (ContainerNodeImpl::childNodeCount):
241 (ContainerNodeImpl::childNode):
242 (ContainerNodeImpl::dispatchChildInsertedEvents):
243 (ContainerNodeImpl::dispatchChildRemovalEvents):
244 * khtml/xml/dom_nodeimpl.h:
245 * khtml/xml/dom_xmlimpl.cpp:
246 (DOM::EntityImpl::EntityImpl):
247 (DOM::EntityReferenceImpl::EntityReferenceImpl):
248 (DOM::NotationImpl::NotationImpl):
249 (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
250 * khtml/xml/dom_xmlimpl.h:
252 2005-05-04 Vicki Murley <vicki@apple.com>
256 - fix mismatched parentheses in one of the ifdefs
258 * khtml/html/html_headimpl.cpp:
259 (HTMLTitleElementImpl::childrenChanged):
261 2005-05-04 Darin Adler <darin@apple.com>
263 Reviewed by Dave Hyatt.
265 - fixed build rules to match other projects
267 * WebCore.pbproj/project.pbxproj: Set deployment target to 10.3 in the build styles.
268 When built without a build style (by Apple B&I) we want to get the target from the
269 environment. But when built with a build style (by Safari engineers and others), we want
272 * Makefile.am: Took out extra parameters that make command-line building different from
273 Xcode building. Now that this is fixed, you should not get a full rebuild if you switch
274 from command line to Xcode or back.
276 2005-05-04 Vicki Murley <vicki@apple.com>
280 - fixed <rdar://problem/3986228> Not able to load additional script blocks dynamically
282 Run scripts when they're inserted into the document. Use createdByParser bit to make sure
283 that scripts aren't run twice, once while parsing and again when inserting.
285 * khtml/html/html_headimpl.cpp:
286 (HTMLScriptElementImpl::HTMLScriptElementImpl):
287 (HTMLScriptElementImpl::~HTMLScriptElementImpl):
288 (HTMLScriptElementImpl::insertedIntoDocument):
289 (HTMLScriptElementImpl::removedFromDocument):
290 (HTMLScriptElementImpl::notifyFinished):
291 * khtml/html/html_headimpl.h:
292 (DOM::HTMLScriptElementImpl::setCreatedByParser):
293 * khtml/html/htmlparser.cpp:
294 (KHTMLParser::getElement):
295 * khtml/xml/xml_tokenizer.cpp:
296 (khtml::XMLTokenizer::startElement):
298 2005-05-03 David Hyatt <hyatt@apple.com>
300 Normalize all our custom properties in our implementation to be -khtml (remove all the -apple).
302 Make sure that -apple, -khtml, and -moz are all able to be used. -apple and -moz just map to -khtml.
304 Add support for automatically converting -khtml-opacity to opacity (for legacy Safari 1.1 compat).
308 * khtml/css/css_computedstyle.cpp:
310 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
311 * khtml/css/cssparser.cpp:
312 (CSSParser::parseValue):
313 * khtml/css/cssproperties.in:
314 * khtml/css/cssstyleselector.cpp:
315 (khtml::CSSStyleSelector::applyDeclarations):
316 (khtml::CSSStyleSelector::applyProperty):
317 * khtml/css/parser.y:
318 * khtml/ecma/kjs_css.cpp:
321 2005-05-03 Darin Adler <darin@apple.com>
325 * WebCore.pbproj/project.pbxproj: Fix some SYMROOTS that should have been SYMROOT.
327 2005-05-03 David Hyatt <hyatt@apple.com>
329 Fix for 4098281, news.com missing a bunch of content. Make sure not to apply strict SGML parsing
330 when stripping comments out of scripts.
332 New test is comments-in-script.html
334 * khtml/html/htmltokenizer.cpp:
335 (khtml::HTMLTokenizer::parseComment):
337 2005-05-03 David Hyatt <hyatt@apple.com>
339 Remove unused notification to avoid ERROR messages spewing on the acid2 test.
343 * khtml/khtml_part.cpp:
344 (KHTMLPart::processObjectRequest):
345 * khtml/rendering/render_frames.cpp:
346 (RenderPartObject::updateWidget):
347 * khtml/rendering/render_frames.h:
349 2005-05-03 Darin Adler <darin@apple.com>
351 Reviewed by Dave Hyatt.
352 No new layout tests needed.
354 - eliminated the bogus kMin/kMax macros that we had in addition to inline functions
357 * kwq/KWQKGlobal.h: Remove the kMin/kMax macros.
359 * khtml/css/cssstyleselector.cpp:
360 (khtml::CSSStyleSelector::applyProperty): Change type of constant so both sides
362 (khtml::CSSStyleSelector::fontSizeForKeyword): Ditto.
363 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseEntity): Ditto.
365 - remove unused parameter to dirtyLinesFromChangedChild for clarity
367 * khtml/rendering/render_object.h: Don't take the parameter.
368 * khtml/rendering/render_object.cpp: (RenderObject::dirtyLinesFromChangedChild): Ditto.
370 * khtml/rendering/render_flow.h: Don't take the parameter.
371 * khtml/rendering/render_flow.cpp:
372 (RenderFlow::detach): Don't pass the parameter.
373 (RenderFlow::dirtyLinesFromChangedChild): Don't take the parameter.
375 * khtml/rendering/render_text.cpp: (RenderText::detach): Don't pass the parameter.
377 - convert DOM::NodeImpl into an abstract base class by making a couple of functions
378 pure virtual for clarity
380 * khtml/xml/dom_nodeimpl.h: Made nodeName and nodeType pure virtual.
381 * khtml/xml/dom_nodeimpl.cpp: Remove bodies of nodeName and nodeType.
383 2005-05-03 David Hyatt <hyatt@apple.com>
385 Fix for object element to support fallback content. WIth this change Safari passes the Acid2 test.
389 * khtml/css/html4.css:
390 * khtml/html/html_objectimpl.cpp:
391 (HTMLObjectElementImpl::HTMLObjectElementImpl):
392 (HTMLObjectElementImpl::parseHTMLAttribute):
393 (HTMLObjectElementImpl::rendererIsNeeded):
394 (HTMLObjectElementImpl::createRenderer):
395 (HTMLObjectElementImpl::attach):
396 (HTMLObjectElementImpl::detach):
397 (HTMLObjectElementImpl::recalcStyle):
398 (HTMLObjectElementImpl::childrenChanged):
399 (HTMLObjectElementImpl::isURLAttribute):
400 (HTMLObjectElementImpl::isImageType):
401 (HTMLObjectElementImpl::renderFallbackContent):
402 * khtml/html/html_objectimpl.h:
403 * khtml/khtml_part.cpp:
404 (KHTMLPart::requestObject):
405 (KHTMLPart::selectFrameElementInParentIfFullySelected):
406 (KHTMLPart::handleFallbackContent):
407 * khtml/khtml_part.h:
408 * khtml/khtmlpart_p.h:
409 (khtml::ChildFrame::ChildFrame):
410 * khtml/rendering/render_frames.cpp:
411 (RenderPartObject::RenderPartObject):
412 (RenderPartObject::updateWidget):
413 * khtml/rendering/render_frames.h:
414 (khtml::RenderPart::hasFallbackContent):
415 * khtml/rendering/render_replaced.cpp:
416 (RenderReplaced::RenderReplaced):
417 * kwq/KWQKHTMLPart.mm:
418 (KWQKHTMLPart::createPart):
419 * kwq/WebCoreBridge.h:
420 * kwq/WebCoreBridge.mm:
421 (-[WebCoreBridge mainResourceError]):
423 2005-05-01 Darin Adler <darin@apple.com>
425 - move to Xcode native targets and stop checking in generated files
427 * WebCore.pbproj/project.pbxproj: Updated to use native targets and generate all the generated
428 files, so we don't have to check them in any more.
429 * Info.plist: Added. Native targets use a separate file for this.
431 * Makefile.am: Removed rule to generate WebCore-combined.exp since this is now handled by the
432 Xcode project. Removed the code to remove the embedded copy of the framework since we don't
433 do that any more. Removed timestamp cleaning rules since we don't use those any more.
435 * WebCore-tests.exp: Removed symbols that aren't really needed. The native target gives an
436 error when you mention a nonexistent symbol, so we can't have them any more.
438 * khtml/css/parser_wrapper.cpp: Added. Shell used to compile parser.cpp since we can't add
439 a generated file easily to the list of files to be compiled.
441 * .cvsignore: Removed various timestamp files.
443 * WebCore-combined.exp: Removed.
444 * force-clean-timestamp: Removed.
445 * force-js-clean-timestamp: Removed.
446 * khtml/.cvsignore: Removed.
447 * khtml/Makefile.am: Removed.
448 * khtml/css/.cvsignore: Removed.
449 * khtml/css/Makefile.am: Removed.
450 * khtml/css/cssproperties.c: Removed.
451 * khtml/css/cssproperties.h: Removed.
452 * khtml/css/cssvalues.c: Removed.
453 * khtml/css/cssvalues.h: Removed.
454 * khtml/css/parser.cpp: Removed.
455 * khtml/css/parser.h: Removed.
456 * khtml/css/tokenizer.cpp: Removed.
457 * khtml/ecma/.cvsignore: Removed.
458 * khtml/ecma/Makefile.am: Removed.
459 * khtml/ecma/kjs_css.lut.h: Removed.
460 * khtml/ecma/kjs_dom.lut.h: Removed.
461 * khtml/ecma/kjs_events.lut.h: Removed.
462 * khtml/ecma/kjs_html.lut.h: Removed.
463 * khtml/ecma/kjs_navigator.lut.h: Removed.
464 * khtml/ecma/kjs_range.lut.h: Removed.
465 * khtml/ecma/kjs_traversal.lut.h: Removed.
466 * khtml/ecma/kjs_views.lut.h: Removed.
467 * khtml/ecma/kjs_window.lut.h: Removed.
468 * khtml/ecma/xmlhttprequest.lut.h: Removed.
469 * khtml/ecma/xmlserializer.lut.h: Removed.
470 * khtml/html/.cvsignore: Removed.
471 * khtml/html/Makefile.am: Removed.
472 * khtml/html/doctypes.cpp: Removed.
473 * khtml/html/kentities.c: Removed.
474 * khtml/misc/.cvsignore: Removed.
475 * khtml/misc/Makefile.am: Removed.
476 * khtml/misc/htmlattrs.c: Removed.
477 * khtml/misc/htmlattrs.h: Removed.
478 * khtml/misc/htmltags.c: Removed.
479 * khtml/misc/htmltags.h: Removed.
480 * kwq/.cvsignore: Removed.
481 * kwq/KWQCharsetData.c: Removed.
482 * kwq/KWQColorData.c: Removed.
483 * kwq/Makefile.am: Removed.
485 2005-05-02 Darin Adler <darin@apple.com>
488 Added two layout tests for regression testing.
490 - redid frameElement (fix for 4091082 below)
492 The first version lacked a security check, and was also broken.
494 * khtml/ecma/kjs_window.cpp:
495 (frameElement): Refactored into separate function; added isSafeScript check.
496 (Window::get): Call the new frameElement function.
498 * layout-tests/fast/frames/frameElement-frame.html: Added.
499 * layout-tests/fast/frames/frameElement-frame-expected.txt: Added.
500 * layout-tests/fast/frames/frameElement-iframe.html: Added.
501 * layout-tests/fast/frames/frameElement-iframe-expected.txt: Added.
502 * layout-tests/fast/frames/resources/frameElement-contents.html: Added.
504 2005-05-02 David Harrison <harrison@apple.com>
508 Fix isStartOfEditableContent and isEndOfEditableContent to return actual, rather than inverted, answers.
509 No Radar. Found this when trying to use isEndOfEditableContent() in some new code.
511 * khtml/editing/visible_units.cpp:
512 (khtml::isStartOfEditableContent):
513 (khtml::isEndOfEditableContent):
516 2005-04-29 Darin Adler <darin@apple.com>
518 Reviewed by David Harrison.
520 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Turn newlines into \n for better dumping.
522 2005-04-29 David Harrison <harrison@apple.com>
526 <rdar://problem/4083333> When deleting link at end of sentence, entire sentence gets deleted
528 * khtml/editing/htmlediting.cpp:
529 (khtml::DeleteSelectionCommand::initializePositionData):
530 Work around bug #4103339 (whose real fix is somewhat risky), so this fix can get into a software update.
532 (khtml::DeleteSelectionCommand::handleGeneralDelete):
533 Add isAncestor check when comparing m_downstreamEnd.node() and m_startNode.
535 * layout-tests/editing/deleting/delete-4083333-fix-expected.txt: Added.
536 * layout-tests/editing/deleting/delete-4083333-fix.html: Added.
538 2005-04-29 Darin Adler <darin@apple.com>
540 Reviewed by Dave Harrison.
542 - changed layout tests to dump more minimal information about caret and selection
544 * kwq/KWQRenderTreeDebug.cpp:
545 (nodePosition): Changed name; now does position relative to document.
546 (writeSelection): Removed upstream/downstream code and changed format slightly.
548 * layout-tests/editing/*-expected.txt: Regenerated in new format.
550 2005-04-29 Darin Adler <darin@apple.com>
552 Reviewed by Chris Blumenberg.
553 Added two layout tests for regression testing.
555 - fixed <rdar://problem/4097849> REGRESSION (162-163): importNode creates non-HTML elements, thus style attributes (and some others) don't work
557 * khtml/xml/dom_docimpl.cpp:
558 (DocumentImpl::importNode): Reorganized and partly rewrote this. The change that fixes the bug at
559 hand is to explicitly use XHTML_NAMESPACE for HTML elements, since the old way of getting the namespace
560 will return the null string for HTML elements, and createElementNS will not create an HTML element
561 if passed a null string for the namespace.
562 (DocumentImpl::processHttpEquiv): Removed some bogus getDocument() calls -- no need to call getDocument()
563 in a document object.
564 (DocumentImpl::attrName): Ditto.
565 (DocumentImpl::tagName): Ditto.
566 (DocumentImpl::setFocusNode): Ditto.
568 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::cloneNode): Moved the actual cloning here
569 from ElementImpl::cloneNode, because XMLElementImpl already had its own version, and in here
570 we can use createHTMLElement, which will work properly even in an XML document, and is also slightly
573 * khtml/xml/dom_nodeimpl.h: Added a namespaceURI method function to go along with localName.
574 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::namespaceURI): Added. Returns null string to be consistent
575 with localName (only works on certain types of elements as documented).
576 * khtml/xml/dom_elementimpl.h: Removed ElementImpl::cloneNode (see above). Added an override of
577 namespaceURI for XMLElementImpl.
578 * khtml/xml/dom_elementimpl.cpp: (XMLElementImpl::namespaceURI): Added. Returns the namespace
579 (consistent with localName).
581 * layout-tests/fast/dom/importNodeHTML.html: Added. Tests both importNode and cloneNode (for comparison).
582 * layout-tests/fast/dom/importNodeHTML-expected.txt: Added.
583 * layout-tests/fast/dom/importNodeXML.xhtml: Added. XML version of the same test as above. Tests a different
584 code path, so useful to have.
585 * layout-tests/fast/dom/importNodeXML-expected.txt: Added.
587 2005-04-28 Darin Adler <darin@apple.com>
589 Reviewed by Dave Harrison.
591 - fixed problems preventing us from compiling with gcc 4.0
593 * WebCore.pbproj/project.pbxproj: Removed -fobjc-exceptions because I can't figure out an easy
594 way to pass it only when compiling Objective-C/C++. Removed -Wmissing-prototypes from
595 WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
597 * khtml/css/parser.y: Changed some rules that were using a float to pass around an enum to use an
598 int instead to avoid a warning.
599 * khtml/css/parser.cpp: Regenerated.
600 * khtml/css/parser.h: Regenerated.
602 * khtml/ecma/kjs_dom.cpp: (DOMTextProtoFunc::tryCall): Rearranged a return statement to avoid an incorrect
604 * khtml/ecma/kjs_html.cpp: (KJS::Context2DFunction::tryCall): Initialized a couple of variables to avoid
605 an incorrect warning.
606 * khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::evaluate): Rearranged how we exit from the function to avoid
608 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Changed some %d to %ld where the
609 parameters where long ints.
610 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
611 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
612 * kwq/DOMEvents.mm: (-[DOMMouseEvent initMouseEvent:::::::::::::::]): Rearranged code to avoid a cast
613 that was causing an incorrect warning.
615 (createObjCDOMNode): Broke out as a separate function.
616 (KJS::ScriptInterpreter::createObjcInstanceForValue): Rearranged code to avoid a namespace collision with
617 KJS::DOMNode and the Objective-C DOMNode class.
618 * kwq/KWQFileButton.mm: Made fields of KWQFileButtonAdapter public to avoid an error, new to gcc 4.0,
619 about accessing protected Objective-C fields.
620 * kwq/KWQKHTMLPart.mm:
621 (KWQKHTMLPart::matchLabelsAgainstElement): Rearranged a return statement to avoid an incorrect warning.
622 (KWQKHTMLPart::imageFromRect): Rearranged how this function does its exception handling to avoid a
623 "may be clobbered" warning.
624 * kwq/KWQKJavaAppletWidget.mm: Fixed incorrect import that said "KHTMLView.h" instead of "khtmlview.h".
625 * kwq/KWQObject.mm: Made fields of KWQObjectTimerTarget public to avoid an error, new to gcc 4.0,
626 about accessing protected Objective-C fields.
627 * kwq/WebCoreBridge.mm: (partHasSelection): Used [bridge part] instead of getting directly at instance
628 variable to avoid an error, new to gcc 4.0, about accessing protected Objective-C fields.
630 * WebCore-combined.exp: Regenerated.
631 * WebCore-tests.exp: Added some additional symbols needed by the tests under gcc 4.0.
633 2005-04-28 Darin Adler <darin@apple.com>
635 * WebCore.pbproj/project.pbxproj: Add back the main_thread_malloc files, rolled out by accident.
637 2005-04-27 Adele Peterson <adele@apple.com>
639 Rolling out fix for <rdar://problem/4097849> because the following layout tests were failing:
641 fast/css/namespaces/001
642 fast/css/namespaces/002
643 fast/css/namespaces/004
644 fast/css/namespaces/005
645 fast/css/namespaces/006
649 * khtml/html/html_documentimpl.cpp:
650 * khtml/html/html_documentimpl.h:
651 * khtml/html/html_elementimpl.cpp:
652 (HTMLElementImpl::namespaceURI):
653 * khtml/xml/dom_docimpl.cpp:
654 (DocumentImpl::importNode):
655 (DocumentImpl::createElementNS):
656 (DocumentImpl::createHTMLElement):
657 (DocumentImpl::attrId):
658 (DocumentImpl::tagId):
659 * khtml/xml/dom_docimpl.h:
661 2005-04-27 John Sullivan <sullivan@apple.com>
665 Experimental prototype of user-resizable textareas. All the new code is guarded by
666 #if ALLOW_RESIZING_TEXTAREAS, which is false unless you remove a comment and rebuild.
668 This code allows you to press near the bottom-right corner of any textarea and drag
669 to resize the textarea on the page. It works correctly with textareas in left-aligned
670 or centered blocks, but is weird in right-aligned blocks. It also does something
671 sensible if the width is specified as a % (in that case, you can resize vertically only).
672 The user-created-size survives resizing the window and survives the back/forward cache.
673 It does not survive reloading the page.
675 This complete-lack-of-affordance UI is obviously not shippable, but this proof of concept
676 code could lead to a real user feature.
678 * kwq/KWQTextArea.mm:
679 (-[KWQTextArea getNumColumns:andNumRows:forSize:]):
680 new method that determines cols and rows for a given textarea frame size
681 (-[KWQTextAreaTextView _trackResizeFromMouseDown:]):
682 new method that tracks a drag and does a live resize-and-relayout
683 (-[KWQTextAreaTextView mouseDown:]):
684 if the mouse down is in the bottom-right corner, call _trackResizeFromMouseDown:
686 2005-04-27 John Sullivan <sullivan@apple.com>
690 - fixed problem with mouse wheel patch where alt and shift keys were switched
692 * khtml/xml/dom2_eventsimpl.h:
693 use the order cntl, alt, shift, meta in KeyboardEventImpl constructors to match
694 superclass. This isn't necessary to fix the bug, but is better for clarity.
696 * khtml/xml/dom2_eventsimpl.cpp:
697 (KeyboardEventImpl::KeyboardEventImpl):
698 switch parameter order to match superclass. Then pass the parameters to superclass's
699 constructor in the right order.
700 (KeyboardEventImpl::initKeyboardEvent):
701 Pass parameters to superclass's constructor in the right order.
703 2005-04-26 Adele Peterson <adele@apple.com>
705 Fixed by Darin, reviewed by me.
707 Fix for <rdar://problem/4084029> designMode doesn't allow editing when iframe src = "" or = about:blank
709 This change will add an HTML element for empty documents. Now that there will be an HTMLDocument in this case,
710 a body will also be created (see rdar://problem/3758785). This was preventing frames with empty documents from
713 * khtml/html/htmlparser.cpp: (KHTMLParser::finished):
715 Updated these tests to expect the HTML and BODY elements
716 * layout-tests/fast/flexbox/016-expected.txt:
717 * layout-tests/fast/frames/001-expected.txt:
718 * layout-tests/fast/frames/002-expected.txt:
719 * layout-tests/fast/frames/contentWindow_Frame-expected.txt:
720 * layout-tests/fast/frames/contentWindow_iFrame-expected.txt:
721 * layout-tests/fast/frames/empty-frame-src-expected.txt:
723 2005-04-26 Maciej Stachowiak <mjs@apple.com>
725 New test case for <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
727 * layout-tests/fast/js/string-from-char-code-expected.txt: Added.
728 * layout-tests/fast/js/string-from-char-code.html: Added.
730 2005-04-26 Darin Adler <darin@apple.com>
734 - fixed <rdar://problem/3655817> please add support for mouse wheel events and the onmousewheel handler
738 - need to test behavior of Windows IE with horizontal scroll wheeling; we currently send a distinct event
739 for that relatively obscure case, which means the event handlers won't fire at all; might be incorrect
740 - overflow scrolling is done after all DOM event handling, but ideally should be done in the overflowing
741 element's default event handler; not important in practice
742 - frame scrolling is done after all DOM event handling, but probably should be done in a default event handler;
743 not sure about this, but it's probably not important in practice and definitely not required
747 * khtml/ecma/kjs_events.h: Added DOMWheelEvent.
748 * khtml/ecma/kjs_events.cpp:
749 (KJS::getDOMEvent): Added a case for wheel event. To be forward looking, I use the event's impl pointer
750 instead of a C++ DOM wrapper. Eventually it will all work this way.
751 (offsetFromTarget): Added. Factored out code to compute offsetX/Y for an event.
752 (DOMMouseEvent::getValueProperty): Changed to call offsetFromTarget for offsetX/Y.
753 (DOMWheelEvent::DOMWheelEvent): Added.
754 (DOMWheelEvent::tryGet): Added.
755 (DOMWheelEvent::getValueProperty): Added.
756 (DOMWheelEventProtoFunc::tryCall): Added. Nothing at the moment, but might get contents later.
758 * khtml/ecma/kjs_dom.h: Added OnMouseWheel to the enum with the list of properties.
759 * khtml/ecma/kjs_dom.cpp: Added onmousewheel as a property of DOM nodes.
760 (DOMNode::getValueProperty): Return the mouse wheel event handler.
761 (DOMNode::putValue): Set the mouse wheel event handler.
763 * khtml/ecma/kjs_window.cpp: Added onmousewheel as a property of the window.
764 (Window::get): Return the mouse wheel event handler.
765 (Window::put): Set the mouse wheel event handler.
767 * khtml/ecma/kjs_window.h: Added OnWindowMouseWheel to the enum with the list of properties.
768 (Other properties distinguish the window handler by lower-casing the initial letter, way too subtle,
769 so I did this one a good way.)
771 * khtml/dom/dom2_events.h: Made the constructors for Event and UIEvent public. There's no good reason
772 for them to be private, and I had to use the UIEvent one in the JavaScript implementation.
776 * khtml/xml/dom2_eventsimpl.h: Added events for mouse wheel and horizontal mouse wheel.
777 Added isWheelEvent function to EventImpl.
778 (DOM::UIEventWithKeyStateImpl): Added. Base class shared by mouse, wheel, and keyboard events.
779 (DOM::MouseRelatedEventImpl): Added. Base class shared by mouse and wheel events.
780 (DOM::WheelEventImpl): Added.
782 * khtml/xml/dom2_eventsimpl.cpp: Added "mousewheel" to list of event names and a placeholder for
783 the horizontal mouse wheel.
784 (EventImpl::isWheelEvent): Added. Returns false.
785 (MouseRelatedEventImpl::MouseRelatedEventImpl): Added. Factored out what's shared between mouse
786 events and wheel events to avoid duplicated code.
787 (MouseRelatedEventImpl::computeLayerPos): Moved to MouseRelatedWheelEventImpl.
788 (MouseEventImpl::MouseEventImpl): Changed since MouseRelatedWheelEventImpl is now the base class
789 so we can share more code with wheel events.
790 (KeyboardEventImpl::KeyboardEventImpl): Changed since UIEventWithKeyStateImpl is now the base class
791 so we can share more code with mouse and wheel events.
792 (WheelEventImpl::WheelEventImpl): Added.
793 (WheelEventImpl::isWheelEvent): Added. Returns true.
795 * khtml/misc/htmlattrs.in: Added "onmousewheel" attribute name.
796 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Added parsing of the
797 "onmousewheel" atribute, consistent with other event handler attributes.
801 * kwq/WebCoreBridge.h: Renamed scrollOverflowWithScrollWheelEvent to sendScrollWheelEvent.
802 * kwq/WebCoreBridge.mm: (-[WebCoreBridge sendScrollWheelEvent:]): Renamed.
804 * kwq/KWQEvent.h: Added Wheel as an event type value.
805 (QWheelEvent::QWheelEvent): Added.
807 (positionForEvent): Updated to know that wheel events have valid positions in them.
808 (orientationForEvent): Added.
809 (deltaForEvent): Added.
810 (QWheelEvent::QWheelEvent): Added.
812 * kwq/KWQKHTMLPart.h: Renamed scrollOverflowWithScrollWheelEvent to wheelEvent.
813 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::wheelEvent): Renamed and added code to construct a QWheelEvent
814 and send it along to KHTMLView::viewportWheelEvent, consistent with how mouse events work.
816 * khtml/khtmlview.cpp: (KHTMLView::viewportWheelEvent): Do a hit test to figure out which node to
817 send the event to, and then call dispatchWheelEvent.
819 * khtml/xml/dom_nodeimpl.h: Added dispatchWheelEvent.
820 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchWheelEvent): Added.
824 * khtml/ecma/kjs_dom.lut.h: Regenerated.
825 * khtml/ecma/kjs_events.lut.h: Regenerated.
826 * khtml/ecma/kjs_window.lut.h: Regenerated.
827 * khtml/misc/htmlattrs.c: Regenerated.
828 * khtml/misc/htmlattrs.h: Regenerated.
830 2005-04-26 David Harrison <harrison@apple.com>
832 Reviewed by Darin, Maciej.
834 <rdar://problem/4075576> Deleting text in new message borks content
836 Fixed by removing the methods that attempted to preserve the position. The idea
837 of preserving position is a very recent one, and turned out to not actually address
838 the problem it was intended to fix (see below). Further, is unclear how the position
839 could be preserved in a form that could be properly used later on. Therefore,
840 removing the code to work like before is the preferred alternative for this software
841 update. I've written <rdar://problem/4099839> to cover the bug that position
842 preservation was supposed to fix (but did not). Added layout tests for
843 both this bug and 4099839. Also, updated existing tests with correct expected results
844 (delete-at-paragraph-boundaries-003 and 004).
846 * khtml/editing/htmlediting.cpp:
847 (khtml::CompositeEditCommand::removeFullySelectedNode):
848 (khtml::CompositeEditCommand::removeChildrenInRange):
849 (khtml::DeleteSelectionCommand::handleGeneralDelete):
850 * khtml/editing/htmlediting.h:
851 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
852 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
853 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-007-expected.txt: Added.
854 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-007.html: Added.
855 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-008-expected.txt: Added.
856 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-008.html: Added.
857 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-009-expected.txt: Added.
858 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-009.html: Added.
859 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-010-expected.txt: Added.
860 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-010.html: Added.
862 2005-04-26 Darin Adler <darin@apple.com>
864 - fixed development builds
866 * khtml/misc/main_thread_malloc.h: Use inlines instead of macros for allocation functions.
868 2005-04-25 David Hyatt <hyatt@apple.com>
870 Fix for 4097842, changing 1st line of a url that wraps doesn't update the second line. Make sure to
871 update line break info for the last dirty line so that when a clean line tries to figure out where it
872 started, it will get an accurate position taking into account the updated string. By doing this, the code
873 will be able to properly distinguish between the old and new positions and not accidentally assume they are
878 * khtml/rendering/render_text.cpp:
879 (RenderText::setTextWithOffset):
881 2005-04-26 Darin Adler <darin@apple.com>
885 - fixed <rdar://problem/4098826> Bezier curves broken in new Safari canvas object (last two parameters parsed incorrectly)
887 * khtml/ecma/kjs_html.cpp: (KJS::Context2DFunction::tryCall): Fixed incorrect argument indices.
888 Thanks to Brian Campbell who figured out what was wrong.
890 2005-04-17 Maciej Stachowiak <mjs@apple.com>
894 - use single-threaded malloc in places where malloc is hot for an
895 8% speed improvement on cvs-base
897 * ForwardingHeaders/misc/fast_malloc.h: Added.
898 * WebCore.pbproj/project.pbxproj:
899 * khtml/css/css_base.h:
900 * khtml/css/css_ruleimpl.h:
901 * khtml/css/css_valueimpl.h:
902 * khtml/css/cssstyleselector.h:
903 * khtml/misc/arena.cpp:
907 * khtml/misc/main_thread_malloc.cpp: Added.
908 * khtml/misc/main_thread_malloc.h: Added.
909 * khtml/rendering/render_style.h:
910 * khtml/xml/dom2_eventsimpl.h:
911 * khtml/xml/dom2_rangeimpl.h:
912 * khtml/xml/dom2_traversalimpl.h:
913 * khtml/xml/dom2_viewsimpl.h:
914 * khtml/xml/dom_docimpl.h:
915 * khtml/xml/dom_elementimpl.cpp:
916 (NamedAttrMapImpl::NamedAttrMapImpl):
917 (NamedAttrMapImpl::clearAttributes):
918 (NamedAttrMapImpl::operator=):
919 (NamedAttrMapImpl::addAttribute):
920 (NamedAttrMapImpl::removeAttribute):
921 * khtml/xml/dom_elementimpl.h:
922 * khtml/xml/dom_nodeimpl.h:
923 * khtml/xml/dom_stringimpl.h:
924 * kwq/KWQFontFamily.h:
925 * kwq/KWQListImpl.mm:
930 (QString::setBufferFromCFString):
933 2005-04-25 John Sullivan <sullivan@apple.com>
935 Reviewed by Dave Harrison.
937 - fixed <rdar://problem/4098731> [DOMHTMLTextAreaElement cols] returns wrong value (usually zero)
940 (-[DOMHTMLTextAreaElement cols]):
941 use ATTR_COLS instead of ATTR_ACCESSKEY (D'oh!)
942 (-[DOMHTMLTextAreaElement setCols:]):
945 2005-04-25 Darin Adler <darin@apple.com>
949 - fixed <rdar://problem/4097849> REGRESSION (162-163): importNode creates non-HTML elements, thus style attributes (and some others) don't work
951 * khtml/xml/dom_docimpl.h: Add virtual functions HTMLElementNamespace and isHTMLNamespace.
952 * khtml/xml/dom_docimpl.cpp:
953 (DocumentImpl::importNode): Rearranged this function and fixed the following problems: 1) made sure to ref node while attributes are
954 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
955 the source document, not the destination document; 3) removed unneeded getDocument() call which just returns this; 4) fixed error
956 handling for cases where an exception happens while processing the children.
957 (DocumentImpl::HTMLElementNamespace): Added. Returns XHTML_NAMESPACE.
958 (DocumentImpl::isHTMLNamespace): Added. Returns true for any namespace that matches XHTML_NAMESPACE (case insensitive).
959 (DocumentImpl::createElementNS): Changed to call isHTMLNamespace, which will cause it to accept the null namespace in an HTML document.
960 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.
961 (DocumentImpl::createHTMLElement): Pass in HTMLElementNamespace() rather than 0 to tagId.
962 (DocumentImpl::attrId): Use isHTMLNamespace instead of allowing the null namespace explicitly.
963 (DocumentImpl::tagId): Ditto.
965 * khtml/html/html_documentimpl.h: Add overrides for HTMLElementNamespace and isHTMLNamespace.
966 * khtml/html/html_documentimpl.cpp:
967 (HTMLDocumentImpl::HTMLElementNamespace): Added. Returns 0 so we use the null string for HTML elements inside HTML documents (as before).
968 (HTMLDocumentImpl::isHTMLNamespace): Added. Allows 0, and then calls base class to check for the actual XHTML namespace. Thus, we allow
969 both no namespace at all and the XHTML namespace inside HTML documents.
971 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::namespaceURI): Changed to call HTMLElementNamespace rather than checking
972 isHTMLDocument. Same result as before, but better division of responsibilities.
974 2005-04-25 Darin Adler <darin@apple.com>
978 - fixed <rdar://problem/4091956> JavaScript drop handlers don't receive more than one dropped item
980 * kwq/KWQClipboard.mm:
981 (cocoaTypeFromMIMEType): Remove some use of compare -- less efficient than a simpler "==" check.
982 Fixed non-GC-safe code to use KWQCFAutorelease instead.
983 (MIMETypeFromCocoaType): Use fromCFString instead of fromNSString to avoid a cast.
984 (KWQClipboard::getData): Rearrange so that we'll use filenames if both filenames and a URL are present, since
985 filenames can accomodate multiple items. Fix bug where we'd return multiple filenames when the type requested
986 is "URL". Fixed loop that computed the count over and over again for the loop termination condition. Check
987 that the data for NSFilenamesPboardType is an NSArray instead of assuming it is.
988 (KWQClipboard::setData): Use isEqualToString: instead of == when comparing types.
990 2005-04-22 David Hyatt <hyatt@apple.com>
992 Fix for 4096878, drop shadow effect not displayed correctly on tbray.org/ongoing/. Block minmaxwidth was
993 broken when negative margins were used and did not properly decrease the max width.
997 * khtml/rendering/render_block.cpp:
998 (khtml::RenderBlock::calcBlockMinMaxWidth):
999 * layout-tests/fast/block/float/034-expected.txt: Added.
1000 * layout-tests/fast/block/float/034.html: Added.
1001 * layout-tests/fast/block/float/035-expected.txt: Added.
1002 * layout-tests/fast/block/float/035.html: Added.
1004 2005-04-22 David Hyatt <hyatt@apple.com>
1006 Remove some dead code from css_valueimpl. It wasn't used at all.
1008 * khtml/css/css_valueimpl.cpp:
1009 * khtml/css/css_valueimpl.h:
1011 2005-04-22 Darin Adler <darin@apple.com>
1013 * khtml/ecma/kjs_html.h: Removed unnecessary bogus class name qualifiers.
1015 2005-04-22 David Hyatt <hyatt@apple.com>
1017 Fix for 4096681, fix regression in how the list-style property is parsed. It no longer parses when it hits
1018 a url in the property value list now, because the list pointer did not get advanced. This fixes alistapart.com.
1022 * khtml/css/cssparser.cpp:
1023 (CSSParser::parseValue):
1024 * layout-tests/fast/lists/009-expected.txt: Added.
1025 * layout-tests/fast/lists/009.html: Added.
1026 * layout-tests/fast/lists/resources/listmark.gif: Added.
1028 2005-04-22 Darin Adler <darin@apple.com>
1032 - fixed <rdar://problem/4091082> Google Suggest no longer works due to lack of "frameElement"
1034 * khtml/ecma/kjs_window.h: Added FrameElement.
1035 * khtml/ecma/kjs_window.cpp: (Window::get): Added "frameElement".
1036 * khtml/ecma/kjs_window.lut.h: Regenerated.
1038 2005-04-22 Darin Adler <darin@apple.com>
1042 - a small editing-related code cleanup
1044 * khtml/rendering/render_text.h: Added positionForOffset and made offsetForPosition const.
1045 * khtml/rendering/render_text.cpp:
1046 (InlineTextBox::offsetForPosition): Made const.
1047 (InlineTextBox::positionForOffset): Added. Moved code here from caretRect.
1048 (RenderText::caretRect): Call positionForOffset instead of doing the work here.
1050 2005-04-21 David Hyatt <hyatt@apple.com>
1052 Fix for 4095839, wrong background image used on flechtwerk.de. Make sure that the global mapped
1053 attribute cache hashed background attributes into per-document buckets.
1055 * khtml/html/html_baseimpl.cpp:
1056 (HTMLBodyElementImpl::mapToEntry):
1057 * khtml/html/html_elementimpl.h:
1059 * khtml/html/html_tableimpl.cpp:
1060 (HTMLTableElementImpl::mapToEntry):
1061 (HTMLTablePartElementImpl::mapToEntry):
1062 * khtml/xml/dom_docimpl.cpp:
1063 (DocumentImpl::DocumentImpl):
1064 * khtml/xml/dom_docimpl.h:
1065 (DOM::DocumentImpl::docID):
1067 2005-04-21 Vicki Murley <vicki@apple.com>
1069 - layout test for 4065447, outerHTML on images
1071 * layout-tests/fast/dynamic/outerHTML-img-expected.txt: Added.
1072 * layout-tests/fast/dynamic/outerHTML-img.html: Added.
1074 2005-04-20 Vicki Murley <vicki@apple.com>
1078 - fixed <rdar://problem/4065447> support outerHTML on IMG elements
1080 * khtml/html/html_elementimpl.cpp:
1081 (HTMLElementImpl::setOuterHTML):
1083 2005-04-18 David Hyatt <hyatt@apple.com>
1085 Fix min-height so that when it resolves to auto it does not use the box's intrinsic height.
1087 * khtml/rendering/render_box.cpp:
1088 (RenderBox::calcHeight):
1089 (RenderBox::calcHeightUsing):
1091 2005-04-18 David Hyatt <hyatt@apple.com>
1093 Back out fix for 4032346, since it is causing garbled image content on many sites.
1095 The bug tracking the fix is 4069093.
1097 (khtml::RenderBlock::matchedEndLine):
1099 2005-04-18 David Hyatt <hyatt@apple.com>
1101 Fix the smile in the Acid2 test. Floats should not grow to contain other floats unless height is auto. Otherwise
1102 the float should use the specified height.
1104 Also fix row 14 of the Acid2 test. Although ambiguous, just modify the table cell baseline alignment code to align
1105 to the bottom of the cell's content height if no suitable baseline could be found.
1107 * khtml/rendering/render_block.cpp:
1108 (khtml::RenderBlock::layoutBlock):
1109 * khtml/rendering/render_block.h:
1110 (khtml::RenderBlock::firstRootBox):
1111 (khtml::RenderBlock::lastRootBox):
1112 * khtml/rendering/render_table.cpp:
1113 (RenderTableSection::calcRowHeight):
1114 (RenderTableCell::baselinePosition):
1116 2005-04-15 David Hyatt <hyatt@apple.com>
1118 Make sure empty tables honor CSS-specified heights when they have no rows or sections. This is done only
1119 in strict mode, since it is not compatible with WinIE.
1121 * khtml/rendering/render_table.cpp:
1122 (RenderTable::layout):
1124 2005-04-15 David Hyatt <hyatt@apple.com>
1126 Fix for row 13 of the Acid2 test. Change HTML comment parsing in strict mode to do proper SGML parsing,
1127 checking for pairs of -- and only being willing to close the comment if every -- is paired up.
1129 * khtml/html/htmltokenizer.cpp:
1130 (khtml::HTMLTokenizer::parseComment):
1132 2005-04-12 Maciej Stachowiak <mjs@apple.com>
1134 Reviewed by Richard.
1136 - use custom single-threaded malloc for all non-GC JavaScriptCore
1137 allocations, for a 9.1% speedup on JavaScript iBench
1139 * khtml/ecma/kjs_binding.cpp:
1141 * khtml/ecma/kjs_proxy.cpp:
1142 (KJSProxyImpl::evaluate):
1144 2005-04-15 David Hyatt <hyatt@apple.com>
1146 Fix the six pixel gap between rows nine and ten of the Acid2 test. Make sure that percentage heights that
1147 resolve to auto are properly treated as though they have auto height by the self-collapsing block check (as per
1148 section 8.3.1, paragraph 7 of the CSS2.1 spec).
1150 * khtml/rendering/render_block.cpp:
1151 (khtml::RenderBlock::isSelfCollapsingBlock):
1153 2005-04-15 David Hyatt <hyatt@apple.com>
1155 The Acid2 test and the reference rendering both make use of overflow:hidden on the <html> element. Turns out
1156 the CSS2.1 wording for this behavior has been revised (based off WinIE/Mozilla behavior). Change our behavior
1157 to match and make <html> overflow apply to the viewport.
1159 * khtml/khtmlview.cpp:
1160 (KHTMLView::applyOverflowToViewport):
1161 (KHTMLView::layout):
1162 * khtml/khtmlview.h:
1163 * khtml/rendering/render_box.cpp:
1164 (RenderBox::setStyle):
1166 2005-04-14 David Hyatt <hyatt@apple.com>
1168 3258403 and 3258402 can now be fixed. min/max-width/height support is now complete. This patch makes them
1169 work for positioned elements and enables us to pass row one of the Acid2 test.
1171 * khtml/rendering/render_box.cpp:
1172 (RenderBox::calcAbsoluteHorizontal):
1173 (RenderBox::calcAbsoluteHorizontalValues):
1174 (RenderBox::calcAbsoluteVertical):
1175 (RenderBox::calcAbsoluteVerticalValues):
1176 * khtml/rendering/render_box.h:
1178 2005-04-12 David Hyatt <hyatt@apple.com>
1180 Working on the Acid2 test, Row 1.
1182 Improve checkChild for the DTD so that it knows what mode a document is in. This allows it to adhere more
1183 strictly to the actual DTD in strict mode and almost strict mode.
1185 Change the <table>-inside-<p> check so that <table> is disallowed inside <p> in
1186 strict mode and almost strict mode. This matches Firefox behavior, which allows <table>
1187 inside <p> only in quirks mode.
1189 * khtml/html/dtd.cpp:
1192 * khtml/html/htmlparser.cpp:
1193 (KHTMLParser::insertNode):
1194 * khtml/html/htmltokenizer.cpp:
1195 (khtml::HTMLTokenizer::parseTag):
1196 * khtml/xml/dom_elementimpl.cpp:
1197 (ElementImpl::childAllowed):
1199 2005-04-12 Vicki Murley <vicki@apple.com>
1203 - fixed <rdar://problem/3760895> Request for including an implementation of the elementFromPoint function
1205 * khtml/dom/dom_doc.cpp:
1206 (DOM::Document::elementFromPoint):
1207 * khtml/dom/dom_doc.h:
1208 * khtml/ecma/kjs_dom.cpp:
1209 (DOMDocumentProtoFunc::tryCall):
1210 * khtml/ecma/kjs_dom.h:
1211 (KJS::DOMDocument::):
1212 * khtml/ecma/kjs_dom.lut.h:
1214 * khtml/xml/dom_docimpl.cpp:
1215 (DocumentImpl::elementFromPoint):
1216 * khtml/xml/dom_docimpl.h:
1218 2005-04-12 David Hyatt <hyatt@apple.com>
1220 Beginning of work to support the Acid2 CSS test put forward by the Web Standards Project. Fix
1221 our handling of the rel attribute on <link> elements to do a proper tokenization so that stylesheets
1222 can be recognized even when other keywords are present in the rel attribute.
1224 * khtml/html/html_headimpl.cpp:
1225 (HTMLLinkElementImpl::HTMLLinkElementImpl):
1226 (HTMLLinkElementImpl::parseHTMLAttribute):
1227 (HTMLLinkElementImpl::tokenizeRelAttribute):
1228 (HTMLLinkElementImpl::process):
1229 * khtml/html/html_headimpl.h:
1231 2005-04-12 John Sullivan <sullivan@apple.com>
1233 - fixed these two bugs (I also fixed these on the experimental-ui-branch)
1234 <rdar://problem/3154293> Find Next should not scroll page if the next target is already visible
1235 <rdar://problem/3121828> scrollToVisible on find cuts off the left part of the view due to needless horiz. scroll
1239 * kwq/KWQKHTMLPart.mm:
1240 (KWQKHTMLPart::jumpToSelection):
1241 Trey had written code to address these issues, but left it commented out due to other
1242 problems. The other problems no longer occur, so I uncommented Trey's code, and then
1243 discovered that I could make it behave more like TextEdit with many fewer lines of
1246 2005-04-08 David Harrison <harrison@apple.com>
1248 Reviewed by Dave Hyatt.
1250 <rdar://problem/4084106> Remove NSAccessibilityForegroundColorTextAttributeWrapper
1252 * kwq/KWQAccObject.mm:
1253 (AXAttributeStringSetStyle):
1254 Use NSAccessibilityForegroundColorTextAttribute directly.
1256 2005-04-05 David Hyatt <hyatt@apple.com>
1258 Fix for 4077106, make sure that mouse wheeling in overflow sections uses 40 rather than 10 as the base line
1263 * khtml/rendering/render_layer.cpp:
1264 (RenderLayer::positionScrollbars):
1265 * kwq/KWQScrollBar.mm:
1266 (QScrollBar::scroll):
1268 2005-04-04 Vicki Murley <vicki@apple.com>
1272 - fixed <rdar://problem/3871669> no focus or blur methods on HTML button elements
1274 * khtml/dom/html_form.cpp:
1275 (HTMLButtonElement::focus):
1276 (HTMLButtonElement::blur):
1277 * khtml/dom/html_form.h:
1278 * khtml/ecma/kjs_html.cpp:
1279 (KJS::HTMLElementFunction::tryCall):
1280 * khtml/ecma/kjs_html.h:
1281 (KJS::HTMLElement::):
1282 * khtml/ecma/kjs_html.lut.h:
1284 * khtml/html/html_formimpl.cpp:
1285 (DOM::HTMLButtonElementImpl::blur):
1286 (DOM::HTMLButtonElementImpl::focus):
1287 * khtml/html/html_formimpl.h:
1291 2005-03-28 David Harrison <harrison@apple.com>
1295 <rdar://problem/4069161> REGRESSION (8A416-8A419): Safari crash bringing up context menu for non-HTML content in a frame
1297 * kwq/KWQAccObject.mm:
1298 (-[KWQAccObject rendererForView:]):
1299 Nil-check node variable instead of rechecking document variable.
1303 2005-03-27 Darin Adler <darin@apple.com>
1305 Reviewed by me, fix by Kida-san.
1307 - fixed <rdar://problem/4067474> 8A424: Safari immediately quit by Cmd+Ctrll+'D'
1309 * kwq/WebCoreBridge.mm: (-[WebCoreBridge convertToNSRange:DOM::]):
1314 2005-03-24 Richard Williamson <rjw@apple.com>
1316 Fixed <rdar://problem/4052683> After adding/removing stocks from Stocks Widget, stock areas went blank
1318 The request was being collected before firing it's load handler.
1319 We now gc protect the request while it's loading.
1323 * khtml/ecma/xmlhttprequest.cpp:
1324 (KJS::XMLHttpRequest::send):
1325 (KJS::XMLHttpRequest::abort):
1326 (KJS::XMLHttpRequest::slotFinished):
1327 (KJS::XMLHttpRequestProtoFunc::tryCall):
1331 2005-03-23 Darin Adler <darin@apple.com>
1333 Further fix for 4053515.
1335 Covered cases where text position doesn't lie inside a
1338 Reviewed by Richard.
1340 * khtml/editing/visible_text.cpp:
1341 (khtml::TextIterator::setRangeFromLocationAndLength):
1343 2005-03-23 Richard Williamson <rjw@apple.com>
1345 Fixed <rdar://problem/4053515> REGRESSION (Mail): Kotoeri input method reconversion does not work in WebViews
1347 We now use actual document NSRanges to represent both marked text
1348 ranges and selection ranges.
1352 * khtml/editing/visible_text.cpp:
1353 (khtml::TextIterator::rangeLength):
1354 (khtml::TextIterator::setRangeFromLocationAndLength):
1355 * khtml/editing/visible_text.h:
1356 * kwq/WebCoreBridge.h:
1357 * kwq/WebCoreBridge.mm:
1358 (-[WebCoreBridge convertToNSRange:DOM::]):
1359 (-[WebCoreBridge DOM::convertToDOMRange:]):
1360 (-[WebCoreBridge selectNSRange:]):
1361 (-[WebCoreBridge markedTextDOMRange]):
1362 (-[WebCoreBridge markedTextNSRange]):
1364 2005-03-22 Kevin Decker <kdecker@apple.com>
1368 Fixed <rdar://problem/4062336> REGRESSION (406-407): HTML submenus not working at hrweb.apple.com after going back
1370 Rolled out the fix for <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
1372 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.
1374 * khtml/khtml_part.cpp:
1375 (KHTMLPart::closeURL):
1376 * khtml/xml/dom_docimpl.cpp:
1377 (DocumentImpl::detach):
1381 2005-03-22 Vicki Murley <vicki@apple.com>
1383 - roll the fix for <rdar://problem/4060266> back in, since its
1386 * khtml/editing/visible_text.cpp:
1387 (khtml::TextIterator::handleTextBox):
1389 2005-03-22 Vicki Murley <vicki@apple.com>
1391 - roll out the fix for <rdar://problem/4060266> since it was denied by CCC
1393 * khtml/editing/visible_text.cpp:
1394 (khtml::TextIterator::handleTextBox):
1396 2005-03-22 David Harrison <harrison@apple.com>
1400 <rdar://problem/4060266> Double-clicking in Dictionary.app doesn't work for some words (coming just after style change)
1402 * khtml/editing/visible_text.cpp:
1403 (khtml::TextIterator::handleTextBox):
1404 Complete the check of whether to emit space for collapsed space.
1406 2005-03-22 David Harrison <harrison@apple.com>
1410 <rdar://problem/4061443> REGRESSION (8A420-8A421): Pasting in the Stickies widget is broken again
1412 * khtml/editing/htmlediting.cpp:
1413 (khtml::positionBeforeContainingSpecialElement):
1414 (khtml::positionAfterContainingSpecialElement):
1415 Return unchanged Position rather than a null or non-editable one.
1419 2005-03-20 Ken Kocienda <kocienda@apple.com>
1423 I made an error in this test earlier. It was not testing what I intended. Fixed.
1425 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt
1426 * layout-tests/editing/unsupported-content/list-delete-001.html
1430 * layout-tests/editing/unsupported-content/table-delete-001-expected.txt: Added.
1431 * layout-tests/editing/unsupported-content/table-delete-001.html: Added.
1432 * layout-tests/editing/unsupported-content/table-delete-002-expected.txt: Added.
1433 * layout-tests/editing/unsupported-content/table-delete-002.html: Added.
1434 * layout-tests/editing/unsupported-content/table-delete-003-expected.txt: Added.
1435 * layout-tests/editing/unsupported-content/table-delete-003.html: Added.
1436 * layout-tests/editing/unsupported-content/table-type-after-expected.txt: Added.
1437 * layout-tests/editing/unsupported-content/table-type-after.html: Added.
1438 * layout-tests/editing/unsupported-content/table-type-before-expected.txt: Added.
1439 * layout-tests/editing/unsupported-content/table-type-before.html: Added.
1441 2005-03-20 Darin Adler <darin@apple.com>
1445 - fixed <rdar://problem/3923903> REGRESSION (164-165): Repro Safari crash in khtml::RenderLayer::scrollToOffset
1447 * khtml/rendering/render_layer.cpp: (RenderLayer::scrollToOffset): Check canvas for nil.
1449 2005-03-20 David Harrison <harrison@apple.com>
1453 <rdar://problem/4055127> Dictionary pop-up panel misplaced at beginning of text blocks (breaks double-clicking in Dictionary.app)
1455 SimplifiedBackwardsTextIterator::advance() needed to not limit to textnodes
1456 when checking whether moving back across block boundaries
1458 VisibleUnits previousBoundary() needed to INIT_DOWN when creating result VisiblePosition
1460 All editing tests pass.
1462 * khtml/editing/visible_text.cpp:
1463 (khtml::SimplifiedBackwardsTextIterator::advance):
1464 * khtml/editing/visible_units.cpp:
1465 (khtml::previousBoundary):
1467 2005-03-20 Darin Adler <darin@apple.com>
1469 Reviewed by Harrison.
1471 - 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
1473 * khtml/khtml_part.h: Added selectFrameElementInParentIfFullySelected.
1474 * khtml/khtml_part.cpp:
1476 (KHTMLPart::setFocusNodeIfNeeded): Changed to not set focus to a frame; was not what this function was
1477 intended to do, and caused trouble when trying to select a frame element.
1478 (KHTMLPart::khtmlMouseReleaseEvent): Call selectFrameElementInParentIfFullySelected.
1479 (KHTMLPart::selectAll): Call selectFrameElementInParentIfFullySelected.
1480 (KHTMLPart::selectFrameElementInParentIfFullySelected): Added. Selects the frame element in the parent
1481 if a frame is entirely selected, which makes it easier to delete or replace the frame and is consistent
1482 with the changes Maciej made recently for other elements.
1484 * kwq/WebCoreBridge.mm:
1485 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Call selectFrameElementInParentIfFullySelected.
1486 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Call selectFrameElementInParentIfFullySelected.
1488 2005-03-20 Darin Adler <darin@apple.com>
1490 Reviewed by me, code change by Ken.
1492 - fixed <rdar://problem/4059852> Deleting from first element of list makes content jump to wrong place
1494 * khtml/editing/htmlediting.cpp:
1495 (khtml::isListStructureNode): Added.
1496 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Check for list nodes as well as table nodes.
1498 2005-03-20 Ken Kocienda <kocienda@apple.com>
1502 Added tests to cover new "unsupported content" editing code.
1504 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt: Added.
1505 * layout-tests/editing/unsupported-content/list-delete-001.html: Added.
1506 * layout-tests/editing/unsupported-content/list-delete-002-expected.txt: Added.
1507 * layout-tests/editing/unsupported-content/list-delete-002.html: Added.
1508 * layout-tests/editing/unsupported-content/list-delete-003-expected.txt: Added.
1509 * layout-tests/editing/unsupported-content/list-delete-003.html: Added.
1510 * layout-tests/editing/unsupported-content/list-type-after-expected.txt: Added.
1511 * layout-tests/editing/unsupported-content/list-type-after.html: Added.
1512 * layout-tests/editing/unsupported-content/list-type-before-expected.txt: Added.
1513 * layout-tests/editing/unsupported-content/list-type-before.html: Added.
1515 2005-03-20 Ken Kocienda <kocienda@apple.com>
1521 <rdar://problem/4059578> Entire list deleted, and caret disappears, when delete key hit at end of list
1523 The problem is that a new case in the delete code did not consider when the
1524 downstream end node of the selection might be an ancestor of the upstream start
1525 node. That is the case in this bug. The downstream end is the body element, and
1526 this line of code would delete all the children of the downstream end:
1527 removeChildrenInRangePreservingPosition(m_downstreamEnd.node(), 0,
1528 m_downstreamEnd.offset(), m_upstreamStart);
1530 The fix is to check for this "is ancestor" case, and do some tree logic to find
1531 the right offset of the downstream end node for the call to
1532 removeChildrenInRangePreservingPosition().
1534 * khtml/editing/htmlediting.cpp:
1535 (khtml::DeleteSelectionCommand::handleGeneralDelete): Fixed as described.
1537 2005-03-19 Ken Kocienda <kocienda@apple.com>
1543 <rdar://problem/4059384> Cannot place insertion point correctly in editable text that avoids floating elements
1545 Note: I strongly suspect this bug blocks a complete solution to this other Tiger/P2:
1546 <rdar://problem/4055748> AX: Dictionary pop-up panel shows at wrong place on specific parts of particular pages
1548 * khtml/rendering/render_text.cpp:
1549 (RenderText::caretRect): Change the y-coordinate used to calculate the available width for a line. Height is wrong.
1550 Top of the box containing the text where the click is done is correct. Also, add in the x-offset for the start
1551 of the text box when calculating the available width. If this text box is avoiding a float at the y-coordinate
1552 for the relevant box, failure to add in the amount of float-avoidance will make the text at the coordinates
1553 greater than end-of-line minus float-avoidance ineligible for caret placement.
1555 2005-03-19 Darin Adler <darin@apple.com>
1559 - fixed <rdar://problem/4057594> REGRESSION (125-406): Unrepro crash in HTMLTokenizer::allDataProcessed after hitting Back button
1561 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::allDataProcessed):
1562 To get the part safely after calling end, save a guarded pointer to the view.
1563 The old way could end trying to call a virtual function a part that was destroyed.
1565 2005-03-19 Maciej Stachowiak <mjs@apple.com>
1569 <rdar://problem/4053506> Pasting Tables and Cells in Mail does not allow editing before or after
1570 <rdar://problem/4005954> REGRESSION (Mail): After copy/paste of content containing list element cannot go back to entering text at left side of page
1572 * khtml/editing/htmlediting.cpp:
1573 (khtml::maxDeepOffset):
1574 (khtml::CompositeEditCommand::removeFullySelectedNodePreservingPosition):
1575 (khtml::CompositeEditCommand::removeChildrenInRangePreservingPosition):
1576 (khtml::CompositeEditCommand::removeNodePreservingPosition):
1577 (khtml::CompositeEditCommand::insertBlockPlaceholder):
1578 (khtml::CompositeEditCommand::appendBlockPlaceholder):
1579 (khtml::CompositeEditCommand::forceBlockPlaceholder):
1580 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
1581 (khtml::isSpecialElement):
1582 (khtml::isFirstVisiblePositionInSpecialElementInFragment):
1583 (khtml::positionBeforePossibleContainingSpecialElement):
1584 (khtml::positionAfterPossibleContainingSpecialElement):
1585 (khtml::ApplyStyleCommand::applyInlineStyle):
1586 (khtml::DeleteSelectionCommand::initializePositionData):
1587 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
1588 (khtml::DeleteSelectionCommand::handleGeneralDelete):
1589 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
1590 (khtml::DeleteSelectionCommand::doApply):
1591 (khtml::InsertParagraphSeparatorCommand::doApply):
1592 (khtml::ReplacementFragment::ReplacementFragment):
1593 (khtml::ReplaceSelectionCommand::doApply):
1594 * khtml/editing/htmlediting.h:
1595 * khtml/editing/visible_position.cpp:
1596 (khtml::isRenderedBR):
1597 (khtml::VisiblePosition::initDownstream):
1598 (khtml::isLastVisiblePositionInBlock):
1599 * khtml/rendering/render_line.cpp:
1600 (khtml::RootInlineBox::closestLeafChildForXPos):
1601 * khtml/xml/dom_nodeimpl.cpp:
1602 (NodeImpl::isBlockFlowOrTable):
1603 (NodeImpl::isEditableBlock):
1604 (NodeImpl::enclosingBlockFlowOrTableElement):
1605 * khtml/xml/dom_nodeimpl.h:
1606 * khtml/xml/dom_position.cpp:
1607 (DOM::Position::upstream):
1608 (DOM::Position::downstream):
1609 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
1610 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
1611 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
1612 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
1613 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt:
1615 2005-03-19 John Sullivan <sullivan@apple.com>
1619 - fixed <rdar://problem/4058740> Crash (nil-deref) editing Mail reply
1620 message in KWQKHTMLPart::fontForSelection (MailViewer-723)
1622 * kwq/KWQKHTMLPart.mm:
1623 (KWQKHTMLPart::fontForSelection):
1624 Add nil check to loop. It shouldn't be necessary, but this crash trace seems to be
1625 running into it. We're not completely certain, but the check is harmless at worst.
1629 2005-03-18 David Harrison <harrison@apple.com>
1633 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
1635 Also changed WebKit.
1637 * kwq/KWQAccObject.mm:
1638 (-[KWQAccObject rendererForView:]):
1639 New to cover both the WebCore and WebKit NSViews.
1641 (-[KWQAccObject _accessibilityParentForSubview:]):
1642 Use rendererForView.
1644 * kwq/WebCoreFrameView.h:
1645 Add WebCoreBridgeHolder protocol to get access to WebKit NSViews.
1647 2005-03-18 David Harrison <harrison@apple.com>
1649 Reviewed by Darin, Ken.
1651 <rdar://problem/3735625> AX: add AXPress action if an element has an onclick handler
1653 * khtml/dom/html_form.cpp:
1654 (HTMLInputElement::click):
1655 * khtml/html/html_elementimpl.cpp:
1656 (HTMLElementImpl::click):
1657 (HTMLElementImpl::accessKeyAction):
1658 * khtml/html/html_elementimpl.h:
1659 * khtml/html/html_formimpl.cpp:
1660 (DOM::HTMLFormElementImpl::submitClick):
1661 (DOM::HTMLButtonElementImpl::click):
1662 (DOM::HTMLButtonElementImpl::accessKeyAction):
1663 (DOM::HTMLInputElementImpl::click):
1664 (DOM::HTMLInputElementImpl::accessKeyAction):
1665 (DOM::HTMLInputElementImpl::defaultEventHandler):
1666 (DOM::HTMLLabelElementImpl::accessKeyAction):
1667 (DOM::HTMLSelectElementImpl::accessKeyAction):
1668 (DOM::HTMLTextAreaElementImpl::accessKeyAction):
1669 * khtml/html/html_formimpl.h:
1670 * khtml/html/html_inlineimpl.cpp:
1671 (HTMLAnchorElementImpl::defaultEventHandler):
1672 (HTMLAnchorElementImpl::accessKeyAction):
1673 * khtml/html/html_inlineimpl.h:
1674 * khtml/rendering/render_form.cpp:
1675 (RenderFileButton::click):
1676 * khtml/rendering/render_form.h:
1677 * khtml/xml/dom_docimpl.cpp:
1678 (DocumentImpl::defaultEventHandler):
1679 * khtml/xml/dom_elementimpl.h:
1680 (DOM::ElementImpl::accessKeyAction):
1682 (-[DOMHTMLInputElement click]):
1686 * kwq/KWQFileButton.h:
1687 * kwq/KWQFileButton.mm:
1688 (KWQFileButton::click):
1690 Add accessKeyAction parameter about whether to limit to HTMLElementImpl subclasses that JavaScript wants, or to apply to others as well.
1692 Add click() parameter about whether to send the mousedown and mouseup events in addition to the click event.
1694 * kwq/KWQAccObject.mm:
1695 (-[KWQAccObject mouseButtonListener]):
1696 Locate a mousedown, mouseup, or click handler in the current element and its ancestors.
1698 (-[KWQAccObject actionElement]):
1699 (-[KWQAccObject accessibilityIsIgnored]):
1700 (-[KWQAccObject accessibilityPerformAction:]):
1701 Consider mouseButtonListener.
1703 2005-03-18 John Sullivan <sullivan@apple.com>
1707 - fixed <rdar://problem/4002164> maps that include start and end
1708 location don't print right from maps.google.com
1710 I thought I checked this in yesterday but a ChangeLog conflict aborted my checkin
1711 without me noticing.
1713 * khtml/rendering/render_style.cpp:
1714 (RenderStyle::diff):
1715 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
1717 * khtml/rendering/render_style.h:
1718 (khtml::RenderStyle::InheritedFlags::operator==):
1719 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
1720 (khtml::RenderStyle::setBitDefaults):
1722 (khtml::RenderStyle::forceBackgroundsToWhite):
1723 ditto, and method name changed too
1724 (khtml::RenderStyle::setForceBackgroundsToWhite):
1727 * khtml/rendering/render_text.cpp:
1728 (InlineTextBox::paint):
1729 updated for name change; also, compare text against white instead of current bg color
1730 because we no longer actually modify the bg color (previously we would always set
1731 the bg color to white, so the result is the same)
1733 * khtml/xml/dom_docimpl.cpp:
1734 (DocumentImpl::recalcStyle):
1735 updated for name change
1737 * kwq/WebCoreBridge.mm:
1738 (-[WebCoreBridge styleSheetForPrinting]):
1740 (-[WebCoreBridge reapplyStylesForDeviceType:]):
1741 removed the code that called styleSheetForPrinting; we no longer use a stylesheet
1744 * khtml/rendering/render_box.cpp:
1745 (RenderBox::paintBackgroundExtended):
1746 If forceBackgroundsToWhite flag is set, convert background images and
1747 background colors to white background color with no background image.
1749 2005-03-18 Ken Kocienda <kocienda@apple.com>
1755 <rdar://problem/4056718> Pasting quotes the entire message
1757 * khtml/editing/htmlediting.cpp:
1758 (khtml::ReplaceSelectionCommand::doApply): After pasting, nodes are moved to the block containing
1759 the end of the pasted content in certain cases. This move logic used to stop once it moved all the
1760 siblings of the node following the last node of the pasted-in content. This means that block elements
1761 could get moved, and if the pasted-in content included a mail blockquote, this could result in
1762 one quote level getting added. The fix is to stop the move of nodes once a <br>, block element, or
1763 <table> is seen. This only affected one of the many test cases we have for such scenarios, and
1764 the change to that result makes sense given the code change.
1765 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: This test result changed in a way that
1766 adequately tests the behavior change, so I did not add a new test.
1768 2005-03-17 Ken Kocienda <kocienda@apple.com>
1770 Reviewed by Harrison
1774 <rdar://problem/4051809> 8A413: Cursor-up in a mail message sometimes gets stuck (with specific reproducible case)
1776 * khtml/rendering/render_text.cpp:
1777 (RenderText::positionForCoordinates): Consider two lines: line-above and line-below. If the caret position in line-below
1778 was at an x coordinate between half way through the x coordinate of the last character on the line-above and the
1779 end of that same character, this bug would happen since the positioning code would assume that it could create a
1780 VisiblePosition with a DOWNSTREAM affinity. Now, I check to see if the character position on the line-above is the
1781 last character on that line, and if it is, I use UPSTREAM as the affinity.
1785 2005-03-17 David Harrison <harrison@apple.com>
1787 Reviewed by Darin, Ken.
1789 * khtml/editing/htmlediting.cpp:
1790 (khtml::EditCommandPtr::setEndingSelection):
1791 Fixed typo so that it calls setEndingSelection rather than setStartingSelection.
1792 Commented out this unused method, tho, since this is late in Tiger. Proved unused by successful build after temporarily removing method declaration or implemenation.
1794 2005-03-16 Kevin Decker <kdecker@apple.com>
1798 Fixed <rdar://problem/4046665> REGRESSION (403-405): mypage.apple.com login does not work (hits assertion in Development build)
1800 * kwq/WebCoreBridge.mm:
1801 (-[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="">
1803 2005-03-16 Darin Adler <darin@apple.com>
1807 - fixed <rdar://problem/4045203> REGRESSION (125-188): Redundant JS imports crash Safari
1809 * khtml/html/htmltokenizer.h: Take inWRite bool out of NDEBUG ifdef.
1810 * khtml/html/htmltokenizer.cpp:
1811 (khtml::HTMLTokenizer::HTMLTokenizer): Take inWrite bool management code out of NDEBUG ifdef.
1812 (khtml::HTMLTokenizer::write): Ditto. Don't call end if inWrite is true, since it will be called
1813 when you return to the body of the outer write() call.
1814 (khtml::HTMLTokenizer::allDataProcessed): Don't call end() if inWrite is true for the same reason.
1815 (khtml::HTMLTokenizer::finish): Ditto.
1817 * kwq/KWQWidget.mm: (QWidget::getOuterView): Removed bogus assertion that has been vexing us of late.
1819 2005-03-16 David Harrison <harrison@apple.com>
1821 Reviewed by me (written by Patti Yeh).
1823 * kwq/KWQAccObject.mm:
1824 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
1825 Use LeftWordIfOnBoundary instead of RightWordIfOnBoundary.
1827 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
1828 Use RightWordIfOnBoundary instead of LeftWordIfOnBoundary.
1830 2005-03-16 David Harrison <harrison@apple.com>
1834 <rdar://problem/4054590> AX: Dictionary panel does not work when page is scrolled on Safari
1836 * kwq/KWQAccObject.mm:
1837 (-[KWQAccObject doAXTextMarkerForPosition:]):
1838 Add in the view's contentsX and contentsY to the point.
1840 2005-03-16 David Harrison <harrison@apple.com>
1844 <rdar://problem/4048506> Deleting from beginning of editable div deletes other document elements
1846 Also changed WebKit.
1848 * khtml/editing/visible_units.h:
1849 * khtml/editing/visible_units.cpp:
1850 (khtml::startOfEditableContent):
1851 (khtml::endOfEditableContent):
1852 (khtml::inSameEditableContent):
1853 (khtml::isStartOfEditableContent):
1854 (khtml::isEndOfEditableContent):
1857 * kwq/WebCoreBridge.h:
1858 * kwq/WebCoreBridge.mm:
1859 (-[WebCoreBridge canDeleteRange:]):
1862 2005-03-16 Ken Kocienda <kocienda@apple.com>
1868 <rdar://problem/4042935> undo doesn't work properly during inline input
1870 * kwq/WebCoreBridge.h: Declare new method below.
1871 * kwq/WebCoreBridge.mm:
1872 (-[WebCoreBridge replaceMarkedTextWithText:]): New method. Wraps calls to TypingCommand::deleteKeyPressed and
1873 TypingCommand::insertText to map the way that international text input works onto the typing undo system.
1875 2005-03-16 David Harrison <harrison@apple.com>
1879 <rdar://problem/4044336> REGRESSION (8A398-8A409): Option-Delete also deletes space to left of deleted word
1881 * khtml/editing/htmlediting.cpp:
1882 (khtml::DeleteSelectionCommand::initializePositionData):
1883 - skip smart delete if the selection to delete already starts or ends with whitespace
1885 * khtml/khtml_part.cpp:
1886 (KHTMLPart::handleMousePressEventDoubleClick):
1887 - preserve selection on double-click when range is already selected
1889 * khtml/xml/dom_position.cpp:
1890 (DOM::Position::leadingWhitespacePosition):
1891 (DOM::Position::trailingWhitespacePosition):
1892 - fix considerNonCollapsibleWhitespace action (logic was reversed)
1893 - add non-breaking space to the non-collapsable ones
1895 * kwq/WebCoreBridge.mm:
1896 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
1897 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
1898 - these methods do not set the selection, so remove calls to setSelectionGranularity
1900 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
1901 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]):
1902 - set the granularity back to character
1903 - the one exception is that we need to keep word granularity
1904 to preserve smart delete behavior when extending by word
1906 2005-03-15 Maciej Stachowiak <mjs@apple.com>
1910 <rdar://problem/4053266> Pressing return a few times right after a link makes the new blank lines part of the link
1912 * khtml/editing/htmlediting.cpp:
1913 (khtml::InsertLineBreakCommand::doApply): Use
1914 positionOutsideContainingSpecialElement in the right two places.
1915 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1917 - move all these helper functions higher in the file
1919 * khtml/editing/htmlediting.cpp:
1920 (khtml::isSpecialElement):
1921 (khtml::isFirstVisiblePositionInSpecialElement):
1922 (khtml::positionBeforeNode):
1923 (khtml::positionBeforeContainingSpecialElement):
1924 (khtml::maxRangeOffset):
1925 (khtml::isLastVisiblePositionInSpecialElement):
1926 (khtml::positionAfterNode):
1927 (khtml::positionAfterContainingSpecialElement):
1928 (khtml::positionOutsideContainingSpecialElement):
1930 2005-03-14 Maciej Stachowiak <mjs@apple.com>
1934 <rdar://problem/4049925> Pasting right after a link makes pasted content part of the link (without visible style change)
1936 * khtml/editing/htmlediting.cpp:
1937 (khtml::positionOutsideContainingSpecialElement): made a helper
1938 function that computes a position outside the outermost containing
1939 special element if the passed in position is right at the start or
1941 (khtml::InsertTextCommand::prepareForTextInsertion): use new helper here
1942 (khtml::ReplaceSelectionCommand::doApply): use it here too: this is the fix
1943 (khtml::positionBeforeNode): made static
1944 (khtml::positionBeforeContainingSpecialElement): made static
1945 (khtml::positionAfterNode): made static
1946 (khtml::positionAfterContainingSpecialElement): made static
1948 2005-03-15 Richard Williamson <rjw@apple.com>
1950 Fixed <rdar://problem/4053658> Crash getting direction at maps.google.com
1952 Add non nil style() check.
1954 Reviewed by Dave Harrison.
1956 * khtml/rendering/render_table.cpp:
1957 (RenderTableCell::collapsedRightBorder):
1959 2005-03-15 Kevin Decker <kdecker@apple.com>
1963 Fixed: <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
1965 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().
1967 This fixes a recent regression from:
1969 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
1971 * khtml/khtml_part.cpp:
1972 (KHTMLPart::closeURL): After dispatching event handlers, go ahead and remove them from the DOM.
1973 * khtml/xml/dom_docimpl.cpp:
1974 (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.
1976 2005-03-15 Ken Kocienda <kocienda@apple.com>
1982 <rdar://problem/4052642> Each delete keystroke is in its own undo group; not included in undo group with other typing
1984 Calling -[WebCore setSelectedDOMRange:range affinity:] had the result of "closing" any active set of typing
1985 keystrokes grouped together in a single undo operation. A change on 27 Jan in WebKit to change the way delete
1986 keystrokes are handled made this feature regress. Previous to that change, the backwards delete
1987 key went through separate code that is no longer in the tree that did not set the selection in the way
1990 The solution is to add an extra argument to the set-selection call. The WebCoreBridge now offers this method:
1991 -[WebCore setSelectedDOMRange:range affinity:closeTyping:]. Now, callers must indicate whether setting the
1992 selection will act to close typing or not.
1994 * kwq/WebCoreBridge.h: Changed header accordingly to change method shown below.
1995 * kwq/WebCoreBridge.mm:
1996 (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Added closeTyping argument to this method.
1998 2005-03-15 John Sullivan <sullivan@apple.com>
2002 - fixed <rdar://problem/4052246> crash in KWQKHTMLPart::createPart() trying to display local file in frame
2004 * kwq/KWQKHTMLPart.mm:
2005 (KWQKHTMLPart::createPart):
2006 Check part for nil before trying to ref. This was probably a longstanding code flaw revealed by
2007 the recent security fix.
2009 2005-03-15 Kevin Decker <kdecker@apple.com>
2011 Reviewed by Ken and Maciej.
2013 New fix for <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
2015 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.
2017 * khtml/html/htmltokenizer.cpp:
2018 (khtml::HTMLTokenizer::HTMLTokenizer): Initialize loadStopped to false.
2019 (khtml::HTMLTokenizer::write): Go ahead and bail out if loadStopped is true.
2020 (khtml::HTMLTokenizer::processToken):
2021 * 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.
2022 * khtml/khtml_part.cpp:
2023 (KHTMLPart::closeURL): Notify the tokenizer to stop parsing.
2024 * khtml/xml/xml_tokenizer.cpp:
2025 (khtml::XMLTokenizer::XMLTokenizer): Initialize loadStopped to false.
2026 * khtml/xml/xml_tokenizer.h:
2027 (khtml::Tokenizer::stopParsing): Added.
2029 2005-03-14 David Harrison <harrison@apple.com>
2031 Reviewed by Darin, Maciej.
2033 <rdar://problem/4046103> REGRESSION (Mail): clicking after style change sets insertion point incorrectly
2035 Also fixes crash by adding nil check.
2037 * khtml/editing/htmlediting.cpp:
2038 (khtml::MoveSelectionCommand::doApply):
2039 Check the node for nil.
2041 * khtml/khtml_part.cpp:
2042 (KHTMLPart::khtmlMouseReleaseEvent):
2043 Use the node from the event rather than from the selection.
2045 2005-03-14 Darin Adler <darin@apple.com>
2047 Reviewed by Harrison.
2049 - fixed <rdar://problem/4049776> Seed: Mail: Disable spellcheck leaves red artifacts
2051 * khtml/xml/dom_docimpl.cpp:
2052 (DocumentImpl::DocumentImpl): Set markers list to be "auto-delete" so they don't all leak.
2053 (DocumentImpl::removeMarker): Remove markers list for a node when the last marker is removed
2054 for that node. Otherwise, we can have empty marker lists for each node forever until the
2056 (DocumentImpl::removeAllMarkers): Added code to dirty the markers.
2057 (DocumentImpl::shiftMarkers): Remove unneeded empty check.
2059 * kwq/WebCoreBridge.h: Added unmarkAllMisspellings for WebKit.
2060 * kwq/WebCoreBridge.mm: (-[WebCoreBridge unmarkAllMisspellings]): Added. Calls removeAllMarkers.
2062 2005-03-14 Richard Williamson <rjw@apple.com>
2064 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
2066 A document may be deleted as a consequence of handling an event,
2067 as was the case with Acrobat.app. Ensure that the document is still valid
2068 before passing the event on for further handling.
2070 * khtml/xml/dom_nodeimpl.cpp:
2071 (NodeImpl::dispatchUIEvent):
2073 2005-03-14 Ken Kocienda <kocienda@apple.com>
2077 Added a couple of comments about setChanged() to this code based on my experiences with 4047028.
2079 * khtml/css/css_valueimpl.cpp:
2080 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties)
2081 (DOM::CSSMutableStyleDeclarationImpl::merge)
2083 2005-03-14 Ken Kocienda <kocienda@apple.com>
2089 <rdar://problem/4047028> Changing quote levels on stylized text causes it to be sent as colored (Blue). Tiger8A410
2091 * khtml/css/css_valueimpl.cpp:
2092 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): This function now calls setChanged() at the
2093 end of its loop if any properties were removed. This makes the style system update correctly in response
2094 to changes made by this function. The code to paste removes style from the pasted content in a
2095 preliminary step, and the fact that the style system did not update properly left unwanted color
2096 declarations in the document.
2098 2005-03-14 Vicki Murley <vicki@apple.com>
2100 - roll out this change for now, since it was denied by CCC
2102 2005-03-11 David Harrison <harrison@apple.com>
2106 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
2108 * kwq/KWQKHTMLPart.mm:
2109 (KWQKHTMLPart::advanceToNextMisspelling):
2110 (KWQKHTMLPart::markMisspellings):
2113 2005-03-14 Ken Kocienda <kocienda@apple.com>
2119 <rdar://problem/4050403> Mail crashes after pasting and deleting the content of one Excel cell
2121 * khtml/editing/htmlediting.cpp:
2122 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add some null checks to the code. This fixes the crash, although
2123 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
2124 the document that cannot be removed (this is actually an empty table). This is undesirable, however, work Maciej is
2125 doing to fix the general-case problem of trying to edit constructs we do not handle well in editing should fix this
2126 particular case, making the deletion of this "blank line" possible. Maciej is doing this work as part of this bug:
2127 <rdar://problem/4036051> Hard to select (and thus delete) an IFRAME in an editable WebView
2129 2005-03-14 Ken Kocienda <kocienda@apple.com>
2135 <rdar://problem/4029632> Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
2137 The problem is that removeInlineStyle() can remove nodes, and if either the start or end node of the
2138 selection at the time of the call to removeInlineStyle() was in a node that got removed, bad things
2139 would happen. The fix is described below.
2141 * khtml/editing/htmlediting.cpp:
2142 (khtml::maxRangeOffset): Moved this static function to a different place in the file so the code below can use it.
2143 (khtml::ApplyStyleCommand::applyInlineStyle): Calling removeInlineStyle() now has the side effect of
2144 setting the command's ending selection. Now resets start and end using the ending selection after the call to
2145 removeInlineStyle() as it is done elsewhere in this function.
2146 (khtml::ApplyStyleCommand::removeInlineStyle): Track the removal of the start or end node based on
2147 the positions passed in. If either the start or the end node is removed as part of style removal,
2148 set an appropriate replacement start or end that is still in the document.
2152 2005-03-14 Ken Kocienda <kocienda@apple.com>
2156 I need to roll out Kevin's change to fix 3667701. It breaks contextual fragments, and hence breaks
2157 paste in editing (among other things).
2159 * khtml/html/htmltokenizer.cpp: Roll out recent change.
2160 (khtml::HTMLTokenizer::write)
2161 * khtml/html/htmltokenizer.h: Ditto.
2163 2005-03-13 Darin Adler <darin@apple.com>
2165 Reviewed by Ken and Maciej.
2167 - fixed <rdar://problem/4049040> REGRESSION (403-405): security check prevents user stylesheet from loading (Dictionary.app doesn't work at all!)
2169 * kwq/WebCoreBridge.mm: (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Changed to give "applewebdata:"
2170 documents the same privileges to open local files that "file:" documents have.
2172 2005-03-13 Kevin Decker <kdecker@apple.com>
2176 Fixed: <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
2178 The problem here was that the tokenizer would continue to receive chunks of data from the loader already
2179 after the view and part had been destroyed. Situations like this could arise when clicking on another link
2180 while still loading the current view, or during self test where we rapidly open, load, and close browser
2183 * khtml/html/htmltokenizer.cpp:
2184 (khtml::HTMLTokenizer::write): Simple nil check against the view.
2185 * khtml/html/htmltokenizer.h: Changed the view pointer from a standard pointer to a QGuardedPtr. The tokenizer's
2186 handle to the view will now automatically nil-out and never dangle.
2188 2005-03-13 Darin Adler <darin@apple.com>
2190 Reviewed by John and Ken.
2192 - fixed <rdar://problem/4044347> REGRESSION (Mail): Control-K in particular message moves insertion point to previous line
2194 Tweaked the deleting code, and added three new deleting layout tests to confirm the new code works.
2196 * khtml/editing/htmlediting.cpp:
2197 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Removed special case with comment that said it was
2198 for the case where a "selection contains only a BR right after a block ended". This code was being triggered in
2199 more cases than just that one, and in all the cases I tested, the general delete code works fine.
2200 (khtml::DeleteSelectionCommand::handleGeneralDelete): Changed the code that decides whether to delete an entire
2201 block to understand the case where the end block is outside the start block, but contains the start block.
2202 In that case, we want to delete the entire block. Not deleting the block was causing us to delete just the <br>,
2203 and not the enclosing <div> in the case in the bug.
2205 * layout-tests/editing/deleting/delete-line-015-expected.txt: Added.
2206 * layout-tests/editing/deleting/delete-line-015.html: Added.
2207 * layout-tests/editing/deleting/delete-line-016-expected.txt: Added.
2208 * layout-tests/editing/deleting/delete-line-016.html: Added.
2209 * layout-tests/editing/deleting/delete-line-017-expected.txt: Added.
2210 * layout-tests/editing/deleting/delete-line-017.html: Added.
2211 * layout-tests/editing/style/smoosh-styles-002-expected.txt: Updated to improved results. With the code change, the deletion
2212 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
2213 we delete both of those.
2215 2005-03-13 Darin Adler <darin@apple.com>
2217 - fixed <rdar://problem/4049172> REGRESSION (403-405): Gmail: text box in "Invite a friend" section overlaps other sections
2219 Rolled out fix for <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
2221 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth): Back to previous version of this file.
2223 2005-03-12 Maciej Stachowiak <mjs@apple.com>
2227 <rdar://problem/4046144> RSS pages leave a hole in local file security policy (need to revert feed: exemption)
2229 * kwq/WebCoreBridge.mm:
2230 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Revert
2231 emergency workaround for Safari RSS, now that a new Syndication
2234 2005-03-11 Maciej Stachowiak <mjs@apple.com>
2238 <rdar://problem/4026787> text typed after a link (pasted or Mail Link to this Page) is part of the link, underlined and colored blue
2240 The concept of this change is every time you type at the very
2241 start or very end of a link (even if nested in further inner
2242 elements), the typed text goes outside the link instead of inside.
2244 * khtml/editing/htmlediting.cpp:
2245 (khtml::InsertTextCommand::prepareForTextInsertion): Check whether
2246 we are at the first visible position or last visible position of a
2247 special element. For now this only includes HTML A elements that
2248 are links (i.e. they have an href).
2249 (khtml::isSpecialElement): Helper function that identifies special
2250 elements (for now only links).
2251 (khtml::isFirstVisiblePositionInSpecialElement): Checks if a given DOM
2252 position is equivalent to the first visible position in some containing
2253 editable special element.
2254 (khtml::positionBeforeNode): Returns the DOM position immediately
2256 (khtml::positionBeforeContainingSpecialElement): Gives a DOM
2257 position immediately before the outermost editable containing
2258 special element where the passed-in position is equivalent to the
2259 first visible position.
2260 (khtml::maxRangeOffset): Helper to get the maximum allowed
2261 range/position offset for a node, does the right thing based on
2262 whether the node would use a character offset or child offset.
2263 (khtml::isLastVisiblePositionInSpecialElement): Similar to above,
2264 but for end of node instead of start.
2265 (khtml::positionAfterNode): Ditto.
2266 (khtml::positionAfterContainingSpecialElement): Ditto.
2268 Some layout tests changed - I looked over all the diffs and found
2269 that the only changes were "junk nodes" like empty spans and text
2270 nodes moving from one spot in the tree to another. These changes
2271 are all harmless and do not affect layout or future editing.
2273 * layout-tests/editing/inserting/typing-003-expected.txt:
2274 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
2275 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
2276 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
2277 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
2278 * layout-tests/editing/style/remove-underline-expected.txt:
2279 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt:
2280 * layout-tests/editing/style/remove-underline-in-bold-expected.txt:
2281 * layout-tests/editing/style/typing-style-003-expected.txt:
2282 * layout-tests/editing/style/unbold-in-bold-expected.txt:
2283 * layout-tests/editing/style/underline-expected.txt:
2285 2005-03-11 Adele Amchan <adele@apple.com>
2287 backing out fix for <rdar://problem/4021711> REGRESSION (125-188): blank pages when browsing forum at cooperativeresearch.org - cached external script problem
2289 This caused the following regressions (that we know of):
2290 <rdar://problem/4047445> REGRESSION (Safari-400-403?): Some or all page contents sometimes don't appear (macworld.com)
2291 <rdar://problem/4046153> 8a409: Problem loading Citibank page in Safari 2 (403)
2292 <rdar://problem/4047801> REGRESSION (402-403): .Mac homepage links don't work
2294 * khtml/html/htmltokenizer.cpp:
2295 (khtml::HTMLTokenizer::scriptHandler):
2297 2005-03-11 David Harrison <harrison@apple.com>
2301 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
2303 * kwq/KWQKHTMLPart.mm:
2304 (KWQKHTMLPart::advanceToNextMisspelling):
2305 (KWQKHTMLPart::markMisspellings):
2308 2005-03-11 Ken Kocienda <kocienda@apple.com>
2312 * ForwardingHeaders/editing/visible_units.h: Added.
2314 2005-03-11 Ken Kocienda <kocienda@apple.com>
2320 <rdar://problem/4045521> Hitting return key with full line selected does not add blank line as it should
2322 * khtml/editing/htmlediting.cpp:
2323 (khtml::InsertParagraphSeparatorCommand::doApply): Removed some "special-case" code from this
2324 function that would look for a selection that started and ended in a different block, and would
2325 then bail right after the deletion of the selection without inserting a paragraph separator.
2326 This was just wrong. So, the code change is removal only. When the general-case code runs instead
2327 of the erroneous special-case code, the bug goes away.
2331 * layout-tests/editing/inserting/return-key-with-selection-001-expected.txt: Added.
2332 * layout-tests/editing/inserting/return-key-with-selection-001.html: Added.
2333 * layout-tests/editing/inserting/return-key-with-selection-002-expected.txt: Added.
2334 * layout-tests/editing/inserting/return-key-with-selection-002.html: Added.
2335 * layout-tests/editing/inserting/return-key-with-selection-003-expected.txt: Added.
2336 * layout-tests/editing/inserting/return-key-with-selection-003.html: Added.
2338 2005-03-11 David Harrison <harrison@apple.com>
2342 <rdar://problem/4009446> AX: kAXTextMarkerForPositionParameterizedAttribute not working correctly (required for Dictionary pop-up)
2344 * kwq/KWQAccObject.mm:
2345 (-[KWQAccObject accessibilityAttributeValue:]):
2348 (-[KWQAccObject doAXTextMarkerForPosition:]):
2351 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
2352 Use the selection's document instead of the top document, to accommodate frames, etc.
2354 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
2355 Fixed parameter processing to look for NSValue instead of AXValue.
2357 2005-03-11 Ken Kocienda <kocienda@apple.com>
2359 Reviewed by Harrison
2363 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
2365 This was fixed, then regressed with Harrison's fix for this bug:
2367 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
2369 * khtml/editing/htmlediting.cpp:
2370 (khtml::ReplaceSelectionCommand::doApply): My now addresses both problems in a way that they no longer
2373 2005-03-10 Ken Kocienda <kocienda@apple.com>
2379 <rdar://problem/4045511> Copying and pasting end-of-paragraph selection puts insertion point in wrong place
2380 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
2382 The copy/paste code before this patch had no notion of a "logical newline" at the start of the selection. We have
2383 had a similar notion for "logical newline" at the end of the selection for quite some time. To fix these bugs, we
2384 need to introduce the same idea for selection starts.
2386 * khtml/editing/htmlediting.cpp:
2387 (khtml::ReplacementFragment::ReplacementFragment): Process the "logical newline" at start as we write it out
2388 in markup. Set the bit we added to this object to signify we have such a newline.
2389 (khtml::ReplaceSelectionCommand::doApply): Many, many changes to introduce the new "logical newline" at start concept.
2390 I also tried to simply the code that sets the start position for inserting content to be pasted. I also improved a
2391 weakness in the smart-paste code. Now, we check before and after the paste for whether we need to add a leading or
2392 trailing space. The code previous to this patch only did a "before" check, with the result that we sometimes added
2393 a second space. In other words, the code did not realize that DOM changes done by pasting could cause formerly
2394 unrendered whitespace to become rendered. Also moved line placeholder clean up code to its own function.
2395 (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): New helper that further refines the notion
2396 of when we can remove a line placeholder. The definition is now, "If a line placeholder is at the visible start
2397 and visible end of its line, keep it; otherwise remove it".
2398 * khtml/editing/htmlediting.h: Declare new functions. Rework inlines in ReplacementFragment class to account for
2399 addition of new "logical newline" at start concept.
2400 (khtml::ReplacementFragment::hasInterchangeNewlineAtStart): New accessor.
2401 (khtml::ReplacementFragment::hasInterchangeNewlineAtEnd): Renamed from hasInterchangeNewline(), since before we
2402 only had a bit for the end, hence we did not need to distinguish it from the start.
2403 * khtml/editing/markup.cpp:
2404 (khtml::createMarkup): Added code to detect and write out markup for cases where we have a "logical newline" at start.
2405 * khtml/xml/dom2_rangeimpl.cpp:
2406 (DOM::RangeImpl::startPosition): New helper.
2407 (DOM::RangeImpl::endPosition): Ditto.
2408 * khtml/xml/dom2_rangeimpl.h: Declare new helpers.
2411 * layout-tests/editing/pasteboard/paste-line-endings-001-expected.txt: Added.
2412 * layout-tests/editing/pasteboard/paste-line-endings-001.html: Added.
2413 * layout-tests/editing/pasteboard/paste-line-endings-002-expected.txt: Added.
2414 * layout-tests/editing/pasteboard/paste-line-endings-002.html: Added.
2415 * layout-tests/editing/pasteboard/paste-line-endings-003-expected.txt: Added.
2416 * layout-tests/editing/pasteboard/paste-line-endings-003.html: Added.
2417 * layout-tests/editing/pasteboard/paste-line-endings-004-expected.txt: Added.
2418 * layout-tests/editing/pasteboard/paste-line-endings-004.html: Added.
2419 * layout-tests/editing/pasteboard/paste-line-endings-005-expected.txt: Added.
2420 * layout-tests/editing/pasteboard/paste-line-endings-005.html: Added.
2421 * layout-tests/editing/pasteboard/paste-line-endings-006-expected.txt: Added.
2422 * layout-tests/editing/pasteboard/paste-line-endings-006.html: Added.
2423 * layout-tests/editing/pasteboard/paste-line-endings-007-expected.txt: Added.
2424 * layout-tests/editing/pasteboard/paste-line-endings-007.html: Added.
2425 * layout-tests/editing/pasteboard/paste-line-endings-008-expected.txt: Added.
2426 * layout-tests/editing/pasteboard/paste-line-endings-008.html: Added.
2427 * layout-tests/editing/pasteboard/paste-line-endings-009-expected.txt: Added.
2428 * layout-tests/editing/pasteboard/paste-line-endings-009.html: Added.
2429 * layout-tests/editing/pasteboard/paste-line-endings-010-expected.txt: Added.
2430 * layout-tests/editing/pasteboard/paste-line-endings-010.html: Added.
2434 2005-03-10 Darin Adler <darin@apple.com>
2436 Reviewed by Richard.
2438 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
2440 * khtml/rendering/render_text.cpp: (getCharacterBreakIterator): Set boolean "got iterator" to true.
2442 2005-03-10 Darin Adler <darin@apple.com>
2446 - fixed <rdar://problem/4042867> "Bigger" changes the font size of too much text when the selection is on a style-change boundary
2448 * khtml/editing/htmlediting.cpp: (khtml::ApplyStyleCommand::applyRelativeFontStyleChange):
2449 Advance out of the starting text node if we're at the end of it.
2451 2005-03-10 Darin Adler <darin@apple.com>
2453 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Fixed assertion for nested calls to write.
2455 2005-03-10 David Harrison <harrison@apple.com>
2459 <rdar://problem/4032346> REGRESSION (Mail): changing 1st line of a URL that wraps to two lines doesn't always update 2nd line
2461 * khtml/rendering/bidi.cpp:
2462 (khtml::RenderBlock::matchedEndLine):
2463 Look at first clean line in case line wrap implicitly dirtied it.
2465 2005-03-10 Maciej Stachowiak <mjs@apple.com>
2469 <rdar://problem/4046018> REGRESSION (TOT): RSS pages don't display anything
2471 * kwq/WebCoreBridge.mm:
2472 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Exempt
2473 feed: and feeds: pages from the local file security check.
2475 2005-03-10 Darin Adler <darin@apple.com>
2477 Change written by Steve Peters, reviewed by me.
2479 - fixed <rdar://problem/4045924> improve compareBoundaryPoints to make style changes faster
2481 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints):
2482 Do early outs in a couple of the loops to make things faster.
2484 2005-03-10 Jens Alfke <jens@apple.com>
2488 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.
2490 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.
2492 This ensures that the applet will get loaded even if there is no explicit </applet> tag.
2494 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.
2496 * khtml/html/html_objectimpl.cpp:
2497 (HTMLAppletElementImpl::closeRenderer):
2498 * khtml/html/html_objectimpl.h:
2499 * khtml/html/htmlparser.cpp:
2500 (KHTMLParser::insertNode):
2501 (KHTMLParser::processCloseTag):
2502 (KHTMLParser::popOneBlock):
2503 * khtml/xml/dom_nodeimpl.h:
2504 (DOM::NodeImpl::closeRenderer):
2506 2005-03-10 Ken Kocienda <kocienda@apple.com>
2512 <rdar://problem/4024929> REGRESSION (Mail): Pasting text with multiple reply levels removes one level instead of all
2514 The code to figure out which node to use to merge into an existing line did not drill into the first inline element
2515 as needed to make the feature work as user expect. Instead, it looked at the first node, and if it was a block, it
2516 skipped that node. This worked for some cases (including the important "paste-as-quotation" case) but obviously
2517 doesn't work for content quoted more than once.
2519 Now, mergeStartNode() will look for the first node in pasted content that is not a block. It will now also look
2520 for nodes specially marked by Mail as a node added to make "Paste As Quotation" work. It won't skip those.
2522 NOTE: This change will break Mail's "Paste As Quotation" feature for TOT WebKit users, but this is only a temporary
2523 problem that will exist until we sync up with Mail's pending change to mark nodes as needed in its pasteAsQuotation:
2526 * khtml/editing/html_interchange.h: Add ApplePasteAsQuotation constant used to check for "marked" blockquotes.
2527 * khtml/editing/htmlediting.cpp:
2528 (khtml::ReplacementFragment::mergeStartNode): Look for first node that is either not a block or is marked as
2529 an ApplePasteAsQuotation node.
2530 (khtml::isMailPasteAsQuotationNode): New helper that looks for nodes marked with ApplePasteAsQuotation.
2531 * khtml/editing/htmlediting.h: Updated header for new function.
2533 This test result changed is an acceptable way.
2535 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
2536 * layout-tests/editing/pasteboard/paste-text-013.html
2538 NOTE: This change causes a regression in this layout test:
2540 * layout-tests/editing/pasteboard/paste-text-013.html
2542 This problem will need to be fixed separately, and this bug has been filed to track this problem:
2543 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
2545 2005-03-09 Maciej Stachowiak <mjs@apple.com>
2547 Reviewed by Richard.
2549 <rdar://problem/4040776> Dashboard (Weather widget) is a memory hog
2551 Change things around so the event listeners for XMLHttpRequest
2552 mark their JS listener objects instead of holding a hard
2553 reference, to avoid an unbreakable reference cycle.
2555 * khtml/ecma/kjs_events.cpp:
2556 (JSAbstractEventListener::JSAbstractEventListener):
2557 (JSAbstractEventListener::~JSAbstractEventListener):
2558 (JSAbstractEventListener::handleEvent):
2559 (JSAbstractEventListener::eventListenerType):
2560 (JSUnprotectedEventListener::JSUnprotectedEventListener):
2561 (JSUnprotectedEventListener::~JSUnprotectedEventListener):
2562 (JSUnprotectedEventListener::listenerObj):
2563 (JSUnprotectedEventListener::windowObj):
2564 (JSUnprotectedEventListener::mark):
2565 (JSEventListener::JSEventListener):
2566 (JSEventListener::~JSEventListener):
2567 (JSEventListener::listenerObj):
2568 (JSEventListener::windowObj):
2569 (JSLazyEventListener::JSLazyEventListener):
2570 * khtml/ecma/kjs_events.h:
2571 * khtml/ecma/kjs_html.h:
2572 * khtml/ecma/kjs_window.cpp:
2573 (Window::getJSEventListener):
2574 (Window::getJSUnprotectedEventListener):
2575 * khtml/ecma/kjs_window.h:
2576 * khtml/ecma/xmlhttprequest.cpp:
2577 (KJS::XMLHttpRequest::putValue):
2578 (KJS::XMLHttpRequest::mark):
2579 * khtml/ecma/xmlhttprequest.h:
2580 * khtml/khtml_part.h:
2582 2005-03-06 Maciej Stachowiak <mjs@apple.com>
2586 <rdar://problem/4005575> Arbitrary file disclosure vulnerability due to ability to load local html from remote content
2588 * khtml/ecma/kjs_html.cpp:
2589 (KJS::HTMLDocument::putValue):
2590 * khtml/ecma/kjs_window.cpp:
2592 (WindowFunc::tryCall):
2594 (LocationFunc::tryCall):
2595 * khtml/khtml_part.cpp:
2597 (KHTMLPart::scheduleLocationChange):
2598 (KHTMLPart::slotRedirect):
2599 (KHTMLPart::processObjectRequest):
2600 * khtml/khtml_part.h:
2601 * khtml/khtmlpart_p.h:
2602 * kwq/KWQKHTMLPart.mm:
2603 (KWQKHTMLPart::openURLRequest):
2604 (KWQKHTMLPart::urlSelected):
2605 (KWQKHTMLPart::createPart):
2606 * kwq/KWQKHTMLPartBrowserExtension.mm:
2607 (KHTMLPartBrowserExtension::createNewWindow):
2608 * kwq/WebCoreBridge.h:
2609 * kwq/WebCoreBridge.mm:
2610 (hasCaseInsensitivePrefix):
2611 (-[WebCoreBridge didNotOpenURL:pageCache:]):
2612 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]):
2614 2005-03-09 Richard Williamson <rjw@apple.com>
2616 Fixed <rdar://problem/4032938> Safari: text layout for MS P Gothic font is corrupted
2618 Remove our hacked special case now we have our own cache of
2619 which fonts are fixed pitch.
2624 (QFont::isFixedPitch):
2626 2005-03-09 David Harrison <harrison@apple.com>
2630 <rdar://problem/4037141> REGRESSION (Mail): Pasting deletes preceding blank lines with certain steps
2632 * khtml/editing/htmlediting.cpp:
2633 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
2634 Add check for anonymous text after blocks.
2636 2005-03-08 Ken Kocienda <kocienda@apple.com>
2642 <rdar://problem/4039661> crash in ApplyStyleCommand::applyBlockStyle pasting contents of webpage into Mail or Blot
2643 <rdar://problem/4039672> hang in moveParagraphContentsToNewBlockIfNecessary after pasting contents of webpage into Blot
2645 * khtml/editing/htmlediting.cpp:
2646 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Fix for 4039672. Iteration needs to do
2647 a traverseNextSibling(), not a traverseNextNode(). The latter might iterate into a child that already got moved, and
2648 the code can infinite loop as a result.
2649 (khtml::ApplyStyleCommand::applyBlockStyle): Fix for 4039661. This function iterates over a set of nodes to apply
2650 block styles. Before, the iteration would go from the start to the end of the selection, and apply block styles
2651 as it went. However, the act of applying style could confuse the iteration. Now I iterate and store the relevant
2652 nodes in QPtrList before doing any style manipulation, and then iterate that set of nodes.
2654 2005-03-08 Darin Adler <darin@apple.com>
2656 Change written by Hyatt, reviewed by me.
2658 - fixed <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
2660 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth):
2661 Only use a minWidth of 0 for images with a percentage value. Other replaced elements aren't scalable
2662 so their minWidth should be their calculated width. This has been wrong all along, but it's a relatively
2663 safe change because it only affects replaced elements' min-width.
2665 2005-03-08 David Harrison <harrison@apple.com>
2669 <rdar://problem/4039006> REGRESSION (Mail): Command-left-arrow goes to the start of the wrong line in particular message
2671 * khtml/editing/visible_units.cpp:
2672 (khtml::startOfLine):
2673 Use firstLeafChild() instead of firstChild().
2675 2005-03-08 Richard Williamson <rjw@apple.com>
2677 Fixed by Tom Madden.
2679 Fixed <rdar://problem/4038586> 8A402: Osaka-Mono text overlaps when typing with input method
2681 We weren't clearing the "all ascii" flag when setting text on
2684 Reviewed by Richard Williamson.
2686 * khtml/rendering/render_text.cpp:
2687 (RenderText::setText):
2689 2005-03-08 Darin Adler <darin@apple.com>
2691 Reviewed by Ken and Maciej.
2693 - fixed <rdar://problem/3988809> REGRESSION (Mail): wide space characters are turned into plain old spaces when typed or pasted
2695 Changed the few places where it matters to use a "collapsible whitespace" concept instead of
2696 the general whitespace concept. This means treating only ' ' and '\n' specially instead of
2697 including other space characters, which matches what the space-collapsing logic does in RenderText,
2698 although it really needs to behave differently based on whitespace mode.
2700 * khtml/editing/visible_text.h: (khtml::isCollapsibleWhitespace): Added. This returns true only for
2701 ' ' and '\n' since they are the only characters collapsed once text is in the DOM. But really it
2702 can't do the job ignoring white-space mode, so some day it must go.
2704 * khtml/editing/html_interchange.cpp: (convertHTMLTextToInterchangeFormat): Changed to use
2705 isCollapsibleWhitespace and removed unnecessary calls to latin1().
2707 * khtml/editing/htmlediting.cpp:
2708 (khtml::isNBSP): Removed unnecessary creation/destruction of QChar each time this is called.
2709 (khtml::nextCharacterIsCollapsibleWhitespace): Renamed from isWS and changed to use isCollapsibleWhitespace.
2710 (khtml::DeleteSelectionCommand::fixupWhitespace): Use isCollapsibleWhitespace instead of isWS,
2711 since we only want to do our NBSP tricks for collapsible whitespace.
2712 (khtml::InsertTextCommand::input): Changed use of isTab to instead say == "\t" since that does the
2713 same thing and is arguably just as clear. Changed use of isWS to == " " since the input text can't
2714 include any "\n" characters, and really a plain old space is the only collapsible thing that can
2715 be passed in. Use isCollapsibleWhitespace instead of isWS since we want to do NBSP tricks only for
2716 collapsible whitespace, not all whitespace.
2717 (khtml::InsertTextCommand::insertSpace): Use isCollapsibleWhitespace instead of isWS since we want
2718 to do NBSP tricks only for collapsible whitespace, not all whitespace.
2719 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
2721 * khtml/xml/dom_position.h: Changed treatNBSPAsWhiteSpace parameters to considerNonCollapsibleWhitespace
2722 parameters. The most common callers are only interested in collapsible whitespace, and the smart copy
2723 and paste callers want to include all whitespace, including non-breaking spaces and all the Unicode spaces.
2724 * khtml/xml/dom_position.cpp:
2725 (DOM::Position::leadingWhitespacePosition): Rename the parameter, and use either QChar::isSpace or
2726 isCollapsibleWhitespace depending on the boolean passed in.
2727 (DOM::Position::trailingWhitespacePosition): Ditto.
2729 2005-03-07 John Sullivan <sullivan@apple.com>
2733 - <rdar://problem/4040868> REGRESSION (Mail, 403-403+): Drag and drop deletes text,
2734 many other bad editing problems
2736 * khtml/rendering/render_text.cpp:
2737 (RenderText::caretMaxOffset):
2738 A "-" should have been a "+" in this method that was tweaked an hour ago. Editing
2739 was completely horked.
2741 2005-03-07 Richard Williamson <rjw@apple.com>
2743 Additional nil check from fix for 4040749.
2745 * khtml/rendering/render_box.cpp:
2746 (RenderBox::setStyle):
2748 2005-03-07 Richard Williamson <rjw@apple.com>
2750 Additional nil check from fix for 4040749.
2752 * khtml/rendering/render_layer.cpp:
2753 (RenderLayer::updateLayerPosition):
2755 2005-03-07 David Harrison <harrison@apple.com>
2759 <rdar://problem/4033202> REGRESSION (Mail): Can't arrow up at a particular spot in a particular Mail message
2761 Doublecheck that new position is really on a different line, because the VisiblePosition constructor does not.
2762 Filed <rdar://problem/4040763> for that problem.
2764 * khtml/editing/visible_units.cpp:
2765 (khtml::previousLinePosition):
2767 2005-03-07 Richard Williamson <rjw@apple.com>
2769 Fixed <rdar://problem/4040749> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
2771 When layers are dynamically created/removed as a result of changing opacity they weren't being correctly
2772 sized and positioned. This happens whenever opacity goes from < 1 to 1.
2776 * khtml/rendering/render_box.cpp:
2777 (RenderBox::setStyle):
2778 * khtml/rendering/render_layer.cpp:
2779 (RenderLayer::updateLayerPosition):
2781 2005-03-07 Christy Warren <kali@apple.com>
2785 * khtml/rendering/render_text.cpp:
2786 (RenderText::caretMinOffset): modified to handle BIDI case by checking all text boxes for min offset
2787 (RenderText::caretMaxOffset): modified to handle BIDI case by checking all text boxes for max offset
2789 2005-03-07 David Harrison <harrison@apple.com>
2793 <rdar://problem/4029225> REGRESSION (Mail): Crash if hit return after dragging in attachment - DeleteSelectionCommand::initializePositionData
2795 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.
2796 Filed <rdar://problem/4040358> RenderBR height() is not accurate.
2798 * khtml/editing/htmlediting.cpp:
2799 (khtml::ReplaceSelectionCommand::doApply):
2800 When height is 0, double check that the placeholder is the first position on the line.
2804 2005-03-07 Ken Kocienda <kocienda@apple.com>
2810 <rdar://problem/4040136> Expose SPI for WebCore's functions to create document fragments from plain text and markup strings
2812 * kwq/DOMHTML.mm: Add two new SPI functions.
2813 (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:])
2814 (-[DOMHTMLDocument _createDocumentFragmentWithText:])
2815 * kwq/DOMPrivate.h: Declare the new SPI here, a privately-exported header, so Mail can make use of it.
2817 2005-03-07 Ken Kocienda <kocienda@apple.com>
2823 <rdar://problem/4039676> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date
2825 * khtml/editing/htmlediting.cpp:
2826 (khtml::ReplaceSelectionCommand::doApply): Code to "eat" a <br> element, that was creating an otherwise empty line, was running
2827 when it should not. If the content being pasted in does not end in a "logical" newline itself, then the <br> already
2828 in the content needs to be preserved. A simple one-line change now sees to this.
2830 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: This test now has an extra, but harmless,
2831 <br> at the end of a paragraph. This makes sense given the code change.
2834 * layout-tests/editing/pasteboard/paste-text-018-expected.txt: Added.
2835 * layout-tests/editing/pasteboard/paste-text-018.html: Added.
2837 2005-03-07 Ken Kocienda <kocienda@apple.com>
2843 <rdar://problem/4035648> REGRESSION (Mail): line feed in source HTML file causes bad copy/paste behavior
2845 The createMarkup() function in markup.cpp iterates over the nodes in a range,
2846 and does some bookkeeping to figure out when to add close tags to the markup.
2847 Some code added at the start of the loop to prevent markup from being written
2848 for unrendered nodes short-circuited the rest of the loop, and so prevented
2849 the close-tag-writing code from running when it should.
2851 This is why the "plain" text wound up inside of the bold tag in the example
2852 above. The addition of the unrendered return character caused an incorrect
2853 delay in the close tag for the bold element from being written out, with the
2854 result being that it wound up including additional content.
2856 The fix is to add checks for node renderers throughout the loop at the points
2857 where markup is written out for each node. This allows the additional close
2858 tag logic to run as needed.
2860 All layout tests pass with this change.
2862 * khtml/editing/markup.cpp:
2863 (khtml::createMarkup)
2867 * layout-tests/editing/pasteboard/paste-4035648-fix-expected.txt: Added.
2868 * layout-tests/editing/pasteboard/paste-4035648-fix.html: Added.
2870 2005-03-06 Christy Warren <kali@appple.com>
2874 * khtml/rendering/render_text.cpp:
2875 (lastRendererOnPrevLine): helper for RenderText::caretRect
2876 (RenderText::caretRect): added code to properly handle bidi ordered text boxes
2878 2005-03-06 Christy Warren <kali@apple.com>
2882 * khtml/editing/visible_position.cpp: Eliminated code that cuts off searching through the text boxes based on an assumption that breaks under bidi
2883 (khtml::VisiblePosition::isCandidate):
2884 * kwq/KWQFontMetrics.mm:
2885 (QFontMetrics::checkSelectionPoint): Made the initialization of the WebCoreStyle honor the reversed flag
2887 2005-03-05 John Sullivan <sullivan@apple.com>
2891 - fixed <rdar://problem/4038417> Mail crashed in StyleChange::checkForLegacyHTMLStyleChange
2892 when composing a reply
2894 * khtml/editing/htmlediting.cpp:
2895 (khtml::StyleChange::checkForLegacyHTMLStyleChange):
2896 Added missing nil check.
2898 2005-03-05 Darin Adler <darin@apple.com>
2902 - fixed <rdar://problem/4038478> Crash in renderer viewing RSS feed at feed://wvs.topleftpixel.com/index.rdf
2904 * khtml/xml/dom_docimpl.cpp: (widgetForNode): Check for nil before going from node to renderer.
2906 2005-03-05 Darin Adler <darin@apple.com>
2908 Reviewed by Richard.
2910 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
2912 * khtml/rendering/render_text.cpp:
2913 (getCharacterBreakIterator): Added. Helper that sets up an iterator for the passed-in text.
2914 Shares a single global iterator (fast, albeit not thread-safe).
2915 (RenderText::previousOffset): Changed to call getCharacterBreakIterator.
2916 (RenderText::nextOffset): Ditto.
2918 2005-03-05 Ken Kocienda <kocienda@apple.com>
2924 <rdar://problem/4038267> REGRESSION (Mail): Crash copying and pasting end of paragraph
2926 Code to handle content that has a "logical" newline at the end of the pasted content, and the code
2927 to adjust the selection at the end of the paste operation made an assumption that at least one
2928 node had been inserted by the paste command. This is not necessarily true in the case where the sole content
2929 in the pasted content is one of these "logical" newlines. Adjust some code around so that we don't deref
2930 null, but still adjust the selection correctly for this case. In each of the two functions below, some
2931 null checks have been added, and some code has been rearranged a little bit to continue on through
2932 the end of completeHTMLReplacement, even if no nodes have been inserted. The patch looks bigger and more
2933 complicated than the conceptual change.
2935 * khtml/editing/htmlediting.cpp:
2936 (khtml::ReplaceSelectionCommand::doApply)
2937 (khtml::ReplaceSelectionCommand::completeHTMLReplacement)
2939 * layout-tests/editing/pasteboard/paste-4038267-fix-expected.txt: Added.
2940 * layout-tests/editing/pasteboard/paste-4038267-fix.html: Added.
2942 2005-03-05 Darin Adler <darin@apple.com>
2946 - fixed <rdar://problem/4025918> images copied from Safari with relative src URLs aren't pasted into Mail messages (KURL resolves base URLs incorrectly)
2948 * kwq/KWQKURL.mm: (KURL::KURL): Add a slash at the start of the path if a relative part is adding
2949 a path onto a URL that has "pre-path" bits like host name, but no path yet. This doesn't come up
2950 for http because in that case we add a trailing "/" as part of canonicalization.
2952 2005-03-04 John Sullivan <sullivan@apple.com>
2956 - fixed <rdar://problem/4033705> REGRESSION (Mail): Copy/Paste from Excel
2957 crashes Mail in KWQKHTMLPart::fontForSelection(bool*) const + 232
2959 * kwq/KWQKHTMLPart.mm:
2960 (KWQKHTMLPart::fontForSelection):
2961 Check for nil startNode, not just nil renderer.
2963 2005-03-04 David Harrison <harrison@apple.com>
2965 Reviewed by Ken, Richard.
2967 <rdar://problem/3996383> REGRESSION (Mail): Deleting all of first line also deletes line ending
2969 Problem was the placeholder check was based on 0 height block, but the block in this
2970 case is the BODY, which has other content even though the paragraph is gone.
2972 * khtml/editing/htmlediting.cpp:
2973 (khtml::CompositeEditCommand::insertBlockPlaceholder):
2974 Now does insert instead of append!
2976 (khtml::CompositeEditCommand::appendBlockPlaceholder):
2977 New. Actually does append.
2979 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
2980 Renamed from insertBlockPlaceholderIfNeeded because it can insert or append. Also accepts "force insert" flag.
2982 (khtml::CompositeEditCommand::removeBlockPlaceholder):
2983 Renamed for succinctness from removeBlockPlaceholderIfNeeded.
2985 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
2986 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
2987 Use renamed methods.
2989 (khtml::DeleteSelectionCommand::doApply):
2990 Use addBlockPlaceholderIfNeeded "force insert" flag if deleting whole paragraphs did not leave an empty one.
2992 (khtml::InsertParagraphSeparatorCommand::doApply):
2993 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
2994 (khtml::InsertTextCommand::input):
2995 Use renamed methods.
2997 * khtml/editing/htmlediting.h:
2998 Renamed and new methods per above.
3001 2005-03-04 Chris Blumenberg <cblu@apple.com>
3003 Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after pasting attachment at end of message
3007 * khtml/editing/visible_units.cpp:
3008 (khtml::endOfParagraph): don't consider text nodes that have no rendered characters
3010 2005-03-04 Richard Williamson <rjw@apple.com>
3012 Fixed <rdar://problem/4034764> REGRESSION(125-188)Viewing text/plain page and going back/forward corrupts HTML pages (google.com)
3014 The parse mode wasn't be restored to the document when going
3019 * kwq/KWQKHTMLPart.mm:
3020 (KWQKHTMLPart::openURLFromPageCache):
3021 * kwq/KWQPageState.h:
3022 * kwq/KWQPageState.mm:
3023 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]):
3025 2005-03-04 Ken Kocienda <kocienda@apple.com>
3029 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Shame on me!
3030 I landed my last fix without running layout tests. This one changes in a subtle, but
3033 2005-03-04 Ken Kocienda <kocienda@apple.com>
3035 Reviewed by Harrison
3039 <rdar://problem/4032543> REGRESSION (Mail): Mail hangs when quoted text is pasted twice
3041 This code change fixes the bug in a non-obvious way. The root cause of the problem was
3042 that a VisiblePosition created using an affinity originating in Mail code caused
3043 two VisiblePosition objects that should have been equal to differ only in their
3044 affinities, which in turn caused us to run a code path that should not have run.
3046 * khtml/editing/visible_position.cpp:
3047 (khtml::VisiblePosition::VisiblePosition): Added copy constructor.
3048 (khtml::VisiblePosition::next): Factored out inline code that used to be here into new
3049 setAffinityUsingLinePosition() function.
3050 (khtml::isEqualIgnoringAffinity): New helper to handle cases when affinity in equality check does
3051 not matter. However, we want to know about such cases where a VisiblePosition differs only by affinity,
3052 and the code will assert in development when this happens.
3053 (khtml::isNotEqualIgnoringAffinity): Ditto, but not. :)
3054 (khtml::setAffinityUsingLinePosition): New helper function mentioned above. This will "correct"
3055 upstream affinity to downstream if the affinity does not make a difference for the position.
3056 * khtml/editing/visible_position.h:
3057 * khtml/editing/visible_range.h: Wacky bug. The operator== for this class took VisiblePosition classes!
3058 * khtml/editing/visible_units.cpp:
3059 (khtml::isStartOfParagraph): Now performs equality check without regard to affinity.
3060 (khtml::isEndOfParagraph): Ditto.
3061 (khtml::isStartOfBlock): Ditto.
3062 (khtml::isEndOfBlock): Ditto.
3063 * kwq/WebCoreBridge.mm:
3064 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Adjusts the affinity using setAffinityUsingLinePosition()
3067 2005-03-04 Darin Adler <darin@apple.com>
3071 - fixed <rdar://problem/4036817> REGRESSION: ctrl-y broken when a line + carriage return cut
3073 * khtml/editing/htmlediting.h: Added insertTextRunWithoutNewlines.
3074 * khtml/editing/htmlediting.cpp:
3075 (khtml::InsertTextCommand::input): Added assertion to make sure strings with newlines don't get
3077 (khtml::TypingCommand::insertText): Added. Takes the name of the old function, but is a new
3078 level that breaks runs into lines and inserts each one separately.
3079 (khtml::TypingCommand::insertTextRunWithoutNewlines): Renamed old insertText to this.
3081 * khtml/dom/dom_string.h: Made substring be a const member function.
3082 * khtml/dom/dom_string.cpp: (DOM::DOMString::substring): Made this const.
3084 2005-03-04 Darin Adler <darin@apple.com>
3088 - fixed <rdar://problem/4020413> REGRESSION (Mail): can't use fonts with names that start with "#" in Mail (Korean fonts)
3090 * khtml/css/css_valueimpl.cpp:
3091 (DOM::isLegalIdentifier): Added. Commented out and not used.
3092 (DOM::quoteStringIfNeeded): Quotes the string if needed. For now only if it starts with "#".
3093 (DOM::CSSPrimitiveValueImpl::cssText): Call quoteStringIfNeeded when asked for cssText for an arbitrary string, since we
3094 need text you can re-parse.
3095 (DOM::FontFamilyValueImpl::cssText): Ditto.
3097 * khtml/editing/markup.cpp:
3098 (khtml::startMarkup): Added comments about lack of quoting for attributes.
3099 (khtml::createMarkup): Ditto.
3101 2005-03-04 Adele Amchan <adele@apple.com>
3105 Fix for <rdar://problem/4021711> REGRESSION(125-188) blank pages when browsing forum at cooperativeresearch.org - cached external script problem
3107 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::scriptHandler): set flag needToRefCachedScript so we can make sure
3108 notifyFinished is called after pendingSrc is set up with the right data from the cached script
3110 2005-03-04 Ken Kocienda <kocienda@apple.com>
3116 <rdar://problem/4029632> Tiger 8A398:- Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
3118 * khtml/editing/htmlediting.cpp:
3119 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): VisiblePosition constructor
3120 was failing to yield a position for a node just pasted into the document since a layout was needed
3121 for the calculation to come out right. Layout added. Crash gone.
3125 2005-03-03 Chris Blumenberg <cblu@apple.com>
3127 Fixed: <rdar://problem/3992803> Cannot navigate through list items with the keyboard, you're stuck in the same <li> block unless you click out
3129 Reviewed by harrison.
3131 * khtml/rendering/render_line.cpp:
3132 (khtml::RootInlineBox::closestLeafChildForXPos): avoid returning list markers when possible. Also improved heuristic for returning the best InlineBox given the passed X position.
3135 2005-03-03 Ken Kocienda <kocienda@apple.com>
3141 <rdar://problem/4035198> Pasting text with different styles does not get reproducible results
3143 I had a good idea yesterday to improve the way we "fixup" styles after
3144 pasting, but i chose a poor data structure to do it, a map of
3145 nodes-to-styles. In the fixup step, I iterated over the map elements and
3146 did the fixup. However, since the order in which the items would come
3147 out of the map is indeterminate, we got unpredictable results.
3149 So, the concept was good, but the implementation was flawed. I have
3150 fixed this mapping to be a list instead, so the order that nodes are
3151 evaluated in the fixup step is document order. This works nicely.
3153 * khtml/editing/htmlediting.cpp:
3154 (khtml::ReplacementFragment::~ReplacementFragment): No longer need to explicity deref nodes and
3155 styles saved away for later fixup. This is now handled by the new NodeDesiredStyle class.
3156 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls computeAndStoreNodeDesiredStyle,
3157 function renamed from mapDesiredStyleForNode.
3158 Now accepts a QValueList<NodeDesiredStyle> in place of the old map.
3159 (khtml::NodeDesiredStyle::NodeDesiredStyle): New class that represents a node-to-style mapping.
3160 (khtml::NodeDesiredStyle::~NodeDesiredStyle): Ditto.
3161 (khtml::NodeDesiredStyle::operator=): Ditto.
3162 (khtml::ReplaceSelectionCommand::doApply): Now calls computeAndStoreNodeDesiredStyle,
3163 function renamed from mapDesiredStyleForNode.
3164 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Now operates on a QValueList<NodeDesiredStyle> in
3165 place of the old map.
3166 (khtml::computeAndStoreNodeDesiredStyle): Renamed from mapDesiredStyleForNode. Now operates on a
3167 QValueList<NodeDesiredStyle> in place of the old map.
3168 * khtml/editing/htmlediting.h:
3169 (khtml::NodeDesiredStyle): New class that represents a node-to-style mapping.
3170 (khtml::ReplacementFragment::desiredStyles): Now returns a QValueList<NodeDesiredStyle> in place of the old map.
3172 * layout-tests/editing/style/typing-style-003-expected.txt: Results changed in an acceptable way.
3174 2005-03-02 Darin Adler <darin@apple.com>
3178 - fixed <rdar://problem/4029741> REGRESSION (188-189): <input type=text> are cleared when you hide/show them
3180 * khtml/html/html_formimpl.h: Added detach functions for both input and text area elements, since
3181 both have m_valueMatchesRenderer flags.
3182 * khtml/html/html_formimpl.cpp:
3183 (DOM::HTMLInputElementImpl::detach): Set m_valueMatchesRenderer to false, since the renderer is going away.
3184 (DOM::HTMLTextAreaElementImpl::detach): Ditto.
3186 2005-03-02 Ken Kocienda <kocienda@apple.com>
3192 <rdar://problem/4006151> in reply, caret moves to next line after toggling bold style then typing
3194 * khtml/editing/htmlediting.cpp:
3195 (khtml::ApplyStyleCommand::applyInlineStyle): Defer cleaning up empty style until the end of the
3196 function. In some situations, the render tree can get confused when we do this removal up front.
3197 I wish I understood the reasons more deeply, but this bit of code shuffling seems harmless, and
3200 2005-03-02 Darin Adler <darin@apple.com>
3204 - fixed <rdar://problem/4024966> crash happened twice in [KWQTextField setHasFocus:] + 0xe8
3206 Added more nil checks to the widget implementations. Anywhere a widget pointer is used, do a nil check,
3207 rather than relying on high level assumptions about which calls can and can't destroy the HTML element
3208 (and hence the widget). The case in the bug seems to be a case where scrolling destroyed the element.
3209 We can't be sure this fixes the bug, but we can be relatively sure we didn't introduce any new problems,
3210 because this just avoids nil-dereferencing.
3213 (-[KWQButton becomeFirstResponder]):
3214 (-[KWQButton nextKeyView]):
3215 (-[KWQButton previousKeyView]):
3216 * kwq/KWQListBox.mm:
3217 (-[KWQTableView mouseDown:]):
3218 (-[KWQTableView becomeFirstResponder]):
3219 (-[KWQTableView numberOfRowsInTableView:]):
3220 (-[KWQTableView tableViewSelectionDidChange:]):
3221 (-[KWQTableView tableView:shouldSelectRow:]):
3222 (-[KWQTableView selectionShouldChangeInTableView:]):
3223 * kwq/KWQScrollBar.mm:
3224 (-[KWQScrollBar scroll:]):
3226 (-[KWQSlider mouseDown:]):
3227 (-[KWQSlider slide:]):
3228 (-[KWQSlider becomeFirstResponder]):
3229 (-[KWQSlider nextKeyView]):
3230 (-[KWQSlider previousKeyView]):
3231 * kwq/KWQTextArea.mm:
3232 (-[KWQTextAreaTextView becomeFirstResponder]):
3233 (-[KWQTextAreaTextView resignFirstResponder]):
3234 (-[KWQTextAreaTextView mouseDown:]):
3235 * kwq/KWQTextField.mm:
3236 (-[KWQTextFieldController action:]):
3237 (-[KWQTextFieldController controlTextDidEndEditing:]):
3238 (-[KWQTextFieldController controlTextDidChange:]):
3239 (-[KWQTextFieldController textView:didHandleEvent:]):
3240 (-[KWQTextFieldController setHasFocus:]):
3242 2005-03-02 Richard Williamson <rjw@apple.com>
3244 Fixed <rdar://problem/4031483> Leak (RenderObject::createInlineBox) reproducible with Stock widget
3246 We were leaking inline block line boxes. Argh!
3250 * khtml/rendering/render_flow.cpp:
3251 (RenderFlow::dirtyLineBoxes):
3252 * khtml/rendering/render_line.cpp:
3253 (khtml::InlineBox::deleteLine):
3255 2005-03-02 Chris Blumenberg <cblu@apple.com>
3257 Fixed: <rdar://problem/3976872> REGRESSION (Mail): Pasted plain text doesn't get the proper style if pasted into newlines
3259 Reviewed by kocienda.
3261 * khtml/editing/htmlediting.cpp:
3262 (khtml::EditCommand::styleAtPosition): new, factored out from calculateStyleBeforeInsertion
3263 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): call styleAtPosition
3264 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): clear new m_insertionStyle ivar
3265 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): deref new m_insertionStyle ivar
3266 (khtml::ReplaceSelectionCommand::doApply): store the style so it later be applied when matching style
3267 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply style from m_insertionStyle when matching style
3268 * khtml/editing/htmlediting.h:
3270 2005-03-02 Maciej Stachowiak <mjs@apple.com>
3274 <rdar://problem/4031718> REGRESSION (401-401+): Safari reproducible crash setting up scope in JSLazyEventListener::parseCode authenticating to bugweb
3276 * khtml/ecma/kjs_events.cpp:
3277 (JSLazyEventListener::parseCode): If originalNode is NULL, don't
3278 mess with the scope chain.
3280 * khtml/html/html_baseimpl.cpp:
3281 (HTMLBodyElementImpl::parseHTMLAttribute): For handlers that are
3282 delcared on body but set on the document, pass NULL to avoid
3283 swizzling the scope chain. It turns out that this is what browsers
3284 do, and it finesses the crash.
3286 2005-03-02 David Harrison <harrison@apple.com>
3290 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
3292 * khtml/editing/htmlediting.cpp:
3293 (khtml::ReplaceSelectionCommand::doApply):
3295 2005-03-02 Ken Kocienda <kocienda@apple.com>
3300 <rdar://problem/4020574> REGRESSION (Mail): copy/paste first part of reply-quoted text alters downstream style
3302 The problem was that the operation to move nodes following the newly-pasted nodes did not preserve the
3303 style of these moved nodes. I have generalized some of the functions that compute and preserve styles
3304 for nodes and then apply these styles after a DOM operation.
3306 * khtml/editing/htmlediting.cpp:
3307 (khtml::ReplacementFragment::~ReplacementFragment): Call new derefNodesAndStylesInMap() helper function
3308 in place of old code that had this deref'ing inline.
3309 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls new mapDesiredStyleForNode() helper
3310 function place of old code that had this style computation inline.
3311 (khtml::ReplacementFragment::removeStyleNodes): Updated comment for new helper name.
3312 (khtml::ReplaceSelectionCommand::doApply): Now calls new helpers in place of helpers whose names were changed,
3313 or in place of pre-refactored inline code.
3314 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Renamed from applyStyleToInsertedNodes(). Now generalized
3315 to take the map of nodes to use for the fixup. This makes it possible to call this code with different maps,
3316 and that is needed to fix the bug.
3317 (khtml::mapDesiredStyleForNode): New helper function to compute the inheritable styles for a given node
3318 and map this style to the given node in the given map. This function now also includes the code that was
3319 in the removeBlockquoteColorsIfNeeded(). This latter helper has now been removed.
3320 (khtml::derefNodesAndStylesInMap): Simple helper to deref map members.
3321 * khtml/editing/htmlediting.h:
3322 (khtml::ReplacementFragment::desiredStyles): New helper to return map of nodes-to-desiredStyles.
3324 2005-03-01 Ken Kocienda <kocienda@apple.com>
3330 <rdar://problem/4011358> REGRESSION(Mail): after dragging&nbs