1 2004-08-23 Maciej Stachowiak <mjs@apple.com>
5 - reduce cost of innerHTML from O(N^2) to O(N*D) where N is the
6 number of nodes and D is the maximum DOM tree depth.
8 * khtml/xml/dom_nodeimpl.cpp:
9 (NodeImpl::recursive_toString): New static helper method for
10 recursive_toHTML - this is recursive for children but iterative
12 (NodeImpl::recursive_toHTML): Call the helper with this as the
14 * khtml/xml/dom_nodeimpl.h:
16 2004-08-23 David Hyatt <hyatt@apple.com>
20 Init the encodedURL explicitly for CSSStyleSelectors. Construction time was too early to be passing in the
21 document m_url, since it doesn't get set during construction.
23 Fix for 3769643, crash on vancouverblast.org.
27 * khtml/css/cssstyleselector.cpp:
28 (khtml::CSSStyleSelector::CSSStyleSelector):
29 (khtml::CSSStyleSelector::init):
30 (khtml::CSSStyleSelector::setEncodedURL):
31 * khtml/css/cssstyleselector.h:
32 * khtml/xml/dom_docimpl.cpp:
33 (DocumentImpl::DocumentImpl):
34 (DocumentImpl::setURL):
35 (DocumentImpl::recalcStyleSelector):
36 * khtml/xml/dom_docimpl.h:
37 (DOM::DocumentImpl::URL):
39 2004-08-23 Kevin Decker <kdecker@apple.com>
43 - fixed rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
44 * khtml/ecma/kjs_window.cpp:
45 (WindowFunc::tryCall): since this is an xml document, we get the
46 domain from the xmlDocImpl(), not docImpl().
48 2004-08-23 Maciej Stachowiak <mjs@apple.com>
52 <rdar://problem/3771426> assertion failed due to reentering dispatchImageLoadEventsNow
54 * khtml/xml/dom_docimpl.cpp:
55 (DocumentImpl::dispatchImageLoadEventsNow): Avoid re-entering this
56 function, since it uses a data member for the copy of the list of events
59 2004-08-23 Maciej Stachowiak <mjs@apple.com>
63 <rdar://problem/3770306> XMLHttpRequest does not honor character set encoding
65 * khtml/ecma/xmlhttprequest.cpp:
66 (KJS::XMLHttpRequest::slotData): Get encoding from the transfer job.
67 * kwq/KWQKJobClasses.h:
68 * kwq/KWQKJobClasses.mm:
69 (KIO::TransferJobPrivate::TransferJobPrivate): Added retrievedCharset
71 (KIO::TransferJob::retrieveCharset): New method, gets the charset
73 (KIO::TransferJob::queryMetaData): Handle charset.
74 (KIO::TransferJob::emitReceivedResponse): Clear retreivedCharset flag.
77 (KWQResponseTextEncodingName): New function, gets the encoding from the response.
79 2004-08-23 David Hyatt <hyatt@apple.com>
81 Apply leo's fix to marquees.
85 * khtml/rendering/render_layer.cpp:
88 2004-08-20 Darin Adler <darin@apple.com>
92 - added an ascii() member function to DOMString and DOMStringImpl to help debugging
94 * khtml/dom/dom_string.h: Add ascii member function for debugging.
95 * khtml/dom/dom_string.cpp: (DOM::DOMString::ascii): Added. Calls through to DOMStringImpl::ascii.
96 * khtml/xml/dom_stringimpl.h: Add ascii member function for debugging.
97 * khtml/xml/dom_stringimpl.cpp: (DOM::DOMStringImpl::ascii): Added. Makes a new buffer and puts
98 a simple ASCII version in it. Maybe make it better about characters outside the 0x20-0x7E range
99 some day, but for now this is way better than what we had before.
101 2004-08-20 David Hyatt <hyatt@apple.com>
103 Divorce the notion of a marquee being stopped from JS from the notion of being suspended by the back/forward cache.
105 * khtml/ecma/kjs_html.cpp:
106 (KJS::HTMLElementFunction::tryCall):
107 * khtml/rendering/render_layer.cpp:
111 (Marquee::updateMarqueePosition):
112 * khtml/rendering/render_layer.h:
114 2004-08-20 Richard Williamson <rjw@apple.com>
116 Implemented new JNI abstraction. We no longer invoke Java methods
117 directly with JNI, rather we call into the plugin. This allows the
118 plugin to dispatch the call to the appropriate VM thread. This
119 change should (will?) fix a whole class of threading related problems with
124 * kwq/KWQKHTMLPart.mm:
125 (KWQKHTMLPart::getAppletInstanceForView):
126 * kwq/WebCoreBridge.mm:
128 (-[WebCoreBridge executionContextForView:]):
130 2004-08-19 Maciej Stachowiak <mjs@apple.com>
134 More text paint cleanup. Separated the background and foreground
135 passes instead of doing a weird for loop thing. Eliminated
136 redundant if conditions. Added comments.
138 * khtml/rendering/render_text.cpp:
141 2004-08-19 Ken Kocienda <kocienda@apple.com>
145 * khtml/css/css_computedstyle.cpp:
146 (DOM::): Changed CopyProperties constant to InheritableProperties. This reflects the
147 name change of copy() to copyInheritableProperties()
148 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties: Renamed from copy().
149 Now just copies those properties which can be inherited.
150 (DOM::CSSComputedStyleDeclarationImpl::diff): Add a couple null checks.
151 * khtml/css/css_computedstyle.h: copyInheritableProperties name change. No longer needs to be virtual.
152 * khtml/css/css_valueimpl.cpp: Removed unneeded copy() function from CSSStyleDeclarationImpl.
153 * khtml/css/css_valueimpl.h: Ditto.
154 * khtml/editing/htmlediting.cpp:
155 (khtml::EditCommand::typingStyle): Added.
156 (khtml::EditCommand::setTypingStyle): Added.
157 * khtml/editing/htmlediting.h:
158 * khtml/editing/htmlediting_impl.cpp:
159 (khtml::StyleChange::currentlyHasStyle): Fix leak of computed style used in this function.
160 (khtml::EditCommandImpl::EditCommandImpl): Initialize m_typingStyle.
161 (khtml::EditCommandImpl::~EditCommandImpl): Deref m_typingStyle.
162 (khtml::EditCommandImpl::assignTypingStyle): New helper used in setting typing style.
163 (khtml::EditCommandImpl::setTypingStyle): New setter.
164 (khtml::DeleteSelectionCommandImpl::doApply): Use new method for managing typing style.
165 * khtml/editing/htmlediting_impl.h:
166 (khtml::EditCommandImpl::typingStyle): New accessor.
167 * khtml/khtml_part.cpp:
168 (KHTMLPart::appliedEditing): Restores typing style from command after setting selection.
169 (KHTMLPart::applyStyle): Does a diff between the current style and the style of the caret.
170 * khtml/khtml_part.h:
171 * khtml/xml/dom_position.cpp:
172 (DOM::Position::computedStyle): Now returns a CSSComputedStyleDeclarationImpl instead of a plain
173 CSSStyleDeclarationImpl.
174 * khtml/xml/dom_position.h:
175 * layout-tests/editing/style/style-3681552-fix-002-expected.txt:
177 2004-08-20 Trey Matteson <trey@apple.com>
179 3655407 - Editing: -complete: method unimplemented (WebKit editing API)
181 One new support routine here.
185 * kwq/WebCoreBridge.h:
186 * kwq/WebCoreBridge.mm:
187 (-[WebCoreBridge caretRectAtNode:offset:]): New routine.
188 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
189 Fixed former misleading method name.
191 2004-08-20 Ken Kocienda <kocienda@apple.com>
197 <rdar://problem/3768378> crash typing newline in Blot
199 * khtml/editing/htmlediting_impl.cpp:
200 (khtml::InputNewlineCommandImpl::doApply): Adding an assert in a recent change
201 showed up that inserting newlines that was not being handled correctly for the
202 case described in the bug. I added a new case to handle inserting BR's when
203 at the caret max offset for a node, and this new code runs instead of the
204 fall-through case that should not have been running and triggered the assert.
205 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Regenerated results.
206 * layout-tests/editing/inserting/insert-br-case6-expected.txt: Added.
207 * layout-tests/editing/inserting/insert-br-case6.html: Added.
209 2004-08-20 Trey Matteson <trey@apple.com>
211 Fixing: Spellchecker called once or twice for every char typed.
215 * khtml/khtml_part.cpp:
216 (KHTMLPart::setSelection): Don't do any spell checking if we're typing (it's done
217 elsewhere, in markMisspellingsAfterTyping)
219 2004-08-19 Maciej Stachowiak <mjs@apple.com>
223 - fixed <rdar://problem/3549369> Crash at www.e1.ru in HTMLTokenizer::notifyFinished
225 Probably also fixed the following likely duplicates:
227 <rdar://problem/3503938> Safari crashed opening many tabs (HTMLTokenizer::notifyFinished(khtml::CachedObject*))
228 <rdar://problem/3566332> CrashTracer: ..405 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
229 <rdar://problem/3703964> CrashTracer: ...86 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
230 <rdar://problem/3703969> CrashTracer: ..234 crashes at com.apple.WebCore: HTMLTokenizer::notifyFinished + 0x1c8
232 * khtml/xml/dom_docimpl.cpp:
233 (DocumentImpl::open): call setParsing(true), because we need to know we are once again
234 parsing when we re-open a document that has previously completed loading.
236 2004-08-19 Maciej Stachowiak <mjs@apple.com>
238 Reviewed by Dave and Darin.
240 * khtml/rendering/render_text.cpp:
241 (RenderText::paint): Split apple and non-apple code paths to allow further cleanup.
243 2004-08-19 Darin Adler <darin@apple.com>
247 - fixed <rdar://problem/3767274> crash in partForWidget inside setFocus (test page attached)
249 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::nextKeyViewInFrame): Remove code to do position
250 the widget; no longer needed since we reworked how widgets get their positions.
251 * kwq/KWQWidget.mm: (QWidget::setFocus): Ditto. This was the one that caused the bug.
253 2004-08-19 David Hyatt <hyatt@apple.com>
255 Fix crash when text is contained inside a table-colgroup.
259 * khtml/xml/dom_textimpl.cpp:
260 (TextImpl::rendererIsNeeded):
262 2004-08-19 Trey Matteson <trey@apple.com>
264 Unexpected errors hit while finding word boundaries, leading to crash.
268 * kwq/KWQTextUtilities.cpp:
269 (KWQFindWordBoundary): Don't call UCFindTextBreak with edge cases it thinks
270 are param errors, and pass correct mask for forward case. Also fix off-by-one
271 crashers in fallback code.
273 2004-08-19 David Hyatt <hyatt@apple.com>
275 Make XSLT imports/includes work. This code has to be turned off until the newer version of libxslt is
280 * khtml/css/css_ruleimpl.cpp:
281 (CSSImportRuleImpl::init):
282 * khtml/xml/dom_docimpl.cpp:
283 (DocumentImpl::DocumentImpl):
284 (DocumentImpl::~DocumentImpl):
285 (DocumentImpl::applyXSLTransform):
286 * khtml/xml/dom_docimpl.h:
287 (DOM::DocumentImpl::setTransformSource):
288 (DOM::DocumentImpl::transformSource):
289 * khtml/xml/dom_xmlimpl.cpp:
290 (DOM::ProcessingInstructionImpl::checkStyleSheet):
291 * khtml/xml/xml_tokenizer.cpp:
296 (khtml::createQStringParser):
297 (khtml::XMLTokenizer::setTransformSource):
298 * khtml/xsl/xsl_stylesheetimpl.cpp:
299 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
300 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
301 (DOM::XSLStyleSheetImpl::isLoading):
302 (DOM::XSLStyleSheetImpl::clearDocuments):
303 (DOM::XSLStyleSheetImpl::parseString):
304 (DOM::XSLStyleSheetImpl::loadChildSheets):
305 (DOM::XSLStyleSheetImpl::loadChildSheet):
306 (DOM::XSLImportRuleImpl::parentStyleSheet):
307 (DOM::XSLStyleSheetImpl::compileStyleSheet):
308 (DOM::XSLStyleSheetImpl::locateStylesheetSubResource):
309 (DOM::XSLImportRuleImpl::XSLImportRuleImpl):
310 (DOM::XSLImportRuleImpl::~XSLImportRuleImpl):
311 (DOM::XSLImportRuleImpl::setStyleSheet):
312 (DOM::XSLImportRuleImpl::isLoading):
313 (DOM::XSLImportRuleImpl::loadSheet):
314 * khtml/xsl/xsl_stylesheetimpl.h:
315 (DOM::XSLStyleSheetImpl::setOwnerDocument):
316 (DOM::XSLStyleSheetImpl::setDocument):
317 (DOM::XSLStyleSheetImpl::markAsProcessed):
318 (DOM::XSLStyleSheetImpl::processed):
319 (DOM::XSLImportRuleImpl::href):
320 (DOM::XSLImportRuleImpl::styleSheet):
321 (DOM::XSLImportRuleImpl::isImportRule):
322 * khtml/xsl/xslt_processorimpl.cpp:
323 (DOM::m_sourceDocument):
324 (DOM::stylesheetLoadFunc):
325 (DOM::XSLTProcessorImpl::transformDocument):
326 * khtml/xsl/xslt_processorimpl.h:
330 2004-08-18 Trey Matteson <trey@apple.com>
332 3765958 - downstreamPosition() can hit infinite loop when at end of doc
334 The problem was that I had a position that was after the maximum position in the text
335 node, because it was the old caret position before a backspace was processed. Later
336 I happened to call downstream() on that position, and hit the bug. Fix is to consider
337 a position past the end point of its node if it is *greater than* or equal to its max offset.
341 * khtml/xml/dom_positioniterator.cpp:
342 (DOM::PositionIterator::atEnd):
344 2004-08-18 David Hyatt <hyatt@apple.com>
346 - did WebCore part of <rdar://problem/3682969> SLIDER: absolute left position of slider should be headline only
348 Make the header overlap the footer in the zero-line case. Changes to Emerson's template will ensure the
349 header draws over the footer.
353 * khtml/rendering/render_block.cpp:
354 (khtml::getHeightForLineCount):
356 2004-08-18 Richard Williamson <rjw@apple.com>
358 Replace horrible pollForAppletInView: with new
359 webPlugInGetApplet. The details of how the applet instance
360 is provided now belong to the Java team. Yeh.
364 * kwq/KWQKHTMLPart.mm:
365 (KWQKHTMLPart::getAppletInstanceForView):
366 * kwq/WebCoreBridge.h:
368 2004-08-18 Chris Blumenberg <cblu@apple.com>
370 Fixed: <rdar://problem/3692199> 8A146: Safari crashes in toHTMLWithOptions, selection with no renderer (various sites)
374 * khtml/xml/dom2_rangeimpl.cpp:
375 (DOM::RangeImpl::toHTML): renamed, don't assume that nodes of the range had renderers, use the common ancestor of the range as the root
376 * khtml/xml/dom2_rangeimpl.h:
377 * khtml/xml/dom_nodeimpl.cpp:
378 (NodeImpl::recursive_toHTML): renamed, removed code that determines whether to include the root in the HTML, leave this up to the caller
379 * khtml/xml/dom_nodeimpl.h:
380 * kwq/WebCoreBridge.mm:
381 (-[WebCoreBridge markupStringFromNode:nodes:]): call renamed methods
382 (-[WebCoreBridge markupStringFromRange:nodes:]): ditto
384 2004-08-18 Ken Kocienda <kocienda@apple.com>
388 * khtml/css/css_valueimpl.cpp:
389 (CSSStyleDeclarationImpl::copy): Roll back silly last minute change that broke this code.
390 Note to self: read code before making changes to it.
392 2004-08-18 Ken Kocienda <kocienda@apple.com>
394 Coded by Darin and Ken
396 * khtml/css/css_computedstyle.cpp: Added CopyProperties static array. This contains
397 the properties we implement that we also want to copy in the new
398 CSSComputedStyleDeclarationImpl::copy described below.
399 (DOM::CSSComputedStyleDeclarationImpl::copy): New function. In this class, copies the
400 computed values of all the properties listed in CopyProperties. In essence, this makes
401 a freeze-dired version of a computed style.
402 (DOM::CSSComputedStyleDeclarationImpl::diff): Removes every property from the passed-in
403 CSSStyleDeclarationImpl that is also in the computed style.
404 * khtml/css/css_computedstyle.h:
405 * khtml/css/css_valueimpl.cpp:
406 (CSSStyleDeclarationImpl::copy): New function. In this class, the copy operation is
407 straightforward. Returns a copy that will be unchanged when the original changes.
408 * khtml/css/css_valueimpl.h:
409 (DOM::CSSStyleDeclarationImpl::values): Added a accessor suitable for use when the
410 CSSStyleDeclarationImpl is const.
412 2004-08-17 Maciej Stachowiak <mjs@apple.com>
416 <rdar://problem/3703768> CrashTracer: ...50 crashes at com.apple.WebCore: KHTMLPart::xmlDocImpl const + 0
418 * khtml/khtmlview.cpp:
419 (KHTMLView::viewportMouseMoveEvent): Add a nil check and an
420 assertion for m_part being null. It seems impossible for this to
421 happen, so we want to debug it ourselves, but in the meantime,
422 let's try to avoid causing crashes for our users.
424 2004-08-17 David Hyatt <hyatt@apple.com>
426 Fix the line truncation function for Emerson so that at the far left setting of the slider, only the header
431 * khtml/rendering/render_block.cpp:
432 (khtml::getHeightForLineCount):
433 * khtml/rendering/render_flexbox.cpp:
434 (khtml::RenderFlexibleBox::layoutVerticalBox):
436 2004-08-17 Ken Kocienda <kocienda@apple.com>
440 Rewrite of the command that deletes a selection. I deleted great
441 big swaths of bug-ridden code to accomplish this and replaced it
442 with code that is much cleaner and smarter.
444 Also, renamed equivalentUpstreamPosition and equivalentDownstreamPosition to
445 upstream to downstream, respectively.
447 Added a couple of new helper methods.
449 * khtml/editing/htmlediting.cpp: DeleteCollapsibleWhitespaceCommand and
450 RemoveNodeAndPruneCommand now obsolete. A huge win.
451 * khtml/editing/htmlediting.h: Ditto.
452 * khtml/editing/htmlediting_impl.cpp:
453 (khtml::debugPosition): Fix printf which had a placeholder, but no argument passed in the varargs.
454 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): New helper. Much simplified and cleaner
456 (khtml::ApplyStyleCommandImpl::doApply): upstream/downstream name change
457 (khtml::ApplyStyleCommandImpl::nodeFullySelected): upstream/downstream name change
458 (khtml::DeleteSelectionCommandImpl::doApply): upstream/downstream name change
459 (khtml::DeleteTextCommandImpl::DeleteTextCommandImpl): Add an assert to check that the
460 passed offset is less than the length of the text node.
461 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition): upstream/downstream name change
462 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition): upstream/downstream name change
463 (khtml::InputNewlineCommandImpl::doApply): upstream/downstream name change
464 (khtml::InputTextCommandImpl::prepareForTextInsertion): upstream/downstream name change
465 (khtml::InputTextCommandImpl::execute): upstream/downstream name change
466 (khtml::InputTextCommandImpl::insertSpace): upstream/downstream name change
467 (khtml::ReplaceSelectionCommandImpl::doApply): upstream/downstream name change
468 (khtml::TypingCommandImpl::issueCommandForDeleteKey): upstream/downstream name change
469 (khtml::TypingCommandImpl::deleteKeyPressed):
470 * khtml/editing/htmlediting_impl.h:
471 * khtml/xml/dom_position.cpp:
472 (DOM::Position::previousWordBoundary):
473 (DOM::Position::nextWordBoundary):
474 (DOM::Position::upstream):
475 (DOM::Position::downstream):
476 (DOM::Position::inRenderedText): Add null check.
477 (DOM::Position::isRenderedCharacter): New helper.
478 (DOM::isWS): New helper in this file.
479 (DOM::Position::leadingWhitespacePosition): New helper. Factored out from htmlediting_impl.cpp.
480 (DOM::Position::trailingWhitespacePosition): Ditto.
481 (DOM::Position::debugPosition): Add null check.
482 * khtml/xml/dom_position.h:
483 * khtml/xml/dom_selection.cpp:
484 (DOM::Selection::toRange): upstream/downstream name change
485 (DOM::Selection::validate): upstream/downstream name change
486 (DOM::Selection::debugPosition): upstream/downstream name change
487 * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Updated tests with new expected results.
488 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
489 * layout-tests/editing/deleting/delete-selection-001-expected.txt: Ditto.
490 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Ditto.
491 * layout-tests/editing/inserting/insert-br-case1-expected.txt: Ditto.
492 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Ditto.
493 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Ditto.
495 2004-08-17 Trey Matteson <trey@apple.com>
497 Various spelling fixes.
501 * khtml/khtml_part.cpp:
502 (KHTMLPart::setSelection): No misspellings in the spelling code comments
503 * khtml/xml/dom_docimpl.cpp:
504 (DocumentImpl::removeMarker): Repaint if doc changes. Sometimes the markers
505 were not being erased when you clicked in a word.
506 * khtml/xml/dom_position.cpp:
507 (DOM::Position::previousWordBoundary): Small optimization. Bail after first
508 try if the second try will not come out any different.
509 (DOM::Position::nextWordBoundary): Ditto
510 * kwq/KWQKHTMLPart.mm:
511 (KWQKHTMLPart::markMisspellingsInSelection): Comment.
513 2004-08-17 Darin Adler <darin@apple.com>
517 - fixed <rdar://problem/3689700> crash loading page; stoxx.com (works in IE and Firefox)
519 * khtml/khtml_part.h: Make completeURL public.
520 * kwq/KWQKJavaAppletWidget.mm: (KJavaAppletWidget::KJavaAppletWidget): Complete the base URL
521 before passing it across the bridge. This sidesteps the crashing bug in CFURL, filed as
522 '<rdar://problem/3764632> CFURLCreateAbsoluteURLWithBytes crashes if passed the string "../.."'
523 and also is obviously correct behavior that may fix other sites too.
525 - fixed <rdar://problem/3547725> Crashes at csuohio.edu, list box vs. mouse event problem (Spoof No Fix)
528 (QListBox::~QListBox): Nil out the pointer from the KWQTableView back to the widget by calling
530 (-[KWQTableView detach]): Set the pointer to the QListBox to 0. Also set the delegate and data
531 source to nil, so we don't need nil checks in delegate and data source methods.
532 (-[KWQTableView mouseDown:]): Add nil check.
533 (-[KWQTableView keyDown:]): Add nil check.
534 (-[KWQTableView keyUp:]): Add nil check.
535 (-[KWQTableView becomeFirstResponder]): Add nil check.
536 (-[KWQTableView resignFirstResponder]): Add nil check.
537 (-[KWQTableView canBecomeKeyView]): Add nil check.
538 (-[KWQTableView tableViewSelectionDidChange:]): Add nil checks, even though this is a delegate
539 callback, to handle cases where calls to JavaScript result in the QListBox going away partway
541 (-[KWQTableView drawRow:clipRect:]): Add nil check.
542 (-[KWQTableView _accessibilityTableCell:tableColumn:]): Add nil check.
544 2004-08-17 Trey Matteson <trey@apple.com>
546 Fix ASSERT in spelling marker management.
550 * khtml/xml/dom_docimpl.cpp:
551 (DocumentImpl::shiftMarkers): Use assert instead of ASSERT.
552 Tweak test to allow for a start position of 0.
554 2004-08-17 Trey Matteson <trey@apple.com>
556 3764147 - failure of subframe to load leaves links in parent doc broken
560 * khtml/khtml_part.cpp:
561 (KHTMLPart::childBegin): New method to mark part as not complete.
562 (KHTMLPart::processObjectRequest): Mark child part imcomplete, so if we
563 later get a failure on load it won't think it's already complete and do nothing.
564 * khtml/khtml_part.h:
568 2004-08-16 David Hyatt <hyatt@apple.com>
570 Fix the #define. I had it all backwards.
574 2004-08-16 David Hyatt <hyatt@apple.com>
576 Land initial support for XSLT using xml-stylesheet PIs.
578 * WebCore.pbproj/project.pbxproj:
579 * khtml/khtml_part.cpp:
580 (KHTMLPart::replaceDocImpl):
581 * khtml/khtml_part.h:
583 * khtml/xml/dom_docimpl.cpp:
584 (DocumentImpl::DocumentImpl):
585 (DocumentImpl::~DocumentImpl):
586 (DocumentImpl::recalcStyleSelector):
587 (DocumentImpl::applyXSLTransform):
588 (DocumentImpl::setTransformSourceDocument):
589 * khtml/xml/dom_docimpl.h:
590 (DOM::DocumentImpl::setTransformSource):
591 (DOM::DocumentImpl::transformSource):
592 (DOM::DocumentImpl::transformSourceDocument):
593 * khtml/xml/dom_xmlimpl.cpp:
594 (DOM::ProcessingInstructionImpl::checkStyleSheet):
595 * khtml/xml/dom_xmlimpl.h:
596 (DOM::ProcessingInstructionImpl::isXSL):
597 * khtml/xml/xml_tokenizer.cpp:
600 (khtml::createQStringParser):
601 (khtml::XMLTokenizer::processingInstruction):
602 (khtml::XMLTokenizer::finish):
603 (khtml::XMLTokenizer::setTransformSource):
604 * khtml/xml/xml_tokenizer.h:
605 (khtml::Tokenizer::setTransformSource):
606 * khtml/xml/xsl_stylesheetimpl.cpp: Removed.
607 * khtml/xml/xsl_stylesheetimpl.h: Removed.
608 * khtml/xsl/xsl_stylesheetimpl.cpp: Added.
609 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
610 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
611 (DOM::XSLStyleSheetImpl::isLoading):
612 (DOM::XSLStyleSheetImpl::checkLoaded):
613 (DOM::XSLStyleSheetImpl::docLoader):
614 (DOM::XSLStyleSheetImpl::parseString):
615 * khtml/xsl/xsl_stylesheetimpl.h: Added.
616 (DOM::XSLStyleSheetImpl::isXSLStyleSheet):
617 (DOM::XSLStyleSheetImpl::type):
618 (DOM::XSLStyleSheetImpl::ownerDocument):
619 (DOM::XSLStyleSheetImpl::document):
620 (DOM::XSLStyleSheetImpl::clearDocument):
621 * khtml/xsl/xslt_processorimpl.cpp: Added.
622 (DOM::m_sourceDocument):
623 (DOM::XSLTProcessorImpl::~XSLTProcessorImpl):
624 (DOM::XSLTProcessorImpl::transformDocument):
626 (DOM::XSLTProcessorImpl::addToResult):
627 (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
628 * khtml/xsl/xslt_processorimpl.h: Added.
630 2004-08-16 Maciej Stachowiak <mjs@apple.com>
634 * khtml/khtml_part.cpp:
635 (KHTMLPart::isImmediateRedirectPending):
637 2004-08-16 Richard Williamson <rjw@apple.com>
639 Fixed <rdar://problem/3704339> Context2D forces integer positions in drawImage
641 Use floats instead of ints to draw images.
645 * khtml/ecma/kjs_html.cpp:
646 (KJS::Context2DFunction::tryCall):
649 (QPainter::drawPixmap):
650 (QPainter::drawFloatPixmap):
652 2004-08-13 Maciej Stachowiak <mjs@apple.com>
656 - fixed <rdar://problem/3752509> Pop up windows not showing up within SAP's BW Module (changing location.href on new window created by window.open)
658 (actually the previous fix for this bug was mostly correct, but
659 this additional change is needed to avoid the regression in
660 <rdar://problem/3751025> REGRESSION: website rejects Safari 125.9
661 as "need to upgrade to IE 6", but didn't reject 125.8
663 So if merging for a software update, make sure to include both
664 this and the previous fix.
666 * khtml/html/htmltokenizer.cpp:
667 (khtml::HTMLTokenizer::write): When there is an immediate reidrect pending,
668 make sure to stop tokenizing, because we need to make sure no further
669 script tags are processed beyond the one that triggered the redirect.
670 * khtml/khtml_part.cpp:
671 (KHTMLPart::isImmediateRedirectPending): New method to allow
672 checking if a redirect is pending.
673 * khtml/khtml_part.h:
675 2004-08-15 David Hyatt <hyatt@apple.com>
677 - fixed <rdar://problem/3760508> REGRESSION (154-155): No text in textarea
679 Fix the blank textarea problem by ensuring that any change to a <textarea>'s DOM children causes the form control
680 to resync with the DOM. This behavior matches WinIE.
684 * khtml/html/html_formimpl.cpp:
685 (HTMLTextAreaElementImpl::childrenChanged):
686 * khtml/html/html_formimpl.h:
688 2004-08-13 Trey Matteson <trey@apple.com>
690 3761794 Slider doesn't call onmouseup handler
694 * khtml/rendering/render_form.cpp:
695 (RenderSlider::RenderSlider): Listen for signal.
696 (RenderSlider::slotClicked): Pass to superclass.
697 * khtml/rendering/render_form.h:
700 (-[KWQSlider mouseDown:]): Generate mouseUp and clicked events,
701 since AK consumes the mouseUp event in a modal tracking loop.
702 (QSlider::QSlider): Make signal.
703 (QSlider::clicked): Send signal.
705 2004-08-12 Trey Matteson <trey@apple.com>
707 3761329 - query result links all dead in ingrammicro.com (sometimes)
708 3761328 - links in some docs dead when doc is loaded from WebArchive
710 Make sure to get part to completed state when end is called,
711 even if we have no doc. See WebKit changelog for more info.
713 Reviewed by Richard and Darin.
715 * khtml/khtml_part.cpp:
718 2004-08-13 Trey Matteson <trey@apple.com>
720 3761098 - red dotted underline for misspelled words shows up in drag image
724 * khtml/rendering/render_text.cpp:
725 (RenderText::paint): Don't draw misspelling when creating selection image.
727 2004-08-12 Richard Williamson <rjw@apple.com>
729 Bring npruntime.h and friends closer to compliance with
734 * kwq/KWQKHTMLPart.mm:
735 (KWQKHTMLPart::windowScriptNPObject):
737 2004-08-12 Maciej Stachowiak <mjs@apple.com>
741 <rdar://problem/3245706> URLs with backslashes instead of slashes work on WinIE; should work on Safari (SAP)
742 <rdar://problem/3506429> <BASE> tag containing backslash is breaking images with absolute URLs
745 (substituteBackslashes): Helper method
746 (KURL::KURL): If the URL contains any backslashes, substitute all
747 that appear before the query or fragment.
749 2004-08-12 Ken Kocienda <kocienda@apple.com>
755 <rdar://problem/3761014> command-down-arrow takes you to start of document instead of end of document
757 * khtml/xml/dom_selection.cpp:
758 (DOM::Selection::modifyExtendingRightForward): Code used to assume, incorrectly, that index 1 of the
759 document element was beyond the last node in the document. But this is not true, since the document
760 element is the HTML element (generally). Instead, move to the index equal to the number of children
761 of the document element. This puts us past everything.
762 (DOM::Selection::modifyMovingRightForward): Ditto.
764 2004-08-12 Ken Kocienda <kocienda@apple.com>
770 <rdar://problem/3695446> shift-down-arrow on last line of editable text should select to end of document
772 Detect when current position is on first or last line and move to the
773 start or end of that line, respectively.
775 * khtml/xml/dom_position.cpp:
776 (DOM::Position::previousLinePosition)
777 (DOM::Position::nextLinePosition)
781 2004-08-12 Ken Kocienda <kocienda@apple.com>
785 Some consolidation in style application code.
787 * khtml/editing/htmlediting_impl.cpp:
788 (khtml::StyleChange::StyleChange): Made this a full-on class and added a couple of
789 members and a constructors to make a StyleChange from a CSSStyleDeclarationImpl, as
790 well as from a CSSStyleDeclarationImpl and a Position.
791 (khtml::StyleChange::init): Common init function for StyleChange constructors.
792 (khtml::StyleChange::currentlyHasStyle): Moved this here from ApplyStyleCommandImpl.
793 (khtml::CompositeEditCommandImpl::applyTypingStyle): Tweak to adjust to new StyleChange
795 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Ditto.
796 * khtml/editing/htmlediting_impl.h:
797 (khtml::StyleChange::StyleChange):
798 (khtml::StyleChange::cssStyle): New accessor.
799 (khtml::StyleChange::applyBold): Ditto.
800 (khtml::StyleChange::applyItalic): Ditto.
801 * khtml/xml/dom_position.cpp:
802 (DOM::Position::computedStyle): New helper.
803 * khtml/xml/dom_position.h: Ditto.
805 2004-08-12 Ken Kocienda <kocienda@apple.com>
810 <rdar://problem/3751098> HTML email has one set of SPAN tags per character in the message
812 Progress on this bug:
813 <rdar://problem/3755562> Typing styles do not use same tag application conventions as font and color panel
815 * khtml/editing/htmlediting_impl.cpp:
816 (khtml::CompositeEditCommandImpl::applyTypingStyle): Name changed from createTypingStyleElement.
817 Also, interface changed to take the node to which the typing style is to be applied.
818 This makes it easier to apply what may be up to three levels of nested tags to get the
819 desired style (<B>, <I>, and <SPAN STYLE="">).
820 Also, Borrow some of the style change smarts from ApplyStyleCommandImpl to use bold and
821 italic tags for applying styles when that is apprpriate. This creates on opportunity to
822 factor the code to do this so that this function and the ApplyStyleCommandImpl class can
823 share the implementation. I will follow up with a change to do that after landing this
824 change. Some future code factoring could be done here to bring together some similar code
826 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Add comment about code factoring work.
827 (khtml::ApplyStyleCommandImpl::computeStyleChange): StyleChange struct no longer a member of the
828 ApplyStyleCommandImpl class. CompositeEditCommandImpl needs it now in its applyTypingStyle()
830 (khtml::InputNewlineCommandImpl::doApply): Pass along node to style to applyTypingStyle.
831 (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
832 * khtml/editing/htmlediting_impl.h:
833 (khtml::StyleChange::StyleChange): Pull this struct out of ApplyStyleCommandImpl so
834 CompositeEditCommandImpl can use it.
835 * khtml/khtml_part.cpp:
836 (KHTMLPart::notifySelectionChanged): Always clear typing style when the selection
837 changes, not only when closing typing. This fixes 3751098.
839 These three tests actually had results that treated the buggy behavior as correct!
841 * layout-tests/editing/style/style-3681552-fix-001-expected.txt
842 * layout-tests/editing/style/style-3681552-fix-002-expected.txt
843 * layout-tests/editing/style/typing-style-002-expected.txt
845 2004-08-12 Darin Adler <darin@apple.com>
849 - fixed <rdar://problem/3740485> Repro crash involving replacing content that includes form field
851 * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Since this function calls selectText: which has a side
852 effect of making the text field be first responder, call to bridge first to make it first responder.
853 The bridge version lets WebHTMLView know we are changing the responder, avoiding some unpleasantness
854 because it sets the "changing focus programmatically" flag. Without that flag set, we were getting
855 an additional setFocusNode(0) call, which is unnecessary and incorrect.
857 2004-08-12 Darin Adler <darin@apple.com>
861 - fixed <rdar://problem/3758756> copying text selected with down arrow results in all text to end of document
863 * khtml/xml/dom2_rangeimpl.h: Make startNode and pastEndNode public.
864 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::pastEndNode): Fix bug where this would return
865 one node too far in the case where the end container was not a text node.
867 * khtml/xml/dom_nodeimpl.cpp:
868 (NodeImpl::recursive_toHTMLWithOptions): Rewrite loop, using startNode and pastEndNode,
869 to fix bug where it would run past the end node, including too many nodes in the generated
870 HTML. Nice side benefit: easier to read the code.
872 2004-08-11 Chris Blumenberg <cblu@apple.com>
874 Fixed: <rdar://problem/3758216> PARENTAL: buttons on parental controls page only work once
878 * kwq/KWQKHTMLPart.mm:
879 (KWQKHTMLPart::submitForm): prevent a form from being submitted more than once only if it uses a scheme of http or https
881 2004-08-11 Darin Adler <darin@apple.com>
885 - fixed <rdar://problem/3715878> 8A162: connect.apple.com password field showed in cleartext
887 * kwq/KWQTextField.mm: (-[KWQSecureTextField textDidEndEditing:]):
888 Enhanced workaround for shifting focus from one secure text field to another so that it works
889 even for the case of shifting focus from a secure text field back to itself.
891 2004-08-11 Ken Kocienda <kocienda@apple.com>
895 Missed adding this file before.
897 * kwq/KWQTextUtilities.mm: Added.
898 (KWQFindNextWordFromIndex):
900 2004-08-11 Ken Kocienda <kocienda@apple.com>
904 Efficiency improvements on string manipulations in these two new function
905 implementations. Use the versions of QString append/prepend that take
906 (QChar *c, uint length) instead of creating new strings each time.
908 * khtml/xml/dom_position.cpp:
909 (DOM::Position::previousWordPosition): Changed, as described above.
910 (DOM::Position::nextWordPosition): Ditto.
912 2004-08-11 Ken Kocienda <kocienda@apple.com>
917 <rdar://problem/3675812> Moving a word at a time does not use the correct conception of "word"
919 I have implemented versions of previousWordPosition and nextWordPosition that are now
920 different than previousWordBoundary and nextWordBoundary. The behavior of the new
921 functions attempts to match what Cocoa does as closely as it can. Let the bug filing begin!
923 * WebCore.pbproj/project.pbxproj: Added KWQTextUtilities.mm
924 * khtml/misc/helper.cpp:
925 (khtml::nextWordFromIndex): Glue to call through to KWQFindNextWordFromIndex.
926 * khtml/misc/helper.h: Declare the function above.
927 * khtml/misc/khtml_text_operations.cpp: Added SimplifiedBackwardsTextIterator class.
928 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): New
929 (khtml::SimplifiedBackwardsTextIterator::advance): Ditto.
930 (khtml::SimplifiedBackwardsTextIterator::handleTextNode): Ditto.
931 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement): Ditto.
932 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Ditto.
933 (khtml::SimplifiedBackwardsTextIterator::exitNode): Ditto.
934 (khtml::SimplifiedBackwardsTextIterator::emitCharacter): Ditto.
935 (khtml::SimplifiedBackwardsTextIterator::range): Ditto.
936 * khtml/misc/khtml_text_operations.h:
937 (khtml::SimplifiedBackwardsTextIterator::atEnd): Ditto.
938 (khtml::SimplifiedBackwardsTextIterator::length): Ditto.
939 (khtml::SimplifiedBackwardsTextIterator::characters): Ditto.
940 * khtml/xml/dom_position.cpp:
941 (DOM::Position::previousWordBoundary): Updated to gather appropriate text and call through to
942 AppKit to perform the same calculations NSText uses.
943 (DOM::Position::nextWordBoundary): Ditto.
944 (DOM::Position::previousWordPosition): Unrelated change to fix case where the function could get "stuck".
945 (DOM::Position::nextWordPosition): Ditto
946 (DOM::Position::equivalentDeepPosition): Changed to look backwards if the position's offset is equal
947 to the number of child nodes it has. This handles more cases correctly, like when the position is
948 gives as one beyond the end of a document element's last child.
949 * kwq/KWQTextUtilities.h: Declared KWQFindNextWordFromIndex.
950 * kwq/KWQTextUtilities.mm: Added.
951 (KWQFindNextWordFromIndex): New function.
953 2004-08-11 Ken Kocienda <kocienda@apple.com>
959 <rdar://problem/3732702> crash in CSSComputedStyleDeclarationImpl running devtools.com editing sample code
961 * khtml/khtml_part.cpp:
962 (KHTMLPart::selectionComputedStyle): Added a null check.
964 2004-08-10 Darin Adler <darin@apple.com>
968 - fixed <rdar://problem/3710123> Loading iframe that replaces content in the parent document crashes Safari
970 I fixed three problems:
972 1) script interpreter destroyed while it was interpreting scripts, caused random havoc
973 2) code trying to get to view after view was detached from part, caused nil-deref
974 3) signals sent to parent after child was no longer in the parent's frames list, caused nil-deref
976 Now the test page works fine. Hope the real sites do too.
978 * khtml/khtml_part.h: Add connectChild and disconnectChild helper functions (private).
979 * khtml/khtml_part.cpp:
980 (KHTMLPart::clear): Call disconnectChild on each frame as we detach it (see below).
981 (KHTMLPart::end): Ref the part at the start, and deref the part at the end, of this function.
982 Otherwise, we can end up destroying the part, and hence the interpreter, inside a script that
983 the interpreter itself is running.
984 (KHTMLPart::slotFinishedParsing): Add another check for a nil m_view, after the call to
986 (KHTMLPart::checkCompleted): Remove bogus if statement with empty body.
987 (KHTMLPart::processObjectRequest): Call disconnectChild to disconnect the child <-> parent signals of the
988 old child that the new one is replacing, and connectChild to connect the signals (nicer factoring).
989 (KHTMLPart::slotChildCompleted): Fixed up a confusing boolean if/expression to be simpler. Not related to
990 the bug fix, but an earlier version of the fix had changes in this function.
991 (KHTMLPart::connectChild): Added. Connects the appropriate signals for a child frame.
992 (KHTMLPart::disconnectChild): Added. Disconnects the same signals that connectChild connects.
994 * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Added a call to disconnectChild before removing the
995 child from the frames list.
997 2004-08-09 Maciej Stachowiak <mjs@apple.com>
1003 - made basic marked text highlighting work to complete basic level of <rdar://problem/3704359> input method support not yet implemented for HTML editing
1005 * kwq/WebCoreBridge.mm:
1006 (-[WebCoreBridge setMarkedDOMRange:]): Added this new call to support storing
1007 a marked range in WebCore. The provided DOMRange must start and end in the same
1008 node, which must be a text node.
1009 (-[WebCoreBridge markedDOMRange]): New call to get the marked range.
1010 (-[WebCoreBridge clearMarkedDOMRange]): New call to clear the marked range.
1011 * kwq/WebCoreBridge.h: Prototype new methods.
1012 * kwq/KWQKHTMLPart.mm:
1013 (KWQKHTMLPart::markedRange): Implementation of WebCore call above.
1014 (KWQKHTMLPart::setMarkedRange): Implementation of WebCore call above -
1015 store the marked range, and repaint new and old nodes if needed.
1016 (KWQKHTMLPart::clear): Clear marked range.
1017 * kwq/KWQKHTMLPart.h: Prototype new methods.
1018 * khtml/rendering/render_text.cpp:
1019 (InlineTextBox::paintMarkedTextBackground): New method to paint the background
1020 for marked text, modeled on paintSelection.
1021 (RenderText::paint): Optionally handle painting marked text
1022 background as well as selection background in the marked text
1024 * khtml/rendering/render_text.h: Prototype new method.
1026 2004-08-10 Darin Adler <darin@apple.com>
1030 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1033 (QRegExp::KWQRegExpPrivate::compile): Null-terminate the pattern and pass it.
1034 (QRegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1036 2004-08-10 Darin Adler <darin@apple.com>
1042 * khtml/editing/jsediting.cpp: Capitalize command names to match Windows.
1043 The dictionary lookup is case insensitive.
1045 * kwq/KWQFoundationExtras.h: Remove inaccurate comment.
1047 2004-08-10 Trey Matteson <trey@apple.com>
1049 3757094 - crash spell checking after a paste
1053 * khtml/rendering/render_text.cpp:
1054 (InlineTextBox::paintSelection): Add nil check.
1056 2004-08-09 Trey Matteson <trey@apple.com>
1058 3756195 - spell checking leaves misspelling marker behind after bad word is deleted
1059 ... and other follow-on spell check fixes
1063 * khtml/rendering/render_text.cpp:
1064 (InlineTextBox::paintMarker): Close inspection shows we were drawing the
1065 misspelling marker one pixel lower than AK, and one pixel outside the selection
1066 rect we draw, in the case of Times-16. So move it up one. Still not an exact
1067 match for AK, but less bad.
1068 * khtml/xml/dom_docimpl.cpp:
1069 (DocumentImpl::removeMarker): Track whether we make any changes, so we only
1070 repaint if something actually changed.
1071 (DocumentImpl::removeAllMarkers): New utility.
1072 (DocumentImpl::removeAllMarkers): Use clear() instead of (errant)
1073 hand-rolled loop to empty array.
1074 (DocumentImpl::shiftMarkers): Track whether we make any changes, so we only
1075 repaint if something actually changed.
1076 * khtml/xml/dom_docimpl.h:
1077 * khtml/xml/dom_textimpl.cpp:
1078 (CharacterDataImpl::deleteData): Along with shifting existing markers around,
1079 remove any markers in the deleted range. Fixes 3756195.
1080 (CharacterDataImpl::replaceData): Ditto for the replaced range.
1081 * kwq/KWQKHTMLPart.mm:
1082 (KWQKHTMLPart::updateSpellChecking): comment
1084 2004-08-08 Trey Matteson <trey@apple.com>
1086 3745023 - Safari crashes trying to access anchor while downloading
1088 I bet this is behind a few other crashers as well. In this bug the start of the
1089 download leaves a KWQPageState hanging around, and when that is freed it damages
1090 the part and view. If you're still using that page, you're dead.
1092 The fix is to properly invalidate the PageState when we receive an error before
1093 reaching WebFrameCommitted state. Normally this happens when a page is reheated
1094 from the PageState, but in this case we never manage to leave the page to begin
1095 with, although we've already created the PageState.
1097 Other errors besides the synthetic one download generates would have caused similar
1098 crashing. Another example would be clicking on a second link before the load
1099 caused by clicking on the first link reached committed state.
1103 * kwq/WebCoreBridge.h:
1104 * kwq/WebCoreBridge.mm:
1105 (-[WebCoreBridge didNotOpenURL:pageCache:]): Invalidate the pageCache state
1106 when a load doesn't get off the ground.
1108 2004-08-06 Ken Kocienda <kocienda@apple.com>
1112 Finish off spellchecking support to HTML editing. Includes work to
1113 enable continuous spellchecking.
1115 * khtml/editing/htmlediting_impl.cpp:
1116 (khtml::EditCommandImpl::markMisspellingsInSelection): Basically, a one-liner convenience to
1117 make the call over to the KWQKHTMLPart.
1118 (khtml::ReplaceSelectionCommandImpl::doApply): Did some rearranging of code so that the
1119 inserted content can be spell-checked. The function is basically the same, except for
1120 the addition of calls to markMisspellingsInSelection.
1121 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): New function. Takes a look at the
1122 selection that results after typing and determines whether it needs to spellcheck.
1123 Since the word containing the current selection is never marked, this does a check to
1124 see if typing made a new word that is not in the current selection. Basically, you
1125 get this by being at the end of a word and typing a space.
1126 (khtml::TypingCommandImpl::typingAddedToOpenCommand): Call markMisspellingsAfterTyping.
1127 * khtml/editing/htmlediting_impl.h: Add new function declarations.
1128 * khtml/khtml_part.cpp:
1129 (KHTMLPart::setSelection): Since spell checks are updated when the selection changes,
1130 and every selection change passes through here, this is a good place to put the call
1131 to the spellchecker.
1132 * khtml/rendering/render_text.cpp:
1133 (InlineTextBox::paintMarker): Remove temporary misspelling line drawing code. Replace with
1134 call that does AppKit-style drawing. Fix up some comments.
1135 * khtml/xml/dom_docimpl.cpp:
1136 (DocumentImpl::addMarker): Repaint the node that had the marker added. This makes it show
1138 (DocumentImpl::removeMarker): Ditto.
1139 (DocumentImpl::removeAllMarkers): New function. Convenience for clearing all markers.
1140 Used when not in continuous spellchecking mode.
1141 (DocumentImpl::shiftMarkers): Moves markers in response to changes in a node's contents.
1142 This shifts the marker offsets by a given amount. This keeps the markers in the right
1143 place when a user types in a node with markers already set on it.
1144 * khtml/xml/dom_docimpl.h: Added new functions. Removed unnecessary enum qualifier from some
1146 * khtml/xml/dom_position.cpp:
1147 (DOM::Position::previousWordBoundary): This function was susceptible to endless loops...and
1148 needlessly so. Basically, if the current position is at a word boundary, run the code again
1149 to find the previous word boundary.
1150 (DOM::Position::nextWordBoundary): Same as above, but for next word boundary.
1151 * khtml/xml/dom_textimpl.cpp:
1152 (CharacterDataImpl::setData): Call shiftMarkers to update markers when this node changes.
1153 (CharacterDataImpl::insertData): Ditto.
1154 (CharacterDataImpl::deleteData): Ditto.
1155 (CharacterDataImpl::replaceData): Ditto.
1156 * kwq/KWQKHTMLPart.h:
1157 * kwq/KWQKHTMLPart.mm:
1158 (KWQKHTMLPart::advanceToNextMisspelling):
1159 (KWQKHTMLPart::markMisspellingsInSelection):
1160 (KWQKHTMLPart::updateSpellChecking):
1161 (KWQKHTMLPart::respondToChangedSelection):
1163 * kwq/KWQPainter.mm:
1164 (QPainter::drawLineForMisspelling): New function. Call over to WebKit to do the drawing.
1165 * kwq/WebCoreBridge.h:
1166 * kwq/WebCoreBridge.mm:
1167 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Pass markMisspellings flag to
1169 * kwq/WebCoreTextRenderer.h:
1173 2004-08-05 David Hyatt <hyatt@apple.com>
1175 Fix for 3752542, stack overflow that crashes Safari at www.dr.dk. This bug is a regression caused by a fix that
1176 attempted to repair <caption> behavior to make it behave like Panther. This fix was incorrect, and in addition
1177 even our <caption> behavior on Panther was incorrect.
1179 The patch that fixes this bug also makes <caption> handling work when <caption>s are contained inside a <td>, a <tr>,
1180 a <th>, or various table section tags (<tbody>, <tfoot>, <thead>). The <caption> is pulled out and inserted just before
1181 the relevant ancestor table section. This behavior matches other browsers.
1185 * khtml/html/htmlparser.cpp:
1186 (KHTMLParser::insertNode):
1188 2004-08-04 David Hyatt <hyatt@apple.com>
1190 The top-level XSL sheet is now loaded and shows up in the activity window. It is not yet parsed.
1192 Reviewed by kocienda
1194 * WebCore.pbproj/project.pbxproj:
1195 * khtml/css/css_base.h:
1196 (DOM::StyleBaseImpl::isXSLStyleSheet):
1197 * khtml/css/css_stylesheetimpl.cpp:
1198 (CSSStyleSheetImpl::CSSStyleSheetImpl):
1199 * khtml/css/css_stylesheetimpl.h:
1200 (DOM::StyleSheetImpl::isLoading):
1201 * khtml/misc/loader.cpp:
1202 * khtml/xml/dom_xmlimpl.cpp:
1203 (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
1204 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1205 (DOM::ProcessingInstructionImpl::sheet):
1206 (DOM::ProcessingInstructionImpl::isLoading):
1207 (DOM::ProcessingInstructionImpl::setStyleSheet):
1208 * khtml/xml/dom_xmlimpl.h:
1210 2004-08-04 David Hyatt <hyatt@apple.com>
1212 Add XSL Stylesheets to the WebCore cache.
1214 Reviewed by kocienda
1216 * khtml/misc/loader.cpp:
1217 (CachedXSLStyleSheet::CachedXSLStyleSheet):
1218 (CachedXSLStyleSheet::ref):
1219 (CachedXSLStyleSheet::deref):
1220 (CachedXSLStyleSheet::data):
1221 (CachedXSLStyleSheet::checkNotify):
1222 (CachedXSLStyleSheet::error):
1223 (DocLoader::requestXSLStyleSheet):
1224 (Cache::requestXSLStyleSheet):
1225 (Cache::getStatistics):
1226 * khtml/misc/loader.h:
1227 (khtml::CachedObject::):
1228 (khtml::CachedXSLStyleSheet::sheet):
1229 (khtml::CachedXSLStyleSheet::schedule):
1231 2004-08-03 Ken Kocienda <kocienda@apple.com>
1235 Changes to improve our handling of object tags during editing, including
1238 <rdar://problem/3744533> Problem editing <OBJECT> elements displayed by WebPlugIns
1240 Part of the fix for this bug involves removing the close() function from render objects.
1241 It was decided that this code was no longer needed, as the work it did could be moved
1242 to other, more modern, places.
1246 <rdar://problem/3748537> crash due to nil node passed into parentNode in computeTypingStyle deleting text
1248 Finally, I filed and fixed this bug I discovered while fixing the one above:
1250 <rdar://problem/3749338> Select-all + delete leaves editing view without blinking caret
1252 * khtml/editing/htmlediting_impl.cpp:
1253 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Fix for 3748537. Put in some more null
1254 checks. Bail, returning 0 for typing style if any null checks yield a null.
1255 (khtml::DeleteSelectionCommandImpl::doApply): Fix for 3749338. A removeNodeAndPrune call may wind
1256 up deleting the node where we calculated that we wanted to put the selection after deleting.
1257 If this happens, move this ending selection to a sensible alternative.
1258 (khtml::RemoveNodeAndPruneCommandImpl::doApply): Call previousNodeConsideringAtomicNodes instead
1259 of traversePreviousNode when doing the prune.
1260 * khtml/html/html_objectimpl.cpp:
1261 (HTMLObjectElementImpl::attach): Part of the fix for 3744533.
1262 (HTMLObjectElementImpl::recalcStyle): Change old strcmp check for type of renderer to be a call
1263 to canRenderImageType.
1264 (HTMLObjectElementImpl::childrenChanged): New function. Helps to keep object tags up to date
1265 as their children change. This also will help to make object tags respond properly to having their
1266 params changed by DOM calls.
1267 * khtml/html/html_objectimpl.h: Cosmetic change.
1268 * khtml/html/htmlparser.cpp:
1269 (KHTMLParser::insertNode): Remove call to obsolete closeRenderer() function.
1270 (KHTMLParser::popOneBlock): Ditto.
1271 * khtml/rendering/render_block.cpp:
1272 (khtml::RenderBlock::makeChildrenNonInline): Remove call to obsolete close() function.
1273 * khtml/rendering/render_container.cpp:
1274 (RenderContainer::updatePseudoChild): Ditto.
1275 * khtml/rendering/render_form.cpp: Remove obsolete close() function.
1276 * khtml/rendering/render_form.h: Ditto.
1277 * khtml/rendering/render_frames.cpp: Ditto.
1278 * khtml/rendering/render_frames.h: Ditto.
1279 * khtml/rendering/render_inline.cpp:
1280 (RenderInline::splitFlow): Remove calls to obsolete close() function.
1281 * khtml/rendering/render_object.h: Remove obsolete close() function.
1282 * khtml/rendering/render_table.cpp:
1283 (RenderTableCell::layout): Ditto.
1284 * khtml/rendering/render_table.h: Ditto.
1285 * khtml/xml/dom_docimpl.cpp:
1286 (DocumentImpl::closeInternal): Remove call to obsolete close() function.
1287 * khtml/xml/dom_nodeimpl.cpp: Remove obsolete m_rendererNeedsClose initialization.
1288 (NodeImpl::NodeImpl): Remove obsolete closeRenderer() function.
1289 (NodeImpl::attach): Remove call to obsolete close() function.
1290 (NodeImpl::isAtomicNode): New function. Helps to fix 3744533. Determines if a node should
1291 be treated as an atomic node for the purposes of editing.
1292 (NodeImpl::previousNodeConsideringAtomicNodes): New helper to traverse tree taking atomic nodes
1294 (NodeImpl::nextNodeConsideringAtomicNodes): Ditto.
1295 (NodeImpl::previousLeafNode): Now calls nextNodeConsideringAtomicNodes to iterate. This helps to
1296 prevent deleting PARAM tag portions of object tags erroneously.
1297 (NodeImpl::nextLeafNode): Ditto.
1298 * khtml/xml/dom_nodeimpl.h: Removed m_rendererNeedsClose bit. Added declarations for new functions.
1299 * khtml/xml/dom_position.cpp:
1300 (DOM::Position::equivalentDeepPosition): Now takes atomic nodes into account as it drills down into the
1302 * khtml/xml/xml_tokenizer.cpp:
1303 (khtml::XMLTokenizer::endElement): Remove call to obsolete closeRenderer() function.
1305 2004-08-03 David Hyatt <hyatt@apple.com>
1307 Add the deprecated text/xsl MIME type (introduced by Internet Explorer 5) as an acceptable MIME type for XML
1312 * khtml/ecma/xmlhttprequest.cpp:
1313 (KJS::XMLHttpRequest::getValueProperty):
1314 * khtml/khtml_part.cpp:
1316 * khtml/misc/loader.cpp:
1317 (CachedXBLDocument::CachedXBLDocument):
1319 2004-08-03 Maciej Stachowiak <mjs@apple.com>
1323 - remove assertions that asserted text is non-empty, just avoid
1324 doing anything for the empty case; this is needed because input
1325 methods like to insert empty text in various cases.
1327 * khtml/editing/htmlediting_impl.cpp:
1328 (khtml::InsertTextCommandImpl::InsertTextCommandImpl):
1329 (khtml::InsertTextCommandImpl::doApply):
1330 (khtml::InsertTextCommandImpl::doUnapply):
1332 2004-08-03 Darin Adler <darin@apple.com>
1336 - fixed <rdar://problem/3740937> ER: A way to turn a DOMRange into text (equivalent of -innerText)
1338 * khtml/xml/dom2_rangeimpl.h: Added text function. Like innerText, but on a range.
1339 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::text): Added.
1341 * kwq/DOM.mm: (-[DOMRange _text]): Added. Calls DOM::RangeImpl::text.
1342 * kwq/DOMPrivate.h: Added.
1344 * WebCore.pbproj/project.pbxproj: Added DOMPrivate.h, an internal header (private in WebKit, internal here).
1346 2004-08-02 John Sullivan <sullivan@apple.com>
1350 WebCore part of fix for <rdar://problem/3631868> NSToolbar adoption:
1351 Tab key should cycle around toolbar and page content
1353 * kwq/WebCoreBridge.mm:
1354 (-[WebCoreBridge nextKeyViewInsideWebFrameViews]):
1355 Made this method start looking from the current focus node. This won't
1356 affect any existing callers because there were no existing callers.
1357 (-[WebCoreBridge previousKeyViewInsideWebFrameViews]):
1360 2004-08-02 David Hyatt <hyatt@apple.com>
1362 Create a #define for XSLT support that at the moment will only be enabled on Tiger.
1364 Reviewed by kocienda
1368 2004-08-02 Ken Kocienda <kocienda@apple.com>
1374 <rdar://problem/3747945> Deleting replaced element can cause crash
1376 * khtml/xml/dom_selection.cpp:
1377 (DOM::Selection::layoutCaret): The crux of the problem is that
1378 the caret drawing code tries to draw the caret at the image
1379 offset after it has been removed from the document. So, make
1380 sure the start node for the selection is in the document before
1381 trying to lay out the caret using that node.
1383 2004-07-31 Ken Kocienda <kocienda@apple.com>
1387 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
1388 <rdar://problem/3746408> HTMLCompose: cannot type in message body of new messages (and tabbing causes a crash.)
1390 * kwq/KWQKHTMLPart.mm:
1391 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Add in some smarts to look around for
1392 a good place to put the caret if focus is turning "on", the part is contentEditable,
1393 and it does not currently have a selection. This has the effect of flashing the caret
1394 in a contentEditable view automatically without requiring the programmer to set a
1395 selection explicitly. This also fixes the bug listed above. Both are cases where the
1396 bad behavior happened since the editing code tried to process input without an active
1397 selection. I always took the extra step of setting the selection explicitly when
1398 opening new windows in programs like Blot, but it seems silly to require developers to
1399 do this in general. With this patch, they no longer need to.
1401 2004-07-30 Ken Kocienda <kocienda@apple.com>
1407 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
1409 * khtml/xml/dom_selection.cpp:
1410 (DOM::Selection::layoutCaret): Don't bail when the start position of the selection is not in rendered
1411 content. The validate() bottleneck function will do all it can to make sure that the start is
1412 moved to rendered content if at all possible before this function runs. If no rendered position can
1413 be found, like in the case of an empty body element, we still want to flash the caret there.
1414 (DOM::Selection::validate): Look for rendered positions for the base and extent, but save off the
1415 base before making this move, and set the selection to the enclosing block flow element of this
1416 original base if no rendered positions can be found. This has the effect of flashing the caret
1417 someplace in an editable block, even if it does not contain any rendered content.
1419 2004-07-30 Ken Kocienda <kocienda@apple.com>
1423 Fix a large number of editing layout test regressions.
1425 * khtml/misc/khtml_text_operations.cpp:
1426 (khtml::TextIterator::TextIterator): Use a new way to compute the end offset of a node for
1427 purposes of text iteration. The end offset is either child count of a node with children,
1428 or the maxOffset() of a node that does not.
1429 * khtml/xml/dom_nodeimpl.cpp: Remove maxOffset() implementation from NodeBaseImpl. This
1430 conflicted with the usage of this function that is needed for editing.
1431 * khtml/xml/dom_nodeimpl.h: Ditto.
1433 2004-07-30 Trey Matteson <trey@apple.com>
1435 Next steps for spell checking: We have data structures for the marked pieces of
1436 text and the smarts to draw them (although at this point, they just get a green
1437 underline instead of using the real AppKit pattern.)
1439 Note we don't call this code outside of development, since at this point I suspect
1440 it could be made to crash by mixing spelling and editing.
1444 * khtml/rendering/render_text.cpp:
1445 (InlineTextBox::paintMarker): Paint one marker's intersection with a text run
1446 (RenderText::paint): Find intersections of all markers and runs, call paintMarker
1447 * khtml/rendering/render_text.h:
1448 * khtml/xml/dom_docimpl.cpp:
1449 (DocumentImpl::addMarker): Adds a marker to a DOM Range.
1450 (DocumentImpl::removeMarker): Removes a marker from a DOM Range.
1451 (DocumentImpl::addMarker): Adds a marker to a single DOM Node, merging previous
1453 (DocumentImpl::removeMarker): Removes a marker from a single DOM Node, breaking
1454 up previous markers as needed.
1455 (DocumentImpl::markersForNode): Return markers for a Node.
1456 * khtml/xml/dom_docimpl.h:
1457 (DOM::DocumentMarker::): New marker struct
1458 (DOM::DocumentMarker::operator == ):
1459 (DOM::DocumentMarker::operator != ):
1460 * kwq/KWQKHTMLPart.mm:
1461 (KWQKHTMLPart::advanceToNextMisspelling): Mark misspelled ranges when we find them.
1464 2004-07-29 Maciej Stachowiak <mjs@apple.com>
1468 <rdar://problem/3745808> Seed: WebKit: Table's caption broken
1470 * khtml/html/htmlparser.cpp:
1471 (KHTMLParser::insertNode): When a caption appears in an illegal
1472 place in a table, pop blocks until we hit a place where it's
1477 2004-07-29 Darin Adler <darin@apple.com>
1481 - added constants for motion across entire document for use in operations like
1482 move to beginning of document
1484 * khtml/xml/dom_selection.h: Added DOCUMENT to ETextGranularity.
1485 * khtml/xml/dom_selection.cpp:
1486 (DOM::Selection::modifyExtendingRightForward): Added case for DOCUMENT.
1487 (DOM::Selection::modifyMovingRightForward): Added case for DOCUMENT.
1488 (DOM::Selection::modifyExtendingLeftBackward): Added case for DOCUMENT.
1489 (DOM::Selection::modifyMovingLeftBackward): Added case for DOCUMENT.
1490 (DOM::Selection::validate): Changed if statements into switch statement,
1491 added case for DOCUMENT.
1493 * kwq/WebCoreBridge.h: Added WebCoreBridge to WebSelectionGranularity.
1495 2004-07-28 Trey Matteson <trey@apple.com>
1497 Small refinement of last checkin. The text iterators now return reasonable values
1498 for range() when atEnd, which gets rid of special cases and pitfalls in the client.
1502 * khtml/misc/khtml_text_operations.cpp:
1503 (khtml::TextIterator::TextIterator): Set endOffset to a valid value instead of
1505 (khtml::TextIterator::range): Implement when atEnd.
1506 (khtml::CharacterIterator::range): Don't massage result when atEnd.
1507 (khtml::WordAwareIterator::WordAwareIterator): Now that this is fixed, we no
1508 longer need this special case.
1509 (khtml::WordAwareIterator::advance): Always set range, even when atEnd, now that
1510 TextIterator::range() always works.
1511 * khtml/xml/dom_nodeimpl.cpp:
1512 (NodeImpl::childNodeCount): Made const
1513 (NodeBaseImpl::maxOffset): Add missing implementation
1514 * khtml/xml/dom_nodeimpl.h:
1515 * kwq/KWQKHTMLPart.mm:
1516 (KWQKHTMLPart::advanceToNextMisspelling): Get rid of special cases, always call
1517 range on our iterator even when it is atEnd.
1519 2004-07-28 Maciej Stachowiak <mjs@apple.com>
1523 <rdar://problem/3678534> controls on page at http://help.sap.com don't work properly
1525 To fix this I implemented the various JavaScript BarInfo properties in JavaScript.
1527 * khtml/ecma/kjs_window.cpp:
1529 (Window::locationbar):
1531 (Window::personalbar):
1532 (Window::statusbar):
1534 (Window::scrollbars):
1537 (SelectionFunc::tryCall):
1539 (BarInfo::~BarInfo):
1542 * khtml/ecma/kjs_window.h:
1545 (KJS::BarInfo::part):
1546 (KJS::BarInfo::classInfo):
1547 * khtml/ecma/kjs_window.lut.h:
1549 * kwq/KWQKHTMLPart.h:
1550 * kwq/KWQKHTMLPart.mm:
1551 (KWQKHTMLPart::locationbarVisible):
1552 (KWQKHTMLPart::menubarVisible):
1553 (KWQKHTMLPart::personalbarVisible):
1554 (KWQKHTMLPart::scrollbarsVisible):
1555 (KWQKHTMLPart::statusbarVisible):
1556 (KWQKHTMLPart::toolbarVisible):
1558 2004-07-28 Ken Kocienda <kocienda@apple.com>
1562 Added more layout tests.
1564 * layout-tests/editing/style/style-3681552-fix-001-expected.txt: Added.
1565 * layout-tests/editing/style/style-3681552-fix-001.html: Added.
1566 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Added.
1567 * layout-tests/editing/style/style-3681552-fix-002.html: Added.
1568 * layout-tests/editing/style/style-3690704-fix-expected.txt: Added.
1569 * layout-tests/editing/style/style-3690704-fix.html: Added.
1570 * layout-tests/editing/style/typing-style-001-expected.txt: Added.
1571 * layout-tests/editing/style/typing-style-001.html: Added.
1572 * layout-tests/editing/style/typing-style-002-expected.txt: Added.
1573 * layout-tests/editing/style/typing-style-002.html: Added.
1575 2004-07-28 Ken Kocienda <kocienda@apple.com>
1579 Added some layout tests.
1581 * layout-tests/editing/selection/select-all-001-expected.txt: Added.
1582 * layout-tests/editing/selection/select-all-001.html: Added.
1583 * layout-tests/editing/selection/select-all-002-expected.txt: Added.
1584 * layout-tests/editing/selection/select-all-002.html: Added.
1585 * layout-tests/editing/selection/select-all-003-expected.txt: Added.
1586 * layout-tests/editing/selection/select-all-003.html: Added.
1588 2004-07-28 Trey Matteson <trey@apple.com>
1590 Spellchecking, Part I. Basic spellcheck is working. Spelling panel is hooked up.
1592 At this point, no special marking of misspellings, no grammar check, no context
1593 menu integration, no "check continually" mode.
1595 Much of the TextIterator and CharacterIterator interface got published outside
1596 of khtml_text_operations.cpp, with a little API rationalizing.
1600 * khtml/misc/khtml_text_operations.cpp:
1601 (khtml::TextIterator::range): Name changes.
1602 (khtml::CharacterIterator::CharacterIterator): Ditto.
1603 (khtml::CharacterIterator::range): Ditto.
1604 (khtml::CharacterIterator::advance): Ditto.
1605 (khtml::CharacterIterator::string): New method to consume chars into a string.
1606 (khtml::WordAwareIterator::WordAwareIterator): New class that iterates over
1607 the text respecting word boundaries.
1608 (khtml::WordAwareIterator::advance):
1609 (khtml::WordAwareIterator::length):
1610 (khtml::WordAwareIterator::characters):
1611 (khtml::plainText): Name changes.
1612 (khtml::findPlainText): Ditto.
1614 API moved from cpp to header file.
1615 * khtml/misc/khtml_text_operations.h:
1616 (khtml::TextIterator::atEnd):
1617 (khtml::TextIterator::length):
1618 (khtml::TextIterator::characters):
1619 (khtml::CharacterIterator::atBreak):
1620 (khtml::CharacterIterator::atEnd):
1621 (khtml::CharacterIterator::length):
1622 (khtml::CharacterIterator::characters):
1623 (khtml::CharacterIterator::characterOffset):
1624 (khtml::WordAwareIterator::atEnd):
1625 (khtml::WordAwareIterator::range):
1627 * khtml/xml/dom_position.cpp:
1628 (DOM::Position::previousWordBoundary): New name for the old routine. This routines semantics
1629 match the current behavior of this code.
1630 (DOM::Position::nextWordBoundary): Ditto.
1631 (DOM::Position::previousWordPosition): Call old code with the new name. When we fix
1632 word advancement, this routine will have its own impl.
1633 (DOM::Position::nextWordPosition): Ditto.
1634 * khtml/xml/dom_position.h:
1635 * khtml/xml/dom_selection.h:
1636 (DOM::Selection::rangeStart): New convenience methods
1637 (DOM::Selection::rangeEnd):
1638 * kwq/KWQKHTMLPart.h:
1639 * kwq/KWQKHTMLPart.mm:
1640 (KWQKHTMLPart::findString): Ensure we use range-compatible positions.
1641 (KWQKHTMLPart::advanceToNextMisspelling): Brand new.
1642 * kwq/WebCoreBridge.h:
1643 * kwq/WebCoreBridge.mm:
1644 (-[WebCoreBridge advanceToNextMisspelling]): Typical bridge glue.
1646 2004-07-28 Ken Kocienda <kocienda@apple.com>
1652 <rdar://problem/3690704> marking partly bold text italic across blocks wrongly extends the bold section
1654 * khtml/editing/htmlediting_impl.cpp:
1655 (khtml::ApplyStyleCommandImpl::doApply): Fixed loop that gathers up groups of nodes to
1656 pass off to the function that applies styles. While this is meant to be conservative in
1657 order to leave the DOM well-formed in all cases, it contained an error where the set
1658 of nodes to be styled together erroneously could include a node that was meant for
1659 the next set. Fixed.
1660 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Unrelated change to remove DOM:: scope
1661 resolution qualifier. Unneeded here.
1663 2004-07-28 Darin Adler <darin@apple.com>
1667 - fixed <rdar://problem/3658471> REGRESSION: Node.appendChild( ) fails when parent already contains that child
1669 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::isAncestor): Restore the original meaning of this function.
1670 It returns true if the parameter is an ancestor of this, but had been changed to return true if this
1671 is an ancestor of the parameter. However, we do retain one change we made at the same time, which is
1672 that it does not consider a node an ancestor of itself.
1674 * khtml/editing/htmlediting_impl.cpp: (khtml::ApplyStyleCommandImpl::nodeFullySelected):
1675 * khtml/xml/dom2_traversalimpl.cpp: (DOM::NodeIteratorImpl::notifyBeforeNodeRemoval):
1676 Reverse parameters for callers who wanted the new meaning of isAncestor, with care to not use it in
1677 any cases where the pointer might be 0.
1679 * khtml/xml/dom_nodeimpl.h: Added const to the parameter to make things more symmetric and allow the
1680 new uses to all compile.
1682 2004-07-28 Ken Kocienda <kocienda@apple.com>
1688 <rdar://problem/3681552> html editing needs to preserve typing font when replacing selection
1690 * khtml/css/css_valueimpl.cpp:
1691 (CSSStyleDeclarationImpl::merge): New helper that merges styles together. Helpful for
1692 dealing with typing styles.
1693 * khtml/css/css_valueimpl.h:
1694 * khtml/editing/htmlediting_impl.cpp:
1695 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): New helper that updates the
1696 typing style based on the current selection. This is a convenient bottleneck for all
1697 the code that needs to worry about typing style.
1698 (khtml::DeleteSelectionCommandImpl::doApply): Update typing style before doing the delete.
1699 (khtml::InputNewlineCommandImpl::doApply): No need to redeclare exceptionCode local.
1701 (khtml::InputTextCommandImpl::prepareForTextInsertion): Remove unneeded complication when
1702 figuring out where to insert style node. Not even sure what I was trying to do here, but
1703 it does not seem to be needed any more.
1704 (khtml::InputTextCommandImpl::execute): Remove unneeded comment.
1705 * khtml/editing/htmlediting_impl.h: Declare new computeTypingStyle helper.
1706 * khtml/khtml_part.cpp:
1707 (KHTMLPart::setCaretVisible): Call selectionLayoutChanged instead of notifySelectionChanged
1708 in this function. The selection did not change simply by calling this function, but it
1710 (KHTMLPart::notifySelectionChanged): Treat clearing the typing style much like closing typing,
1711 instead of clearing it unconditionally.
1712 (KHTMLPart::applyStyle): In the case where the current selection is a caret, merge the
1713 style being applied with any current typing style that already exists.
1715 2004-07-28 Darin Adler <darin@apple.com>
1719 - fixed <rdar://problem/3711080> REGRESSION (125-146): form fields have shrunk by 1 pixel, and now clip descenders
1721 * kwq/KWQLineEdit.mm: (QLineEdit::sizeForCharacterWidth):
1722 Compute the size without ever calling cellSize. After talking with Andrew Platzer,
1723 we decided that hard-coding the size of the borders of a text field was the best
1724 way for WebCore to handle this.
1726 2004-07-28 Darin Adler <darin@apple.com>
1730 - fixed <rdar://problem/3743204> REGRESSION: crash at startribune.com in InlineBox::root()
1732 * khtml/rendering/render_flow.cpp: (RenderFlow::dirtyLinesFromChangedChild):
1733 Added a check for nil.
1735 2004-07-27 Darin Adler <darin@apple.com>
1739 - fixed <rdar://problem/3743138> opaque colors come out of getComputedStyle as "rgba", transparent ones as "rgb"
1741 * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cssText): Use "rgb" rather than
1742 "rgba" when alpha is 0xFF, not when alpha is 0.
1744 2004-07-27 Ken Kocienda <kocienda@apple.com>
1748 Fixed the problem where BR elements on lines by themselves don't paint when selected.
1750 * khtml/khtml_part.cpp:
1751 (KHTMLPart::selectAll): Related fix. Include BR's when figuring out what "all" is.
1752 * khtml/rendering/render_br.cpp:
1753 (RenderBR::paint): New function implementation. Teach BR's how to paint selections.
1754 * khtml/rendering/render_br.h:
1755 * khtml/rendering/render_text.cpp:
1756 (InlineTextBox::paintSelection): Fix some geometry calculations to be more readable (i.e. don't
1757 reuse function argument as a local). Also, improve the logic for determining whether to
1758 extend the selection to block boundaries.
1759 (RenderText::paint): Remove extendSelection argument from paintSelection. The logic to figure out
1760 extensions is now fully contained in paintSelection.
1761 * khtml/rendering/render_text.h:
1763 2004-07-27 David Hyatt <hyatt@apple.com>
1765 Fix for 3665211 (again). Make sure not to leave child line boxes pointing to deleted ancestor line boxes.
1767 Reviewed by kocienda
1769 * khtml/rendering/render_block.cpp:
1770 (khtml::RenderBlock::removeChild):
1772 2004-07-26 Chris Blumenberg <cblu@apple.com>
1774 Fixed: WebView scrolls to the top after making an editing change via drag & drop
1776 Fixed by Ken, reviewed by me.
1778 * kwq/WebCoreBridge.mm:
1779 (-[WebCoreBridge ensureCaretVisible]): do nothing if the selection is not a caret
1783 2004-07-26 Maciej Stachowiak <mjs@apple.com>
1787 <rdar://problem/3740855> REGRESSION: Flash incorrectly positioned at macromedia.com
1789 * khtml/html/htmltokenizer.cpp:
1790 (khtml::HTMLTokenizer::scriptExecution): Do the prepending-src
1791 trick as for inline script execution.
1793 Added new layout tests covering this and other recent tokenizer
1796 * layout-tests/fast/tokenizer/001-expected.txt: Added.
1797 * layout-tests/fast/tokenizer/001.html: Added.
1798 * layout-tests/fast/tokenizer/002-expected.txt: Added.
1799 * layout-tests/fast/tokenizer/002.html: Added.
1800 * layout-tests/fast/tokenizer/003-expected.txt: Added.
1801 * layout-tests/fast/tokenizer/003.html: Added.
1802 * layout-tests/fast/tokenizer/resources/003-script.js: Added.
1804 2004-07-23 Ken Kocienda <kocienda@apple.com>
1810 <rdar://problem/3738920> Caret blinks in inactive window
1812 As part of the fix, I cleaned up the way we handle special drawing that needs
1813 to be done in the HTML view that is first responder in the key window (e.g the
1814 drawing of text selection highlight and caret blinking).
1816 * khtml/khtml_part.cpp: Removed setCaretVisible function. Updating caret visibility
1817 is now done in setDisplaysWithFocusAttributes, described below.
1818 * khtml/khtml_part.h: Ditto.
1819 * khtml/khtmlpart_p.h:
1820 (KHTMLPartPrivate::KHTMLPartPrivate): m_caretVisible now defaults to false. This prevents
1821 the caret from blinking when an app is started from the command line and remains in the
1823 * khtml/khtmlview.cpp:
1824 (KHTMLView::focusInEvent): Remove caret code from here. Not needed.
1825 (KHTMLView::focusOutEvent): Ditto.
1826 * kwq/KWQKHTMLPart.h:
1827 (KWQKHTMLPart::displaysWithFocusAttributes): New accessor to return cached value to other code
1829 * kwq/KWQKHTMLPart.mm:
1830 (KWQKHTMLPart::KWQKHTMLPart):
1831 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Renamed from setShowsFirstResponder and modified
1832 to do the display updating in a clearer way....and now has comments!
1833 * kwq/WebCoreBridge.h: Remove several obsolete functions that use to try to do the work of the new
1834 setDisplaysWithFocusAttributes function (and did so less well).
1835 * kwq/WebCoreBridge.mm:
1836 (-[WebCoreBridge drawRect:]): Now calls displaysWithFocusAttributes to figure out how to draw the
1837 text selection background.
1838 (-[WebCoreBridge setDisplaysWithFocusAttributes:]): Calls through to setDisplaysWithFocusAttributes in
1840 (-[WebCoreBridge selectionColor]): Flipped the value of this ternary expression to accommodate the
1841 change from usesInactiveTextBackgroundColor to setDisplaysWithFocusAttributes.
1842 (-[WebCoreBridge setCaretVisible:]): Removed.
1844 2004-07-23 John Sullivan <sullivan@apple.com>
1848 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
1849 now also extends selection (even if there wasn't one before)
1851 * khtml/khtml_part.cpp:
1852 (KHTMLPart::handleMousePressEventSingleClick):
1853 Uh, duh. Got a ! wrong last time somehow, so it did even more the wrong thing
1854 than ever. I did test this before, so my best guess is an accidental undo or
1855 something before committing.
1857 2004-07-23 David Hyatt <hyatt@apple.com>
1859 Fix for 3735084 and 3737209, when you can find no line boxes in your previous sibling, the line box to dirty
1860 should be the *first* line box and not the last.
1862 Reviewed by kocienda
1864 * khtml/rendering/render_flow.cpp:
1865 (RenderFlow::dirtyLinesFromChangedChild):
1867 2004-07-23 Ken Kocienda <kocienda@apple.com>
1871 * khtml/xml/dom_selection.cpp:
1872 (DOM::Selection::validate): Not exactly a fix of anything per se, but more of a refinement
1873 of how selection validation works. The idea is to let the selection validation process
1874 end up with an empty selection given real DOM position inputs if the validation code
1875 cannot find a rendered position. Since selection is all about display, this makes sense.
1876 Currently, the code will allow the selection to be placed in a location that is not
1877 rendered, and this does nobody any good, as it can lead to bugs like accepting key input
1878 in a div that is set to display:none.
1880 2004-07-23 Ken Kocienda <kocienda@apple.com>
1884 Updated layout tests with new expected results.
1886 * layout-tests/editing/execCommand/boldSelection-expected.txt
1887 * layout-tests/editing/selection/extend-by-character-001-expected.txt
1888 * layout-tests/editing/selection/extend-by-character-003-expected.txt
1889 * layout-tests/editing/selection/unrendered-005-expected.txt
1891 2004-07-22 Maciej Stachowiak <mjs@apple.com>
1895 <rdar://problem/3725467> REGRESSION(140-142) nothing displayed at http://Ye-Olde-Movies.tripod.com
1896 <rdar://problem/3599494> REGRESSION (100-125): Frame does not refresh until user clicks on browser.
1898 * khtml/rendering/render_frames.cpp:
1899 (RenderFrameSet::layout): When returning early because there are
1900 no children, make sure to mark self as no longer needing
1901 layout. Otherwise, when children are added, we'll fail to
1902 propagate childrenNeedLayout to our own parent! This is almost
1903 certainly a long-standing bug that was just masked by our old
1906 2004-07-22 Kevin Decker <kdecker@apple.com>
1910 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1912 * khtml/ecma/kjs_events.cpp:
1913 (JSLazyEventListener::JSLazyEventListener):
1914 (JSLazyEventListener::parseCode):
1915 * khtml/ecma/kjs_events.h:
1916 * khtml/ecma/kjs_proxy.cpp:
1917 (KJSProxyImpl::createHTMLEventHandler):
1918 * khtml/ecma/kjs_window.cpp:
1919 (Window::getJSLazyEventListener):
1920 * khtml/ecma/kjs_window.h:
1922 2004-07-22 Ken Kocienda <kocienda@apple.com>
1928 <rdar://problem/3724344> Bolding and unbolding creates extraneous tags
1930 * khtml/editing/htmlediting_impl.cpp:
1931 (khtml::ApplyStyleCommandImpl::doApply): Move the start of the selection upstream
1932 before calling removeStyle. This makes sure we remove all styles that could apply to the
1933 selection, and not just ones in from the start position of the selection passed to us.
1935 * khtml/xml/dom_selection.cpp:
1936 (DOM::Selection::validate): Related fix to "constrain" the selection to be the
1937 smallest equivalent range of nodes, in effect making a "canonical" version of the
1938 selection. While this is not strictly necessary to fix the bug, it is a step I have been
1939 wanting to take this step for a long time, and some recent improvements made it
1940 possible for me to do now in just two lines of code.
1942 2004-07-22 Ken Kocienda <kocienda@apple.com>
1948 <rdar://problem/3711264> difficult (impossible?) to get cursor in an editable webview containing only tags
1950 * khtml/rendering/render_container.cpp:
1951 (RenderContainer::positionForCoordinates): Don't assume you can pass off
1952 the check to a first child if there is one, since the child can be an element
1953 we do not want to place the caret in, like a table row with no cells (the case
1954 in the bug above). So now, we iterate of the renderer's children looking for
1955 the closest one, but only consider those renderers which either have children
1956 themselves, or are render block flows or are render inlines.
1958 2004-07-22 Darin Adler <darin@apple.com>
1960 - remove a bunch of now-unused code
1962 * ForwardingHeaders/qxml.h: Removed.
1963 * kwq/KWQXmlAttributes.h: Removed.
1964 * kwq/KWQXmlAttributes.mm: Removed.
1965 * kwq/KWQXmlDefaultHandler.h: Removed.
1966 * kwq/KWQXmlDefaultHandler.mm: Removed.
1967 * kwq/KWQXmlSimpleReader.h: Removed.
1968 * kwq/KWQXmlSimpleReader.mm: Removed.
1970 2004-07-22 Darin Adler <darin@apple.com>
1974 - got rid of QXml classes and changed XML parsing to use libxml directly
1976 This is the first step toward more direct use of libxml and libxslt.
1977 Dave is planning to build on this to implement XSLT and to improve our handling
1978 of XML documents (faster and more feature complete, including DTDs).
1980 * khtml/html/html_elementimpl.cpp:
1981 (HTMLElementImpl::createContextualFragment):
1982 * khtml/html/htmltokenizer.cpp:
1983 (khtml::HTMLTokenizer::HTMLTokenizer):
1984 * khtml/html/htmltokenizer.h:
1985 * khtml/xml/dom_docimpl.cpp:
1986 (DocumentImpl::createTokenizer):
1987 (DocumentImpl::open):
1988 * khtml/xml/dom_docimpl.h:
1989 (DOM::DocumentImpl::tokenizer):
1990 * khtml/xml/dom_xmlimpl.cpp:
1991 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1992 * khtml/xml/dom_xmlimpl.h:
1993 * khtml/xml/xml_tokenizer.h:
1994 * khtml/xml/xml_tokenizer.cpp: Redid this all to use libxml directly.
1996 * WebCore.pbproj/project.pbxproj: Removed a bunch of files.
1998 2004-07-21 Trey Matteson <trey@apple.com>
2000 DHTML dragging should use UTI for MIME-pboard type conversion
2004 * kwq/KWQClipboard.mm:
2005 (cocoaTypeFromMIMEType): Use UTI, except for cases we need to hardwire. Only cut off
2006 MIME args following a semi-colon for text/plain.
2007 (MIMETypeFromCocoaType): Use UTI, except for cases we need to hardwire.
2008 (KWQClipboard::types): Filter out ancient NSAsciiPboardType so DHTML never sees this cruft.
2010 2004-07-21 Ken Kocienda <kocienda@apple.com>
2014 Remove handling of HTML editing key events from WebCore.
2015 This now happens in WebKit if an event passes all the
2016 way through WebCore without being handled by the DOM.
2018 In each case below, function were removed, as their
2019 only purpose was to handle editing key events.
2021 * khtml/xml/dom_elementimpl.cpp
2022 * khtml/xml/dom_elementimpl.h
2023 * kwq/KWQKHTMLPart.h
2024 * kwq/KWQKHTMLPart.mm
2025 * kwq/WebCoreBridge.h
2027 2004-07-21 Ken Kocienda <kocienda@apple.com>
2031 * khtml/xml/dom_selection.cpp:
2032 (DOM::Selection::modifyExtendingRightForward): Add LINE_BOUNDARY case to the switch statement in this
2033 function. Use the startAndEndLineNodesIncludingNode helper which already existed to get the right
2035 (DOM::Selection::modifyMovingRightForward): Ditto
2036 (DOM::Selection::modifyExtendingLeftBackward): Ditto
2037 (DOM::Selection::modifyMovingLeftBackward): Ditto
2038 * khtml/xml/dom_selection.h:
2039 (DOM::Selection::): Add LINE_BOUNDARY constant to ETextGranularity enum. This
2040 specifies a new kind of movement that we need to implement the "move-to beggining/end of line"
2041 behavior which AppKit binds to cmd+left/right arrow keys.
2042 * kwq/WebCoreBridge.h: Add WebSelectToLineBoundary constant. This matches
2044 2004-07-20 David Hyatt <hyatt@apple.com>
2046 Fix for 3714434, user stylesheet is always parsed in strict mode, when it should honor the document's setting.
2050 * khtml/css/cssstyleselector.cpp:
2051 (khtml::CSSStyleSelector::CSSStyleSelector):
2053 2004-07-20 Ken Kocienda <kocienda@apple.com>
2057 * khtml/xml/dom_elementimpl.cpp:
2058 (ElementImpl::defaultEventHandler): No longer check whether
2059 the command key is modifying the key event. This check is
2060 now done elsewhere in the code. See the WebKit checkin that
2061 added the _web_keyBindingManagerHasBinding method to
2064 2004-07-20 Chris Blumenberg <cblu@apple.com>
2067 <rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
2068 <rdar://problem/3612691> Missing image icons (blue ?) lack context menu
2072 * kwq/WebCoreBridge.mm:
2073 (-[WebCoreBridge elementAtPoint:]): if there is no image, put the image URL on the element anyway
2075 2004-07-20 David Hyatt <hyatt@apple.com>
2077 Fix for alt text not working on images.
2081 * khtml/rendering/render_image.cpp:
2082 (RenderImage::RenderImage):
2083 (RenderImage::setPixmap):
2084 (RenderImage::paint):
2085 (RenderImage::calcReplacedWidth):
2086 (RenderImage::calcReplacedHeight):
2088 2004-07-20 Maciej Stachowiak <mjs@apple.com>
2092 <rdar://problem/3720111> REGRESSION(125-152): map fails to load depending on banner ad; weather.com (works in IE and Firefox)
2094 * khtml/html/htmltokenizer.cpp:
2095 (khtml::HTMLTokenizer::begin): Initialize currentPrependingSrc.
2096 (khtml::HTMLTokenizer::scriptHandler): Store a pointer to the currently
2097 active prependingSrc variable on the stack, the better to handle weird cases
2098 of scripts writing out additional script tags and so forth.
2099 (khtml::HTMLTokenizer::write): Deal with the above.
2100 * khtml/html/htmltokenizer.h: Declare new member field.
2102 2004-07-20 David Hyatt <hyatt@apple.com>
2104 Fix for layer positioning error that occurs when absolute positioned blocks are inside static positioned overflow:auto
2109 * khtml/rendering/render_layer.cpp:
2110 (RenderLayer::updateLayerPosition):
2112 2004-07-20 Trey Matteson <trey@apple.com>
2114 3705624 REGRESSION: can't rearrange photos on homepage.mac.com album
2116 A subtle problem stemming from some interaction between focus handing and
2117 event propagation. We previously made it so when a focus shift fails we
2118 don't propagate the event to KHTML. The fix is to get rid of the inverse
2119 effect, so now even if a focus shift succeeds, we don't propagate to KHTML if
2120 the page already canceled default behavior.
2122 In this specific case, the page is cancelling default behavior since it
2123 does its own dragging, and the bug was our new system dragging was
2128 * khtml/khtmlview.cpp:
2129 (KHTMLView::dispatchMouseEvent): What he said.
2131 2004-07-20 Ken Kocienda <kocienda@apple.com>
2137 <rdar://problem/3695240> pasting plain text with newlines in it turns them into spaces
2139 * kwq/WebCoreBridge.mm:
2140 (-[WebCoreBridge documentFragmentWithText:]): Refine this function to be smart about converting
2141 line endings into BR elements.
2143 2004-07-20 Ken Kocienda <kocienda@apple.com>
2149 <rdar://problem/3707505> HTMLCompose: blinking cursor in both an address text field and the message body
2151 * khtml/khtml_part.cpp:
2152 (KHTMLPart::setCaretVisible): This method renamed from setSelectionVisible. Since it really only operates
2153 on the caret, this seems like a better name.
2154 * khtml/khtml_part.h:
2155 * khtml/khtmlview.cpp:
2156 (KHTMLView::focusInEvent): Call setCaretVisible(true)
2157 (KHTMLView::focusOutEvent): Call setCaretVisible(false)
2158 * kwq/KWQKHTMLPart.mm:
2159 (KWQKHTMLPart::setShowsFirstResponder): Name change: setSelectionVisible becomes setCaretVisible.
2160 * kwq/WebCoreBridge.h: Expose setCaretVisible as a bridge method.
2161 * kwq/WebCoreBridge.mm:
2162 (-[WebCoreBridge setCaretVisible:]): Ditto.
2164 2004-07-19 Maciej Stachowiak <mjs@apple.com>
2168 <rdar://problem/3721428> REGRESSION (125.8-146): external javascript statements produce extra garbage character (sina.com)
2170 * khtml/misc/stringit.h:
2171 (khtml::TokenizerSubstring::TokenizerSubstring): For the apple branch, use the new
2172 stableUnicode() method to get the unicode pointer.
2175 (QString::detachIfInternal): Reorganize this to be a bit less wacky about refcounts.
2176 It does not leave around a zombie internal data handle but rather destroys it right away,
2177 and leaves the object pointing to the new handle (which it can then deref). This makes
2178 the code more clear.
2179 (QString::~QString): Simplify.
2180 (QString::stableUnicode): New method that detaches a copy of the KWQStringData if it
2181 is internal to a string besides this one. This guarantees that if you get the unicode()
2182 pointer, it won't go bad so long as this string is still alive.
2184 2004-07-19 David Hyatt <hyatt@apple.com>
2186 Fix for 3715117, crash from a bug in removeChildren. Clean up node removal and fix an n-squared removal
2187 bug. Also clean up checks in removeChild and in the dispatch of removedFromDocument mutation events to
2188 make node removal more efficient.
2190 Reviewed by kocienda
2192 * khtml/xml/dom_nodeimpl.cpp:
2194 2004-07-19 John Sullivan <sullivan@apple.com>
2198 - fixed <rdar://problem/3141150> can't undo in form textarea fields
2200 * kwq/KWQTextArea.mm:
2201 (-[KWQTextArea _createTextView]):
2202 call setAllowsUndo:YES. My, wasn't this easy?
2204 2004-07-19 David Hyatt <hyatt@apple.com>
2206 Merge @import fix for CSS1 test suite from Stephan Kulow.
2210 * khtml/css/parser.cpp:
2211 * khtml/css/parser.y:
2212 * layout-tests/css1/basic/containment-expected.txt:
2214 2004-07-19 David Hyatt <hyatt@apple.com>
2216 Fix for 3718697, crash clicking on JS tab at alaskaair.com.
2218 Reviewed by kocienda
2220 * khtml/rendering/render_flow.cpp:
2221 (RenderFlow::detach):
2222 (RenderFlow::dirtyLinesFromChangedChild):
2223 * khtml/rendering/render_flow.h:
2224 * khtml/rendering/render_object.cpp:
2225 (RenderObject::dirtyLinesFromChangedChild):
2226 * khtml/rendering/render_object.h:
2228 2004-07-16 David Hyatt <hyatt@apple.com>
2230 Fix for 3726471, need to ensure that it's safe to do updateRendering from within layout, since isContentEditable
2231 relies on it. The fix is to just recalcStyle up front before beginning the layout, so that all of our renderobjects
2236 * khtml/khtmlview.cpp:
2237 (KHTMLView::layout):
2239 2004-07-16 Ken Kocienda <kocienda@apple.com>
2245 <rdar://problem/3722153> Random crash while typing (DOM::NodeImpl::parentNode (this=0x0))
2247 * khtml/editing/htmlediting_impl.cpp:
2248 (khtml::DeleteSelectionCommandImpl::doApply): This check merely makes the code
2249 more robust. I do not understand how Grant ended up with null start or end
2250 blocks in the case of his bug report, but by adding two null checks, the code is
2251 now hardened a bit in case it happens again.
2253 2004-07-16 Ken Kocienda <kocienda@apple.com>
2259 <rdar://problem/3730785> Crash when arrow navigation goes to empty table cell
2260 <rdar://problem/3730790> Caret does not blink when placed in empty table cell
2262 * khtml/rendering/render_block.cpp:
2263 (khtml::RenderBlock::paintObject): Caret node's renderer might be this block, so
2264 don't block the painting of the caret in this case. This was the case in 3730790.
2265 We had the right geometry for the caret but blocked its painting.
2266 * khtml/xml/dom_position.cpp:
2267 (DOM::Position::previousLinePosition): Rework the logic here. This function asserted
2268 that the new position we would navigate to had a line box, but empty table cells, for
2269 instance will not. So, deal with this situation as well. The end result is a
2270 function that worked like it did before in cases where the previous line position has
2271 a line box, but now also will allow navigation to work when it does not.
2272 (DOM::Position::nextLinePosition): Ditto.
2274 2004-07-16 Ken Kocienda <kocienda@apple.com>
2280 <rdar://problem/3687216> editable inline causes crash when focused
2282 * khtml/xml/dom_docimpl.cpp:
2283 (DocumentImpl::relinquishesEditingFocus): Add null check for rootEditableElement.
2284 (DocumentImpl::acceptsEditingFocus): Ditto.
2286 2004-07-16 David Hyatt <hyatt@apple.com>
2288 Fix for 3709337, crash when using display: compact. Need to make sure that the isCompact() check in bidi.cpp is
2289 also checking for RenderBlocks, since otherwise you match text nodes (and that's just wrong).
2291 Reviewed by kocienda
2293 * khtml/rendering/bidi.cpp:
2294 (khtml::RenderBlock::layoutInlineChildren):
2298 2004-07-15 David Hyatt <hyatt@apple.com>
2300 Fix for 3625611, images offset on first visit to page. The method for determining the last clean line was
2301 flawed and would incorrectly miss dirty lines that occurred after the first clean line.
2305 * khtml/rendering/bidi.cpp:
2306 (khtml::RenderBlock::determineEndPosition):
2308 2004-07-15 Ken Kocienda <kocienda@apple.com>
2313 <rdar://problem/3587601> reproducible assertion failure in Blot deleting text, then image at Yahoo.com
2315 * khtml/editing/htmlediting_impl.cpp:
2316 (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): Relax assertion
2317 that nodes are text nodes during the walk of eligible nodes that could possibly be
2318 deleted. Change the assertion to an conditional check for text nodes. We may have
2319 unrendered nodes in the mix here (as is the case in the bug where the assertion
2320 failed on an AREA element), and the conditional check is sufficient to
2321 skip them while leaving the delete logic we want unperturbed.
2323 2004-07-14 Ken Kocienda <kocienda@apple.com>
2327 * khtml/rendering/render_block.cpp:
2328 (khtml::RenderBlock::paintObject): Add null check on DOM node before
2329 asking if it is contentEditable.
2331 2004-07-14 David Hyatt <hyatt@apple.com>
2333 Fix for 3595073, setting innerHTML on a <table> should work.
2337 * khtml/html/html_elementimpl.cpp:
2338 (HTMLElementImpl::createContextualFragment):
2340 2004-07-14 Ken Kocienda <kocienda@apple.com>
2344 Updated these layout tests as a result of the last patch.
2345 These results are better.
2347 * layout-tests/editing/execCommand/selectAll-expected.txt
2348 * layout-tests/editing/selection/extend-by-character-006-expected.txt
2349 * layout-tests/editing/selection/unrendered-001-expected.txt
2350 * layout-tests/editing/selection/unrendered-003-expected.txt
2352 2004-07-14 Ken Kocienda <kocienda@apple.com>
2356 * khtml/rendering/render_block.cpp:
2357 (khtml::RenderBlock::paintObject): Change back to start() from caretPosition().
2358 Since the policy is now to move the selection to rendered content, if possible,
2359 when the selection is set, there is no longer any reason to have the additional
2360 caretPosition() function to store where the caret should be drawn.
2361 * khtml/xml/dom_docimpl.cpp:
2362 (DocumentImpl::updateSelection): No longer any need to call closestRenderedPosition here.
2363 This is done in Selection::validate.
2364 * khtml/xml/dom_position.cpp:
2365 (DOM::Position::closestRenderedPosition): Improved algorithm. Now much simpler.
2366 * khtml/xml/dom_selection.cpp:
2367 (DOM::Selection::Selection): caretPosition() and m_caretPosition now obsolete.
2368 (DOM::Selection::init): Ditto.
2369 (DOM::Selection::modifyExtendingRightForward): No longer any need to call
2370 closestRenderedPosition here. This is done in Selection::validate.
2371 (DOM::Selection::modifyMovingRightForward): Ditto.
2372 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
2373 (DOM::Selection::modifyMovingLeftBackward): Ditto.
2374 (DOM::Selection::layoutCaret): Ditto.
2375 (DOM::Selection::validate): Add code to move the selection to rendered content if possible.
2376 * khtml/xml/dom_selection.h: caretPosition() and m_caretPosition now obsolete.
2378 2004-07-14 David Hyatt <hyatt@apple.com>
2380 Fix for 3716082, assert when you dynamically remove float or position styles.
2384 * khtml/rendering/render_object.cpp:
2385 (RenderObject::setStyle):
2387 2004-07-14 David Hyatt <hyatt@apple.com>
2389 Fix for various table regressions (malumovies.com and cityofheroes.gameamp.com) involving bungling of
2392 Reviewed by kocienda
2394 * khtml/rendering/render_box.cpp:
2395 (RenderBox::calcPercentageHeight):
2396 (RenderBox::availableHeightUsing):
2397 * khtml/rendering/render_table.cpp:
2398 (RenderTable::layout):
2399 (RenderTableSection::calcRowHeight):
2400 (RenderTableSection::layoutRows):
2401 (RenderTableCell::updateFromElement):
2402 * khtml/rendering/render_table.h:
2404 2004-07-14 Ken Kocienda <kocienda@apple.com>
2408 * khtml/xml/dom_position.cpp:
2409 (DOM::Position::equivalentDeepPosition): New helper function to improve selection handling.
2410 Soon, I plan to land some changes that use this new function.
2411 * khtml/xml/dom_position.h:
2413 2004-07-14 Ken Kocienda <kocienda@apple.com>
2417 * WebCore-combined.exp: Added QString.at symbol to tests exports to facilitate debugging
2418 data formatting change that is to come.
2419 * WebCore-tests.exp:
2421 2004-07-13 John Sullivan <sullivan@apple.com>
2425 - fixed <rdar://problem/3705500> REGRESSION (125.8-146): Cmd-E on an
2426 HTML page puts a trailing space on Find pasteboard
2428 * khtml/misc/khtml_text_operations.cpp:
2429 (khtml::TextIterator::handleTextBox):
2430 In the case where a subrun doesn't extend to the end of the text box,
2431 the well-commented code was supposed to return from this routine, but
2432 the wrong variable was being compared. This would send us through another
2433 pass of the loop, which would end up worrying about collapsed space at the
2434 end of the current box, even though we only cared about the beginning of the
2437 2004-07-12 Richard Williamson <rjw@apple.com>
2439 Fixed 3717982. Implemented navigator.language!
2443 * khtml/ecma/kjs_navigator.cpp:
2444 (Navigator::getValueProperty):
2446 2004-07-12 Ken Kocienda <kocienda@apple.com>
2450 * khtml/xml/dom_position.cpp:
2451 (DOM::Position::inRenderedContent): I broke selection drawing with my last patch. This
2452 function is now used in selection drawing, and it was making an unneeded check to see
2453 that content was editable to answer whether or not is was rendered. Bad. Fixed.
2455 2004-07-12 David Hyatt <hyatt@apple.com>
2457 Fix for 3621138, crash on hrweb.apple.com. Make sure that in the case where objects get pulled up from merging
2458 blocks that we just delete all line boxes.
2460 Reviewed by kocienda
2462 * khtml/rendering/render_block.cpp:
2463 (khtml::RenderBlock::removeChild):
2465 2004-07-10 Maciej Stachowiak <mjs@apple.com>
2469 <rdar://problem/3706080>: (REGRESSION (125.8-147u): Nested <ul> do not display bullets)
2470 <rdar://problem/3676376>: (Second level bullets not printed when printing Xcode release notes)
2473 * kwq/KWQPainter.mm:
2474 (CGColorFromNSColor):
2475 (QPainter::drawEllipse):
2476 (QPainter::setShadow):
2478 2004-07-12 Ken Kocienda <kocienda@apple.com>
2482 Added new editing-related layout tests
2484 * layout-tests/editing/deleting/delete-after-span-ws-001-expected.txt: Added.
2485 * layout-tests/editing/deleting/delete-after-span-ws-001.html: Added.
2486 * layout-tests/editing/deleting/delete-after-span-ws-002-expected.txt: Added.
2487 * layout-tests/editing/deleting/delete-after-span-ws-002.html: Added.
2488 * layout-tests/editing/deleting/delete-after-span-ws-003-expected.txt: Added.
2489 * layout-tests/editing/deleting/delete-after-span-ws-003.html: Added.
2490 * layout-tests/editing/selection/unrendered-001-expected.txt: Added.
2491 * layout-tests/editing/selection/unrendered-001.html: Added.
2492 * layout-tests/editing/selection/unrendered-002-expected.txt: Added.
2493 * layout-tests/editing/selection/unrendered-002.html: Added.
2494 * layout-tests/editing/selection/unrendered-003-expected.txt: Added.
2495 * layout-tests/editing/selection/unrendered-003.html: Added.
2496 * layout-tests/editing/selection/unrendered-004-expected.txt: Added.
2497 * layout-tests/editing/selection/unrendered-004.html: Added.
2498 * layout-tests/editing/selection/unrendered-005-expected.txt: Added.
2499 * layout-tests/editing/selection/unrendered-005.html: Added.
2500 * layout-tests/traversal/node-iterator-008-expected.txt: Added.
2501 * layout-tests/traversal/node-iterator-008.html: Added.
2502 * layout-tests/traversal/tree-walker-005-expected.txt: Added.
2503 * layout-tests/traversal/tree-walker-005.html: Added.
2505 2004-07-12 Ken Kocienda <kocienda@apple.com>
2509 Fixes for these bugs:
2511 <rdar://problem/3723359> Extending then "unextending" selection with arrow keys should draw caret but doesn't
2512 <rdar://problem/3724626> White-space deletion code deletes wrong character when space follows span
2514 * khtml/editing/htmlediting_impl.cpp:
2515 (khtml::DeleteSelectionCommandImpl::doApply): Modify special-case white-space deletion code so it runs
2516 only in the special case. It was throwing its net too widely, catching the case described in 3724626.
2517 By tightening up the special-case white-space deletion, and allowing the more general-purpose code to run,
2519 * khtml/xml/dom_docimpl.cpp:
2520 (DocumentImpl::updateSelection): Use recently-added closestRenderedPosition helper in Position class
2521 to figure out the start and end positions for selection drawing.
2522 * khtml/xml/dom_position.cpp:
2523 (DOM::Position::equivalentUpstreamPosition): Added code to handle white-space that causes line breaks.
2524 (DOM::Position::equivalentDownstreamPosition): Ditto.
2525 (DOM::Position::closestRenderedPosition): Trap empty selections at function entry, return *this.
2526 (DOM::Position::isFirstRenderedPositionOnLine): Can't be first rendered position on line if not rendered.
2528 (DOM::Position::isLastRenderedPositionOnLine): Ditto, but s/first/last/
2529 * khtml/xml/dom_selection.cpp:
2530 (DOM::Selection::validate): A selection is in caret state if the start and end are equal *or* equivalent.
2531 The equivalence case is new, and fixes 3723359.
2533 2004-07-09 Kevin Decker <kdecker@apple.com>
2537 fixes the width:auto problem in
2538 <rdar://problem/3698344> REGRESSION (143?-144): macrumors.com tabs are compressed and illegible
2540 * khtml/css/cssstyleselector.cpp:
2541 (khtml::CSSStyleSelector::applyProperty):
2543 2004-07-09 Ken Kocienda <kocienda@apple.com>
2547 Updated some layout test results.
2549 * layout-tests/editing/deleting/delete-image-004-expected.txt:
2550 * layout-tests/editing/selection/extend-by-character-006-expected.txt:
2552 2004-07-09 Chris Blumenberg <cblu@apple.com>
2554 Allowed my change for 3715785 to compile on Jaguar.
2556 Reviewed by kocienda.
2558 * kwq/WebCoreBridge.h:
2559 * kwq/WebCoreBridge.mm:
2560 (-[WebCoreBridge domain]): new, allows access to the domain without using the DOM API which doesn't exist on Jaguar
2562 2004-07-09 Ken Kocienda <kocienda@apple.com>
2566 Some improvements to fix:
2568 <rdar://problem/3723111> Caret not drawn when selection set to unrendered content
2570 * khtml/editing/htmlediting_impl.cpp:
2571 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Adjust selection to delete if
2572 selected position is not rendered.
2573 * khtml/rendering/render_block.cpp:
2574 (khtml::RenderBlock::paintObject): Use new caretPosition() function on Selection to
2575 figure out whether to paint.
2576 * khtml/xml/dom_position.cpp:
2577 (DOM::Position::previousCharacterPosition): Now correctly deals with a start
2578 position that is not rendered.
2579 (DOM::Position::nextCharacterPosition): Ditto.
2580 (DOM::Position::closestRenderedPosition): New helper.
2581 * khtml/xml/dom_position.h:
2582 (DOM::): Moved in EAffinity from Selection header. Now used in closestRenderedPosition function.
2583 * khtml/xml/dom_selection.cpp:
2584 (DOM::Selection::Selection): Added new m_caretPosition member. This is the position of the caret
2585 after a caret layout. This may be different from start or end if start and end are not rendered.
2586 (DOM::Selection::init):
2587 (DOM::Selection::modifyExtendingRightForward): New helper to clean up modify() and make it more readble.
2588 (DOM::Selection::modifyMovingRightForward): Ditto.
2589 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
2590 (DOM::Selection::modifyMovingLeftBackward): Ditto.
2591 (DOM::Selection::modify): Use new helpers to make this more readble.
2592 (DOM::Selection::layoutCaret): Uses new closestRenderedPosition helper to place the caret if in unrendered
2594 (DOM::Selection::paintCaret): Remove moveToRenderedContent. obsolete.
2595 * khtml/xml/dom_selection.h:
2596 (DOM::Selection::caretPosition): New accessor.
2597 * kwq/WebCoreBridge.mm:
2598 (-[WebCoreBridge setSelectedDOMRange:affinity:]): EAffinity no longer a member enum of Selection class.
2600 2004-07-08 David Hyatt <hyatt@apple.com>
2602 Fix for the table layout test that failed because of a change in how innerText worked. We need to do
2603 updateLayout now when using innerText, since the method has been changed to use line boxes in the render tree
2604 that might otherwise be out of date.
2606 Reviewed by kocienda
2608 * khtml/html/html_elementimpl.cpp:
2609 (HTMLElementImpl::innerText):
2611 2004-07-08 John Sullivan <sullivan@apple.com>
2615 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
2616 now also extends selection (even if there wasn't one before)
2618 * khtml/khtml_part.cpp:
2619 (KHTMLPart::handleMousePressEventSingleClick):
2620 if there's a URL associated with the event, don't extend the selection
2622 2004-07-08 Ken Kocienda <kocienda@apple.com>
2626 Added some helper functions which provide strings to display in the
2627 Xcode debugger's variable inspector window. These functions are called
2628 from the LabyrinthDataFormatter debugger plugin I just checked in to
2629 the Labyrinth/Tools directory.
2631 Note that these functions are compiled in on Development builds only.
2633 * WebCore-combined.exp:
2634 * WebCore-tests.exp: Export all the formatForDebugger symbols so the
2635 debugger program can link with them.
2636 * khtml/xml/dom2_rangeimpl.cpp:
2637 (DOM::RangeImpl::formatForDebugger):
2638 * khtml/xml/dom2_rangeimpl.h:
2639 * khtml/xml/dom_elementimpl.cpp:
2640 (ElementImpl::formatForDebugger):
2641 * khtml/xml/dom_elementimpl.h:
2642 * khtml/xml/dom_nodeimpl.cpp:
2643 * khtml/xml/dom_nodeimpl.h:
2644 * khtml/xml/dom_position.cpp:
2645 (DOM::Position::formatForDebugger):
2646 * khtml/xml/dom_position.h:
2647 * khtml/xml/dom_selection.cpp:
2648 (DOM::Selection::formatForDebugger):
2649 * khtml/xml/dom_selection.h:
2650 * khtml/xml/dom_textimpl.cpp:
2651 (TextImpl::formatForDebugger):
2652 * khtml/xml/dom_textimpl.h:
2654 2004-07-08 John Sullivan <sullivan@apple.com>
2658 - fixed <rdar://problem/3721544> crash increasing font size;
2659 entrezeroetun.com (works in IE and Firefox)
2661 * khtml/rendering/render_block.cpp:
2662 (khtml::RenderBlock::updateFirstLetter):
2663 Check for nil originalString() before dereffing
2665 2004-07-08 David Hyatt <hyatt@apple.com>
2667 Fix for 3721453, CSS3 initial property caused crashes because the macros were not written correctly.
2671 * khtml/css/cssstyleselector.cpp:
2675 2004-07-07 David Hyatt <hyatt@apple.com>
2677 Fix for 3712133, crash from first-line pseudo-style use.
2679 Reviewed by kocienda
2681 * khtml/css/cssstyleselector.cpp:
2682 (khtml::CSSStyleSelector::styleForElement):
2683 * khtml/css/cssstyleselector.h:
2684 * khtml/rendering/render_object.cpp:
2685 (RenderObject::getPseudoStyle):
2687 2004-07-07 Ken Kocienda <kocienda@apple.com>
2693 <rdar://problem/3716479> calling setInnerHTML during a webViewDidChange delegate call causes a crash
2695 The fix involves some rearrangement of code in TypingCommand and TypingCommandImpl.
2696 Formerly, new TypingCommands would apply themselves (which was a no-op) and then
2697 do their action in some code a way different than other commands. This type of command
2698 application is different than for all other commands since TypingCommands can be coalesced.
2699 The crash occurred as a result of the "no-op" TypingCommand having the unconsidered
2700 consequence of causing editing delegate notifications to be sent before the command
2701 has actually run. This change takes a small step towards making TypingCommandImpl function like
2702 other commands, where the command work is done in doApply. This makes the notification
2703 happen in the right order.
2705 * khtml/editing/htmlediting.cpp:
2706 (khtml::TypingCommand::TypingCommand):
2707 (khtml::TypingCommand::insertText):
2708 (khtml::TypingCommand::insertNewline):
2709 (khtml::TypingCommand::deleteKeyPressed):
2710 * khtml/editing/htmlediting.h:
2711 (khtml::TypingCommand::):
2712 * khtml/editing/htmlediting_impl.cpp:
2713 (khtml::TypingCommandImpl::TypingCommandImpl):
2714 (khtml::TypingCommandImpl::doApply):
2715 * khtml/editing/htmlediting_impl.h:
2717 2004-07-06 Ken Kocienda <kocienda@apple.com>
2721 * khtml/html/html_tableimpl.cpp:
2722 (HTMLTableElementImpl::addChild): Added a better comment in the
2723 code I just checked in a few minutes ago.
2725 2004-07-06 Ken Kocienda <kocienda@apple.com>
2731 <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply
2732 due to non-0 exception code trying to insert a DIV markup string
2734 The solution was to revert to the code that was rolled out, and removing
2735 the child checks from NodeImpl::checkAddChild. However, this time, I added
2736 code very similar to this check into the code that runs while HTML is
2737 being parsed to build up tables. This code relies on child-add failure
2738 to ensure the proper construction of well-formed tables (as gross as that
2739 sounds), so the check needs to be retained there. No other code seems to
2740 be so affected. Layout tests are unchanged by this patch.
2742 * khtml/html/html_tableimpl.cpp:
2743 (HTMLTableElementImpl::addChild):
2744 * khtml/xml/dom_nodeimpl.cpp:
2745 (NodeImpl::checkAddChild):
2747 2004-07-06 Ken Kocienda <kocienda@apple.com>
2751 Simple change. I switched the arguments of the appendNode helper function
2752 and the AppendNodeCommand and AppendNodeCommandImpl classes. The node to
2753 insert now comes before the parent node in the argument list. I did this
2754 to make this function match the convention of others in the HTML editing code.
2755 This was the only one that was "different" in the way that it ordered arguments.
2756 As a result, I was always looking to see that I was passing things in the right
2759 * khtml/editing/htmlediting.cpp:
2760 (khtml::AppendNodeCommand::AppendNodeCommand):
2761 (khtml::AppendNodeCommand::appendChild):
2762 (khtml::AppendNodeCommand::parentNode):
2763 * khtml/editing/htmlediting.h:
2764 * khtml/editing/htmlediting_impl.cpp:
2765 (khtml::CompositeEditCommandImpl::insertNodeAfter):
2766 (khtml::CompositeEditCommandImpl::insertNodeAt):
2767 (khtml::CompositeEditCommandImpl::appendNode):
2768 (khtml::AppendNodeCommandImpl::AppendNodeCommandImpl):
2769 (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl):
2770 (khtml::AppendNodeCommandImpl::doApply):
2771 (khtml::AppendNodeCommandImpl::doUnapply):
2772 (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
2773 (khtml::DeleteSelectionCommandImpl::doApply):
2774 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition):
2775 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition):
2776 (khtml::InputTextCommandImpl::prepareForTextInsertion):
2777 * khtml/editing/htmlediting_impl.h:
2778 (khtml::AppendNodeCommandImpl::parentNode):
2780 2004-07-06 Ken Kocienda <kocienda@apple.com>
2784 Fixed several problems with traversal classes. For one, NodeIterators treat
2785 FILTER_REJECT and FILTER_SKIP the same, since it treats the DOM tree as a
2786 flat collection of nodes free of hierarchy. The code before this change did
2787 not do this correctly. It sure pays to go back and read the specs. :)
2789 Also, the code to traverse from node to node when filters were applied was
2790 not working correctly. My first attemmpt to implement this was just plain
2791 buggy, as I discovered when I tried to write tests for my WWDC talk. I have
2792 settled on an implementation which is much simpler and worked for all the
2793 tests I threw at it.
2795 * khtml/xml/dom2_traversalimpl.cpp:
2796 (DOM::NodeIteratorImpl::findNextNode):
2797 (DOM::NodeIteratorImpl::nextNode):
2798 (DOM::NodeIteratorImpl::findPreviousNode):
2799 (DOM::NodeIteratorImpl::previousNode):
2800 (DOM::TreeWalkerImpl::parentNode):
2801 (DOM::TreeWalkerImpl::firstChild):
2802 (DOM::TreeWalkerImpl::lastChild):
2803 (DOM::TreeWalkerImpl::previousSibling):
2804 (DOM::TreeWalkerImpl::nextSibling):
2805 (DOM::TreeWalkerImpl::previousNode):
2806 (DOM::TreeWalkerImpl::nextNode):
2807 (DOM::TreeWalkerImpl::ancestorRejected):
2808 * khtml/xml/dom2_traversalimpl.h:
2810 2004-07-06 Vicki Murley <vicki@apple.com>
2812 Reviewed by kocienda.
2814 - added backColorCommand, foreColorCommand, fontNameCommand,
2817 * layout-tests/editing/editing.js:
2819 2004-07-06 Trey Matteson <trey@apple.com>
2821 3716053 - www.theage.com.au has extra back/forward items due to ads
2823 This turned out to be easily fixed by generalizing the fix to 3438441. We prevent
2824 addition to the b/f list not just during an onload event, but during any non-user
2825 gesture, which includes top level script executing.
2827 Reviewed by Richard.
2829 * kwq/KWQKHTMLPart.mm:
2830 (KWQKHTMLPart::openURL): Only real change - prevent adding to b/f list if not
2832 (KWQKHTMLPart::openURLRequest): Rename "onLoadEvent" to "userGesture", swap sense
2833 (KWQKHTMLPart::submitForm): Ditto
2834 (KWQKHTMLPart::urlSelected): Ditto
2835 * kwq/KWQKHTMLPartBrowserExtension.mm:
2836 (KHTMLPartBrowserExtension::createNewWindow): Ditto
2837 * kwq/WebCoreBridge.h:
2839 2004-07-02 Darin Adler <darin@apple.com>
2843 - fixed half of <rdar://problem/3709244> utf-8 meta tag not parsed when page title contains angle brackets or if </meta> tag used
2845 * khtml/misc/decoder.cpp: (Decoder::decode): Allow </meta> tags without deciding we
2846 are done with the header.
2848 2004-06-30 Trey Matteson <trey@apple.com>
2850 Dragging within a web view should be allowed to start when the window isn't key.
2852 A few months ago, Chris made this work, but it relied on the fact that all dragging
2853 was done in WebKit. When WebCore got involved in dragging, it was broken. Now we
2854 have a new scheme that gets it working again that properly involves WebCore.
2856 The general idea is that when AK asks us whether to accept the first mouse and do
2857 "delayed window ordering", we must consult WC to see if we might start a drag. In
2858 addition, instead of these drags in non-active windows being started as a special
2859 case in WK, they go through the normal WK-WC drag machinery.
2863 * khtml/khtml_part.cpp:
2864 (KHTMLPart::shouldDragAutoNode): New x,y args.
2865 * khtml/khtml_part.h:
2866 * khtml/rendering/render_object.cpp:
2867 (RenderObject::draggableNode): Pass through new x,y args.
2868 * khtml/rendering/render_object.h:
2869 * kwq/KWQKHTMLPart.h:
2870 (KWQKHTMLPart::setActivationEventNumber): New setter.
2871 * kwq/KWQKHTMLPart.mm:
2872 (KWQKHTMLPart::KWQKHTMLPart): Init new ivar.
2873 (KWQKHTMLPart::eventMayStartDrag): New routine that checks if we might start
2874 a drag in response to a mouseDown.
2875 (KWQKHTMLPart::khtmlMouseMoveEvent): Pass x,y to the routine that finds a draggable
2876 node. This eventually gets back up to WK's _mayStartDragAtEventLocation:.
2877 Delay requirement when dragging the selection now implemented here.
2878 (KWQKHTMLPart::khtmlMouseReleaseEvent): Must avoid changing the selection if we
2879 wind up here as part of the first click in a window (because we started handling
2880 the click to possible start a drag, but that never came through).
2881 (KWQKHTMLPart::mouseDown): Save away event timestamp.
2882 (KWQKHTMLPart::shouldDragAutoNode): Pass location up to WK instead of the
2883 most recent event we stashed.
2884 * kwq/WebCoreBridge.h:
2885 * kwq/WebCoreBridge.mm:
2886 (-[WebCoreBridge setActivationEventNumber:]): Trivial glue.
2887 (-[WebCoreBridge eventMayStartDrag:]): Ditto.
2889 2004-06-29 Trey Matteson <trey@apple.com>
2891 Need to tighten up JS error checking for requesting drag props
2896 * khtml/ecma/kjs_events.cpp:
2897 (Clipboard::getValueProperty): Assert if someone somehow set
2898 dropEffect or effectAllowed and it's a copy/paste clipboard
2899 instead of a dragging clipboard.
2900 (Clipboard::putValue): Don't let anyone set dropEffect or
2901 effectAllowed on a copy/paste clipboard.
2902 (ClipboardProtoFunc::tryCall): Disallow setting dragImage on
2903 a copy/paste clipboard.
2905 2004-06-29 Trey Matteson <trey@apple.com>
2907 DHTML dragging - source should have access to the operation chosen
2912 * kwq/KWQKHTMLPart.h:
2913 * kwq/KWQKHTMLPart.mm:
2914 (KWQKHTMLPart::dragSourceEndedAt): Set the destination's operation
2916 * kwq/WebCoreBridge.mm:
2917 (-[WebCoreBridge dragExitedWithDraggingInfo:]): For completeness
2918 we set the source op for the ondragexit event.
2919 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto for the
2921 (-[WebCoreBridge dragSourceEndedAt:operation:]): Pass through of operation.
2923 2004-06-24 Trey Matteson <trey@apple.com>
2925 3710422 - REGRESSION: Safari crashes trying to send onbeforecut event at about://blank
2927 Simple fix - don't try to send the event to the body element if we have no body element.
2931 * kwq/KWQKHTMLPart.mm:
2932 (KWQKHTMLPart::dispatchCPPEvent):
2934 2004-06-24 Trey Matteson <trey@apple.com>
2936 3704950 drag image in DB ConfigBar has horizontal graphics turd WebCore JavaScript
2938 When we generate a drag image (or a selection image too, for that matter) we
2939 translate the CTM using a CG call. Later, WebImageRenderer adjusts the pattern
2940 phase based on the CTM of the focused view, which doesn't include our translate.
2941 So we must inform WebKit about the additional phase adjustment.
2945 * kwq/KWQKHTMLPart.mm: Tell WebKit about the phase adjustment.
2946 (KWQKHTMLPart::imageFromRect):
2947 * kwq/WebCoreGraphicsBridge.h:
2948 * kwq/WebCoreGraphicsBridge.m:
2949 (-[WebCoreGraphicsBridge setAdditionalPatternPhase:]): New routine to receive
2950 the phase adjustment.
2952 2004-06-24 Trey Matteson <trey@apple.com>
2954 3679986 - screenX and screenY are flipped and relative to the bottom left of the WebView, rather than the screen
2955 3699510 - synthesized click events have bogus screen coords
2959 * khtml/khtmlview.cpp:
2960 (KHTMLView::dispatchDragEvent): Generate screen coords for drag events using new func.
2961 (KHTMLView::dispatchMouseEvent): Ditto.
2962 * khtml/khtmlview.h:
2963 * khtml/xml/dom_nodeimpl.cpp:
2964 (NodeImpl::dispatchMouseEvent): Comment tricky semantics.
2965 Calc screen coords in apple-specific way.
2966 * kwq/KWQKHTMLView.mm:
2967 (KHTMLView::viewportToGlobal): Passthrough to window widget.
2968 * kwq/KWQScrollView.mm:
2969 * kwq/KWQWindowWidget.h:
2970 * kwq/KWQWindowWidget.mm:
2971 (KWQWindowWidget::mapToGlobal): Call former code factored to new method below.
2972 (KWQWindowWidget::viewportToGlobal): New method to convert "viewport" (which for us
2973 really means NSWindow coords) to screen coords.
2975 2004-06-24 Trey Matteson <trey@apple.com>
2977 3693420 - onbeforecut and onbeforepaste need real implementaion
2981 * kwq/KWQKHTMLPart.h:
2982 * kwq/KWQKHTMLPart.mm:
2983 (KWQKHTMLPart::mayCut): Dispatch event to DHTML.
2984 (KWQKHTMLPart::mayCopy): Ditto
2985 (KWQKHTMLPart::mayPaste): Ditto
2986 (KWQKHTMLPart::tryCut): No more need to send fake onbefore event
2987 (KWQKHTMLPart::tryCopy): Ditto
2988 (KWQKHTMLPart::tryPaste): Ditto
2989 * kwq/WebCoreBridge.h:
2990 * kwq/WebCoreBridge.mm:
2991 (-[WebCoreBridge mayDHTMLCut]): Standard glue
2992 (-[WebCoreBridge mayDHTMLCopy]): Ditto
2993 (-[WebCoreBridge mayDHTMLPaste]): Ditto
2995 2004-06-24 Darin Adler <darin@apple.com>
2999 - fixed <rdar://problem/3709385> Find on page doesn't find a string at the very end of the file
3001 * khtml/misc/khtml_text_operations.cpp: (khtml::findPlainText): Rearrange loop to avoid an early
3002 exit once we have all the characters we need, but are at the end of the range we are searching.
3004 - fixed <rdar://problem/3102271>: (text areas have scroll bars even when they don't need them)
3005 - fixed <rdar://problem/3665430>: (horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode)
3007 * kwq/KWQTextArea.mm:
3008 (-[KWQTextArea _configureTextViewForWordWrapMode]): Added. Helper method that sets up the
3009 view for a new word wrap mode.
3010 (-[KWQTextArea _createTextView]): Moved much of the code inside _configureTextViewForWordWrapMode.
3011 (-[KWQTextArea _frameSizeChanged]): Added. Method shared by setFrame: and initWithFrame: to
3012 avoid duplicate code that was there before. The old code also had redundant code to update
3013 the text container size, but NSText handles that automatically.
3014 (-[KWQTextArea initWithFrame:]): Set wrap to YES by default, which is the key to fixing bug 3665430.
3015 Call setAutohidesScrollers:YES, which fixes bug 3102271. Also call the new _frameSizeChanged method.
3016 (-[KWQTextArea setWordWrap:]): Call _configureTextViewForWordWrapMode instead of trying
3017 to do the work here. The old version did both too little and too much.
3018 (-[KWQTextArea setFrame:]): Call _frameSizeChanged instead of trying to do the work here.
3019 The old version did both too little and too much.
3021 2004-06-24 John Sullivan <sullivan@apple.com>
3023 Darin made this change on my machine; I reviewed it.
3025 - fixed <rdar://problem/3698333> Find on page doesn't find a particular string
3026 with a newline in the source
3028 * khtml/misc/khtml_text_operations.cpp:
3029 (khtml::TextIterator::handleTextBox):
3030 Clear m_lastTextNodeEndedWithCollapsedSpace after taking it into account.
3032 2004-06-23 Richard Williamson <rjw@apple.com>
3034 Implemented changes for latest npruntime.h.
3038 * kwq/KWQKHTMLPart.h:
3039 * kwq/KWQKHTMLPart.mm:
3040 (KWQKHTMLPart::KWQKHTMLPart):
3041 (KWQKHTMLPart::windowScriptNPObject):
3042 (KWQKHTMLPart::getEmbedInstanceForView):
3043 * kwq/WebCoreBridge.h:
3044 * kwq/WebCoreBridge.mm:
3045 (-[WebCoreBridge windowScriptObject]):
3046 (-[WebCoreBridge windowScriptNPObject]):
3048 2004-06-22 Richard Williamson <rjw@apple.com>
3050 Fixed <rdar://problem/3707162>: accessing embeds[] plug-in interface may crash
3052 embedInstance was uninitialized.
3056 * khtml/html/html_objectimpl.cpp:
3057 (HTMLEmbedElementImpl::HTMLEmbedElementImpl):
3059 2004-06-18 John Sullivan <sullivan@apple.com>
3063 - fixed <rdar://problem/3534851> Pop up windows not showing up within SAP's
3064 BW Module (changing location.href on new window created by window.open)
3066 * khtml/khtml_part.cpp:
3067 (KHTMLPart::scheduleRedirection):
3068 allow new redirect to win if delay <= current delay, not just <
3070 === WebCore-146.1 ===
3072 2004-06-18 Trey Matteson <trey@apple.com>
3074 3702053 - DHTML dragging destination can't control the cursor (by setting the drop operation)
3076 Fallout from security work, but an easy fix.
3080 * kwq/KWQClipboard.mm:
3081 (KWQClipboard::setDropEffect): Allow dest side to set dropEffect.
3083 2004-06-18 Darin Adler <darin@apple.com>
3087 - re-fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)
3089 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
3090 Check !isInlineFlow rather than checking hasMarkupTruncation. Otherwise, we break
3091 plain old non-markup truncation.
3093 2004-06-18 Darin Adler <darin@apple.com>
3097 - fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)
3099 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
3100 Only walk the ellipsis list if hasMarkupTruncation is true.
3104 2004-06-17 Richard Williamson <rjw@apple.com>
3106 Fixed <rdar://problem/3698867> setting the canvas or parent to display:none and updating the causes a nil-deref
3108 Ensured that we have a renderer before rendering.
3112 * khtml/ecma/kjs_html.cpp:
3113 (KJS::Context2DFunction::tryCall):
3115 2004-06-17 David Hyatt <hyatt@apple.com>
3117 Fix for 3674601, "Read More..." links should trail articles in Emerson.
3121 * khtml/rendering/bidi.cpp:
3122 (khtml::RenderBlock::layoutInlineChildren):
3123 (khtml::RenderBlock::deleteEllipsisLineBoxes):
3124 (khtml::RenderBlock::checkLinesForTextOverflow):
3125 * khtml/rendering/render_block.cpp:
3126 (khtml:::RenderFlow):
3127 (khtml::RenderBlock::paintEllipsisBoxes):
3128 (khtml::RenderBlock::nodeAtPoint):
3129 (khtml::shouldCheckLines):
3130 (khtml::getLineAtIndex):
3131 (khtml::getHeightForLineCount):
3132 (khtml::RenderBlock::lineAtIndex):
3133 (khtml::RenderBlock::lineCount):
3134 (khtml::RenderBlock::heightForLineCount):
3135 (khtml::RenderBlock::clearTruncation):
3136 * khtml/rendering/render_block.h:
3137 (khtml::RenderBlock::setHasMarkupTruncation):
3138 (khtml::RenderBlock::hasMarkupTruncation):
3139 * khtml/rendering/render_flexbox.cpp:
3140 (khtml::RenderFlexibleBox::layoutVerticalBox):
3141 * khtml/rendering/render_line.cpp:
3142 (khtml::EllipsisBox::m_str):
3143 (khtml::InlineBox::adjustPosition):
3144 (khtml::InlineFlowBox::adjustPosition):
3145 (khtml::InlineFlowBox::clearTruncation):
3146 (khtml::EllipsisBox::paint):
3147 (khtml::EllipsisBox::nodeAtPoint):
3148 (khtml::RootInlineBox::clearTruncation):
3149 (khtml::RootInlineBox::placeEllipsis):
3150 (khtml::RootInlineBox::paintEllipsisBox):
3151 (khtml::RootInlineBox::hitTestEllipsisBox):
3152 (khtml::RootInlineBox::adjustPosition):
3153 (khtml::RootInlineBox::childRemoved):
3154 * khtml/rendering/render_line.h:
3155 (khtml::InlineBox::clearTruncation):
3156 * khtml/rendering/render_text.cpp:
3157 * khtml/rendering/render_text.h:
3158 (khtml::InlineTextBox::clearTruncation):
3160 2004-06-17 Trey Matteson <trey@apple.com>
3162 3698514 - coordinates in ondragstart and ondrag events are wrong
3164 This part fixes the ondragstart coords. We salt away the window-based mouseDown
3165 location, since we need that when we dispatch the ondragstart event. Previously
3166 we were errantly using a mouseDown point that had already been converted to view
3167 coords, and then the dispatch converted it again.
3171 * kwq/KWQKHTMLPart.h:
3172 * kwq/KWQKHTMLPart.mm:
3173 (KWQKHTMLPart::khtmlMouseMoveEvent): Use window based mouse event coords to dispatch event.
3174 (KWQKHTMLPart::mouseDown): Save window based mouse event coords .
3176 2004-06-16 David Hyatt <hyatt@apple.com>
3178 Fix for 3596620, implement a subset of CSS3 text truncation for Emerson.
3182 * khtml/rendering/bidi.cpp:
3183 (khtml::RenderBlock::checkLinesForTextOverflow):
3184 * khtml/rendering/font.cpp:
3185 (Font::checkSelectionPoint):
3186 * khtml/rendering/font.h:
3187 * khtml/rendering/render_block.cpp:
3188 (khtml::RenderBlock::paintObject):
3189 (khtml::RenderBlock::paintFloats):
3190 (khtml::RenderBlock::paintEllipsisBoxes):
3191 * khtml/rendering/render_block.h:
3192 * khtml/rendering/render_line.cpp:
3193 (InlineBox::canAccommodateEllipsis):
3194 (InlineBox::placeEllipsisBox):
3195 (InlineFlowBox::paintDecorations):
3196 (InlineFlowBox::placeEllipsisBox):
3197 (EllipsisBox::paint):
3198 (RootInlineBox::placeEllipsis):
3199 (RootInlineBox::placeEllipsisBox):
3200 * khtml/rendering/render_line.h:
3201 (khtml::EllipsisBox::m_str):
3202 (khtml::RootInlineBox::ellipsisBox):
3203 * khtml/rendering/render_text.cpp:
3204 (InlineTextBox::placeEllipsisBox):
3205 (InlineTextBox::paintDecoration):
3206 (InlineTextBox::offsetForPosition):
3207 (RenderText::positionForCoordinates):
3208 (RenderText::paint):
3209 * khtml/rendering/render_text.h:
3210 * kwq/KWQFontMetrics.h:
3211 * kwq/KWQFontMetrics.mm:
3212 (QFontMetrics::checkSelectionPoint):
3213 * kwq/WebCoreTextRenderer.h:
3215 === WebCore-145.1 ===
3217 2004-06-16 Maciej Stachowiak <mjs@apple.com>
3221 <rdar://problem/3697602> REGRESSION (144.2-TOT) Selection highlight does not draw
3223 * khtml/rendering/render_canvas.cpp:
3224 (RenderCanvas::setSelection):
3228 2004-06-16 Richard Williamson <rjw@apple.com>
3230 Fixed 3695730: Added support for embeds[], much like
3231 applets[], to allow access to a plugin's exported interface.
3235 * khtml/dom/html_document.cpp:
3236 (HTMLDocument::embeds):
3237 * khtml/dom/html_document.h:
3238 * khtml/ecma/kjs_dom.cpp:
3239 (KJS::getRuntimeObject):
3240 * khtml/ecma/kjs_html.cpp:
3241 (KJS::HTMLDocument::tryGet):
3242 (KJS::HTMLElement::tryGet):
3243 (KJS::HTMLCollection::tryGet):
3244 (KJS::HTMLCollection::getNamedItems):
3245 * khtml/ecma/kjs_html.h:
3246 (KJS::HTMLDocument::):
3247 * khtml/ecma/kjs_html.lut.h:
3249 * khtml/html/html_miscimpl.cpp:
3250 (HTMLCollectionImpl::calcLength):
3251 (HTMLCollectionImpl::getItem):
3252 (HTMLCollectionImpl::getNamedItem):
3253 * khtml/html/html_miscimpl.h:
3254 (DOM::HTMLCollectionImpl::):
3255 * khtml/html/html_objectimpl.cpp:
3256 (HTMLEmbedElementImpl::getEmbedInstance):
3257 * khtml/html/html_objectimpl.h:
3258 * kwq/KWQKHTMLPart.h:
3259 * kwq/KWQKHTMLPart.mm:
3260 (KWQKHTMLPart::getEmbedInstanceForView):
3262 2004-06-15 Maciej Stachowiak <mjs@apple.com>
3266 <rdar://problem/3695907>: (can't enable selection inside parent where it is disabled via CSS)
3268 * khtml/css/cssparser.cpp:
3269 (CSSParser::parseValue):
3270 * khtml/css/cssstyleselector.cpp:
3271 (khtml::CSSStyleSelector::applyProperty):
3272 * khtml/rendering/render_object.cpp:
3273 (RenderObject::shouldSelect):
3274 * khtml/rendering/render_style.h:
3276 (khtml::RenderStyle::userSelect):
3277 (khtml::RenderStyle::setUserSelect):
3278 (khtml::RenderStyle::initialUserSelect):
3280 2004-06-15 David Hyatt <hyatt@apple.com>
3282 Initial impl of the EllipsisBox. This code just gets the box created and gets it placed vertically. The next
3283 stage will be to position the box horizontally as well.
3287 * khtml/rendering/bidi.cpp:
3288 (khtml::RenderBlock::checkLinesForTextOverflow):
3289 * khtml/rendering/render_line.cpp:
3290 (RootInlineBox::placeEllipsis):
3291 * khtml/rendering/render_line.h:
3292 (khtml::EllipsisBox::m_str):
3294 2004-06-15 David Hyatt <hyatt@apple.com>
3296 Implement canAccommodateEllipsis. The basic idea is that everything on a line will allow an ellipsis to be
3297 drawn on top of it unless it's a replaced element. Then, if the replaced element overlaps, the ellipsis won't
3302 * khtml/rendering/bidi.cpp:
3303 (khtml::RenderBlock::checkLinesForTextOverflow):
3304 * khtml/rendering/render_line.cpp:
3305 (InlineBox::closestLeafChildForXPos):
3306 (InlineBox::canAccommodateEllipsis):
3307 (InlineFlowBox::canAccommodateEllipsis):
3308 (RootInlineBox::canAccommodateEllipsis):
3309 * khtml/rendering/render_line.h:
3311 2004-06-15 Vicki Murley <vicki@apple.com>
3313 - added a few layout tests, rdar://3694510
3315 * layout-tests/editing/deleting/delete-image-004-expected.txt: Added.
3316 * layout-tests/editing/deleting/delete-image-004.html: Added.
3317 * layout-tests/editing/selection/extend-by-character-006-expected.txt: Added.
3318 * layout-tests/editing/selection/extend-by-character-006.html: Added.
3320 2004-06-15 Trey Matteson <trey@apple.com>
3322 Dragging tweak: We pass the mouse down coords instead of the
3323 latest mouse drag coords to the ondragstart event. This makes it
3324 easy for the client to figure the correct drag image offset,
3325 whereas the mouse drag location is next to useless for that.
3329 * kwq/KWQKHTMLPart.mm:
3330 (KWQKHTMLPart::khtmlMouseMoveEvent):
3332 2004-06-15 Maciej Stachowiak <mjs@apple.com>
3336 <rdar://problem/3685236>: (Safari does not support onselectstart event handler)
3338 * khtml/ecma/kjs_dom.cpp:
3339 (DOMNode::getValueProperty):
3340 (DOMNode::putValue):
3341 * khtml/ecma/kjs_dom.h:
3343 * khtml/ecma/kjs_dom.lut.h:
3345 * khtml/html/html_elementimpl.cpp:
3346 (HTMLElementImpl::parseHTMLAttribute):
3347 * khtml/misc/htmlattrs.c:
3350 * khtml/misc/htmlattrs.h:
3351 * khtml/misc/htmlattrs.in:
3352 * khtml/rendering/render_object.cpp:
3353 (RenderObject::shouldSelect):
3354 * khtml/xml/dom2_eventsimpl.cpp:
3355 (EventImpl::typeToId):
3356 (EventImpl::idToType):
3357 * khtml/xml/dom2_eventsimpl.h:
3360 2004-06-15 Maciej Stachowiak <mjs@apple.com>
3364 Fix crash with last checkin.
3366 * khtml/ecma/kjs_binding.cpp: