1 2005-05-08 Maciej Stachowiak <mjs@apple.com>
3 Reviewed by Dave Harrison.
5 - remove remaining uses of upstream/downstream DoNotStayInBlock
7 * khtml/editing/htmlediting.cpp:
8 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
9 (khtml::ApplyStyleCommand::nodeFullySelected):
10 (khtml::ApplyStyleCommand::nodeFullyUnselected):
11 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
12 (khtml::InsertParagraphSeparatorCommand::doApply):
13 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
14 (khtml::InsertTextCommand::insertSpace):
15 (khtml::ReplaceSelectionCommand::doApply):
17 * khtml/editing/visible_position.cpp:
18 (khtml::enclosingBlockFlowElement): New helper function.
19 * khtml/editing/visible_position.h:
21 * khtml/editing/visible_units.cpp:
22 (khtml::inSameBlock): Check enclosing block flows instead of comparing
23 visible block starts. Two nested blocks may have the same visible start but
24 different visible ends, so the old check would give false positives.
26 2005-05-09 David Harrison <harrison@apple.com>
28 Add layout test for <rdar://problem/4110366>.
30 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-011-expected.txt: Added.
31 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-011.html: Added.
33 2005-05-09 Darin Adler <darin@apple.com>
35 - checked in a result for the Flash replacement test that Dave added
37 * layout-tests/fast/dynamic/flash-replacement-test-expected.txt: Added.
38 Hope it's right! If not, Dave can update it.
40 2005-05-09 Darin Adler <darin@apple.com>
42 * Makefile.am: Don't set up PBXIntermediatesDirectory explicitly;
43 Not needed to make builds work, spews undesirable error messages too.
45 * WebCore.pbproj/project.pbxproj: Remove unneeded $(DSTROOT) in framework paths.
47 2005-05-07 Maciej Stachowiak <mjs@apple.com>
51 - remove some of the uses of upstream/downstream DoNotStayInBlock
53 * khtml/editing/markup.cpp:
54 (khtml::createMarkup): Instead of using upstream to decide if a line break should be
55 added at the end, use inSameParagraph.
56 * khtml/editing/selection.cpp:
57 (khtml::Selection::debugPosition): Remove the code to print upstream and downstream,
58 the selection endpoints themselves are adequate for debugging and are what we use for
60 * khtml/xml/dom2_rangeimpl.cpp:
61 (DOM::RangeImpl::editingStartPosition): Skip a possible paragraph break at the start
62 of the selection in a more explicit way to avoid DoNotStayInBlock.
64 2005-05-07 David Harrison <harrison@apple.com>
68 <rdar://problem/4110366> Deleting text at the end of email moves insertion point to the top of the document
70 * khtml/editing/htmlediting.cpp:
71 (khtml::DeleteSelectionCommand::handleGeneralDelete):
72 Update m_upstreamStart when deleting m_downstreamEnd.node() if the former is no longer in the document.
73 Better to update here than trying to recover later in calculateEndingPosition().
75 2005-05-07 David Harrison <harrison@apple.com>
77 Remove workaround for <rdar://problem/4103339>.
79 * khtml/editing/htmlediting.cpp:
80 (khtml::DeleteSelectionCommand::initializePositionData):
82 2005-05-06 Maciej Stachowiak <mjs@apple.com>
84 Reviewed by Dave Harrison.
86 - make StayInBlock vs DoNotStayInBlock explicit in all calls to
87 upstream/downstream, in preparation for phasing out the
88 DoNotStayInBlock variant.
90 * khtml/editing/htmlediting.cpp:
91 (khtml::ApplyStyleCommand::nodeFullySelected):
92 (khtml::ApplyStyleCommand::nodeFullyUnselected):
93 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
94 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
95 (khtml::InsertTextCommand::insertSpace):
96 (khtml::ReplaceSelectionCommand::doApply):
97 * khtml/editing/markup.cpp:
98 (khtml::createMarkup):
99 * khtml/editing/selection.cpp:
100 (khtml::Selection::debugPosition):
101 * khtml/xml/dom_position.h:
103 2005-05-06 David Harrison <harrison@apple.com>
105 Reviewed by Maciej, Darin.
107 <rdar://problem/4103339> VisiblePosition and PositionIterator iterators do not return positions in order
109 * WebCore.pbproj/project.pbxproj:
110 Removed dom_positioniterator.h and dom_positioniterator.cpp.
112 * khtml/editing/htmlediting.cpp:
113 Removed unused include of dom_positioniterator.h and "using" of PositionIterator.
115 * khtml/editing/selection.cpp:
116 Removed unused include of dom_positioniterator.h.
118 * khtml/editing/visible_position.h:
119 * khtml/editing/visible_position.cpp:
120 (khtml::VisiblePosition::previousVisiblePosition):
121 (khtml::VisiblePosition::nextVisiblePosition):
122 (khtml::VisiblePosition::downstreamDeepEquivalent):
123 Use Position::next(), Position::previous(), Position::atStart(), Position::atEnd() instead of duplicated code.
125 * khtml/xml/dom_nodeimpl.h:
126 * khtml/xml/dom_nodeimpl.cpp:
127 (NodeImpl::maxDeepOffset):
128 Added to support Position::next(), Position::previous(), Position::atStart(), Position::atEnd()
130 * khtml/xml/dom_position.h:
131 * khtml/xml/dom_position.cpp:
132 (DOM::Position::previous):
133 (DOM::Position::next):
134 (DOM::Position::atStart):
135 (DOM::Position::atEnd):
136 Moved here, replacing VisiblePosition's duplicate and PositionIterator. Fixed to
137 return positions in order and not skip positions.
139 (DOM::Position::previousCharacterPosition):
140 (DOM::Position::nextCharacterPosition):
141 Use Position::next(), Position::previous(), Position::atStart(), Position::atEnd() instead of PositionIterator.
144 (DOM::Position::upstream):
145 (DOM::Position::downstream):
146 Use Position::next(), Position::previous(), Position::atStart(), Position::atEnd() instead of PositionIterator.
148 * khtml/xml/dom_positioniterator.cpp: Removed.
149 * khtml/xml/dom_positioniterator.h: Removed.
150 Removed in favor of Position::next(), Position::previous(), Position::atStart(), Position::atEnd()
152 2005-05-05 Maciej Stachowiak <mjs@apple.com>
156 <rdar://problem/4058167> Unit Converter and Weather widgets crashed in KJS::Collector::markCurrentThreadConservatively
158 Avoid possibly allocating new prototype objects as parameters to
159 superclass constructors - there may be an allocated but
160 uninitilized object so this is a bad time to allocate. Instead,
161 set the prototype in the constructor body, since the object is
162 happily allocated by then.
164 * khtml/ecma/kjs_binding.h:
165 * khtml/ecma/kjs_css.cpp:
166 (DOMCSSStyleDeclaration::DOMCSSStyleDeclaration):
167 (DOMMediaList::DOMMediaList):
168 (DOMCSSStyleSheet::DOMCSSStyleSheet):
169 (DOMCSSPrimitiveValue::DOMCSSPrimitiveValue):
170 (DOMCSSValueList::DOMCSSValueList):
171 * khtml/ecma/kjs_css.h:
172 (KJS::DOMStyleSheet::DOMStyleSheet):
173 (KJS::DOMCSSValue::DOMCSSValue):
174 * khtml/ecma/kjs_dom.cpp:
176 (DOMDocument::DOMDocument):
177 (DOMElement::DOMElement):
178 (DOMDOMImplementation::DOMDOMImplementation):
179 (DOMNamedNodeMap::DOMNamedNodeMap):
180 (DOMNamedNodesCollection::DOMNamedNodesCollection):
181 (DOMCharacterData::DOMCharacterData):
183 * khtml/ecma/kjs_dom.h:
184 (KJS::NodeConstructor::NodeConstructor):
185 (KJS::DOMExceptionConstructor::DOMExceptionConstructor):
186 * khtml/ecma/kjs_events.cpp:
187 (DOMEvent::DOMEvent):
188 (Clipboard::Clipboard):
189 * khtml/ecma/kjs_html.cpp:
190 (HTMLCollection::HTMLCollection):
191 * khtml/ecma/kjs_range.cpp:
192 (DOMRange::DOMRange):
193 * khtml/ecma/kjs_traversal.cpp:
194 (DOMNodeIterator::DOMNodeIterator):
195 (DOMNodeFilter::DOMNodeFilter):
196 (DOMTreeWalker::DOMTreeWalker):
197 * khtml/ecma/xmlhttprequest.cpp:
198 (KJS::XMLHttpRequest::XMLHttpRequest):
199 * khtml/ecma/xmlserializer.cpp:
200 (KJS::XMLSerializer::XMLSerializer):
202 2005-05-06 Darin Adler <darin@apple.com>
206 - make building multiple trees with make work better
208 * Makefile.am: Set up Xcode build directory before invoking xcodebuild.
210 2005-05-05 David Hyatt <hyatt@apple.com>
212 Eliminate the FOUCS on wired.com. innerWidth and innerHeight on window should not do a layout that ignores
213 pending stylesheets, since even if stylesheets are loading the correct window dimensions can be determined with
216 The radar # is 4109888.
220 * khtml/ecma/kjs_window.cpp:
222 (Window::updateLayout):
223 * khtml/ecma/kjs_window.h:
225 2005-05-05 David Hyatt <hyatt@apple.com>
227 Fix for 4109667, sIFR flash replacement technique often malfunctions. This bug occurs when the plugin
228 widget update causes the onload for the document to fire. Because you can be in the middle of a style
229 recalc when doing an attach (in response to a stylesheet load), the onload fires in the middle of the attach
230 process when the tree is in a bogus state.
232 The fix is to add a bit to the document that tells style recalc that the implicitClose() method was invoked
233 during the style recalc process and the code has been patched so that when this situation occurs, the close is
234 deferred until after the style recalc has finished.
236 Reviewed by John Sullivan
238 * khtml/xml/dom_docimpl.cpp:
239 (DocumentImpl::DocumentImpl):
240 (DocumentImpl::recalcStyle):
241 (DocumentImpl::implicitClose):
242 * khtml/xml/dom_docimpl.h:
243 * layout-tests/fast/dynamic/flash-replacement-test.html: Added.
245 2005-05-05 Darin Adler <darin@apple.com>
247 Reviewed by Dave Hyatt.
249 - fixed <rdar://problem/4109564> REGRESSION (Atlanta): maps.google.com doesn't always center California correctly
251 * khtml/ecma/kjs_events.cpp: (offsetFromTarget): Fix two places that said X where they should say Y.
253 2005-05-05 David Harrison <harrison@apple.com>
255 Restore fixed setEndingSelection. Fixed method was ifdef'd out
256 because change was at end of Tiger development, but method is
257 unused. You just can never be _too_ safe.
259 * khtml/editing/htmlediting.cpp:
260 (khtml::EditCommandPtr::setEndingSelection):
262 2005-05-02 Maciej Stachowiak <mjs@apple.com>
266 - renamed NodeBaseImpl to ContainerNodeImpl
268 * khtml/ecma/kjs_dom.cpp:
269 (DOMNodeProtoFunc::tryCall): Avoid use of NodeBaseImpl and avoid
270 use of obsolete checkNoOwner call, use isAncestor instead.
271 * khtml/html/html_elementimpl.cpp:
272 (HTMLElementImpl::setOuterText): Avoid gratuitous use of
274 * khtml/xml/dom_nodeimpl.cpp:
275 (NodeBaseImpl::checkNoOwner): Removed.
277 Ther rest is all just simple renaming.
279 * khtml/xml/dom_docimpl.cpp:
280 (DocumentImpl::DocumentImpl):
281 (DocumentImpl::attach):
282 (DocumentImpl::detach):
283 (DocumentFragmentImpl::DocumentFragmentImpl):
284 * khtml/xml/dom_docimpl.h:
285 * khtml/xml/dom_elementimpl.cpp:
286 (AttrImpl::AttrImpl):
287 (ElementImpl::ElementImpl):
288 (ElementImpl::insertedIntoDocument):
289 (ElementImpl::removedFromDocument):
290 (ElementImpl::attach):
292 * khtml/xml/dom_elementimpl.h:
293 * khtml/xml/dom_nodeimpl.cpp:
294 (ContainerNodeImpl::ContainerNodeImpl):
295 (ContainerNodeImpl::~ContainerNodeImpl):
296 (ContainerNodeImpl::firstChild):
297 (ContainerNodeImpl::lastChild):
298 (ContainerNodeImpl::insertBefore):
299 (ContainerNodeImpl::replaceChild):
300 (ContainerNodeImpl::removeChild):
301 (ContainerNodeImpl::removeChildren):
302 (ContainerNodeImpl::appendChild):
303 (ContainerNodeImpl::hasChildNodes):
304 (ContainerNodeImpl::setFirstChild):
305 (ContainerNodeImpl::setLastChild):
306 (ContainerNodeImpl::checkSameDocument):
307 (ContainerNodeImpl::checkIsChild):
308 (ContainerNodeImpl::addChild):
309 (ContainerNodeImpl::attach):
310 (ContainerNodeImpl::detach):
311 (ContainerNodeImpl::insertedIntoDocument):
312 (ContainerNodeImpl::removedFromDocument):
313 (ContainerNodeImpl::cloneChildNodes):
314 (ContainerNodeImpl::getElementsByTagNameNS):
315 (ContainerNodeImpl::getUpperLeftCorner):
316 (ContainerNodeImpl::getLowerRightCorner):
317 (ContainerNodeImpl::getRect):
318 (ContainerNodeImpl::setFocus):
319 (ContainerNodeImpl::setActive):
320 (ContainerNodeImpl::childNodeCount):
321 (ContainerNodeImpl::childNode):
322 (ContainerNodeImpl::dispatchChildInsertedEvents):
323 (ContainerNodeImpl::dispatchChildRemovalEvents):
324 * khtml/xml/dom_nodeimpl.h:
325 * khtml/xml/dom_xmlimpl.cpp:
326 (DOM::EntityImpl::EntityImpl):
327 (DOM::EntityReferenceImpl::EntityReferenceImpl):
328 (DOM::NotationImpl::NotationImpl):
329 (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
330 * khtml/xml/dom_xmlimpl.h:
332 2005-05-04 Vicki Murley <vicki@apple.com>
336 - fix mismatched parentheses in one of the ifdefs
338 * khtml/html/html_headimpl.cpp:
339 (HTMLTitleElementImpl::childrenChanged):
341 2005-05-04 Darin Adler <darin@apple.com>
343 Reviewed by Dave Hyatt.
345 - fixed build rules to match other projects
347 * WebCore.pbproj/project.pbxproj: Set deployment target to 10.3 in the build styles.
348 When built without a build style (by Apple B&I) we want to get the target from the
349 environment. But when built with a build style (by Safari engineers and others), we want
352 * Makefile.am: Took out extra parameters that make command-line building different from
353 Xcode building. Now that this is fixed, you should not get a full rebuild if you switch
354 from command line to Xcode or back.
356 2005-05-04 Vicki Murley <vicki@apple.com>
360 - fixed <rdar://problem/3986228> Not able to load additional script blocks dynamically
362 Run scripts when they're inserted into the document. Use createdByParser bit to make sure
363 that scripts aren't run twice, once while parsing and again when inserting.
365 * khtml/html/html_headimpl.cpp:
366 (HTMLScriptElementImpl::HTMLScriptElementImpl):
367 (HTMLScriptElementImpl::~HTMLScriptElementImpl):
368 (HTMLScriptElementImpl::insertedIntoDocument):
369 (HTMLScriptElementImpl::removedFromDocument):
370 (HTMLScriptElementImpl::notifyFinished):
371 * khtml/html/html_headimpl.h:
372 (DOM::HTMLScriptElementImpl::setCreatedByParser):
373 * khtml/html/htmlparser.cpp:
374 (KHTMLParser::getElement):
375 * khtml/xml/xml_tokenizer.cpp:
376 (khtml::XMLTokenizer::startElement):
378 2005-05-03 David Hyatt <hyatt@apple.com>
380 Normalize all our custom properties in our implementation to be -khtml (remove all the -apple).
382 Make sure that -apple, -khtml, and -moz are all able to be used. -apple and -moz just map to -khtml.
384 Add support for automatically converting -khtml-opacity to opacity (for legacy Safari 1.1 compat).
388 * khtml/css/css_computedstyle.cpp:
390 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
391 * khtml/css/cssparser.cpp:
392 (CSSParser::parseValue):
393 * khtml/css/cssproperties.in:
394 * khtml/css/cssstyleselector.cpp:
395 (khtml::CSSStyleSelector::applyDeclarations):
396 (khtml::CSSStyleSelector::applyProperty):
397 * khtml/css/parser.y:
398 * khtml/ecma/kjs_css.cpp:
401 2005-05-03 Darin Adler <darin@apple.com>
405 * WebCore.pbproj/project.pbxproj: Fix some SYMROOTS that should have been SYMROOT.
407 2005-05-03 David Hyatt <hyatt@apple.com>
409 Fix for 4098281, news.com missing a bunch of content. Make sure not to apply strict SGML parsing
410 when stripping comments out of scripts.
412 New test is comments-in-script.html
414 * khtml/html/htmltokenizer.cpp:
415 (khtml::HTMLTokenizer::parseComment):
417 2005-05-03 David Hyatt <hyatt@apple.com>
419 Remove unused notification to avoid ERROR messages spewing on the acid2 test.
423 * khtml/khtml_part.cpp:
424 (KHTMLPart::processObjectRequest):
425 * khtml/rendering/render_frames.cpp:
426 (RenderPartObject::updateWidget):
427 * khtml/rendering/render_frames.h:
429 2005-05-03 Darin Adler <darin@apple.com>
431 Reviewed by Dave Hyatt.
432 No new layout tests needed.
434 - eliminated the bogus kMin/kMax macros that we had in addition to inline functions
437 * kwq/KWQKGlobal.h: Remove the kMin/kMax macros.
439 * khtml/css/cssstyleselector.cpp:
440 (khtml::CSSStyleSelector::applyProperty): Change type of constant so both sides
442 (khtml::CSSStyleSelector::fontSizeForKeyword): Ditto.
443 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseEntity): Ditto.
445 - remove unused parameter to dirtyLinesFromChangedChild for clarity
447 * khtml/rendering/render_object.h: Don't take the parameter.
448 * khtml/rendering/render_object.cpp: (RenderObject::dirtyLinesFromChangedChild): Ditto.
450 * khtml/rendering/render_flow.h: Don't take the parameter.
451 * khtml/rendering/render_flow.cpp:
452 (RenderFlow::detach): Don't pass the parameter.
453 (RenderFlow::dirtyLinesFromChangedChild): Don't take the parameter.
455 * khtml/rendering/render_text.cpp: (RenderText::detach): Don't pass the parameter.
457 - convert DOM::NodeImpl into an abstract base class by making a couple of functions
458 pure virtual for clarity
460 * khtml/xml/dom_nodeimpl.h: Made nodeName and nodeType pure virtual.
461 * khtml/xml/dom_nodeimpl.cpp: Remove bodies of nodeName and nodeType.
463 2005-05-03 David Hyatt <hyatt@apple.com>
465 Fix for object element to support fallback content. WIth this change Safari passes the Acid2 test.
469 * khtml/css/html4.css:
470 * khtml/html/html_objectimpl.cpp:
471 (HTMLObjectElementImpl::HTMLObjectElementImpl):
472 (HTMLObjectElementImpl::parseHTMLAttribute):
473 (HTMLObjectElementImpl::rendererIsNeeded):
474 (HTMLObjectElementImpl::createRenderer):
475 (HTMLObjectElementImpl::attach):
476 (HTMLObjectElementImpl::detach):
477 (HTMLObjectElementImpl::recalcStyle):
478 (HTMLObjectElementImpl::childrenChanged):
479 (HTMLObjectElementImpl::isURLAttribute):
480 (HTMLObjectElementImpl::isImageType):
481 (HTMLObjectElementImpl::renderFallbackContent):
482 * khtml/html/html_objectimpl.h:
483 * khtml/khtml_part.cpp:
484 (KHTMLPart::requestObject):
485 (KHTMLPart::selectFrameElementInParentIfFullySelected):
486 (KHTMLPart::handleFallbackContent):
487 * khtml/khtml_part.h:
488 * khtml/khtmlpart_p.h:
489 (khtml::ChildFrame::ChildFrame):
490 * khtml/rendering/render_frames.cpp:
491 (RenderPartObject::RenderPartObject):
492 (RenderPartObject::updateWidget):
493 * khtml/rendering/render_frames.h:
494 (khtml::RenderPart::hasFallbackContent):
495 * khtml/rendering/render_replaced.cpp:
496 (RenderReplaced::RenderReplaced):
497 * kwq/KWQKHTMLPart.mm:
498 (KWQKHTMLPart::createPart):
499 * kwq/WebCoreBridge.h:
500 * kwq/WebCoreBridge.mm:
501 (-[WebCoreBridge mainResourceError]):
503 2005-05-01 Darin Adler <darin@apple.com>
505 - move to Xcode native targets and stop checking in generated files
507 * WebCore.pbproj/project.pbxproj: Updated to use native targets and generate all the generated
508 files, so we don't have to check them in any more.
509 * Info.plist: Added. Native targets use a separate file for this.
511 * Makefile.am: Removed rule to generate WebCore-combined.exp since this is now handled by the
512 Xcode project. Removed the code to remove the embedded copy of the framework since we don't
513 do that any more. Removed timestamp cleaning rules since we don't use those any more.
515 * WebCore-tests.exp: Removed symbols that aren't really needed. The native target gives an
516 error when you mention a nonexistent symbol, so we can't have them any more.
518 * khtml/css/parser_wrapper.cpp: Added. Shell used to compile parser.cpp since we can't add
519 a generated file easily to the list of files to be compiled.
521 * .cvsignore: Removed various timestamp files.
523 * WebCore-combined.exp: Removed.
524 * force-clean-timestamp: Removed.
525 * force-js-clean-timestamp: Removed.
526 * khtml/.cvsignore: Removed.
527 * khtml/Makefile.am: Removed.
528 * khtml/css/.cvsignore: Removed.
529 * khtml/css/Makefile.am: Removed.
530 * khtml/css/cssproperties.c: Removed.
531 * khtml/css/cssproperties.h: Removed.
532 * khtml/css/cssvalues.c: Removed.
533 * khtml/css/cssvalues.h: Removed.
534 * khtml/css/parser.cpp: Removed.
535 * khtml/css/parser.h: Removed.
536 * khtml/css/tokenizer.cpp: Removed.
537 * khtml/ecma/.cvsignore: Removed.
538 * khtml/ecma/Makefile.am: Removed.
539 * khtml/ecma/kjs_css.lut.h: Removed.
540 * khtml/ecma/kjs_dom.lut.h: Removed.
541 * khtml/ecma/kjs_events.lut.h: Removed.
542 * khtml/ecma/kjs_html.lut.h: Removed.
543 * khtml/ecma/kjs_navigator.lut.h: Removed.
544 * khtml/ecma/kjs_range.lut.h: Removed.
545 * khtml/ecma/kjs_traversal.lut.h: Removed.
546 * khtml/ecma/kjs_views.lut.h: Removed.
547 * khtml/ecma/kjs_window.lut.h: Removed.
548 * khtml/ecma/xmlhttprequest.lut.h: Removed.
549 * khtml/ecma/xmlserializer.lut.h: Removed.
550 * khtml/html/.cvsignore: Removed.
551 * khtml/html/Makefile.am: Removed.
552 * khtml/html/doctypes.cpp: Removed.
553 * khtml/html/kentities.c: Removed.
554 * khtml/misc/.cvsignore: Removed.
555 * khtml/misc/Makefile.am: Removed.
556 * khtml/misc/htmlattrs.c: Removed.
557 * khtml/misc/htmlattrs.h: Removed.
558 * khtml/misc/htmltags.c: Removed.
559 * khtml/misc/htmltags.h: Removed.
560 * kwq/.cvsignore: Removed.
561 * kwq/KWQCharsetData.c: Removed.
562 * kwq/KWQColorData.c: Removed.
563 * kwq/Makefile.am: Removed.
565 2005-05-02 Darin Adler <darin@apple.com>
568 Added two layout tests for regression testing.
570 - redid frameElement (fix for 4091082 below)
572 The first version lacked a security check, and was also broken.
574 * khtml/ecma/kjs_window.cpp:
575 (frameElement): Refactored into separate function; added isSafeScript check.
576 (Window::get): Call the new frameElement function.
578 * layout-tests/fast/frames/frameElement-frame.html: Added.
579 * layout-tests/fast/frames/frameElement-frame-expected.txt: Added.
580 * layout-tests/fast/frames/frameElement-iframe.html: Added.
581 * layout-tests/fast/frames/frameElement-iframe-expected.txt: Added.
582 * layout-tests/fast/frames/resources/frameElement-contents.html: Added.
584 2005-05-02 David Harrison <harrison@apple.com>
588 Fix isStartOfEditableContent and isEndOfEditableContent to return actual, rather than inverted, answers.
589 No Radar. Found this when trying to use isEndOfEditableContent() in some new code.
591 * khtml/editing/visible_units.cpp:
592 (khtml::isStartOfEditableContent):
593 (khtml::isEndOfEditableContent):
596 2005-04-29 Darin Adler <darin@apple.com>
598 Reviewed by David Harrison.
600 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Turn newlines into \n for better dumping.
602 2005-04-29 David Harrison <harrison@apple.com>
606 <rdar://problem/4083333> When deleting link at end of sentence, entire sentence gets deleted
608 * khtml/editing/htmlediting.cpp:
609 (khtml::DeleteSelectionCommand::initializePositionData):
610 Work around bug #4103339 (whose real fix is somewhat risky), so this fix can get into a software update.
612 (khtml::DeleteSelectionCommand::handleGeneralDelete):
613 Add isAncestor check when comparing m_downstreamEnd.node() and m_startNode.
615 * layout-tests/editing/deleting/delete-4083333-fix-expected.txt: Added.
616 * layout-tests/editing/deleting/delete-4083333-fix.html: Added.
618 2005-04-29 Darin Adler <darin@apple.com>
620 Reviewed by Dave Harrison.
622 - changed layout tests to dump more minimal information about caret and selection
624 * kwq/KWQRenderTreeDebug.cpp:
625 (nodePosition): Changed name; now does position relative to document.
626 (writeSelection): Removed upstream/downstream code and changed format slightly.
628 * layout-tests/editing/*-expected.txt: Regenerated in new format.
630 2005-04-29 Darin Adler <darin@apple.com>
632 Reviewed by Chris Blumenberg.
633 Added two layout tests for regression testing.
635 - fixed <rdar://problem/4097849> REGRESSION (162-163): importNode creates non-HTML elements, thus style attributes (and some others) don't work
637 * khtml/xml/dom_docimpl.cpp:
638 (DocumentImpl::importNode): Reorganized and partly rewrote this. The change that fixes the bug at
639 hand is to explicitly use XHTML_NAMESPACE for HTML elements, since the old way of getting the namespace
640 will return the null string for HTML elements, and createElementNS will not create an HTML element
641 if passed a null string for the namespace.
642 (DocumentImpl::processHttpEquiv): Removed some bogus getDocument() calls -- no need to call getDocument()
643 in a document object.
644 (DocumentImpl::attrName): Ditto.
645 (DocumentImpl::tagName): Ditto.
646 (DocumentImpl::setFocusNode): Ditto.
648 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::cloneNode): Moved the actual cloning here
649 from ElementImpl::cloneNode, because XMLElementImpl already had its own version, and in here
650 we can use createHTMLElement, which will work properly even in an XML document, and is also slightly
653 * khtml/xml/dom_nodeimpl.h: Added a namespaceURI method function to go along with localName.
654 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::namespaceURI): Added. Returns null string to be consistent
655 with localName (only works on certain types of elements as documented).
656 * khtml/xml/dom_elementimpl.h: Removed ElementImpl::cloneNode (see above). Added an override of
657 namespaceURI for XMLElementImpl.
658 * khtml/xml/dom_elementimpl.cpp: (XMLElementImpl::namespaceURI): Added. Returns the namespace
659 (consistent with localName).
661 * layout-tests/fast/dom/importNodeHTML.html: Added. Tests both importNode and cloneNode (for comparison).
662 * layout-tests/fast/dom/importNodeHTML-expected.txt: Added.
663 * layout-tests/fast/dom/importNodeXML.xhtml: Added. XML version of the same test as above. Tests a different
664 code path, so useful to have.
665 * layout-tests/fast/dom/importNodeXML-expected.txt: Added.
667 2005-04-28 Darin Adler <darin@apple.com>
669 Reviewed by Dave Harrison.
671 - fixed problems preventing us from compiling with gcc 4.0
673 * WebCore.pbproj/project.pbxproj: Removed -fobjc-exceptions because I can't figure out an easy
674 way to pass it only when compiling Objective-C/C++. Removed -Wmissing-prototypes from
675 WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
677 * khtml/css/parser.y: Changed some rules that were using a float to pass around an enum to use an
678 int instead to avoid a warning.
679 * khtml/css/parser.cpp: Regenerated.
680 * khtml/css/parser.h: Regenerated.
682 * khtml/ecma/kjs_dom.cpp: (DOMTextProtoFunc::tryCall): Rearranged a return statement to avoid an incorrect
684 * khtml/ecma/kjs_html.cpp: (KJS::Context2DFunction::tryCall): Initialized a couple of variables to avoid
685 an incorrect warning.
686 * khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::evaluate): Rearranged how we exit from the function to avoid
688 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Changed some %d to %ld where the
689 parameters where long ints.
690 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
691 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
692 * kwq/DOMEvents.mm: (-[DOMMouseEvent initMouseEvent:::::::::::::::]): Rearranged code to avoid a cast
693 that was causing an incorrect warning.
695 (createObjCDOMNode): Broke out as a separate function.
696 (KJS::ScriptInterpreter::createObjcInstanceForValue): Rearranged code to avoid a namespace collision with
697 KJS::DOMNode and the Objective-C DOMNode class.
698 * kwq/KWQFileButton.mm: Made fields of KWQFileButtonAdapter public to avoid an error, new to gcc 4.0,
699 about accessing protected Objective-C fields.
700 * kwq/KWQKHTMLPart.mm:
701 (KWQKHTMLPart::matchLabelsAgainstElement): Rearranged a return statement to avoid an incorrect warning.
702 (KWQKHTMLPart::imageFromRect): Rearranged how this function does its exception handling to avoid a
703 "may be clobbered" warning.
704 * kwq/KWQKJavaAppletWidget.mm: Fixed incorrect import that said "KHTMLView.h" instead of "khtmlview.h".
705 * kwq/KWQObject.mm: Made fields of KWQObjectTimerTarget public to avoid an error, new to gcc 4.0,
706 about accessing protected Objective-C fields.
707 * kwq/WebCoreBridge.mm: (partHasSelection): Used [bridge part] instead of getting directly at instance
708 variable to avoid an error, new to gcc 4.0, about accessing protected Objective-C fields.
710 * WebCore-combined.exp: Regenerated.
711 * WebCore-tests.exp: Added some additional symbols needed by the tests under gcc 4.0.
713 2005-04-28 Darin Adler <darin@apple.com>
715 * WebCore.pbproj/project.pbxproj: Add back the main_thread_malloc files, rolled out by accident.
717 2005-04-27 Adele Peterson <adele@apple.com>
719 Rolling out fix for <rdar://problem/4097849> because the following layout tests were failing:
721 fast/css/namespaces/001
722 fast/css/namespaces/002
723 fast/css/namespaces/004
724 fast/css/namespaces/005
725 fast/css/namespaces/006
729 * khtml/html/html_documentimpl.cpp:
730 * khtml/html/html_documentimpl.h:
731 * khtml/html/html_elementimpl.cpp:
732 (HTMLElementImpl::namespaceURI):
733 * khtml/xml/dom_docimpl.cpp:
734 (DocumentImpl::importNode):
735 (DocumentImpl::createElementNS):
736 (DocumentImpl::createHTMLElement):
737 (DocumentImpl::attrId):
738 (DocumentImpl::tagId):
739 * khtml/xml/dom_docimpl.h:
741 2005-04-27 John Sullivan <sullivan@apple.com>
745 Experimental prototype of user-resizable textareas. All the new code is guarded by
746 #if ALLOW_RESIZING_TEXTAREAS, which is false unless you remove a comment and rebuild.
748 This code allows you to press near the bottom-right corner of any textarea and drag
749 to resize the textarea on the page. It works correctly with textareas in left-aligned
750 or centered blocks, but is weird in right-aligned blocks. It also does something
751 sensible if the width is specified as a % (in that case, you can resize vertically only).
752 The user-created-size survives resizing the window and survives the back/forward cache.
753 It does not survive reloading the page.
755 This complete-lack-of-affordance UI is obviously not shippable, but this proof of concept
756 code could lead to a real user feature.
758 * kwq/KWQTextArea.mm:
759 (-[KWQTextArea getNumColumns:andNumRows:forSize:]):
760 new method that determines cols and rows for a given textarea frame size
761 (-[KWQTextAreaTextView _trackResizeFromMouseDown:]):
762 new method that tracks a drag and does a live resize-and-relayout
763 (-[KWQTextAreaTextView mouseDown:]):
764 if the mouse down is in the bottom-right corner, call _trackResizeFromMouseDown:
766 2005-04-27 John Sullivan <sullivan@apple.com>
770 - fixed problem with mouse wheel patch where alt and shift keys were switched
772 * khtml/xml/dom2_eventsimpl.h:
773 use the order cntl, alt, shift, meta in KeyboardEventImpl constructors to match
774 superclass. This isn't necessary to fix the bug, but is better for clarity.
776 * khtml/xml/dom2_eventsimpl.cpp:
777 (KeyboardEventImpl::KeyboardEventImpl):
778 switch parameter order to match superclass. Then pass the parameters to superclass's
779 constructor in the right order.
780 (KeyboardEventImpl::initKeyboardEvent):
781 Pass parameters to superclass's constructor in the right order.
783 2005-04-26 Adele Peterson <adele@apple.com>
785 Fixed by Darin, reviewed by me.
787 Fix for <rdar://problem/4084029> designMode doesn't allow editing when iframe src = "" or = about:blank
789 This change will add an HTML element for empty documents. Now that there will be an HTMLDocument in this case,
790 a body will also be created (see rdar://problem/3758785). This was preventing frames with empty documents from
793 * khtml/html/htmlparser.cpp: (KHTMLParser::finished):
795 Updated these tests to expect the HTML and BODY elements
796 * layout-tests/fast/flexbox/016-expected.txt:
797 * layout-tests/fast/frames/001-expected.txt:
798 * layout-tests/fast/frames/002-expected.txt:
799 * layout-tests/fast/frames/contentWindow_Frame-expected.txt:
800 * layout-tests/fast/frames/contentWindow_iFrame-expected.txt:
801 * layout-tests/fast/frames/empty-frame-src-expected.txt:
803 2005-04-26 Maciej Stachowiak <mjs@apple.com>
805 New test case for <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
807 * layout-tests/fast/js/string-from-char-code-expected.txt: Added.
808 * layout-tests/fast/js/string-from-char-code.html: Added.
810 2005-04-26 Darin Adler <darin@apple.com>
814 - fixed <rdar://problem/3655817> please add support for mouse wheel events and the onmousewheel handler
818 - need to test behavior of Windows IE with horizontal scroll wheeling; we currently send a distinct event
819 for that relatively obscure case, which means the event handlers won't fire at all; might be incorrect
820 - overflow scrolling is done after all DOM event handling, but ideally should be done in the overflowing
821 element's default event handler; not important in practice
822 - frame scrolling is done after all DOM event handling, but probably should be done in a default event handler;
823 not sure about this, but it's probably not important in practice and definitely not required
827 * khtml/ecma/kjs_events.h: Added DOMWheelEvent.
828 * khtml/ecma/kjs_events.cpp:
829 (KJS::getDOMEvent): Added a case for wheel event. To be forward looking, I use the event's impl pointer
830 instead of a C++ DOM wrapper. Eventually it will all work this way.
831 (offsetFromTarget): Added. Factored out code to compute offsetX/Y for an event.
832 (DOMMouseEvent::getValueProperty): Changed to call offsetFromTarget for offsetX/Y.
833 (DOMWheelEvent::DOMWheelEvent): Added.
834 (DOMWheelEvent::tryGet): Added.
835 (DOMWheelEvent::getValueProperty): Added.
836 (DOMWheelEventProtoFunc::tryCall): Added. Nothing at the moment, but might get contents later.
838 * khtml/ecma/kjs_dom.h: Added OnMouseWheel to the enum with the list of properties.
839 * khtml/ecma/kjs_dom.cpp: Added onmousewheel as a property of DOM nodes.
840 (DOMNode::getValueProperty): Return the mouse wheel event handler.
841 (DOMNode::putValue): Set the mouse wheel event handler.
843 * khtml/ecma/kjs_window.cpp: Added onmousewheel as a property of the window.
844 (Window::get): Return the mouse wheel event handler.
845 (Window::put): Set the mouse wheel event handler.
847 * khtml/ecma/kjs_window.h: Added OnWindowMouseWheel to the enum with the list of properties.
848 (Other properties distinguish the window handler by lower-casing the initial letter, way too subtle,
849 so I did this one a good way.)
851 * khtml/dom/dom2_events.h: Made the constructors for Event and UIEvent public. There's no good reason
852 for them to be private, and I had to use the UIEvent one in the JavaScript implementation.
856 * khtml/xml/dom2_eventsimpl.h: Added events for mouse wheel and horizontal mouse wheel.
857 Added isWheelEvent function to EventImpl.
858 (DOM::UIEventWithKeyStateImpl): Added. Base class shared by mouse, wheel, and keyboard events.
859 (DOM::MouseRelatedEventImpl): Added. Base class shared by mouse and wheel events.
860 (DOM::WheelEventImpl): Added.
862 * khtml/xml/dom2_eventsimpl.cpp: Added "mousewheel" to list of event names and a placeholder for
863 the horizontal mouse wheel.
864 (EventImpl::isWheelEvent): Added. Returns false.
865 (MouseRelatedEventImpl::MouseRelatedEventImpl): Added. Factored out what's shared between mouse
866 events and wheel events to avoid duplicated code.
867 (MouseRelatedEventImpl::computeLayerPos): Moved to MouseRelatedWheelEventImpl.
868 (MouseEventImpl::MouseEventImpl): Changed since MouseRelatedWheelEventImpl is now the base class
869 so we can share more code with wheel events.
870 (KeyboardEventImpl::KeyboardEventImpl): Changed since UIEventWithKeyStateImpl is now the base class
871 so we can share more code with mouse and wheel events.
872 (WheelEventImpl::WheelEventImpl): Added.
873 (WheelEventImpl::isWheelEvent): Added. Returns true.
875 * khtml/misc/htmlattrs.in: Added "onmousewheel" attribute name.
876 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Added parsing of the
877 "onmousewheel" atribute, consistent with other event handler attributes.
881 * kwq/WebCoreBridge.h: Renamed scrollOverflowWithScrollWheelEvent to sendScrollWheelEvent.
882 * kwq/WebCoreBridge.mm: (-[WebCoreBridge sendScrollWheelEvent:]): Renamed.
884 * kwq/KWQEvent.h: Added Wheel as an event type value.
885 (QWheelEvent::QWheelEvent): Added.
887 (positionForEvent): Updated to know that wheel events have valid positions in them.
888 (orientationForEvent): Added.
889 (deltaForEvent): Added.
890 (QWheelEvent::QWheelEvent): Added.
892 * kwq/KWQKHTMLPart.h: Renamed scrollOverflowWithScrollWheelEvent to wheelEvent.
893 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::wheelEvent): Renamed and added code to construct a QWheelEvent
894 and send it along to KHTMLView::viewportWheelEvent, consistent with how mouse events work.
896 * khtml/khtmlview.cpp: (KHTMLView::viewportWheelEvent): Do a hit test to figure out which node to
897 send the event to, and then call dispatchWheelEvent.
899 * khtml/xml/dom_nodeimpl.h: Added dispatchWheelEvent.
900 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchWheelEvent): Added.
904 * khtml/ecma/kjs_dom.lut.h: Regenerated.
905 * khtml/ecma/kjs_events.lut.h: Regenerated.
906 * khtml/ecma/kjs_window.lut.h: Regenerated.
907 * khtml/misc/htmlattrs.c: Regenerated.
908 * khtml/misc/htmlattrs.h: Regenerated.
910 2005-04-26 David Harrison <harrison@apple.com>
912 Reviewed by Darin, Maciej.
914 <rdar://problem/4075576> Deleting text in new message borks content
916 Fixed by removing the methods that attempted to preserve the position. The idea
917 of preserving position is a very recent one, and turned out to not actually address
918 the problem it was intended to fix (see below). Further, is unclear how the position
919 could be preserved in a form that could be properly used later on. Therefore,
920 removing the code to work like before is the preferred alternative for this software
921 update. I've written <rdar://problem/4099839> to cover the bug that position
922 preservation was supposed to fix (but did not). Added layout tests for
923 both this bug and 4099839. Also, updated existing tests with correct expected results
924 (delete-at-paragraph-boundaries-003 and 004).
926 * khtml/editing/htmlediting.cpp:
927 (khtml::CompositeEditCommand::removeFullySelectedNode):
928 (khtml::CompositeEditCommand::removeChildrenInRange):
929 (khtml::DeleteSelectionCommand::handleGeneralDelete):
930 * khtml/editing/htmlediting.h:
931 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
932 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
933 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-007-expected.txt: Added.
934 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-007.html: Added.
935 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-008-expected.txt: Added.
936 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-008.html: Added.
937 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-009-expected.txt: Added.
938 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-009.html: Added.
939 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-010-expected.txt: Added.
940 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-010.html: Added.
942 2005-04-26 Darin Adler <darin@apple.com>
944 - fixed development builds
946 * khtml/misc/main_thread_malloc.h: Use inlines instead of macros for allocation functions.
948 2005-04-25 David Hyatt <hyatt@apple.com>
950 Fix for 4097842, changing 1st line of a url that wraps doesn't update the second line. Make sure to
951 update line break info for the last dirty line so that when a clean line tries to figure out where it
952 started, it will get an accurate position taking into account the updated string. By doing this, the code
953 will be able to properly distinguish between the old and new positions and not accidentally assume they are
958 * khtml/rendering/render_text.cpp:
959 (RenderText::setTextWithOffset):
961 2005-04-26 Darin Adler <darin@apple.com>
965 - fixed <rdar://problem/4098826> Bezier curves broken in new Safari canvas object (last two parameters parsed incorrectly)
967 * khtml/ecma/kjs_html.cpp: (KJS::Context2DFunction::tryCall): Fixed incorrect argument indices.
968 Thanks to Brian Campbell who figured out what was wrong.
970 2005-04-17 Maciej Stachowiak <mjs@apple.com>
974 - use single-threaded malloc in places where malloc is hot for an
975 8% speed improvement on cvs-base
977 * ForwardingHeaders/misc/fast_malloc.h: Added.
978 * WebCore.pbproj/project.pbxproj:
979 * khtml/css/css_base.h:
980 * khtml/css/css_ruleimpl.h:
981 * khtml/css/css_valueimpl.h:
982 * khtml/css/cssstyleselector.h:
983 * khtml/misc/arena.cpp:
987 * khtml/misc/main_thread_malloc.cpp: Added.
988 * khtml/misc/main_thread_malloc.h: Added.
989 * khtml/rendering/render_style.h:
990 * khtml/xml/dom2_eventsimpl.h:
991 * khtml/xml/dom2_rangeimpl.h:
992 * khtml/xml/dom2_traversalimpl.h:
993 * khtml/xml/dom2_viewsimpl.h:
994 * khtml/xml/dom_docimpl.h:
995 * khtml/xml/dom_elementimpl.cpp:
996 (NamedAttrMapImpl::NamedAttrMapImpl):
997 (NamedAttrMapImpl::clearAttributes):
998 (NamedAttrMapImpl::operator=):
999 (NamedAttrMapImpl::addAttribute):
1000 (NamedAttrMapImpl::removeAttribute):
1001 * khtml/xml/dom_elementimpl.h:
1002 * khtml/xml/dom_nodeimpl.h:
1003 * khtml/xml/dom_stringimpl.h:
1004 * kwq/KWQFontFamily.h:
1005 * kwq/KWQListImpl.mm:
1010 (QString::setBufferFromCFString):
1013 2005-04-25 John Sullivan <sullivan@apple.com>
1015 Reviewed by Dave Harrison.
1017 - fixed <rdar://problem/4098731> [DOMHTMLTextAreaElement cols] returns wrong value (usually zero)
1020 (-[DOMHTMLTextAreaElement cols]):
1021 use ATTR_COLS instead of ATTR_ACCESSKEY (D'oh!)
1022 (-[DOMHTMLTextAreaElement setCols:]):
1025 2005-04-25 Darin Adler <darin@apple.com>
1029 - fixed <rdar://problem/4097849> REGRESSION (162-163): importNode creates non-HTML elements, thus style attributes (and some others) don't work
1031 * khtml/xml/dom_docimpl.h: Add virtual functions HTMLElementNamespace and isHTMLNamespace.
1032 * khtml/xml/dom_docimpl.cpp:
1033 (DocumentImpl::importNode): Rearranged this function and fixed the following problems: 1) made sure to ref node while attributes are
1034 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
1035 the source document, not the destination document; 3) removed unneeded getDocument() call which just returns this; 4) fixed error
1036 handling for cases where an exception happens while processing the children.
1037 (DocumentImpl::HTMLElementNamespace): Added. Returns XHTML_NAMESPACE.
1038 (DocumentImpl::isHTMLNamespace): Added. Returns true for any namespace that matches XHTML_NAMESPACE (case insensitive).
1039 (DocumentImpl::createElementNS): Changed to call isHTMLNamespace, which will cause it to accept the null namespace in an HTML document.
1040 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.
1041 (DocumentImpl::createHTMLElement): Pass in HTMLElementNamespace() rather than 0 to tagId.
1042 (DocumentImpl::attrId): Use isHTMLNamespace instead of allowing the null namespace explicitly.
1043 (DocumentImpl::tagId): Ditto.
1045 * khtml/html/html_documentimpl.h: Add overrides for HTMLElementNamespace and isHTMLNamespace.
1046 * khtml/html/html_documentimpl.cpp:
1047 (HTMLDocumentImpl::HTMLElementNamespace): Added. Returns 0 so we use the null string for HTML elements inside HTML documents (as before).
1048 (HTMLDocumentImpl::isHTMLNamespace): Added. Allows 0, and then calls base class to check for the actual XHTML namespace. Thus, we allow
1049 both no namespace at all and the XHTML namespace inside HTML documents.
1051 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::namespaceURI): Changed to call HTMLElementNamespace rather than checking
1052 isHTMLDocument. Same result as before, but better division of responsibilities.
1054 2005-04-25 Darin Adler <darin@apple.com>
1058 - fixed <rdar://problem/4091956> JavaScript drop handlers don't receive more than one dropped item
1060 * kwq/KWQClipboard.mm:
1061 (cocoaTypeFromMIMEType): Remove some use of compare -- less efficient than a simpler "==" check.
1062 Fixed non-GC-safe code to use KWQCFAutorelease instead.
1063 (MIMETypeFromCocoaType): Use fromCFString instead of fromNSString to avoid a cast.
1064 (KWQClipboard::getData): Rearrange so that we'll use filenames if both filenames and a URL are present, since
1065 filenames can accomodate multiple items. Fix bug where we'd return multiple filenames when the type requested
1066 is "URL". Fixed loop that computed the count over and over again for the loop termination condition. Check
1067 that the data for NSFilenamesPboardType is an NSArray instead of assuming it is.
1068 (KWQClipboard::setData): Use isEqualToString: instead of == when comparing types.
1070 2005-04-22 David Hyatt <hyatt@apple.com>
1072 Fix for 4096878, drop shadow effect not displayed correctly on tbray.org/ongoing/. Block minmaxwidth was
1073 broken when negative margins were used and did not properly decrease the max width.
1077 * khtml/rendering/render_block.cpp:
1078 (khtml::RenderBlock::calcBlockMinMaxWidth):
1079 * layout-tests/fast/block/float/034-expected.txt: Added.
1080 * layout-tests/fast/block/float/034.html: Added.
1081 * layout-tests/fast/block/float/035-expected.txt: Added.
1082 * layout-tests/fast/block/float/035.html: Added.
1084 2005-04-22 David Hyatt <hyatt@apple.com>
1086 Remove some dead code from css_valueimpl. It wasn't used at all.
1088 * khtml/css/css_valueimpl.cpp:
1089 * khtml/css/css_valueimpl.h:
1091 2005-04-22 Darin Adler <darin@apple.com>
1093 * khtml/ecma/kjs_html.h: Removed unnecessary bogus class name qualifiers.
1095 2005-04-22 David Hyatt <hyatt@apple.com>
1097 Fix for 4096681, fix regression in how the list-style property is parsed. It no longer parses when it hits
1098 a url in the property value list now, because the list pointer did not get advanced. This fixes alistapart.com.
1102 * khtml/css/cssparser.cpp:
1103 (CSSParser::parseValue):
1104 * layout-tests/fast/lists/009-expected.txt: Added.
1105 * layout-tests/fast/lists/009.html: Added.
1106 * layout-tests/fast/lists/resources/listmark.gif: Added.
1108 2005-04-22 Darin Adler <darin@apple.com>
1112 - fixed <rdar://problem/4091082> Google Suggest no longer works due to lack of "frameElement"
1114 * khtml/ecma/kjs_window.h: Added FrameElement.
1115 * khtml/ecma/kjs_window.cpp: (Window::get): Added "frameElement".
1116 * khtml/ecma/kjs_window.lut.h: Regenerated.
1118 2005-04-22 Darin Adler <darin@apple.com>
1122 - a small editing-related code cleanup
1124 * khtml/rendering/render_text.h: Added positionForOffset and made offsetForPosition const.
1125 * khtml/rendering/render_text.cpp:
1126 (InlineTextBox::offsetForPosition): Made const.
1127 (InlineTextBox::positionForOffset): Added. Moved code here from caretRect.
1128 (RenderText::caretRect): Call positionForOffset instead of doing the work here.
1130 2005-04-21 David Hyatt <hyatt@apple.com>
1132 Fix for 4095839, wrong background image used on flechtwerk.de. Make sure that the global mapped
1133 attribute cache hashed background attributes into per-document buckets.
1135 * khtml/html/html_baseimpl.cpp:
1136 (HTMLBodyElementImpl::mapToEntry):
1137 * khtml/html/html_elementimpl.h:
1139 * khtml/html/html_tableimpl.cpp:
1140 (HTMLTableElementImpl::mapToEntry):
1141 (HTMLTablePartElementImpl::mapToEntry):
1142 * khtml/xml/dom_docimpl.cpp:
1143 (DocumentImpl::DocumentImpl):
1144 * khtml/xml/dom_docimpl.h:
1145 (DOM::DocumentImpl::docID):
1147 2005-04-21 Vicki Murley <vicki@apple.com>
1149 - layout test for 4065447, outerHTML on images
1151 * layout-tests/fast/dynamic/outerHTML-img-expected.txt: Added.
1152 * layout-tests/fast/dynamic/outerHTML-img.html: Added.
1154 2005-04-20 Vicki Murley <vicki@apple.com>
1158 - fixed <rdar://problem/4065447> support outerHTML on IMG elements
1160 * khtml/html/html_elementimpl.cpp:
1161 (HTMLElementImpl::setOuterHTML):
1163 2005-04-18 David Hyatt <hyatt@apple.com>
1165 Fix min-height so that when it resolves to auto it does not use the box's intrinsic height.
1167 * khtml/rendering/render_box.cpp:
1168 (RenderBox::calcHeight):
1169 (RenderBox::calcHeightUsing):
1171 2005-04-18 David Hyatt <hyatt@apple.com>
1173 Back out fix for 4032346, since it is causing garbled image content on many sites.
1175 The bug tracking the fix is 4069093.
1177 (khtml::RenderBlock::matchedEndLine):
1179 2005-04-18 David Hyatt <hyatt@apple.com>
1181 Fix the smile in the Acid2 test. Floats should not grow to contain other floats unless height is auto. Otherwise
1182 the float should use the specified height.
1184 Also fix row 14 of the Acid2 test. Although ambiguous, just modify the table cell baseline alignment code to align
1185 to the bottom of the cell's content height if no suitable baseline could be found.
1187 * khtml/rendering/render_block.cpp:
1188 (khtml::RenderBlock::layoutBlock):
1189 * khtml/rendering/render_block.h:
1190 (khtml::RenderBlock::firstRootBox):
1191 (khtml::RenderBlock::lastRootBox):
1192 * khtml/rendering/render_table.cpp:
1193 (RenderTableSection::calcRowHeight):
1194 (RenderTableCell::baselinePosition):
1196 2005-04-15 David Hyatt <hyatt@apple.com>
1198 Make sure empty tables honor CSS-specified heights when they have no rows or sections. This is done only
1199 in strict mode, since it is not compatible with WinIE.
1201 * khtml/rendering/render_table.cpp:
1202 (RenderTable::layout):
1204 2005-04-15 David Hyatt <hyatt@apple.com>
1206 Fix for row 13 of the Acid2 test. Change HTML comment parsing in strict mode to do proper SGML parsing,
1207 checking for pairs of -- and only being willing to close the comment if every -- is paired up.
1209 * khtml/html/htmltokenizer.cpp:
1210 (khtml::HTMLTokenizer::parseComment):
1212 2005-04-12 Maciej Stachowiak <mjs@apple.com>
1214 Reviewed by Richard.
1216 - use custom single-threaded malloc for all non-GC JavaScriptCore
1217 allocations, for a 9.1% speedup on JavaScript iBench
1219 * khtml/ecma/kjs_binding.cpp:
1221 * khtml/ecma/kjs_proxy.cpp:
1222 (KJSProxyImpl::evaluate):
1224 2005-04-15 David Hyatt <hyatt@apple.com>
1226 Fix the six pixel gap between rows nine and ten of the Acid2 test. Make sure that percentage heights that
1227 resolve to auto are properly treated as though they have auto height by the self-collapsing block check (as per
1228 section 8.3.1, paragraph 7 of the CSS2.1 spec).
1230 * khtml/rendering/render_block.cpp:
1231 (khtml::RenderBlock::isSelfCollapsingBlock):
1233 2005-04-15 David Hyatt <hyatt@apple.com>
1235 The Acid2 test and the reference rendering both make use of overflow:hidden on the <html> element. Turns out
1236 the CSS2.1 wording for this behavior has been revised (based off WinIE/Mozilla behavior). Change our behavior
1237 to match and make <html> overflow apply to the viewport.
1239 * khtml/khtmlview.cpp:
1240 (KHTMLView::applyOverflowToViewport):
1241 (KHTMLView::layout):
1242 * khtml/khtmlview.h:
1243 * khtml/rendering/render_box.cpp:
1244 (RenderBox::setStyle):
1246 2005-04-14 David Hyatt <hyatt@apple.com>
1248 3258403 and 3258402 can now be fixed. min/max-width/height support is now complete. This patch makes them
1249 work for positioned elements and enables us to pass row one of the Acid2 test.
1251 * khtml/rendering/render_box.cpp:
1252 (RenderBox::calcAbsoluteHorizontal):
1253 (RenderBox::calcAbsoluteHorizontalValues):
1254 (RenderBox::calcAbsoluteVertical):
1255 (RenderBox::calcAbsoluteVerticalValues):
1256 * khtml/rendering/render_box.h:
1258 2005-04-12 David Hyatt <hyatt@apple.com>
1260 Working on the Acid2 test, Row 1.
1262 Improve checkChild for the DTD so that it knows what mode a document is in. This allows it to adhere more
1263 strictly to the actual DTD in strict mode and almost strict mode.
1265 Change the <table>-inside-<p> check so that <table> is disallowed inside <p> in
1266 strict mode and almost strict mode. This matches Firefox behavior, which allows <table>
1267 inside <p> only in quirks mode.
1269 * khtml/html/dtd.cpp:
1272 * khtml/html/htmlparser.cpp:
1273 (KHTMLParser::insertNode):
1274 * khtml/html/htmltokenizer.cpp:
1275 (khtml::HTMLTokenizer::parseTag):
1276 * khtml/xml/dom_elementimpl.cpp:
1277 (ElementImpl::childAllowed):
1279 2005-04-12 Vicki Murley <vicki@apple.com>
1283 - fixed <rdar://problem/3760895> Request for including an implementation of the elementFromPoint function
1285 * khtml/dom/dom_doc.cpp:
1286 (DOM::Document::elementFromPoint):
1287 * khtml/dom/dom_doc.h:
1288 * khtml/ecma/kjs_dom.cpp:
1289 (DOMDocumentProtoFunc::tryCall):
1290 * khtml/ecma/kjs_dom.h:
1291 (KJS::DOMDocument::):
1292 * khtml/ecma/kjs_dom.lut.h:
1294 * khtml/xml/dom_docimpl.cpp:
1295 (DocumentImpl::elementFromPoint):
1296 * khtml/xml/dom_docimpl.h:
1298 2005-04-12 David Hyatt <hyatt@apple.com>
1300 Beginning of work to support the Acid2 CSS test put forward by the Web Standards Project. Fix
1301 our handling of the rel attribute on <link> elements to do a proper tokenization so that stylesheets
1302 can be recognized even when other keywords are present in the rel attribute.
1304 * khtml/html/html_headimpl.cpp:
1305 (HTMLLinkElementImpl::HTMLLinkElementImpl):
1306 (HTMLLinkElementImpl::parseHTMLAttribute):
1307 (HTMLLinkElementImpl::tokenizeRelAttribute):
1308 (HTMLLinkElementImpl::process):
1309 * khtml/html/html_headimpl.h:
1311 2005-04-12 John Sullivan <sullivan@apple.com>
1313 - fixed these two bugs (I also fixed these on the experimental-ui-branch)
1314 <rdar://problem/3154293> Find Next should not scroll page if the next target is already visible
1315 <rdar://problem/3121828> scrollToVisible on find cuts off the left part of the view due to needless horiz. scroll
1319 * kwq/KWQKHTMLPart.mm:
1320 (KWQKHTMLPart::jumpToSelection):
1321 Trey had written code to address these issues, but left it commented out due to other
1322 problems. The other problems no longer occur, so I uncommented Trey's code, and then
1323 discovered that I could make it behave more like TextEdit with many fewer lines of
1326 2005-04-08 David Harrison <harrison@apple.com>
1328 Reviewed by Dave Hyatt.
1330 <rdar://problem/4084106> Remove NSAccessibilityForegroundColorTextAttributeWrapper
1332 * kwq/KWQAccObject.mm:
1333 (AXAttributeStringSetStyle):
1334 Use NSAccessibilityForegroundColorTextAttribute directly.
1336 2005-04-05 David Hyatt <hyatt@apple.com>
1338 Fix for 4077106, make sure that mouse wheeling in overflow sections uses 40 rather than 10 as the base line
1343 * khtml/rendering/render_layer.cpp:
1344 (RenderLayer::positionScrollbars):
1345 * kwq/KWQScrollBar.mm:
1346 (QScrollBar::scroll):
1348 2005-04-04 Vicki Murley <vicki@apple.com>
1352 - fixed <rdar://problem/3871669> no focus or blur methods on HTML button elements
1354 * khtml/dom/html_form.cpp:
1355 (HTMLButtonElement::focus):
1356 (HTMLButtonElement::blur):
1357 * khtml/dom/html_form.h:
1358 * khtml/ecma/kjs_html.cpp:
1359 (KJS::HTMLElementFunction::tryCall):
1360 * khtml/ecma/kjs_html.h:
1361 (KJS::HTMLElement::):
1362 * khtml/ecma/kjs_html.lut.h:
1364 * khtml/html/html_formimpl.cpp:
1365 (DOM::HTMLButtonElementImpl::blur):
1366 (DOM::HTMLButtonElementImpl::focus):
1367 * khtml/html/html_formimpl.h:
1371 2005-03-28 David Harrison <harrison@apple.com>
1375 <rdar://problem/4069161> REGRESSION (8A416-8A419): Safari crash bringing up context menu for non-HTML content in a frame
1377 * kwq/KWQAccObject.mm:
1378 (-[KWQAccObject rendererForView:]):
1379 Nil-check node variable instead of rechecking document variable.
1383 2005-03-27 Darin Adler <darin@apple.com>
1385 Reviewed by me, fix by Kida-san.
1387 - fixed <rdar://problem/4067474> 8A424: Safari immediately quit by Cmd+Ctrll+'D'
1389 * kwq/WebCoreBridge.mm: (-[WebCoreBridge convertToNSRange:DOM::]):
1394 2005-03-24 Richard Williamson <rjw@apple.com>
1396 Fixed <rdar://problem/4052683> After adding/removing stocks from Stocks Widget, stock areas went blank
1398 The request was being collected before firing it's load handler.
1399 We now gc protect the request while it's loading.
1403 * khtml/ecma/xmlhttprequest.cpp:
1404 (KJS::XMLHttpRequest::send):
1405 (KJS::XMLHttpRequest::abort):
1406 (KJS::XMLHttpRequest::slotFinished):
1407 (KJS::XMLHttpRequestProtoFunc::tryCall):
1411 2005-03-23 Darin Adler <darin@apple.com>
1413 Further fix for 4053515.
1415 Covered cases where text position doesn't lie inside a
1418 Reviewed by Richard.
1420 * khtml/editing/visible_text.cpp:
1421 (khtml::TextIterator::setRangeFromLocationAndLength):
1423 2005-03-23 Richard Williamson <rjw@apple.com>
1425 Fixed <rdar://problem/4053515> REGRESSION (Mail): Kotoeri input method reconversion does not work in WebViews
1427 We now use actual document NSRanges to represent both marked text
1428 ranges and selection ranges.
1432 * khtml/editing/visible_text.cpp:
1433 (khtml::TextIterator::rangeLength):
1434 (khtml::TextIterator::setRangeFromLocationAndLength):
1435 * khtml/editing/visible_text.h:
1436 * kwq/WebCoreBridge.h:
1437 * kwq/WebCoreBridge.mm:
1438 (-[WebCoreBridge convertToNSRange:DOM::]):
1439 (-[WebCoreBridge DOM::convertToDOMRange:]):
1440 (-[WebCoreBridge selectNSRange:]):
1441 (-[WebCoreBridge markedTextDOMRange]):
1442 (-[WebCoreBridge markedTextNSRange]):
1444 2005-03-22 Kevin Decker <kdecker@apple.com>
1448 Fixed <rdar://problem/4062336> REGRESSION (406-407): HTML submenus not working at hrweb.apple.com after going back
1450 Rolled out the fix for <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
1452 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.
1454 * khtml/khtml_part.cpp:
1455 (KHTMLPart::closeURL):
1456 * khtml/xml/dom_docimpl.cpp:
1457 (DocumentImpl::detach):
1461 2005-03-22 Vicki Murley <vicki@apple.com>
1463 - roll the fix for <rdar://problem/4060266> back in, since its
1466 * khtml/editing/visible_text.cpp:
1467 (khtml::TextIterator::handleTextBox):
1469 2005-03-22 Vicki Murley <vicki@apple.com>
1471 - roll out the fix for <rdar://problem/4060266> since it was denied by CCC
1473 * khtml/editing/visible_text.cpp:
1474 (khtml::TextIterator::handleTextBox):
1476 2005-03-22 David Harrison <harrison@apple.com>
1480 <rdar://problem/4060266> Double-clicking in Dictionary.app doesn't work for some words (coming just after style change)
1482 * khtml/editing/visible_text.cpp:
1483 (khtml::TextIterator::handleTextBox):
1484 Complete the check of whether to emit space for collapsed space.
1486 2005-03-22 David Harrison <harrison@apple.com>
1490 <rdar://problem/4061443> REGRESSION (8A420-8A421): Pasting in the Stickies widget is broken again
1492 * khtml/editing/htmlediting.cpp:
1493 (khtml::positionBeforeContainingSpecialElement):
1494 (khtml::positionAfterContainingSpecialElement):
1495 Return unchanged Position rather than a null or non-editable one.
1499 2005-03-20 Ken Kocienda <kocienda@apple.com>
1503 I made an error in this test earlier. It was not testing what I intended. Fixed.
1505 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt
1506 * layout-tests/editing/unsupported-content/list-delete-001.html
1510 * layout-tests/editing/unsupported-content/table-delete-001-expected.txt: Added.
1511 * layout-tests/editing/unsupported-content/table-delete-001.html: Added.
1512 * layout-tests/editing/unsupported-content/table-delete-002-expected.txt: Added.
1513 * layout-tests/editing/unsupported-content/table-delete-002.html: Added.
1514 * layout-tests/editing/unsupported-content/table-delete-003-expected.txt: Added.
1515 * layout-tests/editing/unsupported-content/table-delete-003.html: Added.
1516 * layout-tests/editing/unsupported-content/table-type-after-expected.txt: Added.
1517 * layout-tests/editing/unsupported-content/table-type-after.html: Added.
1518 * layout-tests/editing/unsupported-content/table-type-before-expected.txt: Added.
1519 * layout-tests/editing/unsupported-content/table-type-before.html: Added.
1521 2005-03-20 Darin Adler <darin@apple.com>
1525 - fixed <rdar://problem/3923903> REGRESSION (164-165): Repro Safari crash in khtml::RenderLayer::scrollToOffset
1527 * khtml/rendering/render_layer.cpp: (RenderLayer::scrollToOffset): Check canvas for nil.
1529 2005-03-20 David Harrison <harrison@apple.com>
1533 <rdar://problem/4055127> Dictionary pop-up panel misplaced at beginning of text blocks (breaks double-clicking in Dictionary.app)
1535 SimplifiedBackwardsTextIterator::advance() needed to not limit to textnodes
1536 when checking whether moving back across block boundaries
1538 VisibleUnits previousBoundary() needed to INIT_DOWN when creating result VisiblePosition
1540 All editing tests pass.
1542 * khtml/editing/visible_text.cpp:
1543 (khtml::SimplifiedBackwardsTextIterator::advance):
1544 * khtml/editing/visible_units.cpp:
1545 (khtml::previousBoundary):
1547 2005-03-20 Darin Adler <darin@apple.com>
1549 Reviewed by Harrison.
1551 - 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
1553 * khtml/khtml_part.h: Added selectFrameElementInParentIfFullySelected.
1554 * khtml/khtml_part.cpp:
1556 (KHTMLPart::setFocusNodeIfNeeded): Changed to not set focus to a frame; was not what this function was
1557 intended to do, and caused trouble when trying to select a frame element.
1558 (KHTMLPart::khtmlMouseReleaseEvent): Call selectFrameElementInParentIfFullySelected.
1559 (KHTMLPart::selectAll): Call selectFrameElementInParentIfFullySelected.
1560 (KHTMLPart::selectFrameElementInParentIfFullySelected): Added. Selects the frame element in the parent
1561 if a frame is entirely selected, which makes it easier to delete or replace the frame and is consistent
1562 with the changes Maciej made recently for other elements.
1564 * kwq/WebCoreBridge.mm:
1565 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Call selectFrameElementInParentIfFullySelected.
1566 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Call selectFrameElementInParentIfFullySelected.
1568 2005-03-20 Darin Adler <darin@apple.com>
1570 Reviewed by me, code change by Ken.
1572 - fixed <rdar://problem/4059852> Deleting from first element of list makes content jump to wrong place
1574 * khtml/editing/htmlediting.cpp:
1575 (khtml::isListStructureNode): Added.
1576 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Check for list nodes as well as table nodes.
1578 2005-03-20 Ken Kocienda <kocienda@apple.com>
1582 Added tests to cover new "unsupported content" editing code.
1584 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt: Added.
1585 * layout-tests/editing/unsupported-content/list-delete-001.html: Added.
1586 * layout-tests/editing/unsupported-content/list-delete-002-expected.txt: Added.
1587 * layout-tests/editing/unsupported-content/list-delete-002.html: Added.
1588 * layout-tests/editing/unsupported-content/list-delete-003-expected.txt: Added.
1589 * layout-tests/editing/unsupported-content/list-delete-003.html: Added.
1590 * layout-tests/editing/unsupported-content/list-type-after-expected.txt: Added.
1591 * layout-tests/editing/unsupported-content/list-type-after.html: Added.
1592 * layout-tests/editing/unsupported-content/list-type-before-expected.txt: Added.
1593 * layout-tests/editing/unsupported-content/list-type-before.html: Added.
1595 2005-03-20 Ken Kocienda <kocienda@apple.com>
1601 <rdar://problem/4059578> Entire list deleted, and caret disappears, when delete key hit at end of list
1603 The problem is that a new case in the delete code did not consider when the
1604 downstream end node of the selection might be an ancestor of the upstream start
1605 node. That is the case in this bug. The downstream end is the body element, and
1606 this line of code would delete all the children of the downstream end:
1607 removeChildrenInRangePreservingPosition(m_downstreamEnd.node(), 0,
1608 m_downstreamEnd.offset(), m_upstreamStart);
1610 The fix is to check for this "is ancestor" case, and do some tree logic to find
1611 the right offset of the downstream end node for the call to
1612 removeChildrenInRangePreservingPosition().
1614 * khtml/editing/htmlediting.cpp:
1615 (khtml::DeleteSelectionCommand::handleGeneralDelete): Fixed as described.
1617 2005-03-19 Ken Kocienda <kocienda@apple.com>
1623 <rdar://problem/4059384> Cannot place insertion point correctly in editable text that avoids floating elements
1625 Note: I strongly suspect this bug blocks a complete solution to this other Tiger/P2:
1626 <rdar://problem/4055748> AX: Dictionary pop-up panel shows at wrong place on specific parts of particular pages
1628 * khtml/rendering/render_text.cpp:
1629 (RenderText::caretRect): Change the y-coordinate used to calculate the available width for a line. Height is wrong.
1630 Top of the box containing the text where the click is done is correct. Also, add in the x-offset for the start
1631 of the text box when calculating the available width. If this text box is avoiding a float at the y-coordinate
1632 for the relevant box, failure to add in the amount of float-avoidance will make the text at the coordinates
1633 greater than end-of-line minus float-avoidance ineligible for caret placement.
1635 2005-03-19 Darin Adler <darin@apple.com>
1639 - fixed <rdar://problem/4057594> REGRESSION (125-406): Unrepro crash in HTMLTokenizer::allDataProcessed after hitting Back button
1641 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::allDataProcessed):
1642 To get the part safely after calling end, save a guarded pointer to the view.
1643 The old way could end trying to call a virtual function a part that was destroyed.
1645 2005-03-19 Maciej Stachowiak <mjs@apple.com>
1649 <rdar://problem/4053506> Pasting Tables and Cells in Mail does not allow editing before or after
1650 <rdar://problem/4005954> REGRESSION (Mail): After copy/paste of content containing list element cannot go back to entering text at left side of page
1652 * khtml/editing/htmlediting.cpp:
1653 (khtml::maxDeepOffset):
1654 (khtml::CompositeEditCommand::removeFullySelectedNodePreservingPosition):
1655 (khtml::CompositeEditCommand::removeChildrenInRangePreservingPosition):
1656 (khtml::CompositeEditCommand::removeNodePreservingPosition):
1657 (khtml::CompositeEditCommand::insertBlockPlaceholder):
1658 (khtml::CompositeEditCommand::appendBlockPlaceholder):
1659 (khtml::CompositeEditCommand::forceBlockPlaceholder):
1660 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
1661 (khtml::isSpecialElement):
1662 (khtml::isFirstVisiblePositionInSpecialElementInFragment):
1663 (khtml::positionBeforePossibleContainingSpecialElement):
1664 (khtml::positionAfterPossibleContainingSpecialElement):
1665 (khtml::ApplyStyleCommand::applyInlineStyle):
1666 (khtml::DeleteSelectionCommand::initializePositionData):
1667 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
1668 (khtml::DeleteSelectionCommand::handleGeneralDelete):
1669 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
1670 (khtml::DeleteSelectionCommand::doApply):
1671 (khtml::InsertParagraphSeparatorCommand::doApply):
1672 (khtml::ReplacementFragment::ReplacementFragment):
1673 (khtml::ReplaceSelectionCommand::doApply):
1674 * khtml/editing/htmlediting.h:
1675 * khtml/editing/visible_position.cpp:
1676 (khtml::isRenderedBR):
1677 (khtml::VisiblePosition::initDownstream):
1678 (khtml::isLastVisiblePositionInBlock):
1679 * khtml/rendering/render_line.cpp:
1680 (khtml::RootInlineBox::closestLeafChildForXPos):
1681 * khtml/xml/dom_nodeimpl.cpp:
1682 (NodeImpl::isBlockFlowOrTable):
1683 (NodeImpl::isEditableBlock):
1684 (NodeImpl::enclosingBlockFlowOrTableElement):
1685 * khtml/xml/dom_nodeimpl.h:
1686 * khtml/xml/dom_position.cpp:
1687 (DOM::Position::upstream):
1688 (DOM::Position::downstream):
1689 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
1690 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
1691 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
1692 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
1693 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt:
1695 2005-03-19 John Sullivan <sullivan@apple.com>
1699 - fixed <rdar://problem/4058740> Crash (nil-deref) editing Mail reply
1700 message in KWQKHTMLPart::fontForSelection (MailViewer-723)
1702 * kwq/KWQKHTMLPart.mm:
1703 (KWQKHTMLPart::fontForSelection):
1704 Add nil check to loop. It shouldn't be necessary, but this crash trace seems to be
1705 running into it. We're not completely certain, but the check is harmless at worst.
1709 2005-03-18 David Harrison <harrison@apple.com>
1713 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
1715 Also changed WebKit.
1717 * kwq/KWQAccObject.mm:
1718 (-[KWQAccObject rendererForView:]):
1719 New to cover both the WebCore and WebKit NSViews.
1721 (-[KWQAccObject _accessibilityParentForSubview:]):
1722 Use rendererForView.
1724 * kwq/WebCoreFrameView.h:
1725 Add WebCoreBridgeHolder protocol to get access to WebKit NSViews.
1727 2005-03-18 David Harrison <harrison@apple.com>
1729 Reviewed by Darin, Ken.
1731 <rdar://problem/3735625> AX: add AXPress action if an element has an onclick handler
1733 * khtml/dom/html_form.cpp:
1734 (HTMLInputElement::click):
1735 * khtml/html/html_elementimpl.cpp:
1736 (HTMLElementImpl::click):
1737 (HTMLElementImpl::accessKeyAction):
1738 * khtml/html/html_elementimpl.h:
1739 * khtml/html/html_formimpl.cpp:
1740 (DOM::HTMLFormElementImpl::submitClick):
1741 (DOM::HTMLButtonElementImpl::click):
1742 (DOM::HTMLButtonElementImpl::accessKeyAction):
1743 (DOM::HTMLInputElementImpl::click):
1744 (DOM::HTMLInputElementImpl::accessKeyAction):
1745 (DOM::HTMLInputElementImpl::defaultEventHandler):
1746 (DOM::HTMLLabelElementImpl::accessKeyAction):
1747 (DOM::HTMLSelectElementImpl::accessKeyAction):
1748 (DOM::HTMLTextAreaElementImpl::accessKeyAction):
1749 * khtml/html/html_formimpl.h:
1750 * khtml/html/html_inlineimpl.cpp:
1751 (HTMLAnchorElementImpl::defaultEventHandler):
1752 (HTMLAnchorElementImpl::accessKeyAction):
1753 * khtml/html/html_inlineimpl.h:
1754 * khtml/rendering/render_form.cpp:
1755 (RenderFileButton::click):
1756 * khtml/rendering/render_form.h:
1757 * khtml/xml/dom_docimpl.cpp:
1758 (DocumentImpl::defaultEventHandler):
1759 * khtml/xml/dom_elementimpl.h:
1760 (DOM::ElementImpl::accessKeyAction):
1762 (-[DOMHTMLInputElement click]):
1766 * kwq/KWQFileButton.h:
1767 * kwq/KWQFileButton.mm:
1768 (KWQFileButton::click):
1770 Add accessKeyAction parameter about whether to limit to HTMLElementImpl subclasses that JavaScript wants, or to apply to others as well.
1772 Add click() parameter about whether to send the mousedown and mouseup events in addition to the click event.
1774 * kwq/KWQAccObject.mm:
1775 (-[KWQAccObject mouseButtonListener]):
1776 Locate a mousedown, mouseup, or click handler in the current element and its ancestors.
1778 (-[KWQAccObject actionElement]):
1779 (-[KWQAccObject accessibilityIsIgnored]):
1780 (-[KWQAccObject accessibilityPerformAction:]):
1781 Consider mouseButtonListener.
1783 2005-03-18 John Sullivan <sullivan@apple.com>
1787 - fixed <rdar://problem/4002164> maps that include start and end
1788 location don't print right from maps.google.com
1790 I thought I checked this in yesterday but a ChangeLog conflict aborted my checkin
1791 without me noticing.
1793 * khtml/rendering/render_style.cpp:
1794 (RenderStyle::diff):
1795 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
1797 * khtml/rendering/render_style.h:
1798 (khtml::RenderStyle::InheritedFlags::operator==):
1799 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
1800 (khtml::RenderStyle::setBitDefaults):
1802 (khtml::RenderStyle::forceBackgroundsToWhite):
1803 ditto, and method name changed too
1804 (khtml::RenderStyle::setForceBackgroundsToWhite):
1807 * khtml/rendering/render_text.cpp:
1808 (InlineTextBox::paint):
1809 updated for name change; also, compare text against white instead of current bg color
1810 because we no longer actually modify the bg color (previously we would always set
1811 the bg color to white, so the result is the same)
1813 * khtml/xml/dom_docimpl.cpp:
1814 (DocumentImpl::recalcStyle):
1815 updated for name change
1817 * kwq/WebCoreBridge.mm:
1818 (-[WebCoreBridge styleSheetForPrinting]):
1820 (-[WebCoreBridge reapplyStylesForDeviceType:]):
1821 removed the code that called styleSheetForPrinting; we no longer use a stylesheet
1824 * khtml/rendering/render_box.cpp:
1825 (RenderBox::paintBackgroundExtended):
1826 If forceBackgroundsToWhite flag is set, convert background images and
1827 background colors to white background color with no background image.
1829 2005-03-18 Ken Kocienda <kocienda@apple.com>
1835 <rdar://problem/4056718> Pasting quotes the entire message
1837 * khtml/editing/htmlediting.cpp:
1838 (khtml::ReplaceSelectionCommand::doApply): After pasting, nodes are moved to the block containing
1839 the end of the pasted content in certain cases. This move logic used to stop once it moved all the
1840 siblings of the node following the last node of the pasted-in content. This means that block elements
1841 could get moved, and if the pasted-in content included a mail blockquote, this could result in
1842 one quote level getting added. The fix is to stop the move of nodes once a <br>, block element, or
1843 <table> is seen. This only affected one of the many test cases we have for such scenarios, and
1844 the change to that result makes sense given the code change.
1845 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: This test result changed in a way that
1846 adequately tests the behavior change, so I did not add a new test.
1848 2005-03-17 Ken Kocienda <kocienda@apple.com>
1850 Reviewed by Harrison
1854 <rdar://problem/4051809> 8A413: Cursor-up in a mail message sometimes gets stuck (with specific reproducible case)
1856 * khtml/rendering/render_text.cpp:
1857 (RenderText::positionForCoordinates): Consider two lines: line-above and line-below. If the caret position in line-below
1858 was at an x coordinate between half way through the x coordinate of the last character on the line-above and the
1859 end of that same character, this bug would happen since the positioning code would assume that it could create a
1860 VisiblePosition with a DOWNSTREAM affinity. Now, I check to see if the character position on the line-above is the
1861 last character on that line, and if it is, I use UPSTREAM as the affinity.
1865 2005-03-17 David Harrison <harrison@apple.com>
1867 Reviewed by Darin, Ken.
1869 * khtml/editing/htmlediting.cpp:
1870 (khtml::EditCommandPtr::setEndingSelection):
1871 Fixed typo so that it calls setEndingSelection rather than setStartingSelection.
1872 Commented out this unused method, tho, since this is late in Tiger. Proved unused by successful build after temporarily removing method declaration or implemenation.
1874 2005-03-16 Kevin Decker <kdecker@apple.com>
1878 Fixed <rdar://problem/4046665> REGRESSION (403-405): mypage.apple.com login does not work (hits assertion in Development build)
1880 * kwq/WebCoreBridge.mm:
1881 (-[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="">
1883 2005-03-16 Darin Adler <darin@apple.com>
1887 - fixed <rdar://problem/4045203> REGRESSION (125-188): Redundant JS imports crash Safari
1889 * khtml/html/htmltokenizer.h: Take inWRite bool out of NDEBUG ifdef.
1890 * khtml/html/htmltokenizer.cpp:
1891 (khtml::HTMLTokenizer::HTMLTokenizer): Take inWrite bool management code out of NDEBUG ifdef.
1892 (khtml::HTMLTokenizer::write): Ditto. Don't call end if inWrite is true, since it will be called
1893 when you return to the body of the outer write() call.
1894 (khtml::HTMLTokenizer::allDataProcessed): Don't call end() if inWrite is true for the same reason.
1895 (khtml::HTMLTokenizer::finish): Ditto.
1897 * kwq/KWQWidget.mm: (QWidget::getOuterView): Removed bogus assertion that has been vexing us of late.
1899 2005-03-16 David Harrison <harrison@apple.com>
1901 Reviewed by me (written by Patti Yeh).
1903 * kwq/KWQAccObject.mm:
1904 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
1905 Use LeftWordIfOnBoundary instead of RightWordIfOnBoundary.
1907 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
1908 Use RightWordIfOnBoundary instead of LeftWordIfOnBoundary.
1910 2005-03-16 David Harrison <harrison@apple.com>
1914 <rdar://problem/4054590> AX: Dictionary panel does not work when page is scrolled on Safari
1916 * kwq/KWQAccObject.mm:
1917 (-[KWQAccObject doAXTextMarkerForPosition:]):
1918 Add in the view's contentsX and contentsY to the point.
1920 2005-03-16 David Harrison <harrison@apple.com>
1924 <rdar://problem/4048506> Deleting from beginning of editable div deletes other document elements
1926 Also changed WebKit.
1928 * khtml/editing/visible_units.h:
1929 * khtml/editing/visible_units.cpp:
1930 (khtml::startOfEditableContent):
1931 (khtml::endOfEditableContent):
1932 (khtml::inSameEditableContent):
1933 (khtml::isStartOfEditableContent):
1934 (khtml::isEndOfEditableContent):
1937 * kwq/WebCoreBridge.h:
1938 * kwq/WebCoreBridge.mm:
1939 (-[WebCoreBridge canDeleteRange:]):
1942 2005-03-16 Ken Kocienda <kocienda@apple.com>
1948 <rdar://problem/4042935> undo doesn't work properly during inline input
1950 * kwq/WebCoreBridge.h: Declare new method below.
1951 * kwq/WebCoreBridge.mm:
1952 (-[WebCoreBridge replaceMarkedTextWithText:]): New method. Wraps calls to TypingCommand::deleteKeyPressed and
1953 TypingCommand::insertText to map the way that international text input works onto the typing undo system.
1955 2005-03-16 David Harrison <harrison@apple.com>
1959 <rdar://problem/4044336> REGRESSION (8A398-8A409): Option-Delete also deletes space to left of deleted word
1961 * khtml/editing/htmlediting.cpp:
1962 (khtml::DeleteSelectionCommand::initializePositionData):
1963 - skip smart delete if the selection to delete already starts or ends with whitespace
1965 * khtml/khtml_part.cpp:
1966 (KHTMLPart::handleMousePressEventDoubleClick):
1967 - preserve selection on double-click when range is already selected
1969 * khtml/xml/dom_position.cpp:
1970 (DOM::Position::leadingWhitespacePosition):
1971 (DOM::Position::trailingWhitespacePosition):
1972 - fix considerNonCollapsibleWhitespace action (logic was reversed)
1973 - add non-breaking space to the non-collapsable ones
1975 * kwq/WebCoreBridge.mm:
1976 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
1977 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
1978 - these methods do not set the selection, so remove calls to setSelectionGranularity
1980 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
1981 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]):
1982 - set the granularity back to character
1983 - the one exception is that we need to keep word granularity
1984 to preserve smart delete behavior when extending by word
1986 2005-03-15 Maciej Stachowiak <mjs@apple.com>
1990 <rdar://problem/4053266> Pressing return a few times right after a link makes the new blank lines part of the link
1992 * khtml/editing/htmlediting.cpp:
1993 (khtml::InsertLineBreakCommand::doApply): Use
1994 positionOutsideContainingSpecialElement in the right two places.
1995 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1997 - move all these helper functions higher in the file
1999 * khtml/editing/htmlediting.cpp:
2000 (khtml::isSpecialElement):
2001 (khtml::isFirstVisiblePositionInSpecialElement):
2002 (khtml::positionBeforeNode):
2003 (khtml::positionBeforeContainingSpecialElement):
2004 (khtml::maxRangeOffset):
2005 (khtml::isLastVisiblePositionInSpecialElement):
2006 (khtml::positionAfterNode):
2007 (khtml::positionAfterContainingSpecialElement):
2008 (khtml::positionOutsideContainingSpecialElement):
2010 2005-03-14 Maciej Stachowiak <mjs@apple.com>
2014 <rdar://problem/4049925> Pasting right after a link makes pasted content part of the link (without visible style change)
2016 * khtml/editing/htmlediting.cpp:
2017 (khtml::positionOutsideContainingSpecialElement): made a helper
2018 function that computes a position outside the outermost containing
2019 special element if the passed in position is right at the start or
2021 (khtml::InsertTextCommand::prepareForTextInsertion): use new helper here
2022 (khtml::ReplaceSelectionCommand::doApply): use it here too: this is the fix
2023 (khtml::positionBeforeNode): made static
2024 (khtml::positionBeforeContainingSpecialElement): made static
2025 (khtml::positionAfterNode): made static
2026 (khtml::positionAfterContainingSpecialElement): made static
2028 2005-03-15 Richard Williamson <rjw@apple.com>
2030 Fixed <rdar://problem/4053658> Crash getting direction at maps.google.com
2032 Add non nil style() check.
2034 Reviewed by Dave Harrison.
2036 * khtml/rendering/render_table.cpp:
2037 (RenderTableCell::collapsedRightBorder):
2039 2005-03-15 Kevin Decker <kdecker@apple.com>
2043 Fixed: <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
2045 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().
2047 This fixes a recent regression from:
2049 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
2051 * khtml/khtml_part.cpp:
2052 (KHTMLPart::closeURL): After dispatching event handlers, go ahead and remove them from the DOM.
2053 * khtml/xml/dom_docimpl.cpp:
2054 (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.
2056 2005-03-15 Ken Kocienda <kocienda@apple.com>
2062 <rdar://problem/4052642> Each delete keystroke is in its own undo group; not included in undo group with other typing
2064 Calling -[WebCore setSelectedDOMRange:range affinity:] had the result of "closing" any active set of typing
2065 keystrokes grouped together in a single undo operation. A change on 27 Jan in WebKit to change the way delete
2066 keystrokes are handled made this feature regress. Previous to that change, the backwards delete
2067 key went through separate code that is no longer in the tree that did not set the selection in the way
2070 The solution is to add an extra argument to the set-selection call. The WebCoreBridge now offers this method:
2071 -[WebCore setSelectedDOMRange:range affinity:closeTyping:]. Now, callers must indicate whether setting the
2072 selection will act to close typing or not.
2074 * kwq/WebCoreBridge.h: Changed header accordingly to change method shown below.
2075 * kwq/WebCoreBridge.mm:
2076 (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Added closeTyping argument to this method.
2078 2005-03-15 John Sullivan <sullivan@apple.com>
2082 - fixed <rdar://problem/4052246> crash in KWQKHTMLPart::createPart() trying to display local file in frame
2084 * kwq/KWQKHTMLPart.mm:
2085 (KWQKHTMLPart::createPart):
2086 Check part for nil before trying to ref. This was probably a longstanding code flaw revealed by
2087 the recent security fix.
2089 2005-03-15 Kevin Decker <kdecker@apple.com>
2091 Reviewed by Ken and Maciej.
2093 New fix for <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
2095 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.
2097 * khtml/html/htmltokenizer.cpp:
2098 (khtml::HTMLTokenizer::HTMLTokenizer): Initialize loadStopped to false.
2099 (khtml::HTMLTokenizer::write): Go ahead and bail out if loadStopped is true.
2100 (khtml::HTMLTokenizer::processToken):
2101 * 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.
2102 * khtml/khtml_part.cpp:
2103 (KHTMLPart::closeURL): Notify the tokenizer to stop parsing.
2104 * khtml/xml/xml_tokenizer.cpp:
2105 (khtml::XMLTokenizer::XMLTokenizer): Initialize loadStopped to false.
2106 * khtml/xml/xml_tokenizer.h:
2107 (khtml::Tokenizer::stopParsing): Added.
2109 2005-03-14 David Harrison <harrison@apple.com>
2111 Reviewed by Darin, Maciej.
2113 <rdar://problem/4046103> REGRESSION (Mail): clicking after style change sets insertion point incorrectly
2115 Also fixes crash by adding nil check.
2117 * khtml/editing/htmlediting.cpp:
2118 (khtml::MoveSelectionCommand::doApply):
2119 Check the node for nil.
2121 * khtml/khtml_part.cpp:
2122 (KHTMLPart::khtmlMouseReleaseEvent):
2123 Use the node from the event rather than from the selection.
2125 2005-03-14 Darin Adler <darin@apple.com>
2127 Reviewed by Harrison.
2129 - fixed <rdar://problem/4049776> Seed: Mail: Disable spellcheck leaves red artifacts
2131 * khtml/xml/dom_docimpl.cpp:
2132 (DocumentImpl::DocumentImpl): Set markers list to be "auto-delete" so they don't all leak.
2133 (DocumentImpl::removeMarker): Remove markers list for a node when the last marker is removed
2134 for that node. Otherwise, we can have empty marker lists for each node forever until the
2136 (DocumentImpl::removeAllMarkers): Added code to dirty the markers.
2137 (DocumentImpl::shiftMarkers): Remove unneeded empty check.
2139 * kwq/WebCoreBridge.h: Added unmarkAllMisspellings for WebKit.
2140 * kwq/WebCoreBridge.mm: (-[WebCoreBridge unmarkAllMisspellings]): Added. Calls removeAllMarkers.
2142 2005-03-14 Richard Williamson <rjw@apple.com>
2144 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
2146 A document may be deleted as a consequence of handling an event,
2147 as was the case with Acrobat.app. Ensure that the document is still valid
2148 before passing the event on for further handling.
2150 * khtml/xml/dom_nodeimpl.cpp:
2151 (NodeImpl::dispatchUIEvent):
2153 2005-03-14 Ken Kocienda <kocienda@apple.com>
2157 Added a couple of comments about setChanged() to this code based on my experiences with 4047028.
2159 * khtml/css/css_valueimpl.cpp:
2160 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties)
2161 (DOM::CSSMutableStyleDeclarationImpl::merge)
2163 2005-03-14 Ken Kocienda <kocienda@apple.com>
2169 <rdar://problem/4047028> Changing quote levels on stylized text causes it to be sent as colored (Blue). Tiger8A410
2171 * khtml/css/css_valueimpl.cpp:
2172 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): This function now calls setChanged() at the
2173 end of its loop if any properties were removed. This makes the style system update correctly in response
2174 to changes made by this function. The code to paste removes style from the pasted content in a
2175 preliminary step, and the fact that the style system did not update properly left unwanted color
2176 declarations in the document.
2178 2005-03-14 Vicki Murley <vicki@apple.com>
2180 - roll out this change for now, since it was denied by CCC
2182 2005-03-11 David Harrison <harrison@apple.com>
2186 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
2188 * kwq/KWQKHTMLPart.mm:
2189 (KWQKHTMLPart::advanceToNextMisspelling):
2190 (KWQKHTMLPart::markMisspellings):
2193 2005-03-14 Ken Kocienda <kocienda@apple.com>
2199 <rdar://problem/4050403> Mail crashes after pasting and deleting the content of one Excel cell
2201 * khtml/editing/htmlediting.cpp:
2202 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add some null checks to the code. This fixes the crash, although
2203 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
2204 the document that cannot be removed (this is actually an empty table). This is undesirable, however, work Maciej is
2205 doing to fix the general-case problem of trying to edit constructs we do not handle well in editing should fix this
2206 particular case, making the deletion of this "blank line" possible. Maciej is doing this work as part of this bug:
2207 <rdar://problem/4036051> Hard to select (and thus delete) an IFRAME in an editable WebView
2209 2005-03-14 Ken Kocienda <kocienda@apple.com>
2215 <rdar://problem/4029632> Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
2217 The problem is that removeInlineStyle() can remove nodes, and if either the start or end node of the
2218 selection at the time of the call to removeInlineStyle() was in a node that got removed, bad things
2219 would happen. The fix is described below.
2221 * khtml/editing/htmlediting.cpp:
2222 (khtml::maxRangeOffset): Moved this static function to a different place in the file so the code below can use it.
2223 (khtml::ApplyStyleCommand::applyInlineStyle): Calling removeInlineStyle() now has the side effect of
2224 setting the command's ending selection. Now resets start and end using the ending selection after the call to
2225 removeInlineStyle() as it is done elsewhere in this function.
2226 (khtml::ApplyStyleCommand::removeInlineStyle): Track the removal of the start or end node based on
2227 the positions passed in. If either the start or the end node is removed as part of style removal,
2228 set an appropriate replacement start or end that is still in the document.
2232 2005-03-14 Ken Kocienda <kocienda@apple.com>
2236 I need to roll out Kevin's change to fix 3667701. It breaks contextual fragments, and hence breaks
2237 paste in editing (among other things).
2239 * khtml/html/htmltokenizer.cpp: Roll out recent change.
2240 (khtml::HTMLTokenizer::write)
2241 * khtml/html/htmltokenizer.h: Ditto.
2243 2005-03-13 Darin Adler <darin@apple.com>
2245 Reviewed by Ken and Maciej.
2247 - fixed <rdar://problem/4049040> REGRESSION (403-405): security check prevents user stylesheet from loading (Dictionary.app doesn't work at all!)
2249 * kwq/WebCoreBridge.mm: (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Changed to give "applewebdata:"
2250 documents the same privileges to open local files that "file:" documents have.
2252 2005-03-13 Kevin Decker <kdecker@apple.com>
2256 Fixed: <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
2258 The problem here was that the tokenizer would continue to receive chunks of data from the loader already
2259 after the view and part had been destroyed. Situations like this could arise when clicking on another link
2260 while still loading the current view, or during self test where we rapidly open, load, and close browser
2263 * khtml/html/htmltokenizer.cpp:
2264 (khtml::HTMLTokenizer::write): Simple nil check against the view.
2265 * khtml/html/htmltokenizer.h: Changed the view pointer from a standard pointer to a QGuardedPtr. The tokenizer's
2266 handle to the view will now automatically nil-out and never dangle.
2268 2005-03-13 Darin Adler <darin@apple.com>
2270 Reviewed by John and Ken.
2272 - fixed <rdar://problem/4044347> REGRESSION (Mail): Control-K in particular message moves insertion point to previous line
2274 Tweaked the deleting code, and added three new deleting layout tests to confirm the new code works.
2276 * khtml/editing/htmlediting.cpp:
2277 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Removed special case with comment that said it was
2278 for the case where a "selection contains only a BR right after a block ended". This code was being triggered in
2279 more cases than just that one, and in all the cases I tested, the general delete code works fine.
2280 (khtml::DeleteSelectionCommand::handleGeneralDelete): Changed the code that decides whether to delete an entire
2281 block to understand the case where the end block is outside the start block, but contains the start block.
2282 In that case, we want to delete the entire block. Not deleting the block was causing us to delete just the <br>,
2283 and not the enclosing <div> in the case in the bug.
2285 * layout-tests/editing/deleting/delete-line-015-expected.txt: Added.
2286 * layout-tests/editing/deleting/delete-line-015.html: Added.
2287 * layout-tests/editing/deleting/delete-line-016-expected.txt: Added.
2288 * layout-tests/editing/deleting/delete-line-016.html: Added.
2289 * layout-tests/editing/deleting/delete-line-017-expected.txt: Added.
2290 * layout-tests/editing/deleting/delete-line-017.html: Added.
2291 * layout-tests/editing/style/smoosh-styles-002-expected.txt: Updated to improved results. With the code change, the deletion
2292 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
2293 we delete both of those.
2295 2005-03-13 Darin Adler <darin@apple.com>
2297 - fixed <rdar://problem/4049172> REGRESSION (403-405): Gmail: text box in "Invite a friend" section overlaps other sections
2299 Rolled out fix for <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
2301 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth): Back to previous version of this file.
2303 2005-03-12 Maciej Stachowiak <mjs@apple.com>
2307 <rdar://problem/4046144> RSS pages leave a hole in local file security policy (need to revert feed: exemption)
2309 * kwq/WebCoreBridge.mm:
2310 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Revert
2311 emergency workaround for Safari RSS, now that a new Syndication
2314 2005-03-11 Maciej Stachowiak <mjs@apple.com>
2318 <rdar://problem/4026787> text typed after a link (pasted or Mail Link to this Page) is part of the link, underlined and colored blue
2320 The concept of this change is every time you type at the very
2321 start or very end of a link (even if nested in further inner
2322 elements), the typed text goes outside the link instead of inside.
2324 * khtml/editing/htmlediting.cpp:
2325 (khtml::InsertTextCommand::prepareForTextInsertion): Check whether
2326 we are at the first visible position or last visible position of a
2327 special element. For now this only includes HTML A elements that
2328 are links (i.e. they have an href).
2329 (khtml::isSpecialElement): Helper function that identifies special
2330 elements (for now only links).
2331 (khtml::isFirstVisiblePositionInSpecialElement): Checks if a given DOM
2332 position is equivalent to the first visible position in some containing
2333 editable special element.
2334 (khtml::positionBeforeNode): Returns the DOM position immediately
2336 (khtml::positionBeforeContainingSpecialElement): Gives a DOM
2337 position immediately before the outermost editable containing
2338 special element where the passed-in position is equivalent to the
2339 first visible position.
2340 (khtml::maxRangeOffset): Helper to get the maximum allowed
2341 range/position offset for a node, does the right thing based on
2342 whether the node would use a character offset or child offset.
2343 (khtml::isLastVisiblePositionInSpecialElement): Similar to above,
2344 but for end of node instead of start.
2345 (khtml::positionAfterNode): Ditto.
2346 (khtml::positionAfterContainingSpecialElement): Ditto.
2348 Some layout tests changed - I looked over all the diffs and found
2349 that the only changes were "junk nodes" like empty spans and text
2350 nodes moving from one spot in the tree to another. These changes
2351 are all harmless and do not affect layout or future editing.
2353 * layout-tests/editing/inserting/typing-003-expected.txt:
2354 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
2355 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
2356 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
2357 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
2358 * layout-tests/editing/style/remove-underline-expected.txt:
2359 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt:
2360 * layout-tests/editing/style/remove-underline-in-bold-expected.txt:
2361 * layout-tests/editing/style/typing-style-003-expected.txt:
2362 * layout-tests/editing/style/unbold-in-bold-expected.txt:
2363 * layout-tests/editing/style/underline-expected.txt:
2365 2005-03-11 Adele Amchan <adele@apple.com>
2367 backing out fix for <rdar://problem/4021711> REGRESSION (125-188): blank pages when browsing forum at cooperativeresearch.org - cached external script problem
2369 This caused the following regressions (that we know of):
2370 <rdar://problem/4047445> REGRESSION (Safari-400-403?): Some or all page contents sometimes don't appear (macworld.com)
2371 <rdar://problem/4046153> 8a409: Problem loading Citibank page in Safari 2 (403)
2372 <rdar://problem/4047801> REGRESSION (402-403): .Mac homepage links don't work
2374 * khtml/html/htmltokenizer.cpp:
2375 (khtml::HTMLTokenizer::scriptHandler):
2377 2005-03-11 David Harrison <harrison@apple.com>
2381 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
2383 * kwq/KWQKHTMLPart.mm:
2384 (KWQKHTMLPart::advanceToNextMisspelling):
2385 (KWQKHTMLPart::markMisspellings):
2388 2005-03-11 Ken Kocienda <kocienda@apple.com>
2392 * ForwardingHeaders/editing/visible_units.h: Added.
2394 2005-03-11 Ken Kocienda <kocienda@apple.com>
2400 <rdar://problem/4045521> Hitting return key with full line selected does not add blank line as it should
2402 * khtml/editing/htmlediting.cpp:
2403 (khtml::InsertParagraphSeparatorCommand::doApply): Removed some "special-case" code from this
2404 function that would look for a selection that started and ended in a different block, and would
2405 then bail right after the deletion of the selection without inserting a paragraph separator.
2406 This was just wrong. So, the code change is removal only. When the general-case code runs instead
2407 of the erroneous special-case code, the bug goes away.
2411 * layout-tests/editing/inserting/return-key-with-selection-001-expected.txt: Added.
2412 * layout-tests/editing/inserting/return-key-with-selection-001.html: Added.
2413 * layout-tests/editing/inserting/return-key-with-selection-002-expected.txt: Added.
2414 * layout-tests/editing/inserting/return-key-with-selection-002.html: Added.
2415 * layout-tests/editing/inserting/return-key-with-selection-003-expected.txt: Added.
2416 * layout-tests/editing/inserting/return-key-with-selection-003.html: Added.
2418 2005-03-11 David Harrison <harrison@apple.com>
2422 <rdar://problem/4009446> AX: kAXTextMarkerForPositionParameterizedAttribute not working correctly (required for Dictionary pop-up)
2424 * kwq/KWQAccObject.mm:
2425 (-[KWQAccObject accessibilityAttributeValue:]):
2428 (-[KWQAccObject doAXTextMarkerForPosition:]):
2431 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
2432 Use the selection's document instead of the top document, to accommodate frames, etc.
2434 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
2435 Fixed parameter processing to look for NSValue instead of AXValue.
2437 2005-03-11 Ken Kocienda <kocienda@apple.com>
2439 Reviewed by Harrison
2443 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
2445 This was fixed, then regressed with Harrison's fix for this bug:
2447 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
2449 * khtml/editing/htmlediting.cpp:
2450 (khtml::ReplaceSelectionCommand::doApply): My now addresses both problems in a way that they no longer
2453 2005-03-10 Ken Kocienda <kocienda@apple.com>
2459 <rdar://problem/4045511> Copying and pasting end-of-paragraph selection puts insertion point in wrong place
2460 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
2462 The copy/paste code before this patch had no notion of a "logical newline" at the start of the selection. We have
2463 had a similar notion for "logical newline" at the end of the selection for quite some time. To fix these bugs, we
2464 need to introduce the same idea for selection starts.
2466 * khtml/editing/htmlediting.cpp:
2467 (khtml::ReplacementFragment::ReplacementFragment): Process the "logical newline" at start as we write it out
2468 in markup. Set the bit we added to this object to signify we have such a newline.
2469 (khtml::ReplaceSelectionCommand::doApply): Many, many changes to introduce the new "logical newline" at start concept.
2470 I also tried to simply the code that sets the start position for inserting content to be pasted. I also improved a
2471 weakness in the smart-paste code. Now, we check before and after the paste for whether we need to add a leading or
2472 trailing space. The code previous to this patch only did a "before" check, with the result that we sometimes added
2473 a second space. In other words, the code did not realize that DOM changes done by pasting could cause formerly
2474 unrendered whitespace to become rendered. Also moved line placeholder clean up code to its own function.
2475 (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): New helper that further refines the notion
2476 of when we can remove a line placeholder. The definition is now, "If a line placeholder is at the visible start
2477 and visible end of its line, keep it; otherwise remove it".
2478 * khtml/editing/htmlediting.h: Declare new functions. Rework inlines in ReplacementFragment class to account for
2479 addition of new "logical newline" at start concept.
2480 (khtml::ReplacementFragment::hasInterchangeNewlineAtStart): New accessor.
2481 (khtml::ReplacementFragment::hasInterchangeNewlineAtEnd): Renamed from hasInterchangeNewline(), since before we
2482 only had a bit for the end, hence we did not need to distinguish it from the start.
2483 * khtml/editing/markup.cpp:
2484 (khtml::createMarkup): Added code to detect and write out markup for cases where we have a "logical newline" at start.
2485 * khtml/xml/dom2_rangeimpl.cpp:
2486 (DOM::RangeImpl::startPosition): New helper.
2487 (DOM::RangeImpl::endPosition): Ditto.
2488 * khtml/xml/dom2_rangeimpl.h: Declare new helpers.
2491 * layout-tests/editing/pasteboard/paste-line-endings-001-expected.txt: Added.
2492 * layout-tests/editing/pasteboard/paste-line-endings-001.html: Added.
2493 * layout-tests/editing/pasteboard/paste-line-endings-002-expected.txt: Added.
2494 * layout-tests/editing/pasteboard/paste-line-endings-002.html: Added.
2495 * layout-tests/editing/pasteboard/paste-line-endings-003-expected.txt: Added.
2496 * layout-tests/editing/pasteboard/paste-line-endings-003.html: Added.
2497 * layout-tests/editing/pasteboard/paste-line-endings-004-expected.txt: Added.
2498 * layout-tests/editing/pasteboard/paste-line-endings-004.html: Added.
2499 * layout-tests/editing/pasteboard/paste-line-endings-005-expected.txt: Added.
2500 * layout-tests/editing/pasteboard/paste-line-endings-005.html: Added.
2501 * layout-tests/editing/pasteboard/paste-line-endings-006-expected.txt: Added.
2502 * layout-tests/editing/pasteboard/paste-line-endings-006.html: Added.
2503 * layout-tests/editing/pasteboard/paste-line-endings-007-expected.txt: Added.
2504 * layout-tests/editing/pasteboard/paste-line-endings-007.html: Added.
2505 * layout-tests/editing/pasteboard/paste-line-endings-008-expected.txt: Added.
2506 * layout-tests/editing/pasteboard/paste-line-endings-008.html: Added.
2507 * layout-tests/editing/pasteboard/paste-line-endings-009-expected.txt: Added.
2508 * layout-tests/editing/pasteboard/paste-line-endings-009.html: Added.
2509 * layout-tests/editing/pasteboard/paste-line-endings-010-expected.txt: Added.
2510 * layout-tests/editing/pasteboard/paste-line-endings-010.html: Added.
2514 2005-03-10 Darin Adler <darin@apple.com>
2516 Reviewed by Richard.
2518 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
2520 * khtml/rendering/render_text.cpp: (getCharacterBreakIterator): Set boolean "got iterator" to true.
2522 2005-03-10 Darin Adler <darin@apple.com>
2526 - fixed <rdar://problem/4042867> "Bigger" changes the font size of too much text when the selection is on a style-change boundary
2528 * khtml/editing/htmlediting.cpp: (khtml::ApplyStyleCommand::applyRelativeFontStyleChange):
2529 Advance out of the starting text node if we're at the end of it.
2531 2005-03-10 Darin Adler <darin@apple.com>
2533 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Fixed assertion for nested calls to write.
2535 2005-03-10 David Harrison <harrison@apple.com>
2539 <rdar://problem/4032346> REGRESSION (Mail): changing 1st line of a URL that wraps to two lines doesn't always update 2nd line
2541 * khtml/rendering/bidi.cpp:
2542 (khtml::RenderBlock::matchedEndLine):
2543 Look at first clean line in case line wrap implicitly dirtied it.
2545 2005-03-10 Maciej Stachowiak <mjs@apple.com>
2549 <rdar://problem/4046018> REGRESSION (TOT): RSS pages don't display anything
2551 * kwq/WebCoreBridge.mm:
2552 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Exempt
2553 feed: and feeds: pages from the local file security check.
2555 2005-03-10 Darin Adler <darin@apple.com>
2557 Change written by Steve Peters, reviewed by me.
2559 - fixed <rdar://problem/4045924> improve compareBoundaryPoints to make style changes faster
2561 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints):
2562 Do early outs in a couple of the loops to make things faster.
2564 2005-03-10 Jens Alfke <jens@apple.com>
2568 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.
2570 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.
2572 This ensures that the applet will get loaded even if there is no explicit </applet> tag.
2574 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.
2576 * khtml/html/html_objectimpl.cpp:
2577 (HTMLAppletElementImpl::closeRenderer):
2578 * khtml/html/html_objectimpl.h:
2579 * khtml/html/htmlparser.cpp:
2580 (KHTMLParser::insertNode):
2581 (KHTMLParser::processCloseTag):
2582 (KHTMLParser::popOneBlock):
2583 * khtml/xml/dom_nodeimpl.h:
2584 (DOM::NodeImpl::closeRenderer):
2586 2005-03-10 Ken Kocienda <kocienda@apple.com>
2592 <rdar://problem/4024929> REGRESSION (Mail): Pasting text with multiple reply levels removes one level instead of all
2594 The code to figure out which node to use to merge into an existing line did not drill into the first inline element
2595 as needed to make the feature work as user expect. Instead, it looked at the first node, and if it was a block, it
2596 skipped that node. This worked for some cases (including the important "paste-as-quotation" case) but obviously
2597 doesn't work for content quoted more than once.
2599 Now, mergeStartNode() will look for the first node in pasted content that is not a block. It will now also look
2600 for nodes specially marked by Mail as a node added to make "Paste As Quotation" work. It won't skip those.
2602 NOTE: This change will break Mail's "Paste As Quotation" feature for TOT WebKit users, but this is only a temporary
2603 problem that will exist until we sync up with Mail's pending change to mark nodes as needed in its pasteAsQuotation:
2606 * khtml/editing/html_interchange.h: Add ApplePasteAsQuotation constant used to check for "marked" blockquotes.
2607 * khtml/editing/htmlediting.cpp:
2608 (khtml::ReplacementFragment::mergeStartNode): Look for first node that is either not a block or is marked as
2609 an ApplePasteAsQuotation node.
2610 (khtml::isMailPasteAsQuotationNode): New helper that looks for nodes marked with ApplePasteAsQuotation.
2611 * khtml/editing/htmlediting.h: Updated header for new function.
2613 This test result changed is an acceptable way.
2615 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
2616 * layout-tests/editing/pasteboard/paste-text-013.html
2618 NOTE: This change causes a regression in this layout test:
2620 * layout-tests/editing/pasteboard/paste-text-013.html
2622 This problem will need to be fixed separately, and this bug has been filed to track this problem:
2623 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
2625 2005-03-09 Maciej Stachowiak <mjs@apple.com>
2627 Reviewed by Richard.
2629 <rdar://problem/4040776> Dashboard (Weather widget) is a memory hog
2631 Change things around so the event listeners for XMLHttpRequest
2632 mark their JS listener objects instead of holding a hard
2633 reference, to avoid an unbreakable reference cycle.
2635 * khtml/ecma/kjs_events.cpp:
2636 (JSAbstractEventListener::JSAbstractEventListener):
2637 (JSAbstractEventListener::~JSAbstractEventListener):
2638 (JSAbstractEventListener::handleEvent):
2639 (JSAbstractEventListener::eventListenerType):
2640 (JSUnprotectedEventListener::JSUnprotectedEventListener):
2641 (JSUnprotectedEventListener::~JSUnprotectedEventListener):
2642 (JSUnprotectedEventListener::listenerObj):
2643 (JSUnprotectedEventListener::windowObj):
2644 (JSUnprotectedEventListener::mark):
2645 (JSEventListener::JSEventListener):
2646 (JSEventListener::~JSEventListener):
2647 (JSEventListener::listenerObj):
2648 (JSEventListener::windowObj):
2649 (JSLazyEventListener::JSLazyEventListener):
2650 * khtml/ecma/kjs_events.h:
2651 * khtml/ecma/kjs_html.h:
2652 * khtml/ecma/kjs_window.cpp:
2653 (Window::getJSEventListener):
2654 (Window::getJSUnprotectedEventListener):
2655 * khtml/ecma/kjs_window.h:
2656 * khtml/ecma/xmlhttprequest.cpp:
2657 (KJS::XMLHttpRequest::putValue):
2658 (KJS::XMLHttpRequest::mark):
2659 * khtml/ecma/xmlhttprequest.h:
2660 * khtml/khtml_part.h:
2662 2005-03-06 Maciej Stachowiak <mjs@apple.com>
2666 <rdar://problem/4005575> Arbitrary file disclosure vulnerability due to ability to load local html from remote content
2668 * khtml/ecma/kjs_html.cpp:
2669 (KJS::HTMLDocument::putValue):
2670 * khtml/ecma/kjs_window.cpp:
2672 (WindowFunc::tryCall):
2674 (LocationFunc::tryCall):
2675 * khtml/khtml_part.cpp:
2677 (KHTMLPart::scheduleLocationChange):
2678 (KHTMLPart::slotRedirect):
2679 (KHTMLPart::processObjectRequest):
2680 * khtml/khtml_part.h:
2681 * khtml/khtmlpart_p.h:
2682 * kwq/KWQKHTMLPart.mm:
2683 (KWQKHTMLPart::openURLRequest):
2684 (KWQKHTMLPart::urlSelected):
2685 (KWQKHTMLPart::createPart):
2686 * kwq/KWQKHTMLPartBrowserExtension.mm:
2687 (KHTMLPartBrowserExtension::createNewWindow):
2688 * kwq/WebCoreBridge.h:
2689 * kwq/WebCoreBridge.mm:
2690 (hasCaseInsensitivePrefix):
2691 (-[WebCoreBridge didNotOpenURL:pageCache:]):
2692 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]):
2694 2005-03-09 Richard Williamson <rjw@apple.com>
2696 Fixed <rdar://problem/4032938> Safari: text layout for MS P Gothic font is corrupted
2698 Remove our hacked special case now we have our own cache of
2699 which fonts are fixed pitch.
2704 (QFont::isFixedPitch):
2706 2005-03-09 David Harrison <harrison@apple.com>
2710 <rdar://problem/4037141> REGRESSION (Mail): Pasting deletes preceding blank lines with certain steps
2712 * khtml/editing/htmlediting.cpp:
2713 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
2714 Add check for anonymous text after blocks.
2716 2005-03-08 Ken Kocienda <kocienda@apple.com>
2722 <rdar://problem/4039661> crash in ApplyStyleCommand::applyBlockStyle pasting contents of webpage into Mail or Blot
2723 <rdar://problem/4039672> hang in moveParagraphContentsToNewBlockIfNecessary after pasting contents of webpage into Blot
2725 * khtml/editing/htmlediting.cpp:
2726 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Fix for 4039672. Iteration needs to do
2727 a traverseNextSibling(), not a traverseNextNode(). The latter might iterate into a child that already got moved, and
2728 the code can infinite loop as a result.
2729 (khtml::ApplyStyleCommand::applyBlockStyle): Fix for 4039661. This function iterates over a set of nodes to apply
2730 block styles. Before, the iteration would go from the start to the end of the selection, and apply block styles
2731 as it went. However, the act of applying style could confuse the iteration. Now I iterate and store the relevant
2732 nodes in QPtrList before doing any style manipulation, and then iterate that set of nodes.
2734 2005-03-08 Darin Adler <darin@apple.com>
2736 Change written by Hyatt, reviewed by me.
2738 - fixed <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
2740 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth):
2741 Only use a minWidth of 0 for images with a percentage value. Other replaced elements aren't scalable
2742 so their minWidth should be their calculated width. This has been wrong all along, but it's a relatively
2743 safe change because it only affects replaced elements' min-width.
2745 2005-03-08 David Harrison <harrison@apple.com>
2749 <rdar://problem/4039006> REGRESSION (Mail): Command-left-arrow goes to the start of the wrong line in particular message
2751 * khtml/editing/visible_units.cpp:
2752 (khtml::startOfLine):
2753 Use firstLeafChild() instead of firstChild().
2755 2005-03-08 Richard Williamson <rjw@apple.com>
2757 Fixed by Tom Madden.
2759 Fixed <rdar://problem/4038586> 8A402: Osaka-Mono text overlaps when typing with input method
2761 We weren't clearing the "all ascii" flag when setting text on
2764 Reviewed by Richard Williamson.
2766 * khtml/rendering/render_text.cpp:
2767 (RenderText::setText):
2769 2005-03-08 Darin Adler <darin@apple.com>
2771 Reviewed by Ken and Maciej.
2773 - fixed <rdar://problem/3988809> REGRESSION (Mail): wide space characters are turned into plain old spaces when typed or pasted
2775 Changed the few places where it matters to use a "collapsible whitespace" concept instead of
2776 the general whitespace concept. This means treating only ' ' and '\n' specially instead of
2777 including other space characters, which matches what the space-collapsing logic does in RenderText,
2778 although it really needs to behave differently based on whitespace mode.
2780 * khtml/editing/visible_text.h: (khtml::isCollapsibleWhitespace): Added. This returns true only for
2781 ' ' and '\n' since they are the only characters collapsed once text is in the DOM. But really it
2782 can't do the job ignoring white-space mode, so some day it must go.
2784 * khtml/editing/html_interchange.cpp: (convertHTMLTextToInterchangeFormat): Changed to use
2785 isCollapsibleWhitespace and removed unnecessary calls to latin1().
2787 * khtml/editing/htmlediting.cpp:
2788 (khtml::isNBSP): Removed unnecessary creation/destruction of QChar each time this is called.
2789 (khtml::nextCharacterIsCollapsibleWhitespace): Renamed from isWS and changed to use isCollapsibleWhitespace.
2790 (khtml::DeleteSelectionCommand::fixupWhitespace): Use isCollapsibleWhitespace instead of isWS,
2791 since we only want to do our NBSP tricks for collapsible whitespace.
2792 (khtml::InsertTextCommand::input): Changed use of isTab to instead say == "\t" since that does the
2793 same thing and is arguably just as clear. Changed use of isWS to == " " since the input text can't
2794 include any "\n" characters, and really a plain old space is the only collapsible thing that can
2795 be passed in. Use isCollapsibleWhitespace instead of isWS since we want to do NBSP tricks only for
2796 collapsible whitespace, not all whitespace.
2797 (khtml::InsertTextCommand::insertSpace): Use isCollapsibleWhitespace instead of isWS since we want
2798 to do NBSP tricks only for collapsible whitespace, not all whitespace.
2799 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
2801 * khtml/xml/dom_position.h: Changed treatNBSPAsWhiteSpace parameters to considerNonCollapsibleWhitespace
2802 parameters. The most common callers are only interested in collapsible whitespace, and the smart copy
2803 and paste callers want to include all whitespace, including non-breaking spaces and all the Unicode spaces.
2804 * khtml/xml/dom_position.cpp:
2805 (DOM::Position::leadingWhitespacePosition): Rename the parameter, and use either QChar::isSpace or
2806 isCollapsibleWhitespace depending on the boolean passed in.
2807 (DOM::Position::trailingWhitespacePosition): Ditto.
2809 2005-03-07 John Sullivan <sullivan@apple.com>
2813 - <rdar://problem/4040868> REGRESSION (Mail, 403-403+): Drag and drop deletes text,
2814 many other bad editing problems
2816 * khtml/rendering/render_text.cpp:
2817 (RenderText::caretMaxOffset):
2818 A "-" should have been a "+" in this method that was tweaked an hour ago. Editing
2819 was completely horked.
2821 2005-03-07 Richard Williamson <rjw@apple.com>
2823 Additional nil check from fix for 4040749.
2825 * khtml/rendering/render_box.cpp:
2826 (RenderBox::setStyle):
2828 2005-03-07 Richard Williamson <rjw@apple.com>
2830 Additional nil check from fix for 4040749.
2832 * khtml/rendering/render_layer.cpp:
2833 (RenderLayer::updateLayerPosition):
2835 2005-03-07 David Harrison <harrison@apple.com>
2839 <rdar://problem/4033202> REGRESSION (Mail): Can't arrow up at a particular spot in a particular Mail message
2841 Doublecheck that new position is really on a different line, because the VisiblePosition constructor does not.
2842 Filed <rdar://problem/4040763> for that problem.
2844 * khtml/editing/visible_units.cpp:
2845 (khtml::previousLinePosition):
2847 2005-03-07 Richard Williamson <rjw@apple.com>
2849 Fixed <rdar://problem/4040749> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
2851 When layers are dynamically created/removed as a result of changing opacity they weren't being correctly
2852 sized and positioned. This happens whenever opacity goes from < 1 to 1.
2856 * khtml/rendering/render_box.cpp:
2857 (RenderBox::setStyle):
2858 * khtml/rendering/render_layer.cpp:
2859 (RenderLayer::updateLayerPosition):
2861 2005-03-07 Christy Warren <kali@apple.com>
2865 * khtml/rendering/render_text.cpp:
2866 (RenderText::caretMinOffset): modified to handle BIDI case by checking all text boxes for min offset
2867 (RenderText::caretMaxOffset): modified to handle BIDI case by checking all text boxes for max offset
2869 2005-03-07 David Harrison <harrison@apple.com>
2873 <rdar://problem/4029225> REGRESSION (Mail): Crash if hit return after dragging in attachment - DeleteSelectionCommand::initializePositionData
2875 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.
2876 Filed <rdar://problem/4040358> RenderBR height() is not accurate.
2878 * khtml/editing/htmlediting.cpp:
2879 (khtml::ReplaceSelectionCommand::doApply):
2880 When height is 0, double check that the placeholder is the first position on the line.
2884 2005-03-07 Ken Kocienda <kocienda@apple.com>
2890 <rdar://problem/4040136> Expose SPI for WebCore's functions to create document fragments from plain text and markup strings
2892 * kwq/DOMHTML.mm: Add two new SPI functions.
2893 (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:])
2894 (-[DOMHTMLDocument _createDocumentFragmentWithText:])
2895 * kwq/DOMPrivate.h: Declare the new SPI here, a privately-exported header, so Mail can make use of it.
2897 2005-03-07 Ken Kocienda <kocienda@apple.com>
2903 <rdar://problem/4039676> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date
2905 * khtml/editing/htmlediting.cpp:
2906 (khtml::ReplaceSelectionCommand::doApply): Code to "eat" a <br> element, that was creating an otherwise empty line, was running
2907 when it should not. If the content being pasted in does not end in a "logical" newline itself, then the <br> already
2908 in the content needs to be preserved. A simple one-line change now sees to this.
2910 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: This test now has an extra, but harmless,
2911 <br> at the end of a paragraph. This makes sense given the code change.
2914 * layout-tests/editing/pasteboard/paste-text-018-expected.txt: Added.
2915 * layout-tests/editing/pasteboard/paste-text-018.html: Added.
2917 2005-03-07 Ken Kocienda <kocienda@apple.com>
2923 <rdar://problem/4035648> REGRESSION (Mail): line feed in source HTML file causes bad copy/paste behavior
2925 The createMarkup() function in markup.cpp iterates over the nodes in a range,
2926 and does some bookkeeping to figure out when to add close tags to the markup.
2927 Some code added at the start of the loop to prevent markup from being written
2928 for unrendered nodes short-circuited the rest of the loop, and so prevented
2929 the close-tag-writing code from running when it should.
2931 This is why the "plain" text wound up inside of the bold tag in the example
2932 above. The addition of the unrendered return character caused an incorrect
2933 delay in the close tag for the bold element from being written out, with the
2934 result being that it wound up including additional content.
2936 The fix is to add checks for node renderers throughout the loop at the points
2937 where markup is written out for each node. This allows the additional close
2938 tag logic to run as needed.
2940 All layout tests pass with this change.
2942 * khtml/editing/markup.cpp:
2943 (khtml::createMarkup)
2947 * layout-tests/editing/pasteboard/paste-4035648-fix-expected.txt: Added.
2948 * layout-tests/editing/pasteboard/paste-4035648-fix.html: Added.
2950 2005-03-06 Christy Warren <kali@appple.com>
2954 * khtml/rendering/render_text.cpp:
2955 (lastRendererOnPrevLine): helper for RenderText::caretRect
2956 (RenderText::caretRect): added code to properly handle bidi ordered text boxes
2958 2005-03-06 Christy Warren <kali@apple.com>
2962 * khtml/editing/visible_position.cpp: Eliminated code that cuts off searching through the text boxes based on an assumption that breaks under bidi
2963 (khtml::VisiblePosition::isCandidate):
2964 * kwq/KWQFontMetrics.mm:
2965 (QFontMetrics::checkSelectionPoint): Made the initialization of the WebCoreStyle honor the reversed flag
2967 2005-03-05 John Sullivan <sullivan@apple.com>
2971 - fixed <rdar://problem/4038417> Mail crashed in StyleChange::checkForLegacyHTMLStyleChange
2972 when composing a reply
2974 * khtml/editing/htmlediting.cpp:
2975 (khtml::StyleChange::checkForLegacyHTMLStyleChange):
2976 Added missing nil check.
2978 2005-03-05 Darin Adler <darin@apple.com>
2982 - fixed <rdar://problem/4038478> Crash in renderer viewing RSS feed at feed://wvs.topleftpixel.com/index.rdf
2984 * khtml/xml/dom_docimpl.cpp: (widgetForNode): Check for nil before going from node to renderer.
2986 2005-03-05 Darin Adler <darin@apple.com>
2988 Reviewed by Richard.
2990 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
2992 * khtml/rendering/render_text.cpp:
2993 (getCharacterBreakIterator): Added. Helper that sets up an iterator for the passed-in text.
2994 Shares a single global iterator (fast, albeit not thread-safe).
2995 (RenderText::previousOffset): Changed to call getCharacterBreakIterator.
2996 (RenderText::nextOffset): Ditto.
2998 2005-03-05 Ken Kocienda <kocienda@apple.com>
3004 <rdar://problem/4038267> REGRESSION (Mail): Crash copying and pasting end of paragraph
3006 Code to handle content that has a "logical" newline at the end of the pasted content, and the code
3007 to adjust the selection at the end of the paste operation made an assumption that at least one
3008 node had been inserted by the paste command. This is not necessarily true in the case where the sole content
3009 in the pasted content is one of these "logical" newlines. Adjust some code around so that we don't deref
3010 null, but still adjust the selection correctly for this case. In each of the two functions below, some
3011 null checks have been added, and some code has been rearranged a little bit to continue on through
3012 the end of completeHTMLReplacement, even if no nodes have been inserted. The patch looks bigger and more
3013 complicated than the conceptual change.
3015 * khtml/editing/htmlediting.cpp:
3016 (khtml::ReplaceSelectionCommand::doApply)
3017 (khtml::ReplaceSelectionCommand::completeHTMLReplacement)
3019 * layout-tests/editing/pasteboard/paste-4038267-fix-expected.txt: Added.
3020 * layout-tests/editing/pasteboard/paste-4038267-fix.html: Added.
3022 2005-03-05 Darin Adler <darin@apple.com>
3026 - fixed <rdar://problem/4025918> images copied from Safari with relative src URLs aren't pasted into Mail messages (KURL resolves base URLs incorrectly)
3028 * kwq/KWQKURL.mm: (KURL::KURL): Add a slash at the start of the path if a relative part is adding
3029 a path onto a URL that has "pre-path" bits like host name, but no path yet. This doesn't come up
3030 for http because in that case we add a trailing "/" as part of canonicalization.
3032 2005-03-04 John Sullivan <sullivan@apple.com>
3036 - fixed <rdar://problem/4033705> REGRESSION (Mail): Copy/Paste from Excel
3037 crashes Mail in KWQKHTMLPart::fontForSelection(bool*) const + 232
3039 * kwq/KWQKHTMLPart.mm:
3040 (KWQKHTMLPart::fontForSelection):
3041 Check for nil startNode, not just nil renderer.
3043 2005-03-04 David Harrison <harrison@apple.com>
3045 Reviewed by Ken, Richard.
3047 <rdar://problem/3996383> REGRESSION (Mail): Deleting all of first line also deletes line ending
3049 Problem was the placeholder check was based on 0 height block, but the block in this
3050 case is the BODY, which has other content even though the paragraph is gone.
3052 * khtml/editing/htmlediting.cpp:
3053 (khtml::CompositeEditCommand::insertBlockPlaceholder):
3054 Now does insert instead of append!
3056 (khtml::CompositeEditCommand::appendBlockPlaceholder):
3057 New. Actually does append.
3059 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
3060 Renamed from insertBlockPlaceholderIfNeeded because it can insert or append. Also accepts "force insert" flag.
3062 (khtml::CompositeEditCommand::removeBlockPlaceholder):
3063 Renamed for succinctness from removeBlockPlaceholderIfNeeded.
3065 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
3066 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
3067 Use renamed methods.
3069 (khtml::DeleteSelectionCommand::doApply):
3070 Use addBlockPlaceholderIfNeeded "force insert" flag if deleting whole paragraphs did not leave an empty one.
3072 (khtml::InsertParagraphSeparatorCommand::doApply):
3073 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
3074 (khtml::InsertTextCommand::input):
3075 Use renamed methods.
3077 * khtml/editing/htmlediting.h:
3078 Renamed and new methods per above.
3081 2005-03-04 Chris Blumenberg <cblu@apple.com>
3083 Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after pasting attachment at end of message
3087 * khtml/editing/visible_units.cpp:
3088 (khtml::endOfParagraph): don't consider text nodes that have no rendered characters
3090 2005-03-04 Richard Williamson <rjw@apple.com>
3092 Fixed <rdar://problem/4034764> REGRESSION(125-188)Viewing text/plain page and going back/forward corrupts HTML pages (google.com)
3094 The parse mode wasn't be restored to the document when going
3099 * kwq/KWQKHTMLPart.mm:
3100 (KWQKHTMLPart::openURLFromPageCache):
3101 * kwq/KWQPageState.h:
3102 * kwq/KWQPageState.mm:
3103 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]):
3105 2005-03-04 Ken Kocienda <kocienda@apple.com>
3109 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Shame on me!
3110 I landed my last fix without running layout tests. This one changes in a subtle, but
3113 2005-03-04 Ken Kocienda <kocienda@apple.com>
3115 Reviewed by Harrison
3119 <rdar://problem/4032543> REGRESSION (Mail): Mail hangs when quoted text is pasted twice
3121 This code change fixes the bug in a non-obvious way. The root cause of the problem was
3122 that a VisiblePosition created using an affinity originating in Mail code caused
3123 two VisiblePosition objects that should have been equal to differ only in their
3124 affinities, which in turn caused us to run a code path that should not have run.
3126 * khtml/editing/visible_position.cpp:
3127 (khtml::VisiblePosition::VisiblePosition): Added copy constructor.
3128 (khtml::VisiblePosition::next): Factored out inline code that used to be here into new
3129 setAffinityUsingLinePosition() function.
3130 (khtml::isEqualIgnoringAffinity): New helper to handle cases when affinity in equality check does
3131 not matter. However, we want to know about such cases where a VisiblePosition differs only by affinity,
3132 and the code will assert in development when this happens.
3133 (khtml::isNotEqualIgnoringAffinity): Ditto, but not. :)
3134 (khtml::setAffinityUsingLinePosition): New helper function mentioned above. This will "correct"
3135 upstream affinity to downstream if the affinity does not make a difference for the position.
3136 * khtml/editing/visible_position.h:
3137 * khtml/editing/visible_range.h: Wacky bug. The operator== for this class took VisiblePosition classes!
3138 * khtml/editing/visible_units.cpp:
3139 (khtml::isStartOfParagraph): Now performs equality check without regard to affinity.
3140 (khtml::isEndOfParagraph): Ditto.
3141 (khtml::isStartOfBlock): Ditto.
3142 (khtml::isEndOfBlock): Ditto.
3143 * kwq/WebCoreBridge.mm:
3144 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Adjusts the affinity using setAffinityUsingLinePosition()
3147 2005-03-04 Darin Adler <darin@apple.com>
3151 - fixed <rdar://problem/4036817> REGRESSION: ctrl-y broken when a line + carriage return cut
3153 * khtml/editing/htmlediting.h: Added insertTextRunWithoutNewlines.
3154 * khtml/editing/htmlediting.cpp:
3155 (khtml::InsertTextCommand::input): Added assertion to make sure strings with newlines don't get
3157 (khtml::TypingCommand::insertText): Added. Takes the name of the old function, but is a new
3158 level that breaks runs into lines and inserts each one separately.
3159 (khtml::TypingCommand::insertTextRunWithoutNewlines): Renamed old insertText to this.
3161 * khtml/dom/dom_string.h: Made substring be a const member function.
3162 * khtml/dom/dom_string.cpp: (DOM::DOMString::substring): Made this const.
3164 2005-03-04 Darin Adler <darin@apple.com>
3168 - fixed <rdar://problem/4020413> REGRESSION (Mail): can't use fonts with names that start with "#" in Mail (Korean fonts)
3170 * khtml/css/css_valueimpl.cpp:
3171 (DOM::isLegalIdentifier): Added. Commented out and not used.
3172 (DOM::quoteStringIfNeeded): Quotes the string if needed. For now only if it starts with "#".
3173 (DOM::CSSPrimitiveValueImpl::cssText): Call quoteStringIfNeeded when asked for cssText for an arbitrary string, since we
3174 need text you can re-parse.
3175 (DOM::FontFamilyValueImpl::cssText): Ditto.
3177 * khtml/editing/markup.cpp:
3178 (khtml::startMarkup): Added comments about lack of quoting for attributes.
3179 (khtml::createMarkup): Ditto.
3181 2005-03-04 Adele Amchan <adele@apple.com>
3185 Fix for <rdar://problem/4021711> REGRESSION(125-188) blank pages when browsing forum at cooperativeresearch.org - cached external script problem
3187 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::scriptHandler): set flag needToRefCachedScript so we can make sure
3188 notifyFinished is called after pendingSrc is set up with the right data from the cached script
3190 2005-03-04 Ken Kocienda <kocienda@apple.com>
3196 <rdar://problem/4029632> Tiger 8A398:- Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
3198 * khtml/editing/htmlediting.cpp:
3199 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): VisiblePosition constructor
3200 was failing to yield a position for a node just pasted into the document since a layout was needed
3201 for the calculation to come out right. Layout added. Crash gone.
3205 2005-03-03 Chris Blumenberg <cblu@apple.com>
3207 Fixed: <rdar://problem/3992803> Cannot navigate through list items with the keyboard, you're stuck in the same <li> block unless you click out
3209 Reviewed by harrison.
3211 * khtml/rendering/render_line.cpp:
3212 (khtml::RootInlineBox::closestLeafChildForXPos): avoid returning list markers when possible. Also improved heuristic for returning the best InlineBox given the passed X position.
3215 2005-03-03 Ken Kocienda <kocienda@apple.com>
3221 <rdar://problem/4035198> Pasting text with different styles does not get reproducible results
3223 I had a good idea yesterday to improve the way we "fixup" styles after
3224 pasting, but i chose a poor data structure to do it, a map of
3225 nodes-to-styles. In the fixup step, I iterated over the map elements and
3226 did the fixup. However, since the order in which the items would come
3227 out of the map is indeterminate, we got unpredictable results.
3229 So, the concept was good, but the implementation was flawed. I have
3230 fixed this mapping to be a list instead, so the order that nodes are
3231 evaluated in the fixup step is document order. This works nicely.
3233 * khtml/editing/htmlediting.cpp:
3234 (khtml::ReplacementFragment::~ReplacementFragment): No longer need to explicity deref nodes and
3235 styles saved away for later fixup. This is now handled by the new NodeDesiredStyle class.
3236 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls computeAndStoreNodeDesiredStyle,
3237 function renamed from mapDesiredStyleForNode.
3238 Now accepts a QValueList<NodeDesiredStyle> in place of the old map.
3239 (khtml::NodeDesiredStyle::NodeDesiredStyle): New class that represents a node-to-style mapping.
3240 (khtml::NodeDesiredStyle::~NodeDesiredStyle): Ditto.
3241 (khtml::NodeDesiredStyle::operator=): Ditto.
3242 (khtml::ReplaceSelectionCommand::doApply): Now calls computeAndStoreNodeDesiredStyle,
3243 function renamed from mapDesiredStyleForNode.
3244 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Now operates on a QValueList<NodeDesiredStyle> in
3245 place of the old map.
3246 (khtml::computeAndStoreNodeDesiredStyle): Renamed from mapDesiredStyleForNode. Now operates on a
3247 QValueList<NodeDesiredStyle> in place of the old map.
3248 * khtml/editing/htmlediting.h:
3249 (khtml::NodeDesiredStyle): New class that represents a node-to-style mapping.
3250 (khtml::ReplacementFragment::desiredStyles): Now returns a QValueList<NodeDesiredStyle> in place of the old map.
3252 * layout-tests/editing/style/typing-style-003-expected.txt: Results changed in an acceptable way.
3254 2005-03-02 Darin Adler <darin@apple.com>
3258 - fixed <rdar://problem/4029741> REGRESSION (188-189): <input type=text> are cleared when you hide/show them
3260 * khtml/html/html_formimpl.h: Added detach functions for both input and text area elements, since
3261 both have m_valueMatchesRenderer flags.
3262 * khtml/html/html_formimpl.cpp:
3263 (DOM::HTMLInputElementImpl::detach): Set m_valueMatchesRenderer to false, since the renderer is going away.
3264 (DOM::HTMLTextAreaElementImpl::detach): Ditto.
3266 2005-03-02 Ken Kocienda <kocienda@apple.com>
3272 <rdar://problem/4006151> in reply, caret moves to next line after toggling bold style then typing
3274 * khtml/editing/htmlediting.cpp:
3275 (khtml::ApplyStyleCommand::applyInlineStyle): Defer cleaning up empty style until the end of the
3276 function. In some situations, the render tree can get confused when we do this removal up front.
3277 I wish I understood the reasons more deeply, but this bit of code shuffling seems harmless, and
3280 2005-03-02 Darin Adler <darin@apple.com>
3284 - fixed <rdar://problem/4024966> crash happened twice in [KWQTextField setHasFocus:] + 0xe8
3286 Added more nil checks to the widget implementations. Anywhere a widget pointer is used, do a nil check,
3287 rather than relying on high level assumptions about which calls can and can't destroy the HTML element
3288 (and hence the widget). The case in the bug seems to be a case where scrolling destroyed the element.
3289 We can't be sure this fixes the bug, but we can be relatively sure we didn't introduce any new problems,
3290 because this just avoids nil-dereferencing.
3293 (-[KWQButton becomeFirstResponder]):
3294 (-[KWQButton nextKeyView]):
3295 (-[KWQButton previousKeyView]):
3296 * kwq/KWQListBox.mm:
3297 (-[KWQTableView mouseDown:]):
3298 (-[KWQTableView becomeFirstResponder]):
3299 (-[KWQTableView numberOfRowsInTableView:]):
3300 (-[KWQTableView tableViewSelectionDidChange:]):
3301 (-[KWQTableView tableView:shouldSelectRow:]):
3302 (-[KWQTableView selectionShouldChangeInTableView:]):
3303 * kwq/KWQScrollBar.mm:
3304 (-[KWQScrollBar scroll:]):
3306 (-[KWQSlider mouseDown:]):
3307 (-[KWQSlider slide:]):
3308 (-[KWQSlider becomeFirstResponder]):
3309 (-[KWQSlider nextKeyView]):
3310 (-[KWQSlider previousKeyView]):
3311 * kwq/KWQTextArea.mm:
3312 (-[KWQTextAreaTextView becomeFirstResponder]):
3313 (-[KWQTextAreaTextView resignFirstResponder]):
3314 (-[KWQTextAreaTextView mouseDown:]):
3315 * kwq/KWQTextField.mm:
3316 (-[KWQTextFieldController action:]):
3317 (-[KWQTextFieldController controlTextDidEndEditing:]):
3318 (-[KWQTextFieldController controlTextDidChange:]):
3319 (-[KWQTextFieldController textView:didHandleEvent:]):
3320 (-[KWQTextFieldController setHasFocus:]):
3322 2005-03-02 Richard Williamson <rjw@apple.com>
3324 Fixed <rdar://problem/4031483> Leak (RenderObject::createInlineBox) reproducible with Stock widget
3326 We were leaking inline block line boxes. Argh!
3330 * khtml/rendering/render_flow.cpp:
3331 (RenderFlow::dirtyLineBoxes):
3332 * khtml/rendering/render_line.cpp:
3333 (khtml::InlineBox::deleteLine):