1 2005-05-09 Adele Peterson <adele@apple.com>
3 fix for <rdar://problem/4110775> Crash will occur when double-clicking outerHTML link on W3 DOM test
7 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::setOuterHTML): added nil check.
8 This was causing a crash when you tried to set the outerHTML on an element that was no longer in the DOM tree.
10 * layout-tests/fast/dom/outerText-no-element.html: Added. Tests case where you try to set outerText on an element no longer in the DOM tree.
11 * layout-tests/fast/dom/outerText-no-element-expected.txt: Added.
12 * layout-tests/fast/dynamic/outerHTML-doc.html: Added. Tests case where someone tries to set outerHTML on the document.
13 * layout-tests/fast/dynamic/outerHTML-doc-expected.txt: Added..
14 * layout-tests/fast/dynamic/outerHTML-no-element.html: Added. Tests case where you try to set outerHTML on an element no longer in the DOM tree.
15 * layout-tests/fast/dynamic/outerHTML-no-element-expected.txt: Added.
16 * layout-tests/fast/dynamic/outerHTML-img.html: moved images to resources directory
17 * layout-tests/fast/dynamic/resources/apple.gif: Added.
18 * layout-tests/fast/dynamic/resources/mozilla.gif: Added.
20 2005-05-09 Maciej Stachowiak <mjs@apple.com>
24 - remove code for DoNotStayInBlock variant of upstream/downstream and make
25 the methods take no parameters
27 * khtml/editing/htmlediting.cpp:
28 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream):
29 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
30 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange):
31 (khtml::ApplyStyleCommand::applyInlineStyle):
32 (khtml::ApplyStyleCommand::removeInlineStyle):
33 (khtml::ApplyStyleCommand::nodeFullySelected):
34 (khtml::ApplyStyleCommand::nodeFullyUnselected):
35 (khtml::DeleteSelectionCommand::initializePositionData):
36 (khtml::DeleteSelectionCommand::fixupWhitespace):
37 (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
38 (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
39 (khtml::InsertLineBreakCommand::doApply):
40 (khtml::InsertParagraphSeparatorCommand::doApply):
41 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
42 (khtml::InsertTextCommand::prepareForTextInsertion):
43 (khtml::InsertTextCommand::input):
44 (khtml::InsertTextCommand::insertSpace):
45 (khtml::ReplaceSelectionCommand::doApply):
46 * khtml/editing/selection.cpp:
47 (khtml::Selection::toRange):
48 (khtml::Selection::validate):
49 * khtml/editing/visible_position.cpp:
50 (khtml::VisiblePosition::previousVisiblePosition):
51 (khtml::VisiblePosition::nextVisiblePosition):
52 (khtml::VisiblePosition::downstreamDeepEquivalent):
53 (khtml::isFirstVisiblePositionInParagraph):
54 (khtml::isFirstVisiblePositionInBlock):
55 (khtml::isLastVisiblePositionInParagraph):
56 * khtml/xml/dom2_rangeimpl.cpp:
57 (DOM::RangeImpl::editingStartPosition):
58 * khtml/xml/dom_position.cpp:
60 (DOM::Position::upstream):
61 (DOM::Position::downstream):
62 (DOM::Position::leadingWhitespacePosition):
63 (DOM::Position::trailingWhitespacePosition):
64 * khtml/xml/dom_position.h:
65 * kwq/WebCoreBridge.mm:
66 (-[WebCoreBridge smartDeleteRangeForProposedRange:]):
68 2005-05-08 Maciej Stachowiak <mjs@apple.com>
70 Reviewed by Dave Harrison.
72 - remove remaining uses of upstream/downstream DoNotStayInBlock
74 * khtml/editing/htmlediting.cpp:
75 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
76 (khtml::ApplyStyleCommand::nodeFullySelected):
77 (khtml::ApplyStyleCommand::nodeFullyUnselected):
78 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
79 (khtml::InsertParagraphSeparatorCommand::doApply):
80 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
81 (khtml::InsertTextCommand::insertSpace):
82 (khtml::ReplaceSelectionCommand::doApply):
84 * khtml/editing/visible_position.cpp:
85 (khtml::enclosingBlockFlowElement): New helper function.
86 * khtml/editing/visible_position.h:
88 * khtml/editing/visible_units.cpp:
89 (khtml::inSameBlock): Check enclosing block flows instead of comparing
90 visible block starts. Two nested blocks may have the same visible start but
91 different visible ends, so the old check would give false positives.
93 2005-05-09 David Harrison <harrison@apple.com>
95 Add layout test for <rdar://problem/4110366>.
97 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-011-expected.txt: Added.
98 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-011.html: Added.
100 2005-05-09 Darin Adler <darin@apple.com>
102 - checked in a result for the Flash replacement test that Dave added
104 * layout-tests/fast/dynamic/flash-replacement-test-expected.txt: Added.
105 Hope it's right! If not, Dave can update it.
107 2005-05-09 Darin Adler <darin@apple.com>
109 * Makefile.am: Don't set up PBXIntermediatesDirectory explicitly;
110 Not needed to make builds work, spews undesirable error messages too.
112 * WebCore.pbproj/project.pbxproj: Remove unneeded $(DSTROOT) in framework paths.
114 2005-05-07 Maciej Stachowiak <mjs@apple.com>
118 - remove some of the uses of upstream/downstream DoNotStayInBlock
120 * khtml/editing/markup.cpp:
121 (khtml::createMarkup): Instead of using upstream to decide if a line break should be
122 added at the end, use inSameParagraph.
123 * khtml/editing/selection.cpp:
124 (khtml::Selection::debugPosition): Remove the code to print upstream and downstream,
125 the selection endpoints themselves are adequate for debugging and are what we use for
127 * khtml/xml/dom2_rangeimpl.cpp:
128 (DOM::RangeImpl::editingStartPosition): Skip a possible paragraph break at the start
129 of the selection in a more explicit way to avoid DoNotStayInBlock.
131 2005-05-07 David Harrison <harrison@apple.com>
135 <rdar://problem/4110366> Deleting text at the end of email moves insertion point to the top of the document
137 * khtml/editing/htmlediting.cpp:
138 (khtml::DeleteSelectionCommand::handleGeneralDelete):
139 Update m_upstreamStart when deleting m_downstreamEnd.node() if the former is no longer in the document.
140 Better to update here than trying to recover later in calculateEndingPosition().
142 2005-05-07 David Harrison <harrison@apple.com>
144 Remove workaround for <rdar://problem/4103339>.
146 * khtml/editing/htmlediting.cpp:
147 (khtml::DeleteSelectionCommand::initializePositionData):
149 2005-05-06 Maciej Stachowiak <mjs@apple.com>
151 Reviewed by Dave Harrison.
153 - make StayInBlock vs DoNotStayInBlock explicit in all calls to
154 upstream/downstream, in preparation for phasing out the
155 DoNotStayInBlock variant.
157 * khtml/editing/htmlediting.cpp:
158 (khtml::ApplyStyleCommand::nodeFullySelected):
159 (khtml::ApplyStyleCommand::nodeFullyUnselected):
160 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
161 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
162 (khtml::InsertTextCommand::insertSpace):
163 (khtml::ReplaceSelectionCommand::doApply):
164 * khtml/editing/markup.cpp:
165 (khtml::createMarkup):
166 * khtml/editing/selection.cpp:
167 (khtml::Selection::debugPosition):
168 * khtml/xml/dom_position.h:
170 2005-05-06 David Harrison <harrison@apple.com>
172 Reviewed by Maciej, Darin.
174 <rdar://problem/4103339> VisiblePosition and PositionIterator iterators do not return positions in order
176 * WebCore.pbproj/project.pbxproj:
177 Removed dom_positioniterator.h and dom_positioniterator.cpp.
179 * khtml/editing/htmlediting.cpp:
180 Removed unused include of dom_positioniterator.h and "using" of PositionIterator.
182 * khtml/editing/selection.cpp:
183 Removed unused include of dom_positioniterator.h.
185 * khtml/editing/visible_position.h:
186 * khtml/editing/visible_position.cpp:
187 (khtml::VisiblePosition::previousVisiblePosition):
188 (khtml::VisiblePosition::nextVisiblePosition):
189 (khtml::VisiblePosition::downstreamDeepEquivalent):
190 Use Position::next(), Position::previous(), Position::atStart(), Position::atEnd() instead of duplicated code.
192 * khtml/xml/dom_nodeimpl.h:
193 * khtml/xml/dom_nodeimpl.cpp:
194 (NodeImpl::maxDeepOffset):
195 Added to support Position::next(), Position::previous(), Position::atStart(), Position::atEnd()
197 * khtml/xml/dom_position.h:
198 * khtml/xml/dom_position.cpp:
199 (DOM::Position::previous):
200 (DOM::Position::next):
201 (DOM::Position::atStart):
202 (DOM::Position::atEnd):
203 Moved here, replacing VisiblePosition's duplicate and PositionIterator. Fixed to
204 return positions in order and not skip positions.
206 (DOM::Position::previousCharacterPosition):
207 (DOM::Position::nextCharacterPosition):
208 Use Position::next(), Position::previous(), Position::atStart(), Position::atEnd() instead of PositionIterator.
211 (DOM::Position::upstream):
212 (DOM::Position::downstream):
213 Use Position::next(), Position::previous(), Position::atStart(), Position::atEnd() instead of PositionIterator.
215 * khtml/xml/dom_positioniterator.cpp: Removed.
216 * khtml/xml/dom_positioniterator.h: Removed.
217 Removed in favor of Position::next(), Position::previous(), Position::atStart(), Position::atEnd()
219 2005-05-05 Maciej Stachowiak <mjs@apple.com>
223 <rdar://problem/4058167> Unit Converter and Weather widgets crashed in KJS::Collector::markCurrentThreadConservatively
225 Avoid possibly allocating new prototype objects as parameters to
226 superclass constructors - there may be an allocated but
227 uninitilized object so this is a bad time to allocate. Instead,
228 set the prototype in the constructor body, since the object is
229 happily allocated by then.
231 * khtml/ecma/kjs_binding.h:
232 * khtml/ecma/kjs_css.cpp:
233 (DOMCSSStyleDeclaration::DOMCSSStyleDeclaration):
234 (DOMMediaList::DOMMediaList):
235 (DOMCSSStyleSheet::DOMCSSStyleSheet):
236 (DOMCSSPrimitiveValue::DOMCSSPrimitiveValue):
237 (DOMCSSValueList::DOMCSSValueList):
238 * khtml/ecma/kjs_css.h:
239 (KJS::DOMStyleSheet::DOMStyleSheet):
240 (KJS::DOMCSSValue::DOMCSSValue):
241 * khtml/ecma/kjs_dom.cpp:
243 (DOMDocument::DOMDocument):
244 (DOMElement::DOMElement):
245 (DOMDOMImplementation::DOMDOMImplementation):
246 (DOMNamedNodeMap::DOMNamedNodeMap):
247 (DOMNamedNodesCollection::DOMNamedNodesCollection):
248 (DOMCharacterData::DOMCharacterData):
250 * khtml/ecma/kjs_dom.h:
251 (KJS::NodeConstructor::NodeConstructor):
252 (KJS::DOMExceptionConstructor::DOMExceptionConstructor):
253 * khtml/ecma/kjs_events.cpp:
254 (DOMEvent::DOMEvent):
255 (Clipboard::Clipboard):
256 * khtml/ecma/kjs_html.cpp:
257 (HTMLCollection::HTMLCollection):
258 * khtml/ecma/kjs_range.cpp:
259 (DOMRange::DOMRange):
260 * khtml/ecma/kjs_traversal.cpp:
261 (DOMNodeIterator::DOMNodeIterator):
262 (DOMNodeFilter::DOMNodeFilter):
263 (DOMTreeWalker::DOMTreeWalker):
264 * khtml/ecma/xmlhttprequest.cpp:
265 (KJS::XMLHttpRequest::XMLHttpRequest):
266 * khtml/ecma/xmlserializer.cpp:
267 (KJS::XMLSerializer::XMLSerializer):
269 2005-05-06 Darin Adler <darin@apple.com>
273 - make building multiple trees with make work better
275 * Makefile.am: Set up Xcode build directory before invoking xcodebuild.
277 2005-05-05 David Hyatt <hyatt@apple.com>
279 Eliminate the FOUCS on wired.com. innerWidth and innerHeight on window should not do a layout that ignores
280 pending stylesheets, since even if stylesheets are loading the correct window dimensions can be determined with
283 The radar # is 4109888.
287 * khtml/ecma/kjs_window.cpp:
289 (Window::updateLayout):
290 * khtml/ecma/kjs_window.h:
292 2005-05-05 David Hyatt <hyatt@apple.com>
294 Fix for 4109667, sIFR flash replacement technique often malfunctions. This bug occurs when the plugin
295 widget update causes the onload for the document to fire. Because you can be in the middle of a style
296 recalc when doing an attach (in response to a stylesheet load), the onload fires in the middle of the attach
297 process when the tree is in a bogus state.
299 The fix is to add a bit to the document that tells style recalc that the implicitClose() method was invoked
300 during the style recalc process and the code has been patched so that when this situation occurs, the close is
301 deferred until after the style recalc has finished.
303 Reviewed by John Sullivan
305 * khtml/xml/dom_docimpl.cpp:
306 (DocumentImpl::DocumentImpl):
307 (DocumentImpl::recalcStyle):
308 (DocumentImpl::implicitClose):
309 * khtml/xml/dom_docimpl.h:
310 * layout-tests/fast/dynamic/flash-replacement-test.html: Added.
312 2005-05-05 Darin Adler <darin@apple.com>
314 Reviewed by Dave Hyatt.
316 - fixed <rdar://problem/4109564> REGRESSION (Atlanta): maps.google.com doesn't always center California correctly
318 * khtml/ecma/kjs_events.cpp: (offsetFromTarget): Fix two places that said X where they should say Y.
320 2005-05-05 David Harrison <harrison@apple.com>
322 Restore fixed setEndingSelection. Fixed method was ifdef'd out
323 because change was at end of Tiger development, but method is
324 unused. You just can never be _too_ safe.
326 * khtml/editing/htmlediting.cpp:
327 (khtml::EditCommandPtr::setEndingSelection):
329 2005-05-02 Maciej Stachowiak <mjs@apple.com>
333 - renamed NodeBaseImpl to ContainerNodeImpl
335 * khtml/ecma/kjs_dom.cpp:
336 (DOMNodeProtoFunc::tryCall): Avoid use of NodeBaseImpl and avoid
337 use of obsolete checkNoOwner call, use isAncestor instead.
338 * khtml/html/html_elementimpl.cpp:
339 (HTMLElementImpl::setOuterText): Avoid gratuitous use of
341 * khtml/xml/dom_nodeimpl.cpp:
342 (NodeBaseImpl::checkNoOwner): Removed.
344 Ther rest is all just simple renaming.
346 * khtml/xml/dom_docimpl.cpp:
347 (DocumentImpl::DocumentImpl):
348 (DocumentImpl::attach):
349 (DocumentImpl::detach):
350 (DocumentFragmentImpl::DocumentFragmentImpl):
351 * khtml/xml/dom_docimpl.h:
352 * khtml/xml/dom_elementimpl.cpp:
353 (AttrImpl::AttrImpl):
354 (ElementImpl::ElementImpl):
355 (ElementImpl::insertedIntoDocument):
356 (ElementImpl::removedFromDocument):
357 (ElementImpl::attach):
359 * khtml/xml/dom_elementimpl.h:
360 * khtml/xml/dom_nodeimpl.cpp:
361 (ContainerNodeImpl::ContainerNodeImpl):
362 (ContainerNodeImpl::~ContainerNodeImpl):
363 (ContainerNodeImpl::firstChild):
364 (ContainerNodeImpl::lastChild):
365 (ContainerNodeImpl::insertBefore):
366 (ContainerNodeImpl::replaceChild):
367 (ContainerNodeImpl::removeChild):
368 (ContainerNodeImpl::removeChildren):
369 (ContainerNodeImpl::appendChild):
370 (ContainerNodeImpl::hasChildNodes):
371 (ContainerNodeImpl::setFirstChild):
372 (ContainerNodeImpl::setLastChild):
373 (ContainerNodeImpl::checkSameDocument):
374 (ContainerNodeImpl::checkIsChild):
375 (ContainerNodeImpl::addChild):
376 (ContainerNodeImpl::attach):
377 (ContainerNodeImpl::detach):
378 (ContainerNodeImpl::insertedIntoDocument):
379 (ContainerNodeImpl::removedFromDocument):
380 (ContainerNodeImpl::cloneChildNodes):
381 (ContainerNodeImpl::getElementsByTagNameNS):
382 (ContainerNodeImpl::getUpperLeftCorner):
383 (ContainerNodeImpl::getLowerRightCorner):
384 (ContainerNodeImpl::getRect):
385 (ContainerNodeImpl::setFocus):
386 (ContainerNodeImpl::setActive):
387 (ContainerNodeImpl::childNodeCount):
388 (ContainerNodeImpl::childNode):
389 (ContainerNodeImpl::dispatchChildInsertedEvents):
390 (ContainerNodeImpl::dispatchChildRemovalEvents):
391 * khtml/xml/dom_nodeimpl.h:
392 * khtml/xml/dom_xmlimpl.cpp:
393 (DOM::EntityImpl::EntityImpl):
394 (DOM::EntityReferenceImpl::EntityReferenceImpl):
395 (DOM::NotationImpl::NotationImpl):
396 (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
397 * khtml/xml/dom_xmlimpl.h:
399 2005-05-04 Vicki Murley <vicki@apple.com>
403 - fix mismatched parentheses in one of the ifdefs
405 * khtml/html/html_headimpl.cpp:
406 (HTMLTitleElementImpl::childrenChanged):
408 2005-05-04 Darin Adler <darin@apple.com>
410 Reviewed by Dave Hyatt.
412 - fixed build rules to match other projects
414 * WebCore.pbproj/project.pbxproj: Set deployment target to 10.3 in the build styles.
415 When built without a build style (by Apple B&I) we want to get the target from the
416 environment. But when built with a build style (by Safari engineers and others), we want
419 * Makefile.am: Took out extra parameters that make command-line building different from
420 Xcode building. Now that this is fixed, you should not get a full rebuild if you switch
421 from command line to Xcode or back.
423 2005-05-04 Vicki Murley <vicki@apple.com>
427 - fixed <rdar://problem/3986228> Not able to load additional script blocks dynamically
429 Run scripts when they're inserted into the document. Use createdByParser bit to make sure
430 that scripts aren't run twice, once while parsing and again when inserting.
432 * khtml/html/html_headimpl.cpp:
433 (HTMLScriptElementImpl::HTMLScriptElementImpl):
434 (HTMLScriptElementImpl::~HTMLScriptElementImpl):
435 (HTMLScriptElementImpl::insertedIntoDocument):
436 (HTMLScriptElementImpl::removedFromDocument):
437 (HTMLScriptElementImpl::notifyFinished):
438 * khtml/html/html_headimpl.h:
439 (DOM::HTMLScriptElementImpl::setCreatedByParser):
440 * khtml/html/htmlparser.cpp:
441 (KHTMLParser::getElement):
442 * khtml/xml/xml_tokenizer.cpp:
443 (khtml::XMLTokenizer::startElement):
445 2005-05-03 David Hyatt <hyatt@apple.com>
447 Normalize all our custom properties in our implementation to be -khtml (remove all the -apple).
449 Make sure that -apple, -khtml, and -moz are all able to be used. -apple and -moz just map to -khtml.
451 Add support for automatically converting -khtml-opacity to opacity (for legacy Safari 1.1 compat).
455 * khtml/css/css_computedstyle.cpp:
457 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
458 * khtml/css/cssparser.cpp:
459 (CSSParser::parseValue):
460 * khtml/css/cssproperties.in:
461 * khtml/css/cssstyleselector.cpp:
462 (khtml::CSSStyleSelector::applyDeclarations):
463 (khtml::CSSStyleSelector::applyProperty):
464 * khtml/css/parser.y:
465 * khtml/ecma/kjs_css.cpp:
468 2005-05-03 Darin Adler <darin@apple.com>
472 * WebCore.pbproj/project.pbxproj: Fix some SYMROOTS that should have been SYMROOT.
474 2005-05-03 David Hyatt <hyatt@apple.com>
476 Fix for 4098281, news.com missing a bunch of content. Make sure not to apply strict SGML parsing
477 when stripping comments out of scripts.
479 New test is comments-in-script.html
481 * khtml/html/htmltokenizer.cpp:
482 (khtml::HTMLTokenizer::parseComment):
484 2005-05-03 David Hyatt <hyatt@apple.com>
486 Remove unused notification to avoid ERROR messages spewing on the acid2 test.
490 * khtml/khtml_part.cpp:
491 (KHTMLPart::processObjectRequest):
492 * khtml/rendering/render_frames.cpp:
493 (RenderPartObject::updateWidget):
494 * khtml/rendering/render_frames.h:
496 2005-05-03 Darin Adler <darin@apple.com>
498 Reviewed by Dave Hyatt.
499 No new layout tests needed.
501 - eliminated the bogus kMin/kMax macros that we had in addition to inline functions
504 * kwq/KWQKGlobal.h: Remove the kMin/kMax macros.
506 * khtml/css/cssstyleselector.cpp:
507 (khtml::CSSStyleSelector::applyProperty): Change type of constant so both sides
509 (khtml::CSSStyleSelector::fontSizeForKeyword): Ditto.
510 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseEntity): Ditto.
512 - remove unused parameter to dirtyLinesFromChangedChild for clarity
514 * khtml/rendering/render_object.h: Don't take the parameter.
515 * khtml/rendering/render_object.cpp: (RenderObject::dirtyLinesFromChangedChild): Ditto.
517 * khtml/rendering/render_flow.h: Don't take the parameter.
518 * khtml/rendering/render_flow.cpp:
519 (RenderFlow::detach): Don't pass the parameter.
520 (RenderFlow::dirtyLinesFromChangedChild): Don't take the parameter.
522 * khtml/rendering/render_text.cpp: (RenderText::detach): Don't pass the parameter.
524 - convert DOM::NodeImpl into an abstract base class by making a couple of functions
525 pure virtual for clarity
527 * khtml/xml/dom_nodeimpl.h: Made nodeName and nodeType pure virtual.
528 * khtml/xml/dom_nodeimpl.cpp: Remove bodies of nodeName and nodeType.
530 2005-05-03 David Hyatt <hyatt@apple.com>
532 Fix for object element to support fallback content. WIth this change Safari passes the Acid2 test.
536 * khtml/css/html4.css:
537 * khtml/html/html_objectimpl.cpp:
538 (HTMLObjectElementImpl::HTMLObjectElementImpl):
539 (HTMLObjectElementImpl::parseHTMLAttribute):
540 (HTMLObjectElementImpl::rendererIsNeeded):
541 (HTMLObjectElementImpl::createRenderer):
542 (HTMLObjectElementImpl::attach):
543 (HTMLObjectElementImpl::detach):
544 (HTMLObjectElementImpl::recalcStyle):
545 (HTMLObjectElementImpl::childrenChanged):
546 (HTMLObjectElementImpl::isURLAttribute):
547 (HTMLObjectElementImpl::isImageType):
548 (HTMLObjectElementImpl::renderFallbackContent):
549 * khtml/html/html_objectimpl.h:
550 * khtml/khtml_part.cpp:
551 (KHTMLPart::requestObject):
552 (KHTMLPart::selectFrameElementInParentIfFullySelected):
553 (KHTMLPart::handleFallbackContent):
554 * khtml/khtml_part.h:
555 * khtml/khtmlpart_p.h:
556 (khtml::ChildFrame::ChildFrame):
557 * khtml/rendering/render_frames.cpp:
558 (RenderPartObject::RenderPartObject):
559 (RenderPartObject::updateWidget):
560 * khtml/rendering/render_frames.h:
561 (khtml::RenderPart::hasFallbackContent):
562 * khtml/rendering/render_replaced.cpp:
563 (RenderReplaced::RenderReplaced):
564 * kwq/KWQKHTMLPart.mm:
565 (KWQKHTMLPart::createPart):
566 * kwq/WebCoreBridge.h:
567 * kwq/WebCoreBridge.mm:
568 (-[WebCoreBridge mainResourceError]):
570 2005-05-01 Darin Adler <darin@apple.com>
572 - move to Xcode native targets and stop checking in generated files
574 * WebCore.pbproj/project.pbxproj: Updated to use native targets and generate all the generated
575 files, so we don't have to check them in any more.
576 * Info.plist: Added. Native targets use a separate file for this.
578 * Makefile.am: Removed rule to generate WebCore-combined.exp since this is now handled by the
579 Xcode project. Removed the code to remove the embedded copy of the framework since we don't
580 do that any more. Removed timestamp cleaning rules since we don't use those any more.
582 * WebCore-tests.exp: Removed symbols that aren't really needed. The native target gives an
583 error when you mention a nonexistent symbol, so we can't have them any more.
585 * khtml/css/parser_wrapper.cpp: Added. Shell used to compile parser.cpp since we can't add
586 a generated file easily to the list of files to be compiled.
588 * .cvsignore: Removed various timestamp files.
590 * WebCore-combined.exp: Removed.
591 * force-clean-timestamp: Removed.
592 * force-js-clean-timestamp: Removed.
593 * khtml/.cvsignore: Removed.
594 * khtml/Makefile.am: Removed.
595 * khtml/css/.cvsignore: Removed.
596 * khtml/css/Makefile.am: Removed.
597 * khtml/css/cssproperties.c: Removed.
598 * khtml/css/cssproperties.h: Removed.
599 * khtml/css/cssvalues.c: Removed.
600 * khtml/css/cssvalues.h: Removed.
601 * khtml/css/parser.cpp: Removed.
602 * khtml/css/parser.h: Removed.
603 * khtml/css/tokenizer.cpp: Removed.
604 * khtml/ecma/.cvsignore: Removed.
605 * khtml/ecma/Makefile.am: Removed.
606 * khtml/ecma/kjs_css.lut.h: Removed.
607 * khtml/ecma/kjs_dom.lut.h: Removed.
608 * khtml/ecma/kjs_events.lut.h: Removed.
609 * khtml/ecma/kjs_html.lut.h: Removed.
610 * khtml/ecma/kjs_navigator.lut.h: Removed.
611 * khtml/ecma/kjs_range.lut.h: Removed.
612 * khtml/ecma/kjs_traversal.lut.h: Removed.
613 * khtml/ecma/kjs_views.lut.h: Removed.
614 * khtml/ecma/kjs_window.lut.h: Removed.
615 * khtml/ecma/xmlhttprequest.lut.h: Removed.
616 * khtml/ecma/xmlserializer.lut.h: Removed.
617 * khtml/html/.cvsignore: Removed.
618 * khtml/html/Makefile.am: Removed.
619 * khtml/html/doctypes.cpp: Removed.
620 * khtml/html/kentities.c: Removed.
621 * khtml/misc/.cvsignore: Removed.
622 * khtml/misc/Makefile.am: Removed.
623 * khtml/misc/htmlattrs.c: Removed.
624 * khtml/misc/htmlattrs.h: Removed.
625 * khtml/misc/htmltags.c: Removed.
626 * khtml/misc/htmltags.h: Removed.
627 * kwq/.cvsignore: Removed.
628 * kwq/KWQCharsetData.c: Removed.
629 * kwq/KWQColorData.c: Removed.
630 * kwq/Makefile.am: Removed.
632 2005-05-02 Darin Adler <darin@apple.com>
635 Added two layout tests for regression testing.
637 - redid frameElement (fix for 4091082 below)
639 The first version lacked a security check, and was also broken.
641 * khtml/ecma/kjs_window.cpp:
642 (frameElement): Refactored into separate function; added isSafeScript check.
643 (Window::get): Call the new frameElement function.
645 * layout-tests/fast/frames/frameElement-frame.html: Added.
646 * layout-tests/fast/frames/frameElement-frame-expected.txt: Added.
647 * layout-tests/fast/frames/frameElement-iframe.html: Added.
648 * layout-tests/fast/frames/frameElement-iframe-expected.txt: Added.
649 * layout-tests/fast/frames/resources/frameElement-contents.html: Added.
651 2005-05-02 David Harrison <harrison@apple.com>
655 Fix isStartOfEditableContent and isEndOfEditableContent to return actual, rather than inverted, answers.
656 No Radar. Found this when trying to use isEndOfEditableContent() in some new code.
658 * khtml/editing/visible_units.cpp:
659 (khtml::isStartOfEditableContent):
660 (khtml::isEndOfEditableContent):
663 2005-04-29 Darin Adler <darin@apple.com>
665 Reviewed by David Harrison.
667 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Turn newlines into \n for better dumping.
669 2005-04-29 David Harrison <harrison@apple.com>
673 <rdar://problem/4083333> When deleting link at end of sentence, entire sentence gets deleted
675 * khtml/editing/htmlediting.cpp:
676 (khtml::DeleteSelectionCommand::initializePositionData):
677 Work around bug #4103339 (whose real fix is somewhat risky), so this fix can get into a software update.
679 (khtml::DeleteSelectionCommand::handleGeneralDelete):
680 Add isAncestor check when comparing m_downstreamEnd.node() and m_startNode.
682 * layout-tests/editing/deleting/delete-4083333-fix-expected.txt: Added.
683 * layout-tests/editing/deleting/delete-4083333-fix.html: Added.
685 2005-04-29 Darin Adler <darin@apple.com>
687 Reviewed by Dave Harrison.
689 - changed layout tests to dump more minimal information about caret and selection
691 * kwq/KWQRenderTreeDebug.cpp:
692 (nodePosition): Changed name; now does position relative to document.
693 (writeSelection): Removed upstream/downstream code and changed format slightly.
695 * layout-tests/editing/*-expected.txt: Regenerated in new format.
697 2005-04-29 Darin Adler <darin@apple.com>
699 Reviewed by Chris Blumenberg.
700 Added two layout tests for regression testing.
702 - fixed <rdar://problem/4097849> REGRESSION (162-163): importNode creates non-HTML elements, thus style attributes (and some others) don't work
704 * khtml/xml/dom_docimpl.cpp:
705 (DocumentImpl::importNode): Reorganized and partly rewrote this. The change that fixes the bug at
706 hand is to explicitly use XHTML_NAMESPACE for HTML elements, since the old way of getting the namespace
707 will return the null string for HTML elements, and createElementNS will not create an HTML element
708 if passed a null string for the namespace.
709 (DocumentImpl::processHttpEquiv): Removed some bogus getDocument() calls -- no need to call getDocument()
710 in a document object.
711 (DocumentImpl::attrName): Ditto.
712 (DocumentImpl::tagName): Ditto.
713 (DocumentImpl::setFocusNode): Ditto.
715 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::cloneNode): Moved the actual cloning here
716 from ElementImpl::cloneNode, because XMLElementImpl already had its own version, and in here
717 we can use createHTMLElement, which will work properly even in an XML document, and is also slightly
720 * khtml/xml/dom_nodeimpl.h: Added a namespaceURI method function to go along with localName.
721 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::namespaceURI): Added. Returns null string to be consistent
722 with localName (only works on certain types of elements as documented).
723 * khtml/xml/dom_elementimpl.h: Removed ElementImpl::cloneNode (see above). Added an override of
724 namespaceURI for XMLElementImpl.
725 * khtml/xml/dom_elementimpl.cpp: (XMLElementImpl::namespaceURI): Added. Returns the namespace
726 (consistent with localName).
728 * layout-tests/fast/dom/importNodeHTML.html: Added. Tests both importNode and cloneNode (for comparison).
729 * layout-tests/fast/dom/importNodeHTML-expected.txt: Added.
730 * layout-tests/fast/dom/importNodeXML.xhtml: Added. XML version of the same test as above. Tests a different
731 code path, so useful to have.
732 * layout-tests/fast/dom/importNodeXML-expected.txt: Added.
734 2005-04-28 Darin Adler <darin@apple.com>
736 Reviewed by Dave Harrison.
738 - fixed problems preventing us from compiling with gcc 4.0
740 * WebCore.pbproj/project.pbxproj: Removed -fobjc-exceptions because I can't figure out an easy
741 way to pass it only when compiling Objective-C/C++. Removed -Wmissing-prototypes from
742 WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
744 * khtml/css/parser.y: Changed some rules that were using a float to pass around an enum to use an
745 int instead to avoid a warning.
746 * khtml/css/parser.cpp: Regenerated.
747 * khtml/css/parser.h: Regenerated.
749 * khtml/ecma/kjs_dom.cpp: (DOMTextProtoFunc::tryCall): Rearranged a return statement to avoid an incorrect
751 * khtml/ecma/kjs_html.cpp: (KJS::Context2DFunction::tryCall): Initialized a couple of variables to avoid
752 an incorrect warning.
753 * khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::evaluate): Rearranged how we exit from the function to avoid
755 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Changed some %d to %ld where the
756 parameters where long ints.
757 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
758 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
759 * kwq/DOMEvents.mm: (-[DOMMouseEvent initMouseEvent:::::::::::::::]): Rearranged code to avoid a cast
760 that was causing an incorrect warning.
762 (createObjCDOMNode): Broke out as a separate function.
763 (KJS::ScriptInterpreter::createObjcInstanceForValue): Rearranged code to avoid a namespace collision with
764 KJS::DOMNode and the Objective-C DOMNode class.
765 * kwq/KWQFileButton.mm: Made fields of KWQFileButtonAdapter public to avoid an error, new to gcc 4.0,
766 about accessing protected Objective-C fields.
767 * kwq/KWQKHTMLPart.mm:
768 (KWQKHTMLPart::matchLabelsAgainstElement): Rearranged a return statement to avoid an incorrect warning.
769 (KWQKHTMLPart::imageFromRect): Rearranged how this function does its exception handling to avoid a
770 "may be clobbered" warning.
771 * kwq/KWQKJavaAppletWidget.mm: Fixed incorrect import that said "KHTMLView.h" instead of "khtmlview.h".
772 * kwq/KWQObject.mm: Made fields of KWQObjectTimerTarget public to avoid an error, new to gcc 4.0,
773 about accessing protected Objective-C fields.
774 * kwq/WebCoreBridge.mm: (partHasSelection): Used [bridge part] instead of getting directly at instance
775 variable to avoid an error, new to gcc 4.0, about accessing protected Objective-C fields.
777 * WebCore-combined.exp: Regenerated.
778 * WebCore-tests.exp: Added some additional symbols needed by the tests under gcc 4.0.
780 2005-04-28 Darin Adler <darin@apple.com>
782 * WebCore.pbproj/project.pbxproj: Add back the main_thread_malloc files, rolled out by accident.
784 2005-04-27 Adele Peterson <adele@apple.com>
786 Rolling out fix for <rdar://problem/4097849> because the following layout tests were failing:
788 fast/css/namespaces/001
789 fast/css/namespaces/002
790 fast/css/namespaces/004
791 fast/css/namespaces/005
792 fast/css/namespaces/006
796 * khtml/html/html_documentimpl.cpp:
797 * khtml/html/html_documentimpl.h:
798 * khtml/html/html_elementimpl.cpp:
799 (HTMLElementImpl::namespaceURI):
800 * khtml/xml/dom_docimpl.cpp:
801 (DocumentImpl::importNode):
802 (DocumentImpl::createElementNS):
803 (DocumentImpl::createHTMLElement):
804 (DocumentImpl::attrId):
805 (DocumentImpl::tagId):
806 * khtml/xml/dom_docimpl.h:
808 2005-04-27 John Sullivan <sullivan@apple.com>
812 Experimental prototype of user-resizable textareas. All the new code is guarded by
813 #if ALLOW_RESIZING_TEXTAREAS, which is false unless you remove a comment and rebuild.
815 This code allows you to press near the bottom-right corner of any textarea and drag
816 to resize the textarea on the page. It works correctly with textareas in left-aligned
817 or centered blocks, but is weird in right-aligned blocks. It also does something
818 sensible if the width is specified as a % (in that case, you can resize vertically only).
819 The user-created-size survives resizing the window and survives the back/forward cache.
820 It does not survive reloading the page.
822 This complete-lack-of-affordance UI is obviously not shippable, but this proof of concept
823 code could lead to a real user feature.
825 * kwq/KWQTextArea.mm:
826 (-[KWQTextArea getNumColumns:andNumRows:forSize:]):
827 new method that determines cols and rows for a given textarea frame size
828 (-[KWQTextAreaTextView _trackResizeFromMouseDown:]):
829 new method that tracks a drag and does a live resize-and-relayout
830 (-[KWQTextAreaTextView mouseDown:]):
831 if the mouse down is in the bottom-right corner, call _trackResizeFromMouseDown:
833 2005-04-27 John Sullivan <sullivan@apple.com>
837 - fixed problem with mouse wheel patch where alt and shift keys were switched
839 * khtml/xml/dom2_eventsimpl.h:
840 use the order cntl, alt, shift, meta in KeyboardEventImpl constructors to match
841 superclass. This isn't necessary to fix the bug, but is better for clarity.
843 * khtml/xml/dom2_eventsimpl.cpp:
844 (KeyboardEventImpl::KeyboardEventImpl):
845 switch parameter order to match superclass. Then pass the parameters to superclass's
846 constructor in the right order.
847 (KeyboardEventImpl::initKeyboardEvent):
848 Pass parameters to superclass's constructor in the right order.
850 2005-04-26 Adele Peterson <adele@apple.com>
852 Fixed by Darin, reviewed by me.
854 Fix for <rdar://problem/4084029> designMode doesn't allow editing when iframe src = "" or = about:blank
856 This change will add an HTML element for empty documents. Now that there will be an HTMLDocument in this case,
857 a body will also be created (see rdar://problem/3758785). This was preventing frames with empty documents from
860 * khtml/html/htmlparser.cpp: (KHTMLParser::finished):
862 Updated these tests to expect the HTML and BODY elements
863 * layout-tests/fast/flexbox/016-expected.txt:
864 * layout-tests/fast/frames/001-expected.txt:
865 * layout-tests/fast/frames/002-expected.txt:
866 * layout-tests/fast/frames/contentWindow_Frame-expected.txt:
867 * layout-tests/fast/frames/contentWindow_iFrame-expected.txt:
868 * layout-tests/fast/frames/empty-frame-src-expected.txt:
870 2005-04-26 Maciej Stachowiak <mjs@apple.com>
872 New test case for <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
874 * layout-tests/fast/js/string-from-char-code-expected.txt: Added.
875 * layout-tests/fast/js/string-from-char-code.html: Added.
877 2005-04-26 Darin Adler <darin@apple.com>
881 - fixed <rdar://problem/3655817> please add support for mouse wheel events and the onmousewheel handler
885 - need to test behavior of Windows IE with horizontal scroll wheeling; we currently send a distinct event
886 for that relatively obscure case, which means the event handlers won't fire at all; might be incorrect
887 - overflow scrolling is done after all DOM event handling, but ideally should be done in the overflowing
888 element's default event handler; not important in practice
889 - frame scrolling is done after all DOM event handling, but probably should be done in a default event handler;
890 not sure about this, but it's probably not important in practice and definitely not required
894 * khtml/ecma/kjs_events.h: Added DOMWheelEvent.
895 * khtml/ecma/kjs_events.cpp:
896 (KJS::getDOMEvent): Added a case for wheel event. To be forward looking, I use the event's impl pointer
897 instead of a C++ DOM wrapper. Eventually it will all work this way.
898 (offsetFromTarget): Added. Factored out code to compute offsetX/Y for an event.
899 (DOMMouseEvent::getValueProperty): Changed to call offsetFromTarget for offsetX/Y.
900 (DOMWheelEvent::DOMWheelEvent): Added.
901 (DOMWheelEvent::tryGet): Added.
902 (DOMWheelEvent::getValueProperty): Added.
903 (DOMWheelEventProtoFunc::tryCall): Added. Nothing at the moment, but might get contents later.
905 * khtml/ecma/kjs_dom.h: Added OnMouseWheel to the enum with the list of properties.
906 * khtml/ecma/kjs_dom.cpp: Added onmousewheel as a property of DOM nodes.
907 (DOMNode::getValueProperty): Return the mouse wheel event handler.
908 (DOMNode::putValue): Set the mouse wheel event handler.
910 * khtml/ecma/kjs_window.cpp: Added onmousewheel as a property of the window.
911 (Window::get): Return the mouse wheel event handler.
912 (Window::put): Set the mouse wheel event handler.
914 * khtml/ecma/kjs_window.h: Added OnWindowMouseWheel to the enum with the list of properties.
915 (Other properties distinguish the window handler by lower-casing the initial letter, way too subtle,
916 so I did this one a good way.)
918 * khtml/dom/dom2_events.h: Made the constructors for Event and UIEvent public. There's no good reason
919 for them to be private, and I had to use the UIEvent one in the JavaScript implementation.
923 * khtml/xml/dom2_eventsimpl.h: Added events for mouse wheel and horizontal mouse wheel.
924 Added isWheelEvent function to EventImpl.
925 (DOM::UIEventWithKeyStateImpl): Added. Base class shared by mouse, wheel, and keyboard events.
926 (DOM::MouseRelatedEventImpl): Added. Base class shared by mouse and wheel events.
927 (DOM::WheelEventImpl): Added.
929 * khtml/xml/dom2_eventsimpl.cpp: Added "mousewheel" to list of event names and a placeholder for
930 the horizontal mouse wheel.
931 (EventImpl::isWheelEvent): Added. Returns false.
932 (MouseRelatedEventImpl::MouseRelatedEventImpl): Added. Factored out what's shared between mouse
933 events and wheel events to avoid duplicated code.
934 (MouseRelatedEventImpl::computeLayerPos): Moved to MouseRelatedWheelEventImpl.
935 (MouseEventImpl::MouseEventImpl): Changed since MouseRelatedWheelEventImpl is now the base class
936 so we can share more code with wheel events.
937 (KeyboardEventImpl::KeyboardEventImpl): Changed since UIEventWithKeyStateImpl is now the base class
938 so we can share more code with mouse and wheel events.
939 (WheelEventImpl::WheelEventImpl): Added.
940 (WheelEventImpl::isWheelEvent): Added. Returns true.
942 * khtml/misc/htmlattrs.in: Added "onmousewheel" attribute name.
943 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Added parsing of the
944 "onmousewheel" atribute, consistent with other event handler attributes.
948 * kwq/WebCoreBridge.h: Renamed scrollOverflowWithScrollWheelEvent to sendScrollWheelEvent.
949 * kwq/WebCoreBridge.mm: (-[WebCoreBridge sendScrollWheelEvent:]): Renamed.
951 * kwq/KWQEvent.h: Added Wheel as an event type value.
952 (QWheelEvent::QWheelEvent): Added.
954 (positionForEvent): Updated to know that wheel events have valid positions in them.
955 (orientationForEvent): Added.
956 (deltaForEvent): Added.
957 (QWheelEvent::QWheelEvent): Added.
959 * kwq/KWQKHTMLPart.h: Renamed scrollOverflowWithScrollWheelEvent to wheelEvent.
960 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::wheelEvent): Renamed and added code to construct a QWheelEvent
961 and send it along to KHTMLView::viewportWheelEvent, consistent with how mouse events work.
963 * khtml/khtmlview.cpp: (KHTMLView::viewportWheelEvent): Do a hit test to figure out which node to
964 send the event to, and then call dispatchWheelEvent.
966 * khtml/xml/dom_nodeimpl.h: Added dispatchWheelEvent.
967 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchWheelEvent): Added.
971 * khtml/ecma/kjs_dom.lut.h: Regenerated.
972 * khtml/ecma/kjs_events.lut.h: Regenerated.
973 * khtml/ecma/kjs_window.lut.h: Regenerated.
974 * khtml/misc/htmlattrs.c: Regenerated.
975 * khtml/misc/htmlattrs.h: Regenerated.
977 2005-04-26 David Harrison <harrison@apple.com>
979 Reviewed by Darin, Maciej.
981 <rdar://problem/4075576> Deleting text in new message borks content
983 Fixed by removing the methods that attempted to preserve the position. The idea
984 of preserving position is a very recent one, and turned out to not actually address
985 the problem it was intended to fix (see below). Further, is unclear how the position
986 could be preserved in a form that could be properly used later on. Therefore,
987 removing the code to work like before is the preferred alternative for this software
988 update. I've written <rdar://problem/4099839> to cover the bug that position
989 preservation was supposed to fix (but did not). Added layout tests for
990 both this bug and 4099839. Also, updated existing tests with correct expected results
991 (delete-at-paragraph-boundaries-003 and 004).
993 * khtml/editing/htmlediting.cpp:
994 (khtml::CompositeEditCommand::removeFullySelectedNode):
995 (khtml::CompositeEditCommand::removeChildrenInRange):
996 (khtml::DeleteSelectionCommand::handleGeneralDelete):
997 * khtml/editing/htmlediting.h:
998 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
999 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
1000 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-007-expected.txt: Added.
1001 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-007.html: Added.
1002 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-008-expected.txt: Added.
1003 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-008.html: Added.
1004 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-009-expected.txt: Added.
1005 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-009.html: Added.
1006 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-010-expected.txt: Added.
1007 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-010.html: Added.
1009 2005-04-26 Darin Adler <darin@apple.com>
1011 - fixed development builds
1013 * khtml/misc/main_thread_malloc.h: Use inlines instead of macros for allocation functions.
1015 2005-04-25 David Hyatt <hyatt@apple.com>
1017 Fix for 4097842, changing 1st line of a url that wraps doesn't update the second line. Make sure to
1018 update line break info for the last dirty line so that when a clean line tries to figure out where it
1019 started, it will get an accurate position taking into account the updated string. By doing this, the code
1020 will be able to properly distinguish between the old and new positions and not accidentally assume they are
1025 * khtml/rendering/render_text.cpp:
1026 (RenderText::setTextWithOffset):
1028 2005-04-26 Darin Adler <darin@apple.com>
1032 - fixed <rdar://problem/4098826> Bezier curves broken in new Safari canvas object (last two parameters parsed incorrectly)
1034 * khtml/ecma/kjs_html.cpp: (KJS::Context2DFunction::tryCall): Fixed incorrect argument indices.
1035 Thanks to Brian Campbell who figured out what was wrong.
1037 2005-04-17 Maciej Stachowiak <mjs@apple.com>
1041 - use single-threaded malloc in places where malloc is hot for an
1042 8% speed improvement on cvs-base
1044 * ForwardingHeaders/misc/fast_malloc.h: Added.
1045 * WebCore.pbproj/project.pbxproj:
1046 * khtml/css/css_base.h:
1047 * khtml/css/css_ruleimpl.h:
1048 * khtml/css/css_valueimpl.h:
1049 * khtml/css/cssstyleselector.h:
1050 * khtml/misc/arena.cpp:
1054 * khtml/misc/main_thread_malloc.cpp: Added.
1055 * khtml/misc/main_thread_malloc.h: Added.
1056 * khtml/rendering/render_style.h:
1057 * khtml/xml/dom2_eventsimpl.h:
1058 * khtml/xml/dom2_rangeimpl.h:
1059 * khtml/xml/dom2_traversalimpl.h:
1060 * khtml/xml/dom2_viewsimpl.h:
1061 * khtml/xml/dom_docimpl.h:
1062 * khtml/xml/dom_elementimpl.cpp:
1063 (NamedAttrMapImpl::NamedAttrMapImpl):
1064 (NamedAttrMapImpl::clearAttributes):
1065 (NamedAttrMapImpl::operator=):
1066 (NamedAttrMapImpl::addAttribute):
1067 (NamedAttrMapImpl::removeAttribute):
1068 * khtml/xml/dom_elementimpl.h:
1069 * khtml/xml/dom_nodeimpl.h:
1070 * khtml/xml/dom_stringimpl.h:
1071 * kwq/KWQFontFamily.h:
1072 * kwq/KWQListImpl.mm:
1077 (QString::setBufferFromCFString):
1080 2005-04-25 John Sullivan <sullivan@apple.com>
1082 Reviewed by Dave Harrison.
1084 - fixed <rdar://problem/4098731> [DOMHTMLTextAreaElement cols] returns wrong value (usually zero)
1087 (-[DOMHTMLTextAreaElement cols]):
1088 use ATTR_COLS instead of ATTR_ACCESSKEY (D'oh!)
1089 (-[DOMHTMLTextAreaElement setCols:]):
1092 2005-04-25 Darin Adler <darin@apple.com>
1096 - fixed <rdar://problem/4097849> REGRESSION (162-163): importNode creates non-HTML elements, thus style attributes (and some others) don't work
1098 * khtml/xml/dom_docimpl.h: Add virtual functions HTMLElementNamespace and isHTMLNamespace.
1099 * khtml/xml/dom_docimpl.cpp:
1100 (DocumentImpl::importNode): Rearranged this function and fixed the following problems: 1) made sure to ref node while attributes are
1101 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
1102 the source document, not the destination document; 3) removed unneeded getDocument() call which just returns this; 4) fixed error
1103 handling for cases where an exception happens while processing the children.
1104 (DocumentImpl::HTMLElementNamespace): Added. Returns XHTML_NAMESPACE.
1105 (DocumentImpl::isHTMLNamespace): Added. Returns true for any namespace that matches XHTML_NAMESPACE (case insensitive).
1106 (DocumentImpl::createElementNS): Changed to call isHTMLNamespace, which will cause it to accept the null namespace in an HTML document.
1107 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.
1108 (DocumentImpl::createHTMLElement): Pass in HTMLElementNamespace() rather than 0 to tagId.
1109 (DocumentImpl::attrId): Use isHTMLNamespace instead of allowing the null namespace explicitly.
1110 (DocumentImpl::tagId): Ditto.
1112 * khtml/html/html_documentimpl.h: Add overrides for HTMLElementNamespace and isHTMLNamespace.
1113 * khtml/html/html_documentimpl.cpp:
1114 (HTMLDocumentImpl::HTMLElementNamespace): Added. Returns 0 so we use the null string for HTML elements inside HTML documents (as before).
1115 (HTMLDocumentImpl::isHTMLNamespace): Added. Allows 0, and then calls base class to check for the actual XHTML namespace. Thus, we allow
1116 both no namespace at all and the XHTML namespace inside HTML documents.
1118 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::namespaceURI): Changed to call HTMLElementNamespace rather than checking
1119 isHTMLDocument. Same result as before, but better division of responsibilities.
1121 2005-04-25 Darin Adler <darin@apple.com>
1125 - fixed <rdar://problem/4091956> JavaScript drop handlers don't receive more than one dropped item
1127 * kwq/KWQClipboard.mm:
1128 (cocoaTypeFromMIMEType): Remove some use of compare -- less efficient than a simpler "==" check.
1129 Fixed non-GC-safe code to use KWQCFAutorelease instead.
1130 (MIMETypeFromCocoaType): Use fromCFString instead of fromNSString to avoid a cast.
1131 (KWQClipboard::getData): Rearrange so that we'll use filenames if both filenames and a URL are present, since
1132 filenames can accomodate multiple items. Fix bug where we'd return multiple filenames when the type requested
1133 is "URL". Fixed loop that computed the count over and over again for the loop termination condition. Check
1134 that the data for NSFilenamesPboardType is an NSArray instead of assuming it is.
1135 (KWQClipboard::setData): Use isEqualToString: instead of == when comparing types.
1137 2005-04-22 David Hyatt <hyatt@apple.com>
1139 Fix for 4096878, drop shadow effect not displayed correctly on tbray.org/ongoing/. Block minmaxwidth was
1140 broken when negative margins were used and did not properly decrease the max width.
1144 * khtml/rendering/render_block.cpp:
1145 (khtml::RenderBlock::calcBlockMinMaxWidth):
1146 * layout-tests/fast/block/float/034-expected.txt: Added.
1147 * layout-tests/fast/block/float/034.html: Added.
1148 * layout-tests/fast/block/float/035-expected.txt: Added.
1149 * layout-tests/fast/block/float/035.html: Added.
1151 2005-04-22 David Hyatt <hyatt@apple.com>
1153 Remove some dead code from css_valueimpl. It wasn't used at all.
1155 * khtml/css/css_valueimpl.cpp:
1156 * khtml/css/css_valueimpl.h:
1158 2005-04-22 Darin Adler <darin@apple.com>
1160 * khtml/ecma/kjs_html.h: Removed unnecessary bogus class name qualifiers.
1162 2005-04-22 David Hyatt <hyatt@apple.com>
1164 Fix for 4096681, fix regression in how the list-style property is parsed. It no longer parses when it hits
1165 a url in the property value list now, because the list pointer did not get advanced. This fixes alistapart.com.
1169 * khtml/css/cssparser.cpp:
1170 (CSSParser::parseValue):
1171 * layout-tests/fast/lists/009-expected.txt: Added.
1172 * layout-tests/fast/lists/009.html: Added.
1173 * layout-tests/fast/lists/resources/listmark.gif: Added.
1175 2005-04-22 Darin Adler <darin@apple.com>
1179 - fixed <rdar://problem/4091082> Google Suggest no longer works due to lack of "frameElement"
1181 * khtml/ecma/kjs_window.h: Added FrameElement.
1182 * khtml/ecma/kjs_window.cpp: (Window::get): Added "frameElement".
1183 * khtml/ecma/kjs_window.lut.h: Regenerated.
1185 2005-04-22 Darin Adler <darin@apple.com>
1189 - a small editing-related code cleanup
1191 * khtml/rendering/render_text.h: Added positionForOffset and made offsetForPosition const.
1192 * khtml/rendering/render_text.cpp:
1193 (InlineTextBox::offsetForPosition): Made const.
1194 (InlineTextBox::positionForOffset): Added. Moved code here from caretRect.
1195 (RenderText::caretRect): Call positionForOffset instead of doing the work here.
1197 2005-04-21 David Hyatt <hyatt@apple.com>
1199 Fix for 4095839, wrong background image used on flechtwerk.de. Make sure that the global mapped
1200 attribute cache hashed background attributes into per-document buckets.
1202 * khtml/html/html_baseimpl.cpp:
1203 (HTMLBodyElementImpl::mapToEntry):
1204 * khtml/html/html_elementimpl.h:
1206 * khtml/html/html_tableimpl.cpp:
1207 (HTMLTableElementImpl::mapToEntry):
1208 (HTMLTablePartElementImpl::mapToEntry):
1209 * khtml/xml/dom_docimpl.cpp:
1210 (DocumentImpl::DocumentImpl):
1211 * khtml/xml/dom_docimpl.h:
1212 (DOM::DocumentImpl::docID):
1214 2005-04-21 Vicki Murley <vicki@apple.com>
1216 - layout test for 4065447, outerHTML on images
1218 * layout-tests/fast/dynamic/outerHTML-img-expected.txt: Added.
1219 * layout-tests/fast/dynamic/outerHTML-img.html: Added.
1221 2005-04-20 Vicki Murley <vicki@apple.com>
1225 - fixed <rdar://problem/4065447> support outerHTML on IMG elements
1227 * khtml/html/html_elementimpl.cpp:
1228 (HTMLElementImpl::setOuterHTML):
1230 2005-04-18 David Hyatt <hyatt@apple.com>
1232 Fix min-height so that when it resolves to auto it does not use the box's intrinsic height.
1234 * khtml/rendering/render_box.cpp:
1235 (RenderBox::calcHeight):
1236 (RenderBox::calcHeightUsing):
1238 2005-04-18 David Hyatt <hyatt@apple.com>
1240 Back out fix for 4032346, since it is causing garbled image content on many sites.
1242 The bug tracking the fix is 4069093.
1244 (khtml::RenderBlock::matchedEndLine):
1246 2005-04-18 David Hyatt <hyatt@apple.com>
1248 Fix the smile in the Acid2 test. Floats should not grow to contain other floats unless height is auto. Otherwise
1249 the float should use the specified height.
1251 Also fix row 14 of the Acid2 test. Although ambiguous, just modify the table cell baseline alignment code to align
1252 to the bottom of the cell's content height if no suitable baseline could be found.
1254 * khtml/rendering/render_block.cpp:
1255 (khtml::RenderBlock::layoutBlock):
1256 * khtml/rendering/render_block.h:
1257 (khtml::RenderBlock::firstRootBox):
1258 (khtml::RenderBlock::lastRootBox):
1259 * khtml/rendering/render_table.cpp:
1260 (RenderTableSection::calcRowHeight):
1261 (RenderTableCell::baselinePosition):
1263 2005-04-15 David Hyatt <hyatt@apple.com>
1265 Make sure empty tables honor CSS-specified heights when they have no rows or sections. This is done only
1266 in strict mode, since it is not compatible with WinIE.
1268 * khtml/rendering/render_table.cpp:
1269 (RenderTable::layout):
1271 2005-04-15 David Hyatt <hyatt@apple.com>
1273 Fix for row 13 of the Acid2 test. Change HTML comment parsing in strict mode to do proper SGML parsing,
1274 checking for pairs of -- and only being willing to close the comment if every -- is paired up.
1276 * khtml/html/htmltokenizer.cpp:
1277 (khtml::HTMLTokenizer::parseComment):
1279 2005-04-12 Maciej Stachowiak <mjs@apple.com>
1281 Reviewed by Richard.
1283 - use custom single-threaded malloc for all non-GC JavaScriptCore
1284 allocations, for a 9.1% speedup on JavaScript iBench
1286 * khtml/ecma/kjs_binding.cpp:
1288 * khtml/ecma/kjs_proxy.cpp:
1289 (KJSProxyImpl::evaluate):
1291 2005-04-15 David Hyatt <hyatt@apple.com>
1293 Fix the six pixel gap between rows nine and ten of the Acid2 test. Make sure that percentage heights that
1294 resolve to auto are properly treated as though they have auto height by the self-collapsing block check (as per
1295 section 8.3.1, paragraph 7 of the CSS2.1 spec).
1297 * khtml/rendering/render_block.cpp:
1298 (khtml::RenderBlock::isSelfCollapsingBlock):
1300 2005-04-15 David Hyatt <hyatt@apple.com>
1302 The Acid2 test and the reference rendering both make use of overflow:hidden on the <html> element. Turns out
1303 the CSS2.1 wording for this behavior has been revised (based off WinIE/Mozilla behavior). Change our behavior
1304 to match and make <html> overflow apply to the viewport.
1306 * khtml/khtmlview.cpp:
1307 (KHTMLView::applyOverflowToViewport):
1308 (KHTMLView::layout):
1309 * khtml/khtmlview.h:
1310 * khtml/rendering/render_box.cpp:
1311 (RenderBox::setStyle):
1313 2005-04-14 David Hyatt <hyatt@apple.com>
1315 3258403 and 3258402 can now be fixed. min/max-width/height support is now complete. This patch makes them
1316 work for positioned elements and enables us to pass row one of the Acid2 test.
1318 * khtml/rendering/render_box.cpp:
1319 (RenderBox::calcAbsoluteHorizontal):
1320 (RenderBox::calcAbsoluteHorizontalValues):
1321 (RenderBox::calcAbsoluteVertical):
1322 (RenderBox::calcAbsoluteVerticalValues):
1323 * khtml/rendering/render_box.h:
1325 2005-04-12 David Hyatt <hyatt@apple.com>
1327 Working on the Acid2 test, Row 1.
1329 Improve checkChild for the DTD so that it knows what mode a document is in. This allows it to adhere more
1330 strictly to the actual DTD in strict mode and almost strict mode.
1332 Change the <table>-inside-<p> check so that <table> is disallowed inside <p> in
1333 strict mode and almost strict mode. This matches Firefox behavior, which allows <table>
1334 inside <p> only in quirks mode.
1336 * khtml/html/dtd.cpp:
1339 * khtml/html/htmlparser.cpp:
1340 (KHTMLParser::insertNode):
1341 * khtml/html/htmltokenizer.cpp:
1342 (khtml::HTMLTokenizer::parseTag):
1343 * khtml/xml/dom_elementimpl.cpp:
1344 (ElementImpl::childAllowed):
1346 2005-04-12 Vicki Murley <vicki@apple.com>
1350 - fixed <rdar://problem/3760895> Request for including an implementation of the elementFromPoint function
1352 * khtml/dom/dom_doc.cpp:
1353 (DOM::Document::elementFromPoint):
1354 * khtml/dom/dom_doc.h:
1355 * khtml/ecma/kjs_dom.cpp:
1356 (DOMDocumentProtoFunc::tryCall):
1357 * khtml/ecma/kjs_dom.h:
1358 (KJS::DOMDocument::):
1359 * khtml/ecma/kjs_dom.lut.h:
1361 * khtml/xml/dom_docimpl.cpp:
1362 (DocumentImpl::elementFromPoint):
1363 * khtml/xml/dom_docimpl.h:
1365 2005-04-12 David Hyatt <hyatt@apple.com>
1367 Beginning of work to support the Acid2 CSS test put forward by the Web Standards Project. Fix
1368 our handling of the rel attribute on <link> elements to do a proper tokenization so that stylesheets
1369 can be recognized even when other keywords are present in the rel attribute.
1371 * khtml/html/html_headimpl.cpp:
1372 (HTMLLinkElementImpl::HTMLLinkElementImpl):
1373 (HTMLLinkElementImpl::parseHTMLAttribute):
1374 (HTMLLinkElementImpl::tokenizeRelAttribute):
1375 (HTMLLinkElementImpl::process):
1376 * khtml/html/html_headimpl.h:
1378 2005-04-12 John Sullivan <sullivan@apple.com>
1380 - fixed these two bugs (I also fixed these on the experimental-ui-branch)
1381 <rdar://problem/3154293> Find Next should not scroll page if the next target is already visible
1382 <rdar://problem/3121828> scrollToVisible on find cuts off the left part of the view due to needless horiz. scroll
1386 * kwq/KWQKHTMLPart.mm:
1387 (KWQKHTMLPart::jumpToSelection):
1388 Trey had written code to address these issues, but left it commented out due to other
1389 problems. The other problems no longer occur, so I uncommented Trey's code, and then
1390 discovered that I could make it behave more like TextEdit with many fewer lines of
1393 2005-04-08 David Harrison <harrison@apple.com>
1395 Reviewed by Dave Hyatt.
1397 <rdar://problem/4084106> Remove NSAccessibilityForegroundColorTextAttributeWrapper
1399 * kwq/KWQAccObject.mm:
1400 (AXAttributeStringSetStyle):
1401 Use NSAccessibilityForegroundColorTextAttribute directly.
1403 2005-04-05 David Hyatt <hyatt@apple.com>
1405 Fix for 4077106, make sure that mouse wheeling in overflow sections uses 40 rather than 10 as the base line
1410 * khtml/rendering/render_layer.cpp:
1411 (RenderLayer::positionScrollbars):
1412 * kwq/KWQScrollBar.mm:
1413 (QScrollBar::scroll):
1415 2005-04-04 Vicki Murley <vicki@apple.com>
1419 - fixed <rdar://problem/3871669> no focus or blur methods on HTML button elements
1421 * khtml/dom/html_form.cpp:
1422 (HTMLButtonElement::focus):
1423 (HTMLButtonElement::blur):
1424 * khtml/dom/html_form.h:
1425 * khtml/ecma/kjs_html.cpp:
1426 (KJS::HTMLElementFunction::tryCall):
1427 * khtml/ecma/kjs_html.h:
1428 (KJS::HTMLElement::):
1429 * khtml/ecma/kjs_html.lut.h:
1431 * khtml/html/html_formimpl.cpp:
1432 (DOM::HTMLButtonElementImpl::blur):
1433 (DOM::HTMLButtonElementImpl::focus):
1434 * khtml/html/html_formimpl.h:
1438 2005-03-28 David Harrison <harrison@apple.com>
1442 <rdar://problem/4069161> REGRESSION (8A416-8A419): Safari crash bringing up context menu for non-HTML content in a frame
1444 * kwq/KWQAccObject.mm:
1445 (-[KWQAccObject rendererForView:]):
1446 Nil-check node variable instead of rechecking document variable.
1450 2005-03-27 Darin Adler <darin@apple.com>
1452 Reviewed by me, fix by Kida-san.
1454 - fixed <rdar://problem/4067474> 8A424: Safari immediately quit by Cmd+Ctrll+'D'
1456 * kwq/WebCoreBridge.mm: (-[WebCoreBridge convertToNSRange:DOM::]):
1461 2005-03-24 Richard Williamson <rjw@apple.com>
1463 Fixed <rdar://problem/4052683> After adding/removing stocks from Stocks Widget, stock areas went blank
1465 The request was being collected before firing it's load handler.
1466 We now gc protect the request while it's loading.
1470 * khtml/ecma/xmlhttprequest.cpp:
1471 (KJS::XMLHttpRequest::send):
1472 (KJS::XMLHttpRequest::abort):
1473 (KJS::XMLHttpRequest::slotFinished):
1474 (KJS::XMLHttpRequestProtoFunc::tryCall):
1478 2005-03-23 Darin Adler <darin@apple.com>
1480 Further fix for 4053515.
1482 Covered cases where text position doesn't lie inside a
1485 Reviewed by Richard.
1487 * khtml/editing/visible_text.cpp:
1488 (khtml::TextIterator::setRangeFromLocationAndLength):
1490 2005-03-23 Richard Williamson <rjw@apple.com>
1492 Fixed <rdar://problem/4053515> REGRESSION (Mail): Kotoeri input method reconversion does not work in WebViews
1494 We now use actual document NSRanges to represent both marked text
1495 ranges and selection ranges.
1499 * khtml/editing/visible_text.cpp:
1500 (khtml::TextIterator::rangeLength):
1501 (khtml::TextIterator::setRangeFromLocationAndLength):
1502 * khtml/editing/visible_text.h:
1503 * kwq/WebCoreBridge.h:
1504 * kwq/WebCoreBridge.mm:
1505 (-[WebCoreBridge convertToNSRange:DOM::]):
1506 (-[WebCoreBridge DOM::convertToDOMRange:]):
1507 (-[WebCoreBridge selectNSRange:]):
1508 (-[WebCoreBridge markedTextDOMRange]):
1509 (-[WebCoreBridge markedTextNSRange]):
1511 2005-03-22 Kevin Decker <kdecker@apple.com>
1515 Fixed <rdar://problem/4062336> REGRESSION (406-407): HTML submenus not working at hrweb.apple.com after going back
1517 Rolled out the fix for <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
1519 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.
1521 * khtml/khtml_part.cpp:
1522 (KHTMLPart::closeURL):
1523 * khtml/xml/dom_docimpl.cpp:
1524 (DocumentImpl::detach):
1528 2005-03-22 Vicki Murley <vicki@apple.com>
1530 - roll the fix for <rdar://problem/4060266> back in, since its
1533 * khtml/editing/visible_text.cpp:
1534 (khtml::TextIterator::handleTextBox):
1536 2005-03-22 Vicki Murley <vicki@apple.com>
1538 - roll out the fix for <rdar://problem/4060266> since it was denied by CCC
1540 * khtml/editing/visible_text.cpp:
1541 (khtml::TextIterator::handleTextBox):
1543 2005-03-22 David Harrison <harrison@apple.com>
1547 <rdar://problem/4060266> Double-clicking in Dictionary.app doesn't work for some words (coming just after style change)
1549 * khtml/editing/visible_text.cpp:
1550 (khtml::TextIterator::handleTextBox):
1551 Complete the check of whether to emit space for collapsed space.
1553 2005-03-22 David Harrison <harrison@apple.com>
1557 <rdar://problem/4061443> REGRESSION (8A420-8A421): Pasting in the Stickies widget is broken again
1559 * khtml/editing/htmlediting.cpp:
1560 (khtml::positionBeforeContainingSpecialElement):
1561 (khtml::positionAfterContainingSpecialElement):
1562 Return unchanged Position rather than a null or non-editable one.
1566 2005-03-20 Ken Kocienda <kocienda@apple.com>
1570 I made an error in this test earlier. It was not testing what I intended. Fixed.
1572 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt
1573 * layout-tests/editing/unsupported-content/list-delete-001.html
1577 * layout-tests/editing/unsupported-content/table-delete-001-expected.txt: Added.
1578 * layout-tests/editing/unsupported-content/table-delete-001.html: Added.
1579 * layout-tests/editing/unsupported-content/table-delete-002-expected.txt: Added.
1580 * layout-tests/editing/unsupported-content/table-delete-002.html: Added.
1581 * layout-tests/editing/unsupported-content/table-delete-003-expected.txt: Added.
1582 * layout-tests/editing/unsupported-content/table-delete-003.html: Added.
1583 * layout-tests/editing/unsupported-content/table-type-after-expected.txt: Added.
1584 * layout-tests/editing/unsupported-content/table-type-after.html: Added.
1585 * layout-tests/editing/unsupported-content/table-type-before-expected.txt: Added.
1586 * layout-tests/editing/unsupported-content/table-type-before.html: Added.
1588 2005-03-20 Darin Adler <darin@apple.com>
1592 - fixed <rdar://problem/3923903> REGRESSION (164-165): Repro Safari crash in khtml::RenderLayer::scrollToOffset
1594 * khtml/rendering/render_layer.cpp: (RenderLayer::scrollToOffset): Check canvas for nil.
1596 2005-03-20 David Harrison <harrison@apple.com>
1600 <rdar://problem/4055127> Dictionary pop-up panel misplaced at beginning of text blocks (breaks double-clicking in Dictionary.app)
1602 SimplifiedBackwardsTextIterator::advance() needed to not limit to textnodes
1603 when checking whether moving back across block boundaries
1605 VisibleUnits previousBoundary() needed to INIT_DOWN when creating result VisiblePosition
1607 All editing tests pass.
1609 * khtml/editing/visible_text.cpp:
1610 (khtml::SimplifiedBackwardsTextIterator::advance):
1611 * khtml/editing/visible_units.cpp:
1612 (khtml::previousBoundary):
1614 2005-03-20 Darin Adler <darin@apple.com>
1616 Reviewed by Harrison.
1618 - 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
1620 * khtml/khtml_part.h: Added selectFrameElementInParentIfFullySelected.
1621 * khtml/khtml_part.cpp:
1623 (KHTMLPart::setFocusNodeIfNeeded): Changed to not set focus to a frame; was not what this function was
1624 intended to do, and caused trouble when trying to select a frame element.
1625 (KHTMLPart::khtmlMouseReleaseEvent): Call selectFrameElementInParentIfFullySelected.
1626 (KHTMLPart::selectAll): Call selectFrameElementInParentIfFullySelected.
1627 (KHTMLPart::selectFrameElementInParentIfFullySelected): Added. Selects the frame element in the parent
1628 if a frame is entirely selected, which makes it easier to delete or replace the frame and is consistent
1629 with the changes Maciej made recently for other elements.
1631 * kwq/WebCoreBridge.mm:
1632 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Call selectFrameElementInParentIfFullySelected.
1633 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Call selectFrameElementInParentIfFullySelected.
1635 2005-03-20 Darin Adler <darin@apple.com>
1637 Reviewed by me, code change by Ken.
1639 - fixed <rdar://problem/4059852> Deleting from first element of list makes content jump to wrong place
1641 * khtml/editing/htmlediting.cpp:
1642 (khtml::isListStructureNode): Added.
1643 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Check for list nodes as well as table nodes.
1645 2005-03-20 Ken Kocienda <kocienda@apple.com>
1649 Added tests to cover new "unsupported content" editing code.
1651 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt: Added.
1652 * layout-tests/editing/unsupported-content/list-delete-001.html: Added.
1653 * layout-tests/editing/unsupported-content/list-delete-002-expected.txt: Added.
1654 * layout-tests/editing/unsupported-content/list-delete-002.html: Added.
1655 * layout-tests/editing/unsupported-content/list-delete-003-expected.txt: Added.
1656 * layout-tests/editing/unsupported-content/list-delete-003.html: Added.
1657 * layout-tests/editing/unsupported-content/list-type-after-expected.txt: Added.
1658 * layout-tests/editing/unsupported-content/list-type-after.html: Added.
1659 * layout-tests/editing/unsupported-content/list-type-before-expected.txt: Added.
1660 * layout-tests/editing/unsupported-content/list-type-before.html: Added.
1662 2005-03-20 Ken Kocienda <kocienda@apple.com>
1668 <rdar://problem/4059578> Entire list deleted, and caret disappears, when delete key hit at end of list
1670 The problem is that a new case in the delete code did not consider when the
1671 downstream end node of the selection might be an ancestor of the upstream start
1672 node. That is the case in this bug. The downstream end is the body element, and
1673 this line of code would delete all the children of the downstream end:
1674 removeChildrenInRangePreservingPosition(m_downstreamEnd.node(), 0,
1675 m_downstreamEnd.offset(), m_upstreamStart);
1677 The fix is to check for this "is ancestor" case, and do some tree logic to find
1678 the right offset of the downstream end node for the call to
1679 removeChildrenInRangePreservingPosition().
1681 * khtml/editing/htmlediting.cpp:
1682 (khtml::DeleteSelectionCommand::handleGeneralDelete): Fixed as described.
1684 2005-03-19 Ken Kocienda <kocienda@apple.com>
1690 <rdar://problem/4059384> Cannot place insertion point correctly in editable text that avoids floating elements
1692 Note: I strongly suspect this bug blocks a complete solution to this other Tiger/P2:
1693 <rdar://problem/4055748> AX: Dictionary pop-up panel shows at wrong place on specific parts of particular pages
1695 * khtml/rendering/render_text.cpp:
1696 (RenderText::caretRect): Change the y-coordinate used to calculate the available width for a line. Height is wrong.
1697 Top of the box containing the text where the click is done is correct. Also, add in the x-offset for the start
1698 of the text box when calculating the available width. If this text box is avoiding a float at the y-coordinate
1699 for the relevant box, failure to add in the amount of float-avoidance will make the text at the coordinates
1700 greater than end-of-line minus float-avoidance ineligible for caret placement.
1702 2005-03-19 Darin Adler <darin@apple.com>
1706 - fixed <rdar://problem/4057594> REGRESSION (125-406): Unrepro crash in HTMLTokenizer::allDataProcessed after hitting Back button
1708 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::allDataProcessed):
1709 To get the part safely after calling end, save a guarded pointer to the view.
1710 The old way could end trying to call a virtual function a part that was destroyed.
1712 2005-03-19 Maciej Stachowiak <mjs@apple.com>
1716 <rdar://problem/4053506> Pasting Tables and Cells in Mail does not allow editing before or after
1717 <rdar://problem/4005954> REGRESSION (Mail): After copy/paste of content containing list element cannot go back to entering text at left side of page
1719 * khtml/editing/htmlediting.cpp:
1720 (khtml::maxDeepOffset):
1721 (khtml::CompositeEditCommand::removeFullySelectedNodePreservingPosition):
1722 (khtml::CompositeEditCommand::removeChildrenInRangePreservingPosition):
1723 (khtml::CompositeEditCommand::removeNodePreservingPosition):
1724 (khtml::CompositeEditCommand::insertBlockPlaceholder):
1725 (khtml::CompositeEditCommand::appendBlockPlaceholder):
1726 (khtml::CompositeEditCommand::forceBlockPlaceholder):
1727 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
1728 (khtml::isSpecialElement):
1729 (khtml::isFirstVisiblePositionInSpecialElementInFragment):
1730 (khtml::positionBeforePossibleContainingSpecialElement):
1731 (khtml::positionAfterPossibleContainingSpecialElement):
1732 (khtml::ApplyStyleCommand::applyInlineStyle):
1733 (khtml::DeleteSelectionCommand::initializePositionData):
1734 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
1735 (khtml::DeleteSelectionCommand::handleGeneralDelete):
1736 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
1737 (khtml::DeleteSelectionCommand::doApply):
1738 (khtml::InsertParagraphSeparatorCommand::doApply):
1739 (khtml::ReplacementFragment::ReplacementFragment):
1740 (khtml::ReplaceSelectionCommand::doApply):
1741 * khtml/editing/htmlediting.h:
1742 * khtml/editing/visible_position.cpp:
1743 (khtml::isRenderedBR):
1744 (khtml::VisiblePosition::initDownstream):
1745 (khtml::isLastVisiblePositionInBlock):
1746 * khtml/rendering/render_line.cpp:
1747 (khtml::RootInlineBox::closestLeafChildForXPos):
1748 * khtml/xml/dom_nodeimpl.cpp:
1749 (NodeImpl::isBlockFlowOrTable):
1750 (NodeImpl::isEditableBlock):
1751 (NodeImpl::enclosingBlockFlowOrTableElement):
1752 * khtml/xml/dom_nodeimpl.h:
1753 * khtml/xml/dom_position.cpp:
1754 (DOM::Position::upstream):
1755 (DOM::Position::downstream):
1756 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
1757 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
1758 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
1759 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
1760 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt:
1762 2005-03-19 John Sullivan <sullivan@apple.com>
1766 - fixed <rdar://problem/4058740> Crash (nil-deref) editing Mail reply
1767 message in KWQKHTMLPart::fontForSelection (MailViewer-723)
1769 * kwq/KWQKHTMLPart.mm:
1770 (KWQKHTMLPart::fontForSelection):
1771 Add nil check to loop. It shouldn't be necessary, but this crash trace seems to be
1772 running into it. We're not completely certain, but the check is harmless at worst.
1776 2005-03-18 David Harrison <harrison@apple.com>
1780 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
1782 Also changed WebKit.
1784 * kwq/KWQAccObject.mm:
1785 (-[KWQAccObject rendererForView:]):
1786 New to cover both the WebCore and WebKit NSViews.
1788 (-[KWQAccObject _accessibilityParentForSubview:]):
1789 Use rendererForView.
1791 * kwq/WebCoreFrameView.h:
1792 Add WebCoreBridgeHolder protocol to get access to WebKit NSViews.
1794 2005-03-18 David Harrison <harrison@apple.com>
1796 Reviewed by Darin, Ken.
1798 <rdar://problem/3735625> AX: add AXPress action if an element has an onclick handler
1800 * khtml/dom/html_form.cpp:
1801 (HTMLInputElement::click):
1802 * khtml/html/html_elementimpl.cpp:
1803 (HTMLElementImpl::click):
1804 (HTMLElementImpl::accessKeyAction):
1805 * khtml/html/html_elementimpl.h:
1806 * khtml/html/html_formimpl.cpp:
1807 (DOM::HTMLFormElementImpl::submitClick):
1808 (DOM::HTMLButtonElementImpl::click):
1809 (DOM::HTMLButtonElementImpl::accessKeyAction):
1810 (DOM::HTMLInputElementImpl::click):
1811 (DOM::HTMLInputElementImpl::accessKeyAction):
1812 (DOM::HTMLInputElementImpl::defaultEventHandler):
1813 (DOM::HTMLLabelElementImpl::accessKeyAction):
1814 (DOM::HTMLSelectElementImpl::accessKeyAction):
1815 (DOM::HTMLTextAreaElementImpl::accessKeyAction):
1816 * khtml/html/html_formimpl.h:
1817 * khtml/html/html_inlineimpl.cpp:
1818 (HTMLAnchorElementImpl::defaultEventHandler):
1819 (HTMLAnchorElementImpl::accessKeyAction):
1820 * khtml/html/html_inlineimpl.h:
1821 * khtml/rendering/render_form.cpp:
1822 (RenderFileButton::click):
1823 * khtml/rendering/render_form.h:
1824 * khtml/xml/dom_docimpl.cpp:
1825 (DocumentImpl::defaultEventHandler):
1826 * khtml/xml/dom_elementimpl.h:
1827 (DOM::ElementImpl::accessKeyAction):
1829 (-[DOMHTMLInputElement click]):
1833 * kwq/KWQFileButton.h:
1834 * kwq/KWQFileButton.mm:
1835 (KWQFileButton::click):
1837 Add accessKeyAction parameter about whether to limit to HTMLElementImpl subclasses that JavaScript wants, or to apply to others as well.
1839 Add click() parameter about whether to send the mousedown and mouseup events in addition to the click event.
1841 * kwq/KWQAccObject.mm:
1842 (-[KWQAccObject mouseButtonListener]):
1843 Locate a mousedown, mouseup, or click handler in the current element and its ancestors.
1845 (-[KWQAccObject actionElement]):
1846 (-[KWQAccObject accessibilityIsIgnored]):
1847 (-[KWQAccObject accessibilityPerformAction:]):
1848 Consider mouseButtonListener.
1850 2005-03-18 John Sullivan <sullivan@apple.com>
1854 - fixed <rdar://problem/4002164> maps that include start and end
1855 location don't print right from maps.google.com
1857 I thought I checked this in yesterday but a ChangeLog conflict aborted my checkin
1858 without me noticing.
1860 * khtml/rendering/render_style.cpp:
1861 (RenderStyle::diff):
1862 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
1864 * khtml/rendering/render_style.h:
1865 (khtml::RenderStyle::InheritedFlags::operator==):
1866 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
1867 (khtml::RenderStyle::setBitDefaults):
1869 (khtml::RenderStyle::forceBackgroundsToWhite):
1870 ditto, and method name changed too
1871 (khtml::RenderStyle::setForceBackgroundsToWhite):
1874 * khtml/rendering/render_text.cpp:
1875 (InlineTextBox::paint):
1876 updated for name change; also, compare text against white instead of current bg color
1877 because we no longer actually modify the bg color (previously we would always set
1878 the bg color to white, so the result is the same)
1880 * khtml/xml/dom_docimpl.cpp:
1881 (DocumentImpl::recalcStyle):
1882 updated for name change
1884 * kwq/WebCoreBridge.mm:
1885 (-[WebCoreBridge styleSheetForPrinting]):
1887 (-[WebCoreBridge reapplyStylesForDeviceType:]):
1888 removed the code that called styleSheetForPrinting; we no longer use a stylesheet
1891 * khtml/rendering/render_box.cpp:
1892 (RenderBox::paintBackgroundExtended):
1893 If forceBackgroundsToWhite flag is set, convert background images and
1894 background colors to white background color with no background image.
1896 2005-03-18 Ken Kocienda <kocienda@apple.com>
1902 <rdar://problem/4056718> Pasting quotes the entire message
1904 * khtml/editing/htmlediting.cpp:
1905 (khtml::ReplaceSelectionCommand::doApply): After pasting, nodes are moved to the block containing
1906 the end of the pasted content in certain cases. This move logic used to stop once it moved all the
1907 siblings of the node following the last node of the pasted-in content. This means that block elements
1908 could get moved, and if the pasted-in content included a mail blockquote, this could result in
1909 one quote level getting added. The fix is to stop the move of nodes once a <br>, block element, or
1910 <table> is seen. This only affected one of the many test cases we have for such scenarios, and
1911 the change to that result makes sense given the code change.
1912 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: This test result changed in a way that
1913 adequately tests the behavior change, so I did not add a new test.
1915 2005-03-17 Ken Kocienda <kocienda@apple.com>
1917 Reviewed by Harrison
1921 <rdar://problem/4051809> 8A413: Cursor-up in a mail message sometimes gets stuck (with specific reproducible case)
1923 * khtml/rendering/render_text.cpp:
1924 (RenderText::positionForCoordinates): Consider two lines: line-above and line-below. If the caret position in line-below
1925 was at an x coordinate between half way through the x coordinate of the last character on the line-above and the
1926 end of that same character, this bug would happen since the positioning code would assume that it could create a
1927 VisiblePosition with a DOWNSTREAM affinity. Now, I check to see if the character position on the line-above is the
1928 last character on that line, and if it is, I use UPSTREAM as the affinity.
1932 2005-03-17 David Harrison <harrison@apple.com>
1934 Reviewed by Darin, Ken.
1936 * khtml/editing/htmlediting.cpp:
1937 (khtml::EditCommandPtr::setEndingSelection):
1938 Fixed typo so that it calls setEndingSelection rather than setStartingSelection.
1939 Commented out this unused method, tho, since this is late in Tiger. Proved unused by successful build after temporarily removing method declaration or implemenation.
1941 2005-03-16 Kevin Decker <kdecker@apple.com>
1945 Fixed <rdar://problem/4046665> REGRESSION (403-405): mypage.apple.com login does not work (hits assertion in Development build)
1947 * kwq/WebCoreBridge.mm:
1948 (-[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="">
1950 2005-03-16 Darin Adler <darin@apple.com>
1954 - fixed <rdar://problem/4045203> REGRESSION (125-188): Redundant JS imports crash Safari
1956 * khtml/html/htmltokenizer.h: Take inWRite bool out of NDEBUG ifdef.
1957 * khtml/html/htmltokenizer.cpp:
1958 (khtml::HTMLTokenizer::HTMLTokenizer): Take inWrite bool management code out of NDEBUG ifdef.
1959 (khtml::HTMLTokenizer::write): Ditto. Don't call end if inWrite is true, since it will be called
1960 when you return to the body of the outer write() call.
1961 (khtml::HTMLTokenizer::allDataProcessed): Don't call end() if inWrite is true for the same reason.
1962 (khtml::HTMLTokenizer::finish): Ditto.
1964 * kwq/KWQWidget.mm: (QWidget::getOuterView): Removed bogus assertion that has been vexing us of late.
1966 2005-03-16 David Harrison <harrison@apple.com>
1968 Reviewed by me (written by Patti Yeh).
1970 * kwq/KWQAccObject.mm:
1971 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
1972 Use LeftWordIfOnBoundary instead of RightWordIfOnBoundary.
1974 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
1975 Use RightWordIfOnBoundary instead of LeftWordIfOnBoundary.
1977 2005-03-16 David Harrison <harrison@apple.com>
1981 <rdar://problem/4054590> AX: Dictionary panel does not work when page is scrolled on Safari
1983 * kwq/KWQAccObject.mm:
1984 (-[KWQAccObject doAXTextMarkerForPosition:]):
1985 Add in the view's contentsX and contentsY to the point.
1987 2005-03-16 David Harrison <harrison@apple.com>
1991 <rdar://problem/4048506> Deleting from beginning of editable div deletes other document elements
1993 Also changed WebKit.
1995 * khtml/editing/visible_units.h:
1996 * khtml/editing/visible_units.cpp:
1997 (khtml::startOfEditableContent):
1998 (khtml::endOfEditableContent):
1999 (khtml::inSameEditableContent):
2000 (khtml::isStartOfEditableContent):
2001 (khtml::isEndOfEditableContent):
2004 * kwq/WebCoreBridge.h:
2005 * kwq/WebCoreBridge.mm:
2006 (-[WebCoreBridge canDeleteRange:]):
2009 2005-03-16 Ken Kocienda <kocienda@apple.com>
2015 <rdar://problem/4042935> undo doesn't work properly during inline input
2017 * kwq/WebCoreBridge.h: Declare new method below.
2018 * kwq/WebCoreBridge.mm:
2019 (-[WebCoreBridge replaceMarkedTextWithText:]): New method. Wraps calls to TypingCommand::deleteKeyPressed and
2020 TypingCommand::insertText to map the way that international text input works onto the typing undo system.
2022 2005-03-16 David Harrison <harrison@apple.com>
2026 <rdar://problem/4044336> REGRESSION (8A398-8A409): Option-Delete also deletes space to left of deleted word
2028 * khtml/editing/htmlediting.cpp:
2029 (khtml::DeleteSelectionCommand::initializePositionData):
2030 - skip smart delete if the selection to delete already starts or ends with whitespace
2032 * khtml/khtml_part.cpp:
2033 (KHTMLPart::handleMousePressEventDoubleClick):
2034 - preserve selection on double-click when range is already selected
2036 * khtml/xml/dom_position.cpp:
2037 (DOM::Position::leadingWhitespacePosition):
2038 (DOM::Position::trailingWhitespacePosition):
2039 - fix considerNonCollapsibleWhitespace action (logic was reversed)
2040 - add non-breaking space to the non-collapsable ones
2042 * kwq/WebCoreBridge.mm:
2043 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
2044 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
2045 - these methods do not set the selection, so remove calls to setSelectionGranularity
2047 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
2048 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]):
2049 - set the granularity back to character
2050 - the one exception is that we need to keep word granularity
2051 to preserve smart delete behavior when extending by word
2053 2005-03-15 Maciej Stachowiak <mjs@apple.com>
2057 <rdar://problem/4053266> Pressing return a few times right after a link makes the new blank lines part of the link
2059 * khtml/editing/htmlediting.cpp:
2060 (khtml::InsertLineBreakCommand::doApply): Use
2061 positionOutsideContainingSpecialElement in the right two places.
2062 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
2064 - move all these helper functions higher in the file
2066 * khtml/editing/htmlediting.cpp:
2067 (khtml::isSpecialElement):
2068 (khtml::isFirstVisiblePositionInSpecialElement):
2069 (khtml::positionBeforeNode):
2070 (khtml::positionBeforeContainingSpecialElement):
2071 (khtml::maxRangeOffset):
2072 (khtml::isLastVisiblePositionInSpecialElement):
2073 (khtml::positionAfterNode):
2074 (khtml::positionAfterContainingSpecialElement):
2075 (khtml::positionOutsideContainingSpecialElement):
2077 2005-03-14 Maciej Stachowiak <mjs@apple.com>
2081 <rdar://problem/4049925> Pasting right after a link makes pasted content part of the link (without visible style change)
2083 * khtml/editing/htmlediting.cpp:
2084 (khtml::positionOutsideContainingSpecialElement): made a helper
2085 function that computes a position outside the outermost containing
2086 special element if the passed in position is right at the start or
2088 (khtml::InsertTextCommand::prepareForTextInsertion): use new helper here
2089 (khtml::ReplaceSelectionCommand::doApply): use it here too: this is the fix
2090 (khtml::positionBeforeNode): made static
2091 (khtml::positionBeforeContainingSpecialElement): made static
2092 (khtml::positionAfterNode): made static
2093 (khtml::positionAfterContainingSpecialElement): made static
2095 2005-03-15 Richard Williamson <rjw@apple.com>
2097 Fixed <rdar://problem/4053658> Crash getting direction at maps.google.com
2099 Add non nil style() check.
2101 Reviewed by Dave Harrison.
2103 * khtml/rendering/render_table.cpp:
2104 (RenderTableCell::collapsedRightBorder):
2106 2005-03-15 Kevin Decker <kdecker@apple.com>
2110 Fixed: <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
2112 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().
2114 This fixes a recent regression from:
2116 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
2118 * khtml/khtml_part.cpp:
2119 (KHTMLPart::closeURL): After dispatching event handlers, go ahead and remove them from the DOM.
2120 * khtml/xml/dom_docimpl.cpp:
2121 (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.
2123 2005-03-15 Ken Kocienda <kocienda@apple.com>
2129 <rdar://problem/4052642> Each delete keystroke is in its own undo group; not included in undo group with other typing
2131 Calling -[WebCore setSelectedDOMRange:range affinity:] had the result of "closing" any active set of typing
2132 keystrokes grouped together in a single undo operation. A change on 27 Jan in WebKit to change the way delete
2133 keystrokes are handled made this feature regress. Previous to that change, the backwards delete
2134 key went through separate code that is no longer in the tree that did not set the selection in the way
2137 The solution is to add an extra argument to the set-selection call. The WebCoreBridge now offers this method:
2138 -[WebCore setSelectedDOMRange:range affinity:closeTyping:]. Now, callers must indicate whether setting the
2139 selection will act to close typing or not.
2141 * kwq/WebCoreBridge.h: Changed header accordingly to change method shown below.
2142 * kwq/WebCoreBridge.mm:
2143 (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Added closeTyping argument to this method.
2145 2005-03-15 John Sullivan <sullivan@apple.com>
2149 - fixed <rdar://problem/4052246> crash in KWQKHTMLPart::createPart() trying to display local file in frame
2151 * kwq/KWQKHTMLPart.mm:
2152 (KWQKHTMLPart::createPart):
2153 Check part for nil before trying to ref. This was probably a longstanding code flaw revealed by
2154 the recent security fix.
2156 2005-03-15 Kevin Decker <kdecker@apple.com>
2158 Reviewed by Ken and Maciej.
2160 New fix for <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
2162 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.
2164 * khtml/html/htmltokenizer.cpp:
2165 (khtml::HTMLTokenizer::HTMLTokenizer): Initialize loadStopped to false.
2166 (khtml::HTMLTokenizer::write): Go ahead and bail out if loadStopped is true.
2167 (khtml::HTMLTokenizer::processToken):
2168 * 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.
2169 * khtml/khtml_part.cpp:
2170 (KHTMLPart::closeURL): Notify the tokenizer to stop parsing.
2171 * khtml/xml/xml_tokenizer.cpp:
2172 (khtml::XMLTokenizer::XMLTokenizer): Initialize loadStopped to false.
2173 * khtml/xml/xml_tokenizer.h:
2174 (khtml::Tokenizer::stopParsing): Added.
2176 2005-03-14 David Harrison <harrison@apple.com>
2178 Reviewed by Darin, Maciej.
2180 <rdar://problem/4046103> REGRESSION (Mail): clicking after style change sets insertion point incorrectly
2182 Also fixes crash by adding nil check.
2184 * khtml/editing/htmlediting.cpp:
2185 (khtml::MoveSelectionCommand::doApply):
2186 Check the node for nil.
2188 * khtml/khtml_part.cpp:
2189 (KHTMLPart::khtmlMouseReleaseEvent):
2190 Use the node from the event rather than from the selection.
2192 2005-03-14 Darin Adler <darin@apple.com>
2194 Reviewed by Harrison.
2196 - fixed <rdar://problem/4049776> Seed: Mail: Disable spellcheck leaves red artifacts
2198 * khtml/xml/dom_docimpl.cpp:
2199 (DocumentImpl::DocumentImpl): Set markers list to be "auto-delete" so they don't all leak.
2200 (DocumentImpl::removeMarker): Remove markers list for a node when the last marker is removed
2201 for that node. Otherwise, we can have empty marker lists for each node forever until the
2203 (DocumentImpl::removeAllMarkers): Added code to dirty the markers.
2204 (DocumentImpl::shiftMarkers): Remove unneeded empty check.
2206 * kwq/WebCoreBridge.h: Added unmarkAllMisspellings for WebKit.
2207 * kwq/WebCoreBridge.mm: (-[WebCoreBridge unmarkAllMisspellings]): Added. Calls removeAllMarkers.
2209 2005-03-14 Richard Williamson <rjw@apple.com>
2211 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
2213 A document may be deleted as a consequence of handling an event,
2214 as was the case with Acrobat.app. Ensure that the document is still valid
2215 before passing the event on for further handling.
2217 * khtml/xml/dom_nodeimpl.cpp:
2218 (NodeImpl::dispatchUIEvent):
2220 2005-03-14 Ken Kocienda <kocienda@apple.com>
2224 Added a couple of comments about setChanged() to this code based on my experiences with 4047028.
2226 * khtml/css/css_valueimpl.cpp:
2227 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties)
2228 (DOM::CSSMutableStyleDeclarationImpl::merge)
2230 2005-03-14 Ken Kocienda <kocienda@apple.com>
2236 <rdar://problem/4047028> Changing quote levels on stylized text causes it to be sent as colored (Blue). Tiger8A410
2238 * khtml/css/css_valueimpl.cpp:
2239 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): This function now calls setChanged() at the
2240 end of its loop if any properties were removed. This makes the style system update correctly in response
2241 to changes made by this function. The code to paste removes style from the pasted content in a
2242 preliminary step, and the fact that the style system did not update properly left unwanted color
2243 declarations in the document.
2245 2005-03-14 Vicki Murley <vicki@apple.com>
2247 - roll out this change for now, since it was denied by CCC
2249 2005-03-11 David Harrison <harrison@apple.com>
2253 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
2255 * kwq/KWQKHTMLPart.mm:
2256 (KWQKHTMLPart::advanceToNextMisspelling):
2257 (KWQKHTMLPart::markMisspellings):
2260 2005-03-14 Ken Kocienda <kocienda@apple.com>
2266 <rdar://problem/4050403> Mail crashes after pasting and deleting the content of one Excel cell
2268 * khtml/editing/htmlediting.cpp:
2269 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add some null checks to the code. This fixes the crash, although
2270 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
2271 the document that cannot be removed (this is actually an empty table). This is undesirable, however, work Maciej is
2272 doing to fix the general-case problem of trying to edit constructs we do not handle well in editing should fix this
2273 particular case, making the deletion of this "blank line" possible. Maciej is doing this work as part of this bug:
2274 <rdar://problem/4036051> Hard to select (and thus delete) an IFRAME in an editable WebView
2276 2005-03-14 Ken Kocienda <kocienda@apple.com>
2282 <rdar://problem/4029632> Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
2284 The problem is that removeInlineStyle() can remove nodes, and if either the start or end node of the
2285 selection at the time of the call to removeInlineStyle() was in a node that got removed, bad things
2286 would happen. The fix is described below.
2288 * khtml/editing/htmlediting.cpp:
2289 (khtml::maxRangeOffset): Moved this static function to a different place in the file so the code below can use it.
2290 (khtml::ApplyStyleCommand::applyInlineStyle): Calling removeInlineStyle() now has the side effect of
2291 setting the command's ending selection. Now resets start and end using the ending selection after the call to
2292 removeInlineStyle() as it is done elsewhere in this function.
2293 (khtml::ApplyStyleCommand::removeInlineStyle): Track the removal of the start or end node based on
2294 the positions passed in. If either the start or the end node is removed as part of style removal,
2295 set an appropriate replacement start or end that is still in the document.
2299 2005-03-14 Ken Kocienda <kocienda@apple.com>
2303 I need to roll out Kevin's change to fix 3667701. It breaks contextual fragments, and hence breaks
2304 paste in editing (among other things).
2306 * khtml/html/htmltokenizer.cpp: Roll out recent change.
2307 (khtml::HTMLTokenizer::write)
2308 * khtml/html/htmltokenizer.h: Ditto.
2310 2005-03-13 Darin Adler <darin@apple.com>
2312 Reviewed by Ken and Maciej.
2314 - fixed <rdar://problem/4049040> REGRESSION (403-405): security check prevents user stylesheet from loading (Dictionary.app doesn't work at all!)
2316 * kwq/WebCoreBridge.mm: (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Changed to give "applewebdata:"
2317 documents the same privileges to open local files that "file:" documents have.
2319 2005-03-13 Kevin Decker <kdecker@apple.com>
2323 Fixed: <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
2325 The problem here was that the tokenizer would continue to receive chunks of data from the loader already
2326 after the view and part had been destroyed. Situations like this could arise when clicking on another link
2327 while still loading the current view, or during self test where we rapidly open, load, and close browser
2330 * khtml/html/htmltokenizer.cpp:
2331 (khtml::HTMLTokenizer::write): Simple nil check against the view.
2332 * khtml/html/htmltokenizer.h: Changed the view pointer from a standard pointer to a QGuardedPtr. The tokenizer's
2333 handle to the view will now automatically nil-out and never dangle.
2335 2005-03-13 Darin Adler <darin@apple.com>
2337 Reviewed by John and Ken.
2339 - fixed <rdar://problem/4044347> REGRESSION (Mail): Control-K in particular message moves insertion point to previous line
2341 Tweaked the deleting code, and added three new deleting layout tests to confirm the new code works.
2343 * khtml/editing/htmlediting.cpp:
2344 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Removed special case with comment that said it was
2345 for the case where a "selection contains only a BR right after a block ended". This code was being triggered in
2346 more cases than just that one, and in all the cases I tested, the general delete code works fine.
2347 (khtml::DeleteSelectionCommand::handleGeneralDelete): Changed the code that decides whether to delete an entire
2348 block to understand the case where the end block is outside the start block, but contains the start block.
2349 In that case, we want to delete the entire block. Not deleting the block was causing us to delete just the <br>,
2350 and not the enclosing <div> in the case in the bug.
2352 * layout-tests/editing/deleting/delete-line-015-expected.txt: Added.
2353 * layout-tests/editing/deleting/delete-line-015.html: Added.
2354 * layout-tests/editing/deleting/delete-line-016-expected.txt: Added.
2355 * layout-tests/editing/deleting/delete-line-016.html: Added.
2356 * layout-tests/editing/deleting/delete-line-017-expected.txt: Added.
2357 * layout-tests/editing/deleting/delete-line-017.html: Added.
2358 * layout-tests/editing/style/smoosh-styles-002-expected.txt: Updated to improved results. With the code change, the deletion
2359 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
2360 we delete both of those.
2362 2005-03-13 Darin Adler <darin@apple.com>
2364 - fixed <rdar://problem/4049172> REGRESSION (403-405): Gmail: text box in "Invite a friend" section overlaps other sections
2366 Rolled out fix for <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
2368 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth): Back to previous version of this file.
2370 2005-03-12 Maciej Stachowiak <mjs@apple.com>
2374 <rdar://problem/4046144> RSS pages leave a hole in local file security policy (need to revert feed: exemption)
2376 * kwq/WebCoreBridge.mm:
2377 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Revert
2378 emergency workaround for Safari RSS, now that a new Syndication
2381 2005-03-11 Maciej Stachowiak <mjs@apple.com>
2385 <rdar://problem/4026787> text typed after a link (pasted or Mail Link to this Page) is part of the link, underlined and colored blue
2387 The concept of this change is every time you type at the very
2388 start or very end of a link (even if nested in further inner
2389 elements), the typed text goes outside the link instead of inside.
2391 * khtml/editing/htmlediting.cpp:
2392 (khtml::InsertTextCommand::prepareForTextInsertion): Check whether
2393 we are at the first visible position or last visible position of a
2394 special element. For now this only includes HTML A elements that
2395 are links (i.e. they have an href).
2396 (khtml::isSpecialElement): Helper function that identifies special
2397 elements (for now only links).
2398 (khtml::isFirstVisiblePositionInSpecialElement): Checks if a given DOM
2399 position is equivalent to the first visible position in some containing
2400 editable special element.
2401 (khtml::positionBeforeNode): Returns the DOM position immediately
2403 (khtml::positionBeforeContainingSpecialElement): Gives a DOM
2404 position immediately before the outermost editable containing
2405 special element where the passed-in position is equivalent to the
2406 first visible position.
2407 (khtml::maxRangeOffset): Helper to get the maximum allowed
2408 range/position offset for a node, does the right thing based on
2409 whether the node would use a character offset or child offset.
2410 (khtml::isLastVisiblePositionInSpecialElement): Similar to above,
2411 but for end of node instead of start.
2412 (khtml::positionAfterNode): Ditto.
2413 (khtml::positionAfterContainingSpecialElement): Ditto.
2415 Some layout tests changed - I looked over all the diffs and found
2416 that the only changes were "junk nodes" like empty spans and text
2417 nodes moving from one spot in the tree to another. These changes
2418 are all harmless and do not affect layout or future editing.
2420 * layout-tests/editing/inserting/typing-003-expected.txt:
2421 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
2422 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
2423 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
2424 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
2425 * layout-tests/editing/style/remove-underline-expected.txt:
2426 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt:
2427 * layout-tests/editing/style/remove-underline-in-bold-expected.txt:
2428 * layout-tests/editing/style/typing-style-003-expected.txt:
2429 * layout-tests/editing/style/unbold-in-bold-expected.txt:
2430 * layout-tests/editing/style/underline-expected.txt:
2432 2005-03-11 Adele Amchan <adele@apple.com>
2434 backing out fix for <rdar://problem/4021711> REGRESSION (125-188): blank pages when browsing forum at cooperativeresearch.org - cached external script problem
2436 This caused the following regressions (that we know of):
2437 <rdar://problem/4047445> REGRESSION (Safari-400-403?): Some or all page contents sometimes don't appear (macworld.com)
2438 <rdar://problem/4046153> 8a409: Problem loading Citibank page in Safari 2 (403)
2439 <rdar://problem/4047801> REGRESSION (402-403): .Mac homepage links don't work
2441 * khtml/html/htmltokenizer.cpp:
2442 (khtml::HTMLTokenizer::scriptHandler):
2444 2005-03-11 David Harrison <harrison@apple.com>
2448 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
2450 * kwq/KWQKHTMLPart.mm:
2451 (KWQKHTMLPart::advanceToNextMisspelling):
2452 (KWQKHTMLPart::markMisspellings):
2455 2005-03-11 Ken Kocienda <kocienda@apple.com>
2459 * ForwardingHeaders/editing/visible_units.h: Added.
2461 2005-03-11 Ken Kocienda <kocienda@apple.com>
2467 <rdar://problem/4045521> Hitting return key with full line selected does not add blank line as it should
2469 * khtml/editing/htmlediting.cpp:
2470 (khtml::InsertParagraphSeparatorCommand::doApply): Removed some "special-case" code from this
2471 function that would look for a selection that started and ended in a different block, and would
2472 then bail right after the deletion of the selection without inserting a paragraph separator.
2473 This was just wrong. So, the code change is removal only. When the general-case code runs instead
2474 of the erroneous special-case code, the bug goes away.
2478 * layout-tests/editing/inserting/return-key-with-selection-001-expected.txt: Added.
2479 * layout-tests/editing/inserting/return-key-with-selection-001.html: Added.
2480 * layout-tests/editing/inserting/return-key-with-selection-002-expected.txt: Added.
2481 * layout-tests/editing/inserting/return-key-with-selection-002.html: Added.
2482 * layout-tests/editing/inserting/return-key-with-selection-003-expected.txt: Added.
2483 * layout-tests/editing/inserting/return-key-with-selection-003.html: Added.
2485 2005-03-11 David Harrison <harrison@apple.com>
2489 <rdar://problem/4009446> AX: kAXTextMarkerForPositionParameterizedAttribute not working correctly (required for Dictionary pop-up)
2491 * kwq/KWQAccObject.mm:
2492 (-[KWQAccObject accessibilityAttributeValue:]):
2495 (-[KWQAccObject doAXTextMarkerForPosition:]):
2498 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
2499 Use the selection's document instead of the top document, to accommodate frames, etc.
2501 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
2502 Fixed parameter processing to look for NSValue instead of AXValue.
2504 2005-03-11 Ken Kocienda <kocienda@apple.com>
2506 Reviewed by Harrison
2510 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
2512 This was fixed, then regressed with Harrison's fix for this bug:
2514 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
2516 * khtml/editing/htmlediting.cpp:
2517 (khtml::ReplaceSelectionCommand::doApply): My now addresses both problems in a way that they no longer
2520 2005-03-10 Ken Kocienda <kocienda@apple.com>
2526 <rdar://problem/4045511> Copying and pasting end-of-paragraph selection puts insertion point in wrong place
2527 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
2529 The copy/paste code before this patch had no notion of a "logical newline" at the start of the selection. We have
2530 had a similar notion for "logical newline" at the end of the selection for quite some time. To fix these bugs, we
2531 need to introduce the same idea for selection starts.
2533 * khtml/editing/htmlediting.cpp:
2534 (khtml::ReplacementFragment::ReplacementFragment): Process the "logical newline" at start as we write it out
2535 in markup. Set the bit we added to this object to signify we have such a newline.
2536 (khtml::ReplaceSelectionCommand::doApply): Many, many changes to introduce the new "logical newline" at start concept.
2537 I also tried to simply the code that sets the start position for inserting content to be pasted. I also improved a
2538 weakness in the smart-paste code. Now, we check before and after the paste for whether we need to add a leading or
2539 trailing space. The code previous to this patch only did a "before" check, with the result that we sometimes added
2540 a second space. In other words, the code did not realize that DOM changes done by pasting could cause formerly
2541 unrendered whitespace to become rendered. Also moved line placeholder clean up code to its own function.
2542 (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): New helper that further refines the notion
2543 of when we can remove a line placeholder. The definition is now, "If a line placeholder is at the visible start
2544 and visible end of its line, keep it; otherwise remove it".
2545 * khtml/editing/htmlediting.h: Declare new functions. Rework inlines in ReplacementFragment class to account for
2546 addition of new "logical newline" at start concept.
2547 (khtml::ReplacementFragment::hasInterchangeNewlineAtStart): New accessor.
2548 (khtml::ReplacementFragment::hasInterchangeNewlineAtEnd): Renamed from hasInterchangeNewline(), since before we
2549 only had a bit for the end, hence we did not need to distinguish it from the start.
2550 * khtml/editing/markup.cpp:
2551 (khtml::createMarkup): Added code to detect and write out markup for cases where we have a "logical newline" at start.
2552 * khtml/xml/dom2_rangeimpl.cpp:
2553 (DOM::RangeImpl::startPosition): New helper.
2554 (DOM::RangeImpl::endPosition): Ditto.
2555 * khtml/xml/dom2_rangeimpl.h: Declare new helpers.
2558 * layout-tests/editing/pasteboard/paste-line-endings-001-expected.txt: Added.
2559 * layout-tests/editing/pasteboard/paste-line-endings-001.html: Added.
2560 * layout-tests/editing/pasteboard/paste-line-endings-002-expected.txt: Added.
2561 * layout-tests/editing/pasteboard/paste-line-endings-002.html: Added.
2562 * layout-tests/editing/pasteboard/paste-line-endings-003-expected.txt: Added.
2563 * layout-tests/editing/pasteboard/paste-line-endings-003.html: Added.
2564 * layout-tests/editing/pasteboard/paste-line-endings-004-expected.txt: Added.
2565 * layout-tests/editing/pasteboard/paste-line-endings-004.html: Added.
2566 * layout-tests/editing/pasteboard/paste-line-endings-005-expected.txt: Added.
2567 * layout-tests/editing/pasteboard/paste-line-endings-005.html: Added.
2568 * layout-tests/editing/pasteboard/paste-line-endings-006-expected.txt: Added.
2569 * layout-tests/editing/pasteboard/paste-line-endings-006.html: Added.
2570 * layout-tests/editing/pasteboard/paste-line-endings-007-expected.txt: Added.
2571 * layout-tests/editing/pasteboard/paste-line-endings-007.html: Added.
2572 * layout-tests/editing/pasteboard/paste-line-endings-008-expected.txt: Added.
2573 * layout-tests/editing/pasteboard/paste-line-endings-008.html: Added.
2574 * layout-tests/editing/pasteboard/paste-line-endings-009-expected.txt: Added.
2575 * layout-tests/editing/pasteboard/paste-line-endings-009.html: Added.
2576 * layout-tests/editing/pasteboard/paste-line-endings-010-expected.txt: Added.
2577 * layout-tests/editing/pasteboard/paste-line-endings-010.html: Added.
2581 2005-03-10 Darin Adler <darin@apple.com>
2583 Reviewed by Richard.
2585 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
2587 * khtml/rendering/render_text.cpp: (getCharacterBreakIterator): Set boolean "got iterator" to true.
2589 2005-03-10 Darin Adler <darin@apple.com>
2593 - fixed <rdar://problem/4042867> "Bigger" changes the font size of too much text when the selection is on a style-change boundary
2595 * khtml/editing/htmlediting.cpp: (khtml::ApplyStyleCommand::applyRelativeFontStyleChange):
2596 Advance out of the starting text node if we're at the end of it.
2598 2005-03-10 Darin Adler <darin@apple.com>
2600 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Fixed assertion for nested calls to write.
2602 2005-03-10 David Harrison <harrison@apple.com>
2606 <rdar://problem/4032346> REGRESSION (Mail): changing 1st line of a URL that wraps to two lines doesn't always update 2nd line
2608 * khtml/rendering/bidi.cpp:
2609 (khtml::RenderBlock::matchedEndLine):
2610 Look at first clean line in case line wrap implicitly dirtied it.
2612 2005-03-10 Maciej Stachowiak <mjs@apple.com>
2616 <rdar://problem/4046018> REGRESSION (TOT): RSS pages don't display anything
2618 * kwq/WebCoreBridge.mm:
2619 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Exempt
2620 feed: and feeds: pages from the local file security check.
2622 2005-03-10 Darin Adler <darin@apple.com>
2624 Change written by Steve Peters, reviewed by me.
2626 - fixed <rdar://problem/4045924> improve compareBoundaryPoints to make style changes faster
2628 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints):
2629 Do early outs in a couple of the loops to make things faster.
2631 2005-03-10 Jens Alfke <jens@apple.com>
2635 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.
2637 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.
2639 This ensures that the applet will get loaded even if there is no explicit </applet> tag.
2641 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.
2643 * khtml/html/html_objectimpl.cpp:
2644 (HTMLAppletElementImpl::closeRenderer):
2645 * khtml/html/html_objectimpl.h:
2646 * khtml/html/htmlparser.cpp:
2647 (KHTMLParser::insertNode):
2648 (KHTMLParser::processCloseTag):
2649 (KHTMLParser::popOneBlock):
2650 * khtml/xml/dom_nodeimpl.h:
2651 (DOM::NodeImpl::closeRenderer):
2653 2005-03-10 Ken Kocienda <kocienda@apple.com>
2659 <rdar://problem/4024929> REGRESSION (Mail): Pasting text with multiple reply levels removes one level instead of all
2661 The code to figure out which node to use to merge into an existing line did not drill into the first inline element
2662 as needed to make the feature work as user expect. Instead, it looked at the first node, and if it was a block, it
2663 skipped that node. This worked for some cases (including the important "paste-as-quotation" case) but obviously
2664 doesn't work for content quoted more than once.
2666 Now, mergeStartNode() will look for the first node in pasted content that is not a block. It will now also look
2667 for nodes specially marked by Mail as a node added to make "Paste As Quotation" work. It won't skip those.
2669 NOTE: This change will break Mail's "Paste As Quotation" feature for TOT WebKit users, but this is only a temporary
2670 problem that will exist until we sync up with Mail's pending change to mark nodes as needed in its pasteAsQuotation:
2673 * khtml/editing/html_interchange.h: Add ApplePasteAsQuotation constant used to check for "marked" blockquotes.
2674 * khtml/editing/htmlediting.cpp:
2675 (khtml::ReplacementFragment::mergeStartNode): Look for first node that is either not a block or is marked as
2676 an ApplePasteAsQuotation node.
2677 (khtml::isMailPasteAsQuotationNode): New helper that looks for nodes marked with ApplePasteAsQuotation.
2678 * khtml/editing/htmlediting.h: Updated header for new function.
2680 This test result changed is an acceptable way.
2682 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
2683 * layout-tests/editing/pasteboard/paste-text-013.html
2685 NOTE: This change causes a regression in this layout test:
2687 * layout-tests/editing/pasteboard/paste-text-013.html
2689 This problem will need to be fixed separately, and this bug has been filed to track this problem:
2690 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
2692 2005-03-09 Maciej Stachowiak <mjs@apple.com>
2694 Reviewed by Richard.
2696 <rdar://problem/4040776> Dashboard (Weather widget) is a memory hog
2698 Change things around so the event listeners for XMLHttpRequest
2699 mark their JS listener objects instead of holding a hard
2700 reference, to avoid an unbreakable reference cycle.
2702 * khtml/ecma/kjs_events.cpp:
2703 (JSAbstractEventListener::JSAbstractEventListener):
2704 (JSAbstractEventListener::~JSAbstractEventListener):
2705 (JSAbstractEventListener::handleEvent):
2706 (JSAbstractEventListener::eventListenerType):
2707 (JSUnprotectedEventListener::JSUnprotectedEventListener):
2708 (JSUnprotectedEventListener::~JSUnprotectedEventListener):
2709 (JSUnprotectedEventListener::listenerObj):
2710 (JSUnprotectedEventListener::windowObj):
2711 (JSUnprotectedEventListener::mark):
2712 (JSEventListener::JSEventListener):
2713 (JSEventListener::~JSEventListener):
2714 (JSEventListener::listenerObj):
2715 (JSEventListener::windowObj):
2716 (JSLazyEventListener::JSLazyEventListener):
2717 * khtml/ecma/kjs_events.h:
2718 * khtml/ecma/kjs_html.h:
2719 * khtml/ecma/kjs_window.cpp:
2720 (Window::getJSEventListener):
2721 (Window::getJSUnprotectedEventListener):
2722 * khtml/ecma/kjs_window.h:
2723 * khtml/ecma/xmlhttprequest.cpp:
2724 (KJS::XMLHttpRequest::putValue):
2725 (KJS::XMLHttpRequest::mark):
2726 * khtml/ecma/xmlhttprequest.h:
2727 * khtml/khtml_part.h:
2729 2005-03-06 Maciej Stachowiak <mjs@apple.com>
2733 <rdar://problem/4005575> Arbitrary file disclosure vulnerability due to ability to load local html from remote content
2735 * khtml/ecma/kjs_html.cpp:
2736 (KJS::HTMLDocument::putValue):
2737 * khtml/ecma/kjs_window.cpp:
2739 (WindowFunc::tryCall):
2741 (LocationFunc::tryCall):
2742 * khtml/khtml_part.cpp:
2744 (KHTMLPart::scheduleLocationChange):
2745 (KHTMLPart::slotRedirect):
2746 (KHTMLPart::processObjectRequest):
2747 * khtml/khtml_part.h:
2748 * khtml/khtmlpart_p.h:
2749 * kwq/KWQKHTMLPart.mm:
2750 (KWQKHTMLPart::openURLRequest):
2751 (KWQKHTMLPart::urlSelected):
2752 (KWQKHTMLPart::createPart):
2753 * kwq/KWQKHTMLPartBrowserExtension.mm:
2754 (KHTMLPartBrowserExtension::createNewWindow):
2755 * kwq/WebCoreBridge.h:
2756 * kwq/WebCoreBridge.mm:
2757 (hasCaseInsensitivePrefix):
2758 (-[WebCoreBridge didNotOpenURL:pageCache:]):
2759 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]):
2761 2005-03-09 Richard Williamson <rjw@apple.com>
2763 Fixed <rdar://problem/4032938> Safari: text layout for MS P Gothic font is corrupted
2765 Remove our hacked special case now we have our own cache of
2766 which fonts are fixed pitch.
2771 (QFont::isFixedPitch):
2773 2005-03-09 David Harrison <harrison@apple.com>
2777 <rdar://problem/4037141> REGRESSION (Mail): Pasting deletes preceding blank lines with certain steps
2779 * khtml/editing/htmlediting.cpp:
2780 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
2781 Add check for anonymous text after blocks.
2783 2005-03-08 Ken Kocienda <kocienda@apple.com>
2789 <rdar://problem/4039661> crash in ApplyStyleCommand::applyBlockStyle pasting contents of webpage into Mail or Blot
2790 <rdar://problem/4039672> hang in moveParagraphContentsToNewBlockIfNecessary after pasting contents of webpage into Blot
2792 * khtml/editing/htmlediting.cpp:
2793 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Fix for 4039672. Iteration needs to do
2794 a traverseNextSibling(), not a traverseNextNode(). The latter might iterate into a child that already got moved, and
2795 the code can infinite loop as a result.
2796 (khtml::ApplyStyleCommand::applyBlockStyle): Fix for 4039661. This function iterates over a set of nodes to apply
2797 block styles. Before, the iteration would go from the start to the end of the selection, and apply block styles
2798 as it went. However, the act of applying style could confuse the iteration. Now I iterate and store the relevant
2799 nodes in QPtrList before doing any style manipulation, and then iterate that set of nodes.
2801 2005-03-08 Darin Adler <darin@apple.com>
2803 Change written by Hyatt, reviewed by me.
2805 - fixed <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
2807 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth):
2808 Only use a minWidth of 0 for images with a percentage value. Other replaced elements aren't scalable
2809 so their minWidth should be their calculated width. This has been wrong all along, but it's a relatively
2810 safe change because it only affects replaced elements' min-width.
2812 2005-03-08 David Harrison <harrison@apple.com>
2816 <rdar://problem/4039006> REGRESSION (Mail): Command-left-arrow goes to the start of the wrong line in particular message
2818 * khtml/editing/visible_units.cpp:
2819 (khtml::startOfLine):
2820 Use firstLeafChild() instead of firstChild().
2822 2005-03-08 Richard Williamson <rjw@apple.com>
2824 Fixed by Tom Madden.
2826 Fixed <rdar://problem/4038586> 8A402: Osaka-Mono text overlaps when typing with input method
2828 We weren't clearing the "all ascii" flag when setting text on
2831 Reviewed by Richard Williamson.
2833 * khtml/rendering/render_text.cpp:
2834 (RenderText::setText):
2836 2005-03-08 Darin Adler <darin@apple.com>
2838 Reviewed by Ken and Maciej.
2840 - fixed <rdar://problem/3988809> REGRESSION (Mail): wide space characters are turned into plain old spaces when typed or pasted
2842 Changed the few places where it matters to use a "collapsible whitespace" concept instead of
2843 the general whitespace concept. This means treating only ' ' and '\n' specially instead of
2844 including other space characters, which matches what the space-collapsing logic does in RenderText,
2845 although it really needs to behave differently based on whitespace mode.
2847 * khtml/editing/visible_text.h: (khtml::isCollapsibleWhitespace): Added. This returns true only for
2848 ' ' and '\n' since they are the only characters collapsed once text is in the DOM. But really it
2849 can't do the job ignoring white-space mode, so some day it must go.
2851 * khtml/editing/html_interchange.cpp: (convertHTMLTextToInterchangeFormat): Changed to use
2852 isCollapsibleWhitespace and removed unnecessary calls to latin1().
2854 * khtml/editing/htmlediting.cpp:
2855 (khtml::isNBSP): Removed unnecessary creation/destruction of QChar each time this is called.
2856 (khtml::nextCharacterIsCollapsibleWhitespace): Renamed from isWS and changed to use isCollapsibleWhitespace.
2857 (khtml::DeleteSelectionCommand::fixupWhitespace): Use isCollapsibleWhitespace instead of isWS,
2858 since we only want to do our NBSP tricks for collapsible whitespace.
2859 (khtml::InsertTextCommand::input): Changed use of isTab to instead say == "\t" since that does the
2860 same thing and is arguably just as clear. Changed use of isWS to == " " since the input text can't
2861 include any "\n" characters, and really a plain old space is the only collapsible thing that can
2862 be passed in. Use isCollapsibleWhitespace instead of isWS since we want to do NBSP tricks only for
2863 collapsible whitespace, not all whitespace.
2864 (khtml::InsertTextCommand::insertSpace): Use isCollapsibleWhitespace instead of isWS since we want
2865 to do NBSP tricks only for collapsible whitespace, not all whitespace.
2866 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
2868 * khtml/xml/dom_position.h: Changed treatNBSPAsWhiteSpace parameters to considerNonCollapsibleWhitespace
2869 parameters. The most common callers are only interested in collapsible whitespace, and the smart copy
2870 and paste callers want to include all whitespace, including non-breaking spaces and all the Unicode spaces.
2871 * khtml/xml/dom_position.cpp:
2872 (DOM::Position::leadingWhitespacePosition): Rename the parameter, and use either QChar::isSpace or
2873 isCollapsibleWhitespace depending on the boolean passed in.
2874 (DOM::Position::trailingWhitespacePosition): Ditto.
2876 2005-03-07 John Sullivan <sullivan@apple.com>
2880 - <rdar://problem/4040868> REGRESSION (Mail, 403-403+): Drag and drop deletes text,
2881 many other bad editing problems
2883 * khtml/rendering/render_text.cpp:
2884 (RenderText::caretMaxOffset):
2885 A "-" should have been a "+" in this method that was tweaked an hour ago. Editing
2886 was completely horked.
2888 2005-03-07 Richard Williamson <rjw@apple.com>
2890 Additional nil check from fix for 4040749.
2892 * khtml/rendering/render_box.cpp:
2893 (RenderBox::setStyle):
2895 2005-03-07 Richard Williamson <rjw@apple.com>
2897 Additional nil check from fix for 4040749.
2899 * khtml/rendering/render_layer.cpp:
2900 (RenderLayer::updateLayerPosition):
2902 2005-03-07 David Harrison <harrison@apple.com>
2906 <rdar://problem/4033202> REGRESSION (Mail): Can't arrow up at a particular spot in a particular Mail message
2908 Doublecheck that new position is really on a different line, because the VisiblePosition constructor does not.
2909 Filed <rdar://problem/4040763> for that problem.
2911 * khtml/editing/visible_units.cpp:
2912 (khtml::previousLinePosition):
2914 2005-03-07 Richard Williamson <rjw@apple.com>
2916 Fixed <rdar://problem/4040749> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
2918 When layers are dynamically created/removed as a result of changing opacity they weren't being correctly
2919 sized and positioned. This happens whenever opacity goes from < 1 to 1.
2923 * khtml/rendering/render_box.cpp:
2924 (RenderBox::setStyle):
2925 * khtml/rendering/render_layer.cpp:
2926 (RenderLayer::updateLayerPosition):
2928 2005-03-07 Christy Warren <kali@apple.com>
2932 * khtml/rendering/render_text.cpp:
2933 (RenderText::caretMinOffset): modified to handle BIDI case by checking all text boxes for min offset
2934 (RenderText::caretMaxOffset): modified to handle BIDI case by checking all text boxes for max offset
2936 2005-03-07 David Harrison <harrison@apple.com>
2940 <rdar://problem/4029225> REGRESSION (Mail): Crash if hit return after dragging in attachment - DeleteSelectionCommand::initializePositionData
2942 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.
2943 Filed <rdar://problem/4040358> RenderBR height() is not accurate.
2945 * khtml/editing/htmlediting.cpp:
2946 (khtml::ReplaceSelectionCommand::doApply):
2947 When height is 0, double check that the placeholder is the first position on the line.
2951 2005-03-07 Ken Kocienda <kocienda@apple.com>
2957 <rdar://problem/4040136> Expose SPI for WebCore's functions to create document fragments from plain text and markup strings
2959 * kwq/DOMHTML.mm: Add two new SPI functions.
2960 (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:])
2961 (-[DOMHTMLDocument _createDocumentFragmentWithText:])
2962 * kwq/DOMPrivate.h: Declare the new SPI here, a privately-exported header, so Mail can make use of it.
2964 2005-03-07 Ken Kocienda <kocienda@apple.com>
2970 <rdar://problem/4039676> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date
2972 * khtml/editing/htmlediting.cpp:
2973 (khtml::ReplaceSelectionCommand::doApply): Code to "eat" a <br> element, that was creating an otherwise empty line, was running
2974 when it should not. If the content being pasted in does not end in a "logical" newline itself, then the <br> already
2975 in the content needs to be preserved. A simple one-line change now sees to this.
2977 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: This test now has an extra, but harmless,
2978 <br> at the end of a paragraph. This makes sense given the code change.
2981 * layout-tests/editing/pasteboard/paste-text-018-expected.txt: Added.
2982 * layout-tests/editing/pasteboard/paste-text-018.html: Added.
2984 2005-03-07 Ken Kocienda <kocienda@apple.com>
2990 <rdar://problem/4035648> REGRESSION (Mail): line feed in source HTML file causes bad copy/paste behavior
2992 The createMarkup() function in markup.cpp iterates over the nodes in a range,
2993 and does some bookkeeping to figure out when to add close tags to the markup.
2994 Some code added at the start of the loop to prevent markup from being written
2995 for unrendered nodes short-circuited the rest of the loop, and so prevented
2996 the close-tag-writing code from running when it should.
2998 This is why the "plain" text wound up inside of the bold tag in the example
2999 above. The addition of the unrendered return character caused an incorrect
3000 delay in the close tag for the bold element from being written out, with the
3001 result being that it wound up including additional content.
3003 The fix is to add checks for node renderers throughout the loop at the points
3004 where markup is written out for each node. This allows the additional close
3005 tag logic to run as needed.
3007 All layout tests pass with this change.
3009 * khtml/editing/markup.cpp:
3010 (khtml::createMarkup)
3014 * layout-tests/editing/pasteboard/paste-4035648-fix-expected.txt: Added.
3015 * layout-tests/editing/pasteboard/paste-4035648-fix.html: Added.
3017 2005-03-06 Christy Warren <kali@appple.com>
3021 * khtml/rendering/render_text.cpp:
3022 (lastRendererOnPrevLine): helper for RenderText::caretRect
3023 (RenderText::caretRect): added code to properly handle bidi ordered text boxes
3025 2005-03-06 Christy Warren <kali@apple.com>
3029 * khtml/editing/visible_position.cpp: Eliminated code that cuts off searching through the text boxes based on an assumption that breaks under bidi
3030 (khtml::VisiblePosition::isCandidate):
3031 * kwq/KWQFontMetrics.mm:
3032 (QFontMetrics::checkSelectionPoint): Made the initialization of the WebCoreStyle honor the reversed flag
3034 2005-03-05 John Sullivan <sullivan@apple.com>
3038 - fixed <rdar://problem/4038417> Mail crashed in StyleChange::checkForLegacyHTMLStyleChange
3039 when composing a reply
3041 * khtml/editing/htmlediting.cpp:
3042 (khtml::StyleChange::checkForLegacyHTMLStyleChange):
3043 Added missing nil check.
3045 2005-03-05 Darin Adler <darin@apple.com>
3049 - fixed <rdar://problem/4038478> Crash in renderer viewing RSS feed at feed://wvs.topleftpixel.com/index.rdf
3051 * khtml/xml/dom_docimpl.cpp: (widgetForNode): Check for nil before going from node to renderer.
3053 2005-03-05 Darin Adler <darin@apple.com>
3055 Reviewed by Richard.
3057 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
3059 * khtml/rendering/render_text.cpp:
3060 (getCharacterBreakIterator): Added. Helper that sets up an iterator for the passed-in text.
3061 Shares a single global iterator (fast, albeit not thread-safe).
3062 (RenderText::previousOffset): Changed to call getCharacterBreakIterator.
3063 (RenderText::nextOffset): Ditto.
3065 2005-03-05 Ken Kocienda <kocienda@apple.com>
3071 <rdar://problem/4038267> REGRESSION (Mail): Crash copying and pasting end of paragraph
3073 Code to handle content that has a "logical" newline at the end of the pasted content, and the code
3074 to adjust the selection at the end of the paste operation made an assumption that at least one
3075 node had been inserted by the paste command. This is not necessarily true in the case where the sole content
3076 in the pasted content is one of these "logical" newlines. Adjust some code around so that we don't deref
3077 null, but still adjust the selection correctly for this case. In each of the two functions below, some
3078 null checks have been added, and some code has been rearranged a little bit to continue on through
3079 the end of completeHTMLReplacement, even if no nodes have been inserted. The patch looks bigger and more
3080 complicated than the conceptual change.
3082 * khtml/editing/htmlediting.cpp:
3083 (khtml::ReplaceSelectionCommand::doApply)
3084 (khtml::ReplaceSelectionCommand::completeHTMLReplacement)
3086 * layout-tests/editing/pasteboard/paste-4038267-fix-expected.txt: Added.
3087 * layout-tests/editing/pasteboard/paste-4038267-fix.html: Added.
3089 2005-03-05 Darin Adler <darin@apple.com>
3093 - fixed <rdar://problem/4025918> images copied from Safari with relative src URLs aren't pasted into Mail messages (KURL resolves base URLs incorrectly)
3095 * kwq/KWQKURL.mm: (KURL::KURL): Add a slash at the start of the path if a relative part is adding
3096 a path onto a URL that has "pre-path" bits like host name, but no path yet. This doesn't come up
3097 for http because in that case we add a trailing "/" as part of canonicalization.
3099 2005-03-04 John Sullivan <sullivan@apple.com>
3103 - fixed <rdar://problem/4033705> REGRESSION (Mail): Copy/Paste from Excel
3104 crashes Mail in KWQKHTMLPart::fontForSelection(bool*) const + 232
3106 * kwq/KWQKHTMLPart.mm:
3107 (KWQKHTMLPart::fontForSelection):
3108 Check for nil startNode, not just nil renderer.
3110 2005-03-04 David Harrison <harrison@apple.com>
3112 Reviewed by Ken, Richard.
3114 <rdar://problem/3996383> REGRESSION (Mail): Deleting all of first line also deletes line ending
3116 Problem was the placeholder check was based on 0 height block, but the block in this
3117 case is the BODY, which has other content even though the paragraph is gone.
3119 * khtml/editing/htmlediting.cpp:
3120 (khtml::CompositeEditCommand::insertBlockPlaceholder):
3121 Now does insert instead of append!
3123 (khtml::CompositeEditCommand::appendBlockPlaceholder):
3124 New. Actually does append.
3126 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
3127 Renamed from insertBlockPlaceholderIfNeeded because it can insert or append. Also accepts "force insert" flag.
3129 (khtml::CompositeEditCommand::removeBlockPlaceholder):
3130 Renamed for succinctness from removeBlockPlaceholderIfNeeded.
3132 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
3133 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
3134 Use renamed methods.
3136 (khtml::DeleteSelectionCommand::doApply):
3137 Use addBlockPlaceholderIfNeeded "force insert" flag if deleting whole paragraphs did not leave an empty one.
3139 (khtml::InsertParagraphSeparatorCommand::doApply):
3140 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
3141 (khtml::InsertTextCommand::input):
3142 Use renamed methods.
3144 * khtml/editing/htmlediting.h:
3145 Renamed and new methods per above.
3148 2005-03-04 Chris Blumenberg <cblu@apple.com>
3150 Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after pasting attachment at end of message
3154 * khtml/editing/visible_units.cpp:
3155 (khtml::endOfParagraph): don't consider text nodes that have no rendered characters
3157 2005-03-04 Richard Williamson <rjw@apple.com>
3159 Fixed <rdar://problem/4034764> REGRESSION(125-188)Viewing text/plain page and going back/forward corrupts HTML pages (google.com)
3161 The parse mode wasn't be restored to the document when going
3166 * kwq/KWQKHTMLPart.mm:
3167 (KWQKHTMLPart::openURLFromPageCache):
3168 * kwq/KWQPageState.h:
3169 * kwq/KWQPageState.mm:
3170 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]):
3172 2005-03-04 Ken Kocienda <kocienda@apple.com>
3176 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Shame on me!
3177 I landed my last fix without running layout tests. This one changes in a subtle, but
3180 2005-03-04 Ken Kocienda <kocienda@apple.com>
3182 Reviewed by Harrison
3186 <rdar://problem/4032543> REGRESSION (Mail): Mail hangs when quoted text is pasted twice
3188 This code change fixes the bug in a non-obvious way. The root cause of the problem was
3189 that a VisiblePosition created using an affinity originating in Mail code caused
3190 two VisiblePosition objects that should have been equal to differ only in their
3191 affinities, which in turn caused us to run a code path that should not have run.
3193 * khtml/editing/visible_position.cpp:
3194 (khtml::VisiblePosition::VisiblePosition): Added copy constructor.
3195 (khtml::VisiblePosition::next): Factored out inline code that used to be here into new
3196 setAffinityUsingLinePosition() function.
3197 (khtml::isEqualIgnoringAffinity): New helper to handle cases when affinity in equality check does
3198 not matter. However, we want to know about such cases where a VisiblePosition differs only by affinity,
3199 and the code will assert in development when this happens.
3200 (khtml::isNotEqualIgnoringAffinity): Ditto, but not. :)
3201 (khtml::setAffinityUsingLinePosition): New helper function mentioned above. This will "correct"
3202 upstream affinity to downstream if the affinity does not make a difference for the position.
3203 * khtml/editing/visible_position.h:
3204 * khtml/editing/visible_range.h: Wacky bug. The operator== for this class took VisiblePosition classes!
3205 * khtml/editing/visible_units.cpp:
3206 (khtml::isStartOfParagraph): Now performs equality check without regard to affinity.
3207 (khtml::isEndOfParagraph): Ditto.
3208 (khtml::isStartOfBlock): Ditto.
3209 (khtml::isEndOfBlock): Ditto.
3210 * kwq/WebCoreBridge.mm:
3211 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Adjusts the affinity using setAffinityUsingLinePosition()
3214 2005-03-04 Darin Adler <darin@apple.com>
3218 - fixed <rdar://problem/4036817> REGRESSION: ctrl-y broken when a line + carriage return cut
3220 * khtml/editing/htmlediting.h: Added insertTextRunWithoutNewlines.
3221 * khtml/editing/htmlediting.cpp:
3222 (khtml::InsertTextCommand::input): Added assertion to make sure strings with newlines don't get
3224 (khtml::TypingCommand::insertText): Added. Takes the name of the old function, but is a new
3225 level that breaks runs into lines and inserts each one separately.
3226 (khtml::TypingCommand::insertTextRunWithoutNewlines): Renamed old insertText to this.
3228 * khtml/dom/dom_string.h: Made substring be a const member function.
3229 * khtml/dom/dom_string.cpp: (DOM::DOMString::substring): Made this const.
3231 2005-03-04 Darin Adler <darin@apple.com>
3235 - fixed <rdar://problem/4020413> REGRESSION (Mail): can't use fonts with names that start with "#" in Mail (Korean fonts)
3237 * khtml/css/css_valueimpl.cpp:
3238 (DOM::isLegalIdentifier): Added. Commented out and not used.
3239 (DOM::quoteStringIfNeeded): Quotes the string if needed. For now only if it starts with "#".
3240 (DOM::CSSPrimitiveValueImpl::cssText): Call quoteStringIfNeeded when asked for cssText for an arbitrary string, since we
3241 need text you can re-parse.
3242 (DOM::FontFamilyValueImpl::cssText): Ditto.
3244 * khtml/editing/markup.cpp:
3245 (khtml::startMarkup): Added comments about lack of quoting for attributes.
3246 (khtml::createMarkup): Ditto.
3248 2005-03-04 Adele Amchan <adele@apple.com>
3252 Fix for <rdar://problem/4021711> REGRESSION(125-188) blank pages when browsing forum at cooperativeresearch.org - cached external script problem
3254 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::scriptHandler): set flag needToRefCachedScript so we can make sure
3255 notifyFinished is called after pendingSrc is set up with the right data from the cached script
3257 2005-03-04 Ken Kocienda <kocienda@apple.com>
3263 <rdar://problem/4029632> Tiger 8A398:- Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
3265 * khtml/editing/htmlediting.cpp:
3266 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): VisiblePosition constructor
3267 was failing to yield a position for a node just pasted into the document since a layout was needed
3268 for the calculation to come out right. Layout added. Crash gone.
3272 2005-03-03 Chris Blumenberg <cblu@apple.com>
3274 Fixed: <rdar://problem/3992803> Cannot navigate through list items with the keyboard, you're stuck in the same <li> block unless you click out
3276 Reviewed by harrison.
3278 * khtml/rendering/render_line.cpp:
3279 (khtml::RootInlineBox::closestLeafChildForXPos): avoid returning list markers when possible. Also improved heuristic for returning the best InlineBox given the passed X position.
3282 2005-03-03 Ken Kocienda <kocienda@apple.com>
3288 <rdar://problem/4035198> Pasting text with different styles does not get reproducible results
3290 I had a good idea yesterday to improve the way we "fixup" styles after
3291 pasting, but i chose a poor data structure to do it, a map of
3292 nodes-to-styles. In the fixup step, I iterated over the map elements and
3293 did the fixup. However, since the order in which the items would come
3294 out of the map is indeterminate, we got unpredictable results.
3296 So, the concept was good, but the implementation was flawed. I have
3297 fixed this mapping to be a list instead, so the order that nodes are
3298 evaluated in the fixup step is document order. This works nicely.
3300 * khtml/editing/htmlediting.cpp:
3301 (khtml::ReplacementFragment::~ReplacementFragment): No longer need to explicity deref nodes and
3302 styles saved away for later fixup. This is now handled by the new NodeDesiredStyle class.
3303 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls computeAndStoreNodeDesiredStyle,
3304 function renamed from mapDesiredStyleForNode.
3305 Now accepts a QValueList<NodeDesiredStyle> in place of the old map.
3306 (khtml::NodeDesiredStyle::NodeDesiredStyle): New class that represents a node-to-style mapping.
3307 (khtml::NodeDesiredStyle::~NodeDesiredStyle): Ditto.
3308 (khtml::NodeDesiredStyle::operator=): Ditto.
3309 (khtml::ReplaceSelectionCommand::doApply): Now calls computeAndStoreNodeDesiredStyle,
3310 function renamed from mapDesiredStyleForNode.
3311 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Now operates on a QValueList<NodeDesiredStyle> in
3312 place of the old map.
3313 (khtml::computeAndStoreNodeDesiredStyle): Renamed from mapDesiredStyleForNode. Now operates on a
3314 QValueList<NodeDesiredStyle> in place of the old map.
3315 * khtml/editing/htmlediting.h:
3316 (khtml::NodeDesiredStyle): New class that represents a node-to-style mapping.
3317 (khtml::ReplacementFragment::desiredStyles): Now returns a QValueList<NodeDesiredStyle> in place of the old map.
3319 * layout-tests/editing/style/typing-style-003-expected.txt: Results changed in an acceptable way.
3321 2005-03-02 Darin Adler <darin@apple.com>
3325 - fixed <rdar://problem/4029741> REGRESSION (188-189): <input type=text> are cleared when you hide/show them
3327 * khtml/html/html_formimpl.h: Added detach functions for both input and text area elements, since
3328 both have m_valueMatchesRenderer flags.
3329 * khtml/html/html_formimpl.cpp:
3330 (DOM::HTMLInputElementImpl::detach): Set m_valueMatchesRenderer to false, since the renderer is going away.
3331 (DOM::HTMLTextAreaElementImpl::detach): Ditto.
3333 2005-03-02 Ken Kocienda <kocienda@apple.com>
3339 <rdar://problem/4006151> in reply, caret moves to next line after toggling bold style then typing
3341 * khtml/editing/htmlediting.cpp:
3342 (khtml::ApplyStyleCommand::applyInlineStyle): Defer cleaning up empty style until the end of the
3343 function. In some situations, the render tree can get confused when we do this removal up front.
3344 I wish I understood the reasons more deeply, but this bit of code shuffling seems harmless, and
3347 2005-03-02 Darin Adler <darin@apple.com>
3351 - fixed <rdar://problem/4024966> crash happened twice in [KWQTextField setHasFocus:] + 0xe8
3353 Added more nil checks to the widget implementations. Anywhere a widget pointer is used, do a nil check,
3354 rather than relying on high level assumptions about which calls can and can't destroy the HTML element
3355 (and hence the widget). The case in the bug seems to be a case where scrolling destroyed the element.
3356 We can't be sure this fixes the bug, but we can be relatively sure we didn't introduce any new problems,
3357 because this just avoids nil-dereferencing.
3360 (-[KWQButton becomeFirstResponder]):
3361 (-[KWQButton nextKeyView]):
3362 (-[KWQButton previousKeyView]):
3363 * kwq/KWQListBox.mm:
3364 (-[KWQTableView mouseDown:]):
3365 (-[KWQTableView becomeFirstResponder]):
3366 (-[KWQTableView numberOfRowsInTableView:]):
3367 (-[KWQTableView tableViewSelectionDidChange:]):
3368 (-[KWQTableView tableView:shouldSelectRow:]):
3369 (-[KWQTableView selectionShouldChangeInTableView:]):
3370 * kwq/KWQScrollBar.mm:
3371 (-[KWQScrollBar scroll:]):
3373 (-[KWQSlider mouseDown:]):
3374 (-[KWQSlider slide:]):
3375 (-[KWQSlider becomeFirstResponder]):
3376 (-[KWQSlider nextKeyView]):
3377 (-[KWQSlider previousKeyView]):
3378 * kwq/KWQTextArea.mm:
3379 (-[KWQTextAreaTextView becomeFirstResponder]):
3380 (-[KWQTextAreaTextView resignFirstResponder]):
3381 (-[KWQTextAreaTextView mouseDown:]):
3382 * kwq/KWQTextField.mm:
3383 (-[KWQTextFieldController action:]):
3384 (-[KWQTextFieldController controlTextDidEndEditing:]):
3385 (-[KWQTextFieldController controlTextDidChange:]):
3386 (-[KWQTextFieldController textView:didHandleEvent:]):
3387 (-[KWQTextFieldController setHasFocus:]):
3389 2005-03-02 Richard Williamson <rjw@apple.com>
3391 Fixed <rdar://problem/4031483> Leak (RenderObject::createInlineBox) reproducible with Stock widget
3393 We were leaking inline block line boxes. Argh!
3397 * khtml/rendering/render_flow.cpp:
3398 (RenderFlow::dirtyLineBoxes):
3399 * khtml/rendering/render_line.cpp:
3400 (khtml::InlineBox::deleteLine):
3402 2005-03-02 Chris Blumenberg <cblu@apple.com>
3404 Fixed: <rdar://problem/3976872> REGRESSION (Mail): Pasted plain text doesn't get the proper style if pasted into newlines
3406 Reviewed by kocienda.
3408 * khtml/editing/htmlediting.cpp:
3409 (khtml::EditCommand::styleAtPosition): new, factored out from calculateStyleBeforeInsertion
3410 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): call styleAtPosition
3411 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): clear new m_insertionStyle ivar
3412 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): deref new m_insertionStyle ivar
3413 (khtml::ReplaceSelectionCommand::doApply): store the style so it later be applied when matching style
3414 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply style from m_insertionStyle when matching style
3415 * khtml/editing/htmlediting.h:
3417 2005-03-02 Maciej Stachowiak <mjs@apple.com>
3421 <rdar://problem/4031718> REGRESSION (401-401+): Safari reproducible crash setting up scope in JSLazyEventListener::parseCode authenticating to bugweb
3423 * khtml/ecma/kjs_events.cpp:
3424 (JSLazyEventListener::parseCode): If originalNode is NULL, don't
3425 mess with the scope chain.
3427 * khtml/html/html_baseimpl.cpp:
3428 (HTMLBodyElementImpl::parseHTMLAttribute): For handlers that are
3429 delcared on body but set on the document, pass NULL to avoid
3430 swizzling the scope chain. It turns out that this is what browsers
3431 do, and it finesses the crash.
3433 2005-03-02 David Harrison <harrison@apple.com>
3437 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
3439 * khtml/editing/htmlediting.cpp:
3440 (khtml::ReplaceSelectionCommand::doApply):
3442 2005-03-02 Ken Kocienda <kocienda@apple.com>
3447 <rdar://problem/4020574> REGRESSION (Mail): copy/paste first part of reply-quoted text alters downstream style
3449 The problem was that the operation to move nodes following the newly-pasted nodes did not preserve the
3450 style of these moved nodes. I have generalized some of the functions that compute and preserve styles
3451 for nodes and then apply these styles after a DOM operation.
3453 * khtml/editing/htmlediting.cpp:
3454 (khtml::ReplacementFragment::~ReplacementFragment): Call new derefNodesAndStylesInMap() helper function
3455 in place of old code that had this deref'ing inline.
3456 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls new mapDesiredStyleForNode() helper
3457 function place of old code that had this style computation inline.
3458 (khtml::ReplacementFragment::removeStyleNodes): Updated comment for new helper name.
3459 (khtml::ReplaceSelectionCommand::doApply): Now calls new helpers in place of helpers whose names were changed,
3460 or in place of pre-refactored inline code.
3461 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Renamed from applyStyleToInsertedNodes(). Now generalized
3462 to take the map of nodes to use for the fixup. This makes it possible to call this code with different maps,
3463 and that is needed to fix the bug.
3464 (khtml::mapDesiredStyleForNode): New helper function to compute the inheritable styles for a given node
3465 and map this style to the given node in the given map. This function now also includes the code that was
3466 in the removeBlockquoteColorsIfNeeded(). This latter helper has now been removed.
3467 (khtml::derefNodesAndStylesInMap): Simple helper to deref map members.
3468 * khtml/editing/htmlediting.h:
3469 (khtml::ReplacementFragment::desiredStyles): New helper to return map of nodes-to-desiredStyles.
3471 2005-03-01 Ken Kocienda <kocienda@apple.com>
3477 <rdar://problem/4011358> REGRESSION(Mail): after dragging text to mail message and deleting, typing or dragging new text doesn't work
3479 * khtml/editing/visible_position.cpp:
3480 (khtml::VisiblePosition::isCandidate): Insertion point disappearing was due to a failed
3481 check here after deleting all the content in the body element. The special "empty block"
3482 needs to add check for DOM children. A block may have straggling anonymous render children in
3483 some cases, and so the check needs to be (!DOM-kids || !render-kids).
3485 Also, I botched the last checkin trying to split these two patches in my tree. Wrong layout tests
3486 got checked in, I checked in a conflict marker in the Changelog, etc. I fixed everything with this checkin.
3488 2005-03-01 Ken Kocienda <kocienda@apple.com>
3492 Improved fix for this bug:
3494 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
3496 Maciej and I discussed this situation at length, and we came up with a better fix than I did earlier.
3498 * khtml/editing/htmlediting.cpp:
3499 (khtml::InsertParagraphSeparatorCommand::doApply): Simplify one special case so that it only handles the
3500 "last in block" situation. Remove special case for "downstream node is in different block" and handle
3501 this case with a little bit of special code in the general insertion case.
3503 Results studied to make sure there were no problems.
3505 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt
3506 * layout-tests/editing/inserting/insert-div-001-expected.txt
3507 * layout-tests/editing/inserting/insert-div-002-expected.txt
3508 * layout-tests/editing/inserting/insert-div-004-expected.txt
3509 * layout-tests/editing/inserting/insert-div-005-expected.txt
3510 * layout-tests/editing/inserting/insert-div-009-expected.txt
3511 * layout-tests/editing/inserting/insert-div-014-expected.txt
3512 * layout-tests/editing/inserting/insert-div-018-expected.txt
3513 * layout-tests/editing/inserting/insert-div-024-expected.txt
3514 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
3515 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
3516 * layout-tests/editing/pasteboard/paste-text-015-expected.txt
3517 * layout-tests/editing/style/block-style-004-expected.txt
3518 * layout-tests/editing/style/block-style-005-expected.txt
3519 * layout-tests/editing/style/block-style-006-expected.txt
3523 * layout-tests/editing/inserting/insert-div-027.html
3524 * layout-tests/editing/inserting/insert-div-027-expected.txt
3526 2005-03-01 David Hyatt <hyatt@apple.com>
3528 Fix for 4030890, regression with <sup> on Google. Fix some bogus != comparison checks in verticalPositionHint.
3532 (RenderObject::getVerticalPosition):
3534 2005-03-01 Chris Blumenberg <cblu@apple.com>
3536 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
3540 * khtml/editing/htmlediting.cpp:
3541 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
3542 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
3543 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
3544 * layout-tests/editing/deleting/smart-delete-001.html: Added.
3545 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
3546 * layout-tests/editing/deleting/smart-delete-002.html: Added.
3548 2005-03-01 Richard Williamson <rjw@apple.com>
3550 Fixed <rdar://problem/4029772> Weather widgets use a lot of memory (more that other widgets)
3552 The string objects created by KWQHeaderStringFromDictionary() leaked.
3554 Reviewed by John Louch.
3557 (KWQHeaderStringFromDictionary):
3559 2005-03-01 Jens Alfke <jens@apple.com>
3563 <rdar://problem/4004531> Simple Sun Signed Applet throws exceptions; doesn't run
3564 Two fixes for the way we extract the parameter-y goodness from <object> tags.
3566 * khtml/rendering/render_frames.cpp:
3567 (RenderPartObject::updateWidget):
3569 2005-03-01 Richard Williamson <rjw@apple.com>
3571 Fixed <rdar://problem/3990258> REGRESSION (125.12-181): top of picture that spans two pages is cut off on print from Safari
3573 The problem was due to incorrect "object truncation" in RenderFlow::paintLines.
3574 We attempt to push objects down if they don't fit on a page at
3575 paint time. If the attempt to push object down failed we just
3576 didn't paint at all.
3580 * khtml/rendering/render_flow.cpp:
3581 (RenderFlow::paintLines):
3583 2005-03-01 Chris Blumenberg <cblu@apple.com>
3585 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
3589 * khtml/editing/htmlediting.cpp:
3590 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
3591 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
3592 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
3593 * layout-tests/editing/deleting/smart-delete-001.html: Added.
3594 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
3595 * layout-tests/editing/deleting/smart-delete-002.html: Added.
3597 2005-03-01 Ken Kocienda <kocienda@apple.com>
3603 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
3605 * khtml/editing/htmlediting.cpp:
3606 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
3608 2005-03-01 Maciej Stachowiak <mjs@apple.com>
3612 <rdar://problem/4003774> REGRESSION(125-181): JavaScript problems @ Yankee/Dixie quiz
3614 Reworked how scopes are set up for event handlers to match other
3615 browser. This includes the following changes:
3617 - Special scope entries are set up at the time the event handler
3618 is created, not at the time it fires.
3620 - Special scope is only set up for event handlers set in the html
3621 source through an html attribute, not for handlers set using
3622 addEventHandler or setting JS properties like onclick through
3625 - Special scope is based on the DOM node on which the handler is
3626 an attribute, not the event target.
3628 This fixes the regression while allowing the fix to
3629 <rdar://problem/3798453> (DIG: getting variable with same name as
3630 DOM element attribute gets attribute value instead) to keep
3633 * khtml/ecma/kjs_events.cpp:
3634 (JSEventListener::handleEvent):
3635 (JSLazyEventListener::JSLazyEventListener):
3636 (JSLazyEventListener::parseCode):
3637 * khtml/ecma/kjs_events.h:
3638 * khtml/ecma/kjs_proxy.cpp:
3639 (KJSProxyImpl::createHTMLEventHandler):
3640 * khtml/ecma/kjs_proxy.h:
3641 * khtml/ecma/kjs_window.cpp:
3642 (Window::getJSLazyEventListener):
3643 * khtml/ecma/kjs_window.h:
3644 * khtml/html/html_baseimpl.cpp:
3645 (HTMLBodyElementImpl::parseHTMLAttribute):
3646 (HTMLFrameElementImpl::parseHTMLAttribute):
3647 (HTMLFrameSetElementImpl::parseHTMLAttribute):
3648 * khtml/html/html_elementimpl.cpp:
3649 (HTMLElementImpl::parseHTMLAttribute):
3650 * khtml/html/html_formimpl.cpp:
3651 (DOM::HTMLFormElementImpl::parseHTMLAttribute):
3652 (DOM::HTMLButtonElementImpl::parseHTMLAttribute):
3653 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
3654 (DOM::HTMLLabelElementImpl::parseHTMLAttribute):
3655 (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
3656 (DOM::HTMLTextAreaElementImpl::parseHTMLAttribute):
3657 * khtml/html/html_imageimpl.cpp:
3658 (HTMLImageElementImpl::parseHTMLAttribute):
3659 * khtml/html/html_objectimpl.cpp:
3660 (HTMLObjectElementImpl::parseHTMLAttribute):
3661 * khtml/khtml_part.cpp:
3662 (KHTMLPart::createHTMLEventListener):
3663 * khtml/khtml_part.h:
3664 * khtml/xml/dom_docimpl.cpp:
3665 (DocumentImpl::createHTMLEventListener):
3666 * khtml/xml/dom_docimpl.h:
3670 2005-03-01 Chris Blumenberg <cblu@apple.com>
3672 Backed out my patch since the tree was closed.
3674 * khtml/editing/htmlediting.cpp:
3675 (khtml::DeleteSelectionCommand::initializePositionData):
3676 * khtml/editing/jsediting.cpp:
3678 2005-03-01 Chris Blumenberg <cblu@apple.com>
3680 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
3684 * khtml/editing/htmlediting.cpp:
3685 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
3686 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
3687 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
3688 * layout-tests/editing/deleting/smart-delete-001.html: Added.
3689 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
3690 * layout-tests/editing/deleting/smart-delete-002.html: Added.
3692 2005-03-01 Ken Kocienda <kocienda@apple.com>
3698 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
3700 * khtml/editing/htmlediting.cpp:
3701 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
3703 2005-03-01 David Harrison <harrison@apple.com>
3707 <rdar://problem/3915560> Mail would like an SPI to enable "smart" text paste/drop
3709 * kwq/WebCoreBridge.h:
3710 * kwq/WebCoreBridge.mm:
3711 (-[WebCoreBridge smartDeleteRangeForProposedRange:]):
3712 (-[WebCoreBridge smartInsertForString:replacingRange:beforeString:afterString:]):
3715 2005-03-01 Chris Blumenberg <cblu@apple.com>
3717 Fixed: <rdar://problem/4030404> selection granularity should be set when extending selection via JS
3719 Reviewed by kocienda.
3721 * khtml/ecma/kjs_window.cpp:
3722 (SelectionFunc::tryCall): set the granularity on the part. This will allow us to write smart paste layout tests.
3723 * layout-tests/editing/pasteboard/smart-paste-001-expected.txt: Added.
3724 * layout-tests/editing/pasteboard/smart-paste-001.html: Added.
3725 * layout-tests/editing/pasteboard/smart-paste-002-expected.txt: Added.
3726 * layout-tests/editing/pasteboard/smart-paste-002.html: Added.
3727 * layout-tests/editing/pasteboard/smart-paste-003-expected.txt: Added.
3728 * layout-tests/editing/pasteboard/smart-paste-003.html: Added.
3729 * layout-tests/editing/pasteboard/smart-paste-004-expected.txt: Added.
3730 * layout-tests/editing/pasteboard/smart-paste-004.html: Added.
3731 * layout-tests/editing/pasteboard/smart-paste-005-expected.txt: Added.
3732 * layout-tests/editing/pasteboard/smart-paste-005.html: Added.
3733 * layout-tests/editing/pasteboard/smart-paste-006-expected.txt: Added.
3734 * layout-tests/editing/pasteboard/smart-paste-006.html: Added.
3735 * layout-tests/editing/pasteboard/smart-paste-007-expected.txt: Added.
3736 * layout-tests/editing/pasteboard/smart-paste-007.html: Added.
3738 2005-03-01 Chris Blumenberg <cblu@apple.com>
3740 Fixed: <rdar://problem/4029934> smart paste with plain text can add too many spaces
3742 Reviewed by kocienda.
3744 * khtml/editing/htmlediting.cpp:
3745 (khtml::ReplaceSelectionCommand::doApply): pass true for treatNBSPAsWhitespace to leadingWhitespacePosition and trailingWhitespacePosition
3746 * khtml/xml/dom_position.cpp:
3747 (DOM::isWS): take treatNBSPAsWhitespace param
3748 (DOM::Position::leadingWhitespacePosition): ditto
3749 (DOM::Position::trailingWhitespacePosition): ditto
3750 * khtml/xml/dom_position.h:
3752 2005-03-01 Ken Kocienda <kocienda@apple.com>
3758 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
3760 * khtml/editing/htmlediting.cpp:
3761 (khtml::InsertParagraphSeparatorCommand::doApply): Look for the upstream-most block to insert after
3762 when at the visible end of a block. This helps to avoid some undesirable sequences of markup which
3763 Dave says will be vary hard to render. Changing the command in this way avoids the "limitations"
3764 of the render tree by not asking it to render markup we do not want to make anyway.
3766 All these tests change, but either in insignificant ways, or for the better.
3768 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt:
3769 * layout-tests/editing/inserting/insert-div-001-expected.txt:
3770 * layout-tests/editing/inserting/insert-div-002-expected.txt:
3771 * layout-tests/editing/inserting/insert-div-004-expected.txt:
3772 * layout-tests/editing/inserting/insert-div-005-expected.txt:
3773 * layout-tests/editing/inserting/insert-div-009-expected.txt:
3774 * layout-tests/editing/inserting/insert-div-024-expected.txt:
3775 * layout-tests/editing/pasteboard/paste-text-011-expected.txt:
3776 * layout-tests/editing/pasteboard/paste-text-013-expected.txt:
3777 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
3778 * layout-tests/editing/style/block-style-004-expected.txt:
3779 * layout-tests/editing/style/block-style-005-expected.txt:
3780 * layout-tests/editing/style/block-style-006-expected.txt:
3781 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
3782 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
3783 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
3784 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
3786 New test to check specific problem mentioned in the bug.
3788 * layout-tests/editing/inserting/insert-div-026-expected.txt: Added.
3789 * layout-tests/editing/inserting/insert-div-026.html: Added.
3791 2005-02-28 Maciej Stachowiak <mjs@apple.com>
3795 <rdar://problem/4002864> REGRESSION(125-146) getElementById in onload fails in a test case involving external resources
3797 Moved management of elementById hashtable from attach/detach to
3798 insertedIntoDocument/removedFromDocument, to avoid being thrown
3799 off by temporary detaches due to style recalcs.
3801 * khtml/xml/dom_elementimpl.cpp:
3802 (ElementImpl::insertedIntoDocument):
3803 (ElementImpl::removedFromDocument):
3804 (ElementImpl::attach):
3805 (ElementImpl::updateId):
3806 * khtml/xml/dom_elementimpl.h:
3808 Make sure that insertedIntoDocument is called before firing any
3811 * khtml/xml/dom_nodeimpl.cpp:
3812 (NodeBaseImpl::dispatchChildInsertedEvents):
3814 2005-02-28 David Hyatt <hyatt@apple.com>
3816 Fix for 4028999, safari crashes when resetting if mallocsribble is on. Clip rects were being cleared using dead
3817 render objects. Change the ordering.
3821 * khtml/rendering/render_box.cpp:
3822 (RenderBox::detach):
3823 * khtml/rendering/render_layer.cpp:
3824 (RenderLayer::~RenderLayer):
3826 2005-02-28 Chris Blumenberg <cblu@apple.com>
3828 Fixed: <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
3830 Reviewed by kocienda.
3832 * khtml/editing/htmlediting.cpp:
3833 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Call updateLayout so caretMinOffset and caretMaxOffset return correct values.
3835 2005-02-28 John Sullivan <sullivan@apple.com>
3839 - WebCore part of fix for <rdar://problem/4023490> REGRESSION (125-185): Tabbing through links
3840 on frameset page gets stuck at end (tivofaq.com)
3842 * kwq/WebCoreBridge.h:
3843 add nextValidKeyViewOutsideWebFrameViews (code is in WebKit)
3845 2005-02-28 Ken Kocienda <kocienda@apple.com>
3851 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
3853 * khtml/css/css_computedstyle.cpp: inheritableProperties array now defined in css_valueimpl.cpp.
3854 * khtml/css/css_valueimpl.cpp: Define inheritableProperties array here.
3855 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Use new name for blockProperties, and use the new
3856 constant for the number of items in the array.
3857 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
3858 (DOM::CSSMutableStyleDeclarationImpl::removeInheritableProperties): New function.
3859 * khtml/css/css_valueimpl.h: Declare inheritableProperties array and numInheritableProperties extern so they
3860 can be defined in css_valueimpl.cpp and used in css_computedstyle.cpp.
3861 * khtml/editing/htmlediting.cpp:
3862 (khtml::ReplacementFragment::removeStyleNodes): This code was misguided, and removed too much style from HTML
3863 elements. Now, it removes from HTML elements only the styles that we replace later with a call to applyStyle().
3864 Also, add ID_B to list of inline "style" nodes we are willing to remove. Leaving it off was an oversight.
3866 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: ID_B fix made this result change, without any
3867 visible change in the test.
3871 * layout-tests/editing/style/smoosh-styles-003.html
3872 * layout-tests/editing/style/smoosh-styles-003-expected.txt
3874 2005-02-28 Richard Williamson <rjw@apple.com>
3876 Fixed <rdar://problem/4026985> CrashTracer: ...14 crashes at com.apple.WebCore: -[KWQPageState invalidate] + 32
3878 Added more nil checking and ASSERTS.
3879 Without a reproducible case this is hard to definitively resolve.
3881 Reviewed by John Sullivan.
3883 * kwq/KWQPageState.mm:
3884 (-[KWQPageState invalidate]):
3886 2005-02-28 Richard Williamson <rjw@apple.com>
3888 Fixed <rdar://problem/4027702> 3.5% performance regression btwn Safari-188 and Safari-400
3890 I inadvertently checked in some debugging code that disabled
3891 style sharing. Backed out that change.
3893 * khtml/css/cssstyleselector.cpp:
3894 (khtml::CSSStyleSelector::styleForElement):
3896 2005-02-28 Chris Blumenberg <cblu@apple.com>
3898 Fixed: <rdar://problem/4026639> www.bmw.ca configurator does not work with Safari
3902 * khtml/ecma/kjs_html.cpp:
3903 (KJS::HTMLElement::tryGet): when frameset.<name of frame child> is called, return the window object of the frame child
3905 2005-02-28 Ken Kocienda <kocienda@apple.com>
3911 <rdar://problem/4026906> Paste of HTML table content can break table structure
3913 * khtml/editing/htmlediting.cpp:
3914 (khtml::ReplacementFragment::pruneEmptyNodes): Call new isProbablyTableStructureNode() function to prevent
3915 removal of empty table structure nodes.
3916 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
3917 (khtml::isProbablyTableStructureNode): New helper function.
3918 * khtml/editing/htmlediting.h: Declare new helper.
3920 2005-02-28 Chris Blumenberg <cblu@apple.com>
3922 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
3924 Reviewed by kocienda.
3926 * khtml/editing/htmlediting.cpp:
3927 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): ref and deref the element while it is "floating"
3928 (khtml::ReplacementFragment::insertFragmentForTestRendering): ditto
3929 (khtml::floatRefdElement): new, keeps an element alive while its ref count is 0
3930 (khtml::createDefaultParagraphElement): removed commented out code
3931 (khtml::createBlockPlaceholderElement): ref the element and return it as "floating"
3932 (khtml::createFontElement): ditto
3933 (khtml::createStyleSpanElement): ditto
3934 * khtml/editing/htmlediting.h:
3936 2005-02-27 Maciej Stachowiak <mjs@apple.com>
3940 <rdar://problem/3993557> REGRESSION (125-180-ish): getElementsByTagName no longer works with namespace designations
3942 * khtml/xml/dom_nodeimpl.cpp:
3943 (NodeBaseImpl::getElementsByTagNameNS): When no namespace is specified, find elements
3944 of the specified name in any namespace to match Mozilla and earlier Safari behavior.
3946 2005-02-25 Darin Adler <darin@apple.com>
3950 - fixed <rdar://problem/4025618> Crash while searching at hollywoodvideo.com
3952 * khtml/html/html_formimpl.h: Added valueWithDefault.
3953 * khtml/html/html_formimpl.cpp:
3954 (DOM::HTMLInputElementImpl::appendFormData): Call valueWithDefault instead of going at the render object
3955 to try to get the default value; there may be no render object if this is display:none.
3956 (DOM::HTMLInputElementImpl::valueWithDefault): Added. Knows about the defaults for "submit" and "reset"
3957 buttons; otherwise just returns the value as-is.
3959 * khtml/rendering/render_form.h: Removed the defaultLabel member functions.
3960 * khtml/rendering/render_form.cpp:
3961 (RenderSubmitButton::rawText): Call valueWithDefault instead of using defaultLabel function here on
3962 the render side. The DOM needs to know how to deal with the default anyway for form submission.
3963 (RenderSubmitButton::defaultLabel): Removed.
3964 (RenderResetButton::defaultLabel): Removed.
3965 (RenderPushButton::defaultLabel): Removed.
3967 2005-02-25 Darin Adler <darin@apple.com>
3971 - fixed <rdar://problem/4025088> window onblur and onfocus don't fire when text field has focus