1 2004-08-23 Maciej Stachowiak <mjs@apple.com>
5 <rdar://problem/3770306> XMLHttpRequest does not honor character set encoding
7 * khtml/ecma/xmlhttprequest.cpp:
8 (KJS::XMLHttpRequest::slotData): Get encoding from the transfer job.
9 * kwq/KWQKJobClasses.h:
10 * kwq/KWQKJobClasses.mm:
11 (KIO::TransferJobPrivate::TransferJobPrivate): Added retrievedCharset
13 (KIO::TransferJob::retrieveCharset): New method, gets the charset
15 (KIO::TransferJob::queryMetaData): Handle charset.
16 (KIO::TransferJob::emitReceivedResponse): Clear retreivedCharset flag.
19 (KWQResponseTextEncodingName): New function, gets the encoding from the response.
21 2004-08-23 David Hyatt <hyatt@apple.com>
23 Apply leo's fix to marquees.
27 * khtml/rendering/render_layer.cpp:
30 2004-08-20 Darin Adler <darin@apple.com>
34 - added an ascii() member function to DOMString and DOMStringImpl to help debugging
36 * khtml/dom/dom_string.h: Add ascii member function for debugging.
37 * khtml/dom/dom_string.cpp: (DOM::DOMString::ascii): Added. Calls through to DOMStringImpl::ascii.
38 * khtml/xml/dom_stringimpl.h: Add ascii member function for debugging.
39 * khtml/xml/dom_stringimpl.cpp: (DOM::DOMStringImpl::ascii): Added. Makes a new buffer and puts
40 a simple ASCII version in it. Maybe make it better about characters outside the 0x20-0x7E range
41 some day, but for now this is way better than what we had before.
43 2004-08-20 David Hyatt <hyatt@apple.com>
45 Divorce the notion of a marquee being stopped from JS from the notion of being suspended by the back/forward cache.
47 * khtml/ecma/kjs_html.cpp:
48 (KJS::HTMLElementFunction::tryCall):
49 * khtml/rendering/render_layer.cpp:
53 (Marquee::updateMarqueePosition):
54 * khtml/rendering/render_layer.h:
56 2004-08-20 Richard Williamson <rjw@apple.com>
58 Implemented new JNI abstraction. We no longer invoke Java methods
59 directly with JNI, rather we call into the plugin. This allows the
60 plugin to dispatch the call to the appropriate VM thread. This
61 change should (will?) fix a whole class of threading related problems with
66 * kwq/KWQKHTMLPart.mm:
67 (KWQKHTMLPart::getAppletInstanceForView):
68 * kwq/WebCoreBridge.mm:
70 (-[WebCoreBridge executionContextForView:]):
72 2004-08-19 Maciej Stachowiak <mjs@apple.com>
76 More text paint cleanup. Separated the background and foreground
77 passes instead of doing a weird for loop thing. Eliminated
78 redundant if conditions. Added comments.
80 * khtml/rendering/render_text.cpp:
83 2004-08-19 Ken Kocienda <kocienda@apple.com>
87 * khtml/css/css_computedstyle.cpp:
88 (DOM::): Changed CopyProperties constant to InheritableProperties. This reflects the
89 name change of copy() to copyInheritableProperties()
90 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties: Renamed from copy().
91 Now just copies those properties which can be inherited.
92 (DOM::CSSComputedStyleDeclarationImpl::diff): Add a couple null checks.
93 * khtml/css/css_computedstyle.h: copyInheritableProperties name change. No longer needs to be virtual.
94 * khtml/css/css_valueimpl.cpp: Removed unneeded copy() function from CSSStyleDeclarationImpl.
95 * khtml/css/css_valueimpl.h: Ditto.
96 * khtml/editing/htmlediting.cpp:
97 (khtml::EditCommand::typingStyle): Added.
98 (khtml::EditCommand::setTypingStyle): Added.
99 * khtml/editing/htmlediting.h:
100 * khtml/editing/htmlediting_impl.cpp:
101 (khtml::StyleChange::currentlyHasStyle): Fix leak of computed style used in this function.
102 (khtml::EditCommandImpl::EditCommandImpl): Initialize m_typingStyle.
103 (khtml::EditCommandImpl::~EditCommandImpl): Deref m_typingStyle.
104 (khtml::EditCommandImpl::assignTypingStyle): New helper used in setting typing style.
105 (khtml::EditCommandImpl::setTypingStyle): New setter.
106 (khtml::DeleteSelectionCommandImpl::doApply): Use new method for managing typing style.
107 * khtml/editing/htmlediting_impl.h:
108 (khtml::EditCommandImpl::typingStyle): New accessor.
109 * khtml/khtml_part.cpp:
110 (KHTMLPart::appliedEditing): Restores typing style from command after setting selection.
111 (KHTMLPart::applyStyle): Does a diff between the current style and the style of the caret.
112 * khtml/khtml_part.h:
113 * khtml/xml/dom_position.cpp:
114 (DOM::Position::computedStyle): Now returns a CSSComputedStyleDeclarationImpl instead of a plain
115 CSSStyleDeclarationImpl.
116 * khtml/xml/dom_position.h:
117 * layout-tests/editing/style/style-3681552-fix-002-expected.txt:
119 2004-08-20 Trey Matteson <trey@apple.com>
121 3655407 - Editing: -complete: method unimplemented (WebKit editing API)
123 One new support routine here.
127 * kwq/WebCoreBridge.h:
128 * kwq/WebCoreBridge.mm:
129 (-[WebCoreBridge caretRectAtNode:offset:]): New routine.
130 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
131 Fixed former misleading method name.
134 2004-08-20 Ken Kocienda <kocienda@apple.com>
140 <rdar://problem/3768378> crash typing newline in Blot
142 * khtml/editing/htmlediting_impl.cpp:
143 (khtml::InputNewlineCommandImpl::doApply): Adding an assert in a recent change
144 showed up that inserting newlines that was not being handled correctly for the
145 case described in the bug. I added a new case to handle inserting BR's when
146 at the caret max offset for a node, and this new code runs instead of the
147 fall-through case that should not have been running and triggered the assert.
148 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Regenerated results.
149 * layout-tests/editing/inserting/insert-br-case6-expected.txt: Added.
150 * layout-tests/editing/inserting/insert-br-case6.html: Added.
152 2004-08-20 Trey Matteson <trey@apple.com>
154 Fixing: Spellchecker called once or twice for every char typed.
158 * khtml/khtml_part.cpp:
159 (KHTMLPart::setSelection): Don't do any spell checking if we're typing (it's done
160 elsewhere, in markMisspellingsAfterTyping)
162 2004-08-19 Maciej Stachowiak <mjs@apple.com>
166 - fixed <rdar://problem/3549369> Crash at www.e1.ru in HTMLTokenizer::notifyFinished
168 Probably also fixed the following likely duplicates:
170 <rdar://problem/3503938> Safari crashed opening many tabs (HTMLTokenizer::notifyFinished(khtml::CachedObject*))
171 <rdar://problem/3566332> CrashTracer: ..405 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
172 <rdar://problem/3703964> CrashTracer: ...86 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
173 <rdar://problem/3703969> CrashTracer: ..234 crashes at com.apple.WebCore: HTMLTokenizer::notifyFinished + 0x1c8
175 * khtml/xml/dom_docimpl.cpp:
176 (DocumentImpl::open): call setParsing(true), because we need to know we are once again
177 parsing when we re-open a document that has previously completed loading.
179 2004-08-19 Maciej Stachowiak <mjs@apple.com>
181 Reviewed by Dave and Darin.
183 * khtml/rendering/render_text.cpp:
184 (RenderText::paint): Split apple and non-apple code paths to allow further cleanup.
186 2004-08-19 Darin Adler <darin@apple.com>
190 - fixed <rdar://problem/3767274> crash in partForWidget inside setFocus (test page attached)
192 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::nextKeyViewInFrame): Remove code to do position
193 the widget; no longer needed since we reworked how widgets get their positions.
194 * kwq/KWQWidget.mm: (QWidget::setFocus): Ditto. This was the one that caused the bug.
196 2004-08-19 David Hyatt <hyatt@apple.com>
198 Fix crash when text is contained inside a table-colgroup.
202 * khtml/xml/dom_textimpl.cpp:
203 (TextImpl::rendererIsNeeded):
205 2004-08-19 Trey Matteson <trey@apple.com>
207 Unexpected errors hit while finding word boundaries, leading to crash.
211 * kwq/KWQTextUtilities.cpp:
212 (KWQFindWordBoundary): Don't call UCFindTextBreak with edge cases it thinks
213 are param errors, and pass correct mask for forward case. Also fix off-by-one
214 crashers in fallback code.
216 2004-08-19 David Hyatt <hyatt@apple.com>
218 Make XSLT imports/includes work. This code has to be turned off until the newer version of libxslt is
223 * khtml/css/css_ruleimpl.cpp:
224 (CSSImportRuleImpl::init):
225 * khtml/xml/dom_docimpl.cpp:
226 (DocumentImpl::DocumentImpl):
227 (DocumentImpl::~DocumentImpl):
228 (DocumentImpl::applyXSLTransform):
229 * khtml/xml/dom_docimpl.h:
230 (DOM::DocumentImpl::setTransformSource):
231 (DOM::DocumentImpl::transformSource):
232 * khtml/xml/dom_xmlimpl.cpp:
233 (DOM::ProcessingInstructionImpl::checkStyleSheet):
234 * khtml/xml/xml_tokenizer.cpp:
239 (khtml::createQStringParser):
240 (khtml::XMLTokenizer::setTransformSource):
241 * khtml/xsl/xsl_stylesheetimpl.cpp:
242 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
243 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
244 (DOM::XSLStyleSheetImpl::isLoading):
245 (DOM::XSLStyleSheetImpl::clearDocuments):
246 (DOM::XSLStyleSheetImpl::parseString):
247 (DOM::XSLStyleSheetImpl::loadChildSheets):
248 (DOM::XSLStyleSheetImpl::loadChildSheet):
249 (DOM::XSLImportRuleImpl::parentStyleSheet):
250 (DOM::XSLStyleSheetImpl::compileStyleSheet):
251 (DOM::XSLStyleSheetImpl::locateStylesheetSubResource):
252 (DOM::XSLImportRuleImpl::XSLImportRuleImpl):
253 (DOM::XSLImportRuleImpl::~XSLImportRuleImpl):
254 (DOM::XSLImportRuleImpl::setStyleSheet):
255 (DOM::XSLImportRuleImpl::isLoading):
256 (DOM::XSLImportRuleImpl::loadSheet):
257 * khtml/xsl/xsl_stylesheetimpl.h:
258 (DOM::XSLStyleSheetImpl::setOwnerDocument):
259 (DOM::XSLStyleSheetImpl::setDocument):
260 (DOM::XSLStyleSheetImpl::markAsProcessed):
261 (DOM::XSLStyleSheetImpl::processed):
262 (DOM::XSLImportRuleImpl::href):
263 (DOM::XSLImportRuleImpl::styleSheet):
264 (DOM::XSLImportRuleImpl::isImportRule):
265 * khtml/xsl/xslt_processorimpl.cpp:
266 (DOM::m_sourceDocument):
267 (DOM::stylesheetLoadFunc):
268 (DOM::XSLTProcessorImpl::transformDocument):
269 * khtml/xsl/xslt_processorimpl.h:
274 2004-08-18 Trey Matteson <trey@apple.com>
276 3765958 - downstreamPosition() can hit infinite loop when at end of doc
278 The problem was that I had a position that was after the maximum position in the text
279 node, because it was the old caret position before a backspace was processed. Later
280 I happened to call downstream() on that position, and hit the bug. Fix is to consider
281 a position past the end point of its node if it is *greater than* or equal to its max offset.
285 * khtml/xml/dom_positioniterator.cpp:
286 (DOM::PositionIterator::atEnd):
288 2004-08-18 David Hyatt <hyatt@apple.com>
290 - did WebCore part of <rdar://problem/3682969> SLIDER: absolute left position of slider should be headline only
292 Make the header overlap the footer in the zero-line case. Changes to Emerson's template will ensure the
293 header draws over the footer.
297 * khtml/rendering/render_block.cpp:
298 (khtml::getHeightForLineCount):
300 2004-08-18 Richard Williamson <rjw@apple.com>
302 Replace horrible pollForAppletInView: with new
303 webPlugInGetApplet. The details of how the applet instance
304 is provided now belong to the Java team. Yeh.
308 * kwq/KWQKHTMLPart.mm:
309 (KWQKHTMLPart::getAppletInstanceForView):
310 * kwq/WebCoreBridge.h:
312 2004-08-18 Chris Blumenberg <cblu@apple.com>
314 Fixed: <rdar://problem/3692199> 8A146: Safari crashes in toHTMLWithOptions, selection with no renderer (various sites)
318 * khtml/xml/dom2_rangeimpl.cpp:
319 (DOM::RangeImpl::toHTML): renamed, don't assume that nodes of the range had renderers, use the common ancestor of the range as the root
320 * khtml/xml/dom2_rangeimpl.h:
321 * khtml/xml/dom_nodeimpl.cpp:
322 (NodeImpl::recursive_toHTML): renamed, removed code that determines whether to include the root in the HTML, leave this up to the caller
323 * khtml/xml/dom_nodeimpl.h:
324 * kwq/WebCoreBridge.mm:
325 (-[WebCoreBridge markupStringFromNode:nodes:]): call renamed methods
326 (-[WebCoreBridge markupStringFromRange:nodes:]): ditto
328 2004-08-18 Ken Kocienda <kocienda@apple.com>
332 * khtml/css/css_valueimpl.cpp:
333 (CSSStyleDeclarationImpl::copy): Roll back silly last minute change that broke this code.
334 Note to self: read code before making changes to it.
336 2004-08-18 Ken Kocienda <kocienda@apple.com>
338 Coded by Darin and Ken
340 * khtml/css/css_computedstyle.cpp: Added CopyProperties static array. This contains
341 the properties we implement that we also want to copy in the new
342 CSSComputedStyleDeclarationImpl::copy described below.
343 (DOM::CSSComputedStyleDeclarationImpl::copy): New function. In this class, copies the
344 computed values of all the properties listed in CopyProperties. In essence, this makes
345 a freeze-dired version of a computed style.
346 (DOM::CSSComputedStyleDeclarationImpl::diff): Removes every property from the passed-in
347 CSSStyleDeclarationImpl that is also in the computed style.
348 * khtml/css/css_computedstyle.h:
349 * khtml/css/css_valueimpl.cpp:
350 (CSSStyleDeclarationImpl::copy): New function. In this class, the copy operation is
351 straightforward. Returns a copy that will be unchanged when the original changes.
352 * khtml/css/css_valueimpl.h:
353 (DOM::CSSStyleDeclarationImpl::values): Added a accessor suitable for use when the
354 CSSStyleDeclarationImpl is const.
356 2004-08-17 Maciej Stachowiak <mjs@apple.com>
360 <rdar://problem/3703768> CrashTracer: ...50 crashes at com.apple.WebCore: KHTMLPart::xmlDocImpl const + 0
362 * khtml/khtmlview.cpp:
363 (KHTMLView::viewportMouseMoveEvent): Add a nil check and an
364 assertion for m_part being null. It seems impossible for this to
365 happen, so we want to debug it ourselves, but in the meantime,
366 let's try to avoid causing crashes for our users.
368 2004-08-17 David Hyatt <hyatt@apple.com>
370 Fix the line truncation function for Emerson so that at the far left setting of the slider, only the header
375 * khtml/rendering/render_block.cpp:
376 (khtml::getHeightForLineCount):
377 * khtml/rendering/render_flexbox.cpp:
378 (khtml::RenderFlexibleBox::layoutVerticalBox):
380 2004-08-17 Ken Kocienda <kocienda@apple.com>
384 Rewrite of the command that deletes a selection. I deleted great
385 big swaths of bug-ridden code to accomplish this and replaced it
386 with code that is much cleaner and smarter.
388 Also, renamed equivalentUpstreamPosition and equivalentDownstreamPosition to
389 upstream to downstream, respectively.
391 Added a couple of new helper methods.
393 * khtml/editing/htmlediting.cpp: DeleteCollapsibleWhitespaceCommand and
394 RemoveNodeAndPruneCommand now obsolete. A huge win.
395 * khtml/editing/htmlediting.h: Ditto.
396 * khtml/editing/htmlediting_impl.cpp:
397 (khtml::debugPosition): Fix printf which had a placeholder, but no argument passed in the varargs.
398 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): New helper. Much simplified and cleaner
400 (khtml::ApplyStyleCommandImpl::doApply): upstream/downstream name change
401 (khtml::ApplyStyleCommandImpl::nodeFullySelected): upstream/downstream name change
402 (khtml::DeleteSelectionCommandImpl::doApply): upstream/downstream name change
403 (khtml::DeleteTextCommandImpl::DeleteTextCommandImpl): Add an assert to check that the
404 passed offset is less than the length of the text node.
405 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition): upstream/downstream name change
406 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition): upstream/downstream name change
407 (khtml::InputNewlineCommandImpl::doApply): upstream/downstream name change
408 (khtml::InputTextCommandImpl::prepareForTextInsertion): upstream/downstream name change
409 (khtml::InputTextCommandImpl::execute): upstream/downstream name change
410 (khtml::InputTextCommandImpl::insertSpace): upstream/downstream name change
411 (khtml::ReplaceSelectionCommandImpl::doApply): upstream/downstream name change
412 (khtml::TypingCommandImpl::issueCommandForDeleteKey): upstream/downstream name change
413 (khtml::TypingCommandImpl::deleteKeyPressed):
414 * khtml/editing/htmlediting_impl.h:
415 * khtml/xml/dom_position.cpp:
416 (DOM::Position::previousWordBoundary):
417 (DOM::Position::nextWordBoundary):
418 (DOM::Position::upstream):
419 (DOM::Position::downstream):
420 (DOM::Position::inRenderedText): Add null check.
421 (DOM::Position::isRenderedCharacter): New helper.
422 (DOM::isWS): New helper in this file.
423 (DOM::Position::leadingWhitespacePosition): New helper. Factored out from htmlediting_impl.cpp.
424 (DOM::Position::trailingWhitespacePosition): Ditto.
425 (DOM::Position::debugPosition): Add null check.
426 * khtml/xml/dom_position.h:
427 * khtml/xml/dom_selection.cpp:
428 (DOM::Selection::toRange): upstream/downstream name change
429 (DOM::Selection::validate): upstream/downstream name change
430 (DOM::Selection::debugPosition): upstream/downstream name change
431 * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Updated tests with new expected results.
432 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
433 * layout-tests/editing/deleting/delete-selection-001-expected.txt: Ditto.
434 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Ditto.
435 * layout-tests/editing/inserting/insert-br-case1-expected.txt: Ditto.
436 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Ditto.
437 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Ditto.
439 2004-08-17 Trey Matteson <trey@apple.com>
441 Various spelling fixes.
445 * khtml/khtml_part.cpp:
446 (KHTMLPart::setSelection): No misspellings in the spelling code comments
447 * khtml/xml/dom_docimpl.cpp:
448 (DocumentImpl::removeMarker): Repaint if doc changes. Sometimes the markers
449 were not being erased when you clicked in a word.
450 * khtml/xml/dom_position.cpp:
451 (DOM::Position::previousWordBoundary): Small optimization. Bail after first
452 try if the second try will not come out any different.
453 (DOM::Position::nextWordBoundary): Ditto
454 * kwq/KWQKHTMLPart.mm:
455 (KWQKHTMLPart::markMisspellingsInSelection): Comment.
457 2004-08-17 Darin Adler <darin@apple.com>
461 - fixed <rdar://problem/3689700> crash loading page; stoxx.com (works in IE and Firefox)
463 * khtml/khtml_part.h: Make completeURL public.
464 * kwq/KWQKJavaAppletWidget.mm: (KJavaAppletWidget::KJavaAppletWidget): Complete the base URL
465 before passing it across the bridge. This sidesteps the crashing bug in CFURL, filed as
466 '<rdar://problem/3764632> CFURLCreateAbsoluteURLWithBytes crashes if passed the string "../.."'
467 and also is obviously correct behavior that may fix other sites too.
469 - fixed <rdar://problem/3547725> Crashes at csuohio.edu, list box vs. mouse event problem (Spoof No Fix)
472 (QListBox::~QListBox): Nil out the pointer from the KWQTableView back to the widget by calling
474 (-[KWQTableView detach]): Set the pointer to the QListBox to 0. Also set the delegate and data
475 source to nil, so we don't need nil checks in delegate and data source methods.
476 (-[KWQTableView mouseDown:]): Add nil check.
477 (-[KWQTableView keyDown:]): Add nil check.
478 (-[KWQTableView keyUp:]): Add nil check.
479 (-[KWQTableView becomeFirstResponder]): Add nil check.
480 (-[KWQTableView resignFirstResponder]): Add nil check.
481 (-[KWQTableView canBecomeKeyView]): Add nil check.
482 (-[KWQTableView tableViewSelectionDidChange:]): Add nil checks, even though this is a delegate
483 callback, to handle cases where calls to JavaScript result in the QListBox going away partway
485 (-[KWQTableView drawRow:clipRect:]): Add nil check.
486 (-[KWQTableView _accessibilityTableCell:tableColumn:]): Add nil check.
488 2004-08-17 Trey Matteson <trey@apple.com>
490 Fix ASSERT in spelling marker management.
494 * khtml/xml/dom_docimpl.cpp:
495 (DocumentImpl::shiftMarkers): Use assert instead of ASSERT.
496 Tweak test to allow for a start position of 0.
498 2004-08-17 Trey Matteson <trey@apple.com>
500 3764147 - failure of subframe to load leaves links in parent doc broken
504 * khtml/khtml_part.cpp:
505 (KHTMLPart::childBegin): New method to mark part as not complete.
506 (KHTMLPart::processObjectRequest): Mark child part imcomplete, so if we
507 later get a failure on load it won't think it's already complete and do nothing.
508 * khtml/khtml_part.h:
512 2004-08-16 David Hyatt <hyatt@apple.com>
514 Fix the #define. I had it all backwards.
518 2004-08-16 David Hyatt <hyatt@apple.com>
520 Land initial support for XSLT using xml-stylesheet PIs.
522 * WebCore.pbproj/project.pbxproj:
523 * khtml/khtml_part.cpp:
524 (KHTMLPart::replaceDocImpl):
525 * khtml/khtml_part.h:
527 * khtml/xml/dom_docimpl.cpp:
528 (DocumentImpl::DocumentImpl):
529 (DocumentImpl::~DocumentImpl):
530 (DocumentImpl::recalcStyleSelector):
531 (DocumentImpl::applyXSLTransform):
532 (DocumentImpl::setTransformSourceDocument):
533 * khtml/xml/dom_docimpl.h:
534 (DOM::DocumentImpl::setTransformSource):
535 (DOM::DocumentImpl::transformSource):
536 (DOM::DocumentImpl::transformSourceDocument):
537 * khtml/xml/dom_xmlimpl.cpp:
538 (DOM::ProcessingInstructionImpl::checkStyleSheet):
539 * khtml/xml/dom_xmlimpl.h:
540 (DOM::ProcessingInstructionImpl::isXSL):
541 * khtml/xml/xml_tokenizer.cpp:
544 (khtml::createQStringParser):
545 (khtml::XMLTokenizer::processingInstruction):
546 (khtml::XMLTokenizer::finish):
547 (khtml::XMLTokenizer::setTransformSource):
548 * khtml/xml/xml_tokenizer.h:
549 (khtml::Tokenizer::setTransformSource):
550 * khtml/xml/xsl_stylesheetimpl.cpp: Removed.
551 * khtml/xml/xsl_stylesheetimpl.h: Removed.
552 * khtml/xsl/xsl_stylesheetimpl.cpp: Added.
553 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
554 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
555 (DOM::XSLStyleSheetImpl::isLoading):
556 (DOM::XSLStyleSheetImpl::checkLoaded):
557 (DOM::XSLStyleSheetImpl::docLoader):
558 (DOM::XSLStyleSheetImpl::parseString):
559 * khtml/xsl/xsl_stylesheetimpl.h: Added.
560 (DOM::XSLStyleSheetImpl::isXSLStyleSheet):
561 (DOM::XSLStyleSheetImpl::type):
562 (DOM::XSLStyleSheetImpl::ownerDocument):
563 (DOM::XSLStyleSheetImpl::document):
564 (DOM::XSLStyleSheetImpl::clearDocument):
565 * khtml/xsl/xslt_processorimpl.cpp: Added.
566 (DOM::m_sourceDocument):
567 (DOM::XSLTProcessorImpl::~XSLTProcessorImpl):
568 (DOM::XSLTProcessorImpl::transformDocument):
570 (DOM::XSLTProcessorImpl::addToResult):
571 (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
572 * khtml/xsl/xslt_processorimpl.h: Added.
574 2004-08-16 Maciej Stachowiak <mjs@apple.com>
578 * khtml/khtml_part.cpp:
579 (KHTMLPart::isImmediateRedirectPending):
581 2004-08-16 Richard Williamson <rjw@apple.com>
583 Fixed <rdar://problem/3704339> Context2D forces integer positions in drawImage
585 Use floats instead of ints to draw images.
589 * khtml/ecma/kjs_html.cpp:
590 (KJS::Context2DFunction::tryCall):
593 (QPainter::drawPixmap):
594 (QPainter::drawFloatPixmap):
596 2004-08-13 Maciej Stachowiak <mjs@apple.com>
600 - 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)
602 (actually the previous fix for this bug was mostly correct, but
603 this additional change is needed to avoid the regression in
604 <rdar://problem/3751025> REGRESSION: website rejects Safari 125.9
605 as "need to upgrade to IE 6", but didn't reject 125.8
607 So if merging for a software update, make sure to include both
608 this and the previous fix.
610 * khtml/html/htmltokenizer.cpp:
611 (khtml::HTMLTokenizer::write): When there is an immediate reidrect pending,
612 make sure to stop tokenizing, because we need to make sure no further
613 script tags are processed beyond the one that triggered the redirect.
614 * khtml/khtml_part.cpp:
615 (KHTMLPart::isImmediateRedirectPending): New method to allow
616 checking if a redirect is pending.
617 * khtml/khtml_part.h:
619 2004-08-15 David Hyatt <hyatt@apple.com>
621 - fixed <rdar://problem/3760508> REGRESSION (154-155): No text in textarea
623 Fix the blank textarea problem by ensuring that any change to a <textarea>'s DOM children causes the form control
624 to resync with the DOM. This behavior matches WinIE.
628 * khtml/html/html_formimpl.cpp:
629 (HTMLTextAreaElementImpl::childrenChanged):
630 * khtml/html/html_formimpl.h:
632 2004-08-13 Trey Matteson <trey@apple.com>
634 3761794 Slider doesn't call onmouseup handler
638 * khtml/rendering/render_form.cpp:
639 (RenderSlider::RenderSlider): Listen for signal.
640 (RenderSlider::slotClicked): Pass to superclass.
641 * khtml/rendering/render_form.h:
644 (-[KWQSlider mouseDown:]): Generate mouseUp and clicked events,
645 since AK consumes the mouseUp event in a modal tracking loop.
646 (QSlider::QSlider): Make signal.
647 (QSlider::clicked): Send signal.
649 2004-08-12 Trey Matteson <trey@apple.com>
651 3761329 - query result links all dead in ingrammicro.com (sometimes)
652 3761328 - links in some docs dead when doc is loaded from WebArchive
654 Make sure to get part to completed state when end is called,
655 even if we have no doc. See WebKit changelog for more info.
657 Reviewed by Richard and Darin.
659 * khtml/khtml_part.cpp:
662 2004-08-13 Trey Matteson <trey@apple.com>
664 3761098 - red dotted underline for misspelled words shows up in drag image
668 * khtml/rendering/render_text.cpp:
669 (RenderText::paint): Don't draw misspelling when creating selection image.
671 2004-08-12 Richard Williamson <rjw@apple.com>
673 Bring npruntime.h and friends closer to compliance with
678 * kwq/KWQKHTMLPart.mm:
679 (KWQKHTMLPart::windowScriptNPObject):
681 2004-08-12 Maciej Stachowiak <mjs@apple.com>
685 <rdar://problem/3245706> URLs with backslashes instead of slashes work on WinIE; should work on Safari (SAP)
686 <rdar://problem/3506429> <BASE> tag containing backslash is breaking images with absolute URLs
689 (substituteBackslashes): Helper method
690 (KURL::KURL): If the URL contains any backslashes, substitute all
691 that appear before the query or fragment.
693 2004-08-12 Ken Kocienda <kocienda@apple.com>
699 <rdar://problem/3761014> command-down-arrow takes you to start of document instead of end of document
701 * khtml/xml/dom_selection.cpp:
702 (DOM::Selection::modifyExtendingRightForward): Code used to assume, incorrectly, that index 1 of the
703 document element was beyond the last node in the document. But this is not true, since the document
704 element is the HTML element (generally). Instead, move to the index equal to the number of children
705 of the document element. This puts us past everything.
706 (DOM::Selection::modifyMovingRightForward): Ditto.
708 2004-08-12 Ken Kocienda <kocienda@apple.com>
714 <rdar://problem/3695446> shift-down-arrow on last line of editable text should select to end of document
716 Detect when current position is on first or last line and move to the
717 start or end of that line, respectively.
719 * khtml/xml/dom_position.cpp:
720 (DOM::Position::previousLinePosition)
721 (DOM::Position::nextLinePosition)
725 2004-08-12 Ken Kocienda <kocienda@apple.com>
729 Some consolidation in style application code.
731 * khtml/editing/htmlediting_impl.cpp:
732 (khtml::StyleChange::StyleChange): Made this a full-on class and added a couple of
733 members and a constructors to make a StyleChange from a CSSStyleDeclarationImpl, as
734 well as from a CSSStyleDeclarationImpl and a Position.
735 (khtml::StyleChange::init): Common init function for StyleChange constructors.
736 (khtml::StyleChange::currentlyHasStyle): Moved this here from ApplyStyleCommandImpl.
737 (khtml::CompositeEditCommandImpl::applyTypingStyle): Tweak to adjust to new StyleChange
739 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Ditto.
740 * khtml/editing/htmlediting_impl.h:
741 (khtml::StyleChange::StyleChange):
742 (khtml::StyleChange::cssStyle): New accessor.
743 (khtml::StyleChange::applyBold): Ditto.
744 (khtml::StyleChange::applyItalic): Ditto.
745 * khtml/xml/dom_position.cpp:
746 (DOM::Position::computedStyle): New helper.
747 * khtml/xml/dom_position.h: Ditto.
749 2004-08-12 Ken Kocienda <kocienda@apple.com>
754 <rdar://problem/3751098> HTML email has one set of SPAN tags per character in the message
756 Progress on this bug:
757 <rdar://problem/3755562> Typing styles do not use same tag application conventions as font and color panel
759 * khtml/editing/htmlediting_impl.cpp:
760 (khtml::CompositeEditCommandImpl::applyTypingStyle): Name changed from createTypingStyleElement.
761 Also, interface changed to take the node to which the typing style is to be applied.
762 This makes it easier to apply what may be up to three levels of nested tags to get the
763 desired style (<B>, <I>, and <SPAN STYLE="">).
764 Also, Borrow some of the style change smarts from ApplyStyleCommandImpl to use bold and
765 italic tags for applying styles when that is apprpriate. This creates on opportunity to
766 factor the code to do this so that this function and the ApplyStyleCommandImpl class can
767 share the implementation. I will follow up with a change to do that after landing this
768 change. Some future code factoring could be done here to bring together some similar code
770 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Add comment about code factoring work.
771 (khtml::ApplyStyleCommandImpl::computeStyleChange): StyleChange struct no longer a member of the
772 ApplyStyleCommandImpl class. CompositeEditCommandImpl needs it now in its applyTypingStyle()
774 (khtml::InputNewlineCommandImpl::doApply): Pass along node to style to applyTypingStyle.
775 (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
776 * khtml/editing/htmlediting_impl.h:
777 (khtml::StyleChange::StyleChange): Pull this struct out of ApplyStyleCommandImpl so
778 CompositeEditCommandImpl can use it.
779 * khtml/khtml_part.cpp:
780 (KHTMLPart::notifySelectionChanged): Always clear typing style when the selection
781 changes, not only when closing typing. This fixes 3751098.
783 These three tests actually had results that treated the buggy behavior as correct!
785 * layout-tests/editing/style/style-3681552-fix-001-expected.txt
786 * layout-tests/editing/style/style-3681552-fix-002-expected.txt
787 * layout-tests/editing/style/typing-style-002-expected.txt
789 2004-08-12 Darin Adler <darin@apple.com>
793 - fixed <rdar://problem/3740485> Repro crash involving replacing content that includes form field
795 * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Since this function calls selectText: which has a side
796 effect of making the text field be first responder, call to bridge first to make it first responder.
797 The bridge version lets WebHTMLView know we are changing the responder, avoiding some unpleasantness
798 because it sets the "changing focus programmatically" flag. Without that flag set, we were getting
799 an additional setFocusNode(0) call, which is unnecessary and incorrect.
801 2004-08-12 Darin Adler <darin@apple.com>
805 - fixed <rdar://problem/3758756> copying text selected with down arrow results in all text to end of document
807 * khtml/xml/dom2_rangeimpl.h: Make startNode and pastEndNode public.
808 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::pastEndNode): Fix bug where this would return
809 one node too far in the case where the end container was not a text node.
811 * khtml/xml/dom_nodeimpl.cpp:
812 (NodeImpl::recursive_toHTMLWithOptions): Rewrite loop, using startNode and pastEndNode,
813 to fix bug where it would run past the end node, including too many nodes in the generated
814 HTML. Nice side benefit: easier to read the code.
816 2004-08-11 Chris Blumenberg <cblu@apple.com>
818 Fixed: <rdar://problem/3758216> PARENTAL: buttons on parental controls page only work once
822 * kwq/KWQKHTMLPart.mm:
823 (KWQKHTMLPart::submitForm): prevent a form from being submitted more than once only if it uses a scheme of http or https
825 2004-08-11 Darin Adler <darin@apple.com>
829 - fixed <rdar://problem/3715878> 8A162: connect.apple.com password field showed in cleartext
831 * kwq/KWQTextField.mm: (-[KWQSecureTextField textDidEndEditing:]):
832 Enhanced workaround for shifting focus from one secure text field to another so that it works
833 even for the case of shifting focus from a secure text field back to itself.
835 2004-08-11 Ken Kocienda <kocienda@apple.com>
839 Missed adding this file before.
841 * kwq/KWQTextUtilities.mm: Added.
842 (KWQFindNextWordFromIndex):
844 2004-08-11 Ken Kocienda <kocienda@apple.com>
848 Efficiency improvements on string manipulations in these two new function
849 implementations. Use the versions of QString append/prepend that take
850 (QChar *c, uint length) instead of creating new strings each time.
852 * khtml/xml/dom_position.cpp:
853 (DOM::Position::previousWordPosition): Changed, as described above.
854 (DOM::Position::nextWordPosition): Ditto.
856 2004-08-11 Ken Kocienda <kocienda@apple.com>
861 <rdar://problem/3675812> Moving a word at a time does not use the correct conception of "word"
863 I have implemented versions of previousWordPosition and nextWordPosition that are now
864 different than previousWordBoundary and nextWordBoundary. The behavior of the new
865 functions attempts to match what Cocoa does as closely as it can. Let the bug filing begin!
867 * WebCore.pbproj/project.pbxproj: Added KWQTextUtilities.mm
868 * khtml/misc/helper.cpp:
869 (khtml::nextWordFromIndex): Glue to call through to KWQFindNextWordFromIndex.
870 * khtml/misc/helper.h: Declare the function above.
871 * khtml/misc/khtml_text_operations.cpp: Added SimplifiedBackwardsTextIterator class.
872 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): New
873 (khtml::SimplifiedBackwardsTextIterator::advance): Ditto.
874 (khtml::SimplifiedBackwardsTextIterator::handleTextNode): Ditto.
875 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement): Ditto.
876 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Ditto.
877 (khtml::SimplifiedBackwardsTextIterator::exitNode): Ditto.
878 (khtml::SimplifiedBackwardsTextIterator::emitCharacter): Ditto.
879 (khtml::SimplifiedBackwardsTextIterator::range): Ditto.
880 * khtml/misc/khtml_text_operations.h:
881 (khtml::SimplifiedBackwardsTextIterator::atEnd): Ditto.
882 (khtml::SimplifiedBackwardsTextIterator::length): Ditto.
883 (khtml::SimplifiedBackwardsTextIterator::characters): Ditto.
884 * khtml/xml/dom_position.cpp:
885 (DOM::Position::previousWordBoundary): Updated to gather appropriate text and call through to
886 AppKit to perform the same calculations NSText uses.
887 (DOM::Position::nextWordBoundary): Ditto.
888 (DOM::Position::previousWordPosition): Unrelated change to fix case where the function could get "stuck".
889 (DOM::Position::nextWordPosition): Ditto
890 (DOM::Position::equivalentDeepPosition): Changed to look backwards if the position's offset is equal
891 to the number of child nodes it has. This handles more cases correctly, like when the position is
892 gives as one beyond the end of a document element's last child.
893 * kwq/KWQTextUtilities.h: Declared KWQFindNextWordFromIndex.
894 * kwq/KWQTextUtilities.mm: Added.
895 (KWQFindNextWordFromIndex): New function.
897 2004-08-11 Ken Kocienda <kocienda@apple.com>
903 <rdar://problem/3732702> crash in CSSComputedStyleDeclarationImpl running devtools.com editing sample code
905 * khtml/khtml_part.cpp:
906 (KHTMLPart::selectionComputedStyle): Added a null check.
908 2004-08-10 Darin Adler <darin@apple.com>
912 - fixed <rdar://problem/3710123> Loading iframe that replaces content in the parent document crashes Safari
914 I fixed three problems:
916 1) script interpreter destroyed while it was interpreting scripts, caused random havoc
917 2) code trying to get to view after view was detached from part, caused nil-deref
918 3) signals sent to parent after child was no longer in the parent's frames list, caused nil-deref
920 Now the test page works fine. Hope the real sites do too.
922 * khtml/khtml_part.h: Add connectChild and disconnectChild helper functions (private).
923 * khtml/khtml_part.cpp:
924 (KHTMLPart::clear): Call disconnectChild on each frame as we detach it (see below).
925 (KHTMLPart::end): Ref the part at the start, and deref the part at the end, of this function.
926 Otherwise, we can end up destroying the part, and hence the interpreter, inside a script that
927 the interpreter itself is running.
928 (KHTMLPart::slotFinishedParsing): Add another check for a nil m_view, after the call to
930 (KHTMLPart::checkCompleted): Remove bogus if statement with empty body.
931 (KHTMLPart::processObjectRequest): Call disconnectChild to disconnect the child <-> parent signals of the
932 old child that the new one is replacing, and connectChild to connect the signals (nicer factoring).
933 (KHTMLPart::slotChildCompleted): Fixed up a confusing boolean if/expression to be simpler. Not related to
934 the bug fix, but an earlier version of the fix had changes in this function.
935 (KHTMLPart::connectChild): Added. Connects the appropriate signals for a child frame.
936 (KHTMLPart::disconnectChild): Added. Disconnects the same signals that connectChild connects.
938 * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Added a call to disconnectChild before removing the
939 child from the frames list.
941 2004-08-09 Maciej Stachowiak <mjs@apple.com>
947 - made basic marked text highlighting work to complete basic level of <rdar://problem/3704359> input method support not yet implemented for HTML editing
949 * kwq/WebCoreBridge.mm:
950 (-[WebCoreBridge setMarkedDOMRange:]): Added this new call to support storing
951 a marked range in WebCore. The provided DOMRange must start and end in the same
952 node, which must be a text node.
953 (-[WebCoreBridge markedDOMRange]): New call to get the marked range.
954 (-[WebCoreBridge clearMarkedDOMRange]): New call to clear the marked range.
955 * kwq/WebCoreBridge.h: Prototype new methods.
956 * kwq/KWQKHTMLPart.mm:
957 (KWQKHTMLPart::markedRange): Implementation of WebCore call above.
958 (KWQKHTMLPart::setMarkedRange): Implementation of WebCore call above -
959 store the marked range, and repaint new and old nodes if needed.
960 (KWQKHTMLPart::clear): Clear marked range.
961 * kwq/KWQKHTMLPart.h: Prototype new methods.
962 * khtml/rendering/render_text.cpp:
963 (InlineTextBox::paintMarkedTextBackground): New method to paint the background
964 for marked text, modeled on paintSelection.
965 (RenderText::paint): Optionally handle painting marked text
966 background as well as selection background in the marked text
968 * khtml/rendering/render_text.h: Prototype new method.
970 2004-08-10 Darin Adler <darin@apple.com>
974 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
977 (QRegExp::KWQRegExpPrivate::compile): Null-terminate the pattern and pass it.
978 (QRegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
980 2004-08-10 Darin Adler <darin@apple.com>
986 * khtml/editing/jsediting.cpp: Capitalize command names to match Windows.
987 The dictionary lookup is case insensitive.
989 * kwq/KWQFoundationExtras.h: Remove inaccurate comment.
991 2004-08-10 Trey Matteson <trey@apple.com>
993 3757094 - crash spell checking after a paste
997 * khtml/rendering/render_text.cpp:
998 (InlineTextBox::paintSelection): Add nil check.
1000 2004-08-09 Trey Matteson <trey@apple.com>
1002 3756195 - spell checking leaves misspelling marker behind after bad word is deleted
1003 ... and other follow-on spell check fixes
1007 * khtml/rendering/render_text.cpp:
1008 (InlineTextBox::paintMarker): Close inspection shows we were drawing the
1009 misspelling marker one pixel lower than AK, and one pixel outside the selection
1010 rect we draw, in the case of Times-16. So move it up one. Still not an exact
1011 match for AK, but less bad.
1012 * khtml/xml/dom_docimpl.cpp:
1013 (DocumentImpl::removeMarker): Track whether we make any changes, so we only
1014 repaint if something actually changed.
1015 (DocumentImpl::removeAllMarkers): New utility.
1016 (DocumentImpl::removeAllMarkers): Use clear() instead of (errant)
1017 hand-rolled loop to empty array.
1018 (DocumentImpl::shiftMarkers): Track whether we make any changes, so we only
1019 repaint if something actually changed.
1020 * khtml/xml/dom_docimpl.h:
1021 * khtml/xml/dom_textimpl.cpp:
1022 (CharacterDataImpl::deleteData): Along with shifting existing markers around,
1023 remove any markers in the deleted range. Fixes 3756195.
1024 (CharacterDataImpl::replaceData): Ditto for the replaced range.
1025 * kwq/KWQKHTMLPart.mm:
1026 (KWQKHTMLPart::updateSpellChecking): comment
1028 2004-08-08 Trey Matteson <trey@apple.com>
1030 3745023 - Safari crashes trying to access anchor while downloading
1032 I bet this is behind a few other crashers as well. In this bug the start of the
1033 download leaves a KWQPageState hanging around, and when that is freed it damages
1034 the part and view. If you're still using that page, you're dead.
1036 The fix is to properly invalidate the PageState when we receive an error before
1037 reaching WebFrameCommitted state. Normally this happens when a page is reheated
1038 from the PageState, but in this case we never manage to leave the page to begin
1039 with, although we've already created the PageState.
1041 Other errors besides the synthetic one download generates would have caused similar
1042 crashing. Another example would be clicking on a second link before the load
1043 caused by clicking on the first link reached committed state.
1047 * kwq/WebCoreBridge.h:
1048 * kwq/WebCoreBridge.mm:
1049 (-[WebCoreBridge didNotOpenURL:pageCache:]): Invalidate the pageCache state
1050 when a load doesn't get off the ground.
1052 2004-08-06 Ken Kocienda <kocienda@apple.com>
1056 Finish off spellchecking support to HTML editing. Includes work to
1057 enable continuous spellchecking.
1059 * khtml/editing/htmlediting_impl.cpp:
1060 (khtml::EditCommandImpl::markMisspellingsInSelection): Basically, a one-liner convenience to
1061 make the call over to the KWQKHTMLPart.
1062 (khtml::ReplaceSelectionCommandImpl::doApply): Did some rearranging of code so that the
1063 inserted content can be spell-checked. The function is basically the same, except for
1064 the addition of calls to markMisspellingsInSelection.
1065 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): New function. Takes a look at the
1066 selection that results after typing and determines whether it needs to spellcheck.
1067 Since the word containing the current selection is never marked, this does a check to
1068 see if typing made a new word that is not in the current selection. Basically, you
1069 get this by being at the end of a word and typing a space.
1070 (khtml::TypingCommandImpl::typingAddedToOpenCommand): Call markMisspellingsAfterTyping.
1071 * khtml/editing/htmlediting_impl.h: Add new function declarations.
1072 * khtml/khtml_part.cpp:
1073 (KHTMLPart::setSelection): Since spell checks are updated when the selection changes,
1074 and every selection change passes through here, this is a good place to put the call
1075 to the spellchecker.
1076 * khtml/rendering/render_text.cpp:
1077 (InlineTextBox::paintMarker): Remove temporary misspelling line drawing code. Replace with
1078 call that does AppKit-style drawing. Fix up some comments.
1079 * khtml/xml/dom_docimpl.cpp:
1080 (DocumentImpl::addMarker): Repaint the node that had the marker added. This makes it show
1082 (DocumentImpl::removeMarker): Ditto.
1083 (DocumentImpl::removeAllMarkers): New function. Convenience for clearing all markers.
1084 Used when not in continuous spellchecking mode.
1085 (DocumentImpl::shiftMarkers): Moves markers in response to changes in a node's contents.
1086 This shifts the marker offsets by a given amount. This keeps the markers in the right
1087 place when a user types in a node with markers already set on it.
1088 * khtml/xml/dom_docimpl.h: Added new functions. Removed unnecessary enum qualifier from some
1090 * khtml/xml/dom_position.cpp:
1091 (DOM::Position::previousWordBoundary): This function was susceptible to endless loops...and
1092 needlessly so. Basically, if the current position is at a word boundary, run the code again
1093 to find the previous word boundary.
1094 (DOM::Position::nextWordBoundary): Same as above, but for next word boundary.
1095 * khtml/xml/dom_textimpl.cpp:
1096 (CharacterDataImpl::setData): Call shiftMarkers to update markers when this node changes.
1097 (CharacterDataImpl::insertData): Ditto.
1098 (CharacterDataImpl::deleteData): Ditto.
1099 (CharacterDataImpl::replaceData): Ditto.
1100 * kwq/KWQKHTMLPart.h:
1101 * kwq/KWQKHTMLPart.mm:
1102 (KWQKHTMLPart::advanceToNextMisspelling):
1103 (KWQKHTMLPart::markMisspellingsInSelection):
1104 (KWQKHTMLPart::updateSpellChecking):
1105 (KWQKHTMLPart::respondToChangedSelection):
1107 * kwq/KWQPainter.mm:
1108 (QPainter::drawLineForMisspelling): New function. Call over to WebKit to do the drawing.
1109 * kwq/WebCoreBridge.h:
1110 * kwq/WebCoreBridge.mm:
1111 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Pass markMisspellings flag to
1113 * kwq/WebCoreTextRenderer.h:
1117 2004-08-05 David Hyatt <hyatt@apple.com>
1119 Fix for 3752542, stack overflow that crashes Safari at www.dr.dk. This bug is a regression caused by a fix that
1120 attempted to repair <caption> behavior to make it behave like Panther. This fix was incorrect, and in addition
1121 even our <caption> behavior on Panther was incorrect.
1123 The patch that fixes this bug also makes <caption> handling work when <caption>s are contained inside a <td>, a <tr>,
1124 a <th>, or various table section tags (<tbody>, <tfoot>, <thead>). The <caption> is pulled out and inserted just before
1125 the relevant ancestor table section. This behavior matches other browsers.
1129 * khtml/html/htmlparser.cpp:
1130 (KHTMLParser::insertNode):
1132 2004-08-04 David Hyatt <hyatt@apple.com>
1134 The top-level XSL sheet is now loaded and shows up in the activity window. It is not yet parsed.
1136 Reviewed by kocienda
1138 * WebCore.pbproj/project.pbxproj:
1139 * khtml/css/css_base.h:
1140 (DOM::StyleBaseImpl::isXSLStyleSheet):
1141 * khtml/css/css_stylesheetimpl.cpp:
1142 (CSSStyleSheetImpl::CSSStyleSheetImpl):
1143 * khtml/css/css_stylesheetimpl.h:
1144 (DOM::StyleSheetImpl::isLoading):
1145 * khtml/misc/loader.cpp:
1146 * khtml/xml/dom_xmlimpl.cpp:
1147 (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
1148 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1149 (DOM::ProcessingInstructionImpl::sheet):
1150 (DOM::ProcessingInstructionImpl::isLoading):
1151 (DOM::ProcessingInstructionImpl::setStyleSheet):
1152 * khtml/xml/dom_xmlimpl.h:
1154 2004-08-04 David Hyatt <hyatt@apple.com>
1156 Add XSL Stylesheets to the WebCore cache.
1158 Reviewed by kocienda
1160 * khtml/misc/loader.cpp:
1161 (CachedXSLStyleSheet::CachedXSLStyleSheet):
1162 (CachedXSLStyleSheet::ref):
1163 (CachedXSLStyleSheet::deref):
1164 (CachedXSLStyleSheet::data):
1165 (CachedXSLStyleSheet::checkNotify):
1166 (CachedXSLStyleSheet::error):
1167 (DocLoader::requestXSLStyleSheet):
1168 (Cache::requestXSLStyleSheet):
1169 (Cache::getStatistics):
1170 * khtml/misc/loader.h:
1171 (khtml::CachedObject::):
1172 (khtml::CachedXSLStyleSheet::sheet):
1173 (khtml::CachedXSLStyleSheet::schedule):
1175 2004-08-03 Ken Kocienda <kocienda@apple.com>
1179 Changes to improve our handling of object tags during editing, including
1182 <rdar://problem/3744533> Problem editing <OBJECT> elements displayed by WebPlugIns
1184 Part of the fix for this bug involves removing the close() function from render objects.
1185 It was decided that this code was no longer needed, as the work it did could be moved
1186 to other, more modern, places.
1190 <rdar://problem/3748537> crash due to nil node passed into parentNode in computeTypingStyle deleting text
1192 Finally, I filed and fixed this bug I discovered while fixing the one above:
1194 <rdar://problem/3749338> Select-all + delete leaves editing view without blinking caret
1196 * khtml/editing/htmlediting_impl.cpp:
1197 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Fix for 3748537. Put in some more null
1198 checks. Bail, returning 0 for typing style if any null checks yield a null.
1199 (khtml::DeleteSelectionCommandImpl::doApply): Fix for 3749338. A removeNodeAndPrune call may wind
1200 up deleting the node where we calculated that we wanted to put the selection after deleting.
1201 If this happens, move this ending selection to a sensible alternative.
1202 (khtml::RemoveNodeAndPruneCommandImpl::doApply): Call previousNodeConsideringAtomicNodes instead
1203 of traversePreviousNode when doing the prune.
1204 * khtml/html/html_objectimpl.cpp:
1205 (HTMLObjectElementImpl::attach): Part of the fix for 3744533.
1206 (HTMLObjectElementImpl::recalcStyle): Change old strcmp check for type of renderer to be a call
1207 to canRenderImageType.
1208 (HTMLObjectElementImpl::childrenChanged): New function. Helps to keep object tags up to date
1209 as their children change. This also will help to make object tags respond properly to having their
1210 params changed by DOM calls.
1211 * khtml/html/html_objectimpl.h: Cosmetic change.
1212 * khtml/html/htmlparser.cpp:
1213 (KHTMLParser::insertNode): Remove call to obsolete closeRenderer() function.
1214 (KHTMLParser::popOneBlock): Ditto.
1215 * khtml/rendering/render_block.cpp:
1216 (khtml::RenderBlock::makeChildrenNonInline): Remove call to obsolete close() function.
1217 * khtml/rendering/render_container.cpp:
1218 (RenderContainer::updatePseudoChild): Ditto.
1219 * khtml/rendering/render_form.cpp: Remove obsolete close() function.
1220 * khtml/rendering/render_form.h: Ditto.
1221 * khtml/rendering/render_frames.cpp: Ditto.
1222 * khtml/rendering/render_frames.h: Ditto.
1223 * khtml/rendering/render_inline.cpp:
1224 (RenderInline::splitFlow): Remove calls to obsolete close() function.
1225 * khtml/rendering/render_object.h: Remove obsolete close() function.
1226 * khtml/rendering/render_table.cpp:
1227 (RenderTableCell::layout): Ditto.
1228 * khtml/rendering/render_table.h: Ditto.
1229 * khtml/xml/dom_docimpl.cpp:
1230 (DocumentImpl::closeInternal): Remove call to obsolete close() function.
1231 * khtml/xml/dom_nodeimpl.cpp: Remove obsolete m_rendererNeedsClose initialization.
1232 (NodeImpl::NodeImpl): Remove obsolete closeRenderer() function.
1233 (NodeImpl::attach): Remove call to obsolete close() function.
1234 (NodeImpl::isAtomicNode): New function. Helps to fix 3744533. Determines if a node should
1235 be treated as an atomic node for the purposes of editing.
1236 (NodeImpl::previousNodeConsideringAtomicNodes): New helper to traverse tree taking atomic nodes
1238 (NodeImpl::nextNodeConsideringAtomicNodes): Ditto.
1239 (NodeImpl::previousLeafNode): Now calls nextNodeConsideringAtomicNodes to iterate. This helps to
1240 prevent deleting PARAM tag portions of object tags erroneously.
1241 (NodeImpl::nextLeafNode): Ditto.
1242 * khtml/xml/dom_nodeimpl.h: Removed m_rendererNeedsClose bit. Added declarations for new functions.
1243 * khtml/xml/dom_position.cpp:
1244 (DOM::Position::equivalentDeepPosition): Now takes atomic nodes into account as it drills down into the
1246 * khtml/xml/xml_tokenizer.cpp:
1247 (khtml::XMLTokenizer::endElement): Remove call to obsolete closeRenderer() function.
1249 2004-08-03 David Hyatt <hyatt@apple.com>
1251 Add the deprecated text/xsl MIME type (introduced by Internet Explorer 5) as an acceptable MIME type for XML
1256 * khtml/ecma/xmlhttprequest.cpp:
1257 (KJS::XMLHttpRequest::getValueProperty):
1258 * khtml/khtml_part.cpp:
1260 * khtml/misc/loader.cpp:
1261 (CachedXBLDocument::CachedXBLDocument):
1263 2004-08-03 Maciej Stachowiak <mjs@apple.com>
1267 - remove assertions that asserted text is non-empty, just avoid
1268 doing anything for the empty case; this is needed because input
1269 methods like to insert empty text in various cases.
1271 * khtml/editing/htmlediting_impl.cpp:
1272 (khtml::InsertTextCommandImpl::InsertTextCommandImpl):
1273 (khtml::InsertTextCommandImpl::doApply):
1274 (khtml::InsertTextCommandImpl::doUnapply):
1276 2004-08-03 Darin Adler <darin@apple.com>
1280 - fixed <rdar://problem/3740937> ER: A way to turn a DOMRange into text (equivalent of -innerText)
1282 * khtml/xml/dom2_rangeimpl.h: Added text function. Like innerText, but on a range.
1283 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::text): Added.
1285 * kwq/DOM.mm: (-[DOMRange _text]): Added. Calls DOM::RangeImpl::text.
1286 * kwq/DOMPrivate.h: Added.
1288 * WebCore.pbproj/project.pbxproj: Added DOMPrivate.h, an internal header (private in WebKit, internal here).
1290 2004-08-02 John Sullivan <sullivan@apple.com>
1294 WebCore part of fix for <rdar://problem/3631868> NSToolbar adoption:
1295 Tab key should cycle around toolbar and page content
1297 * kwq/WebCoreBridge.mm:
1298 (-[WebCoreBridge nextKeyViewInsideWebFrameViews]):
1299 Made this method start looking from the current focus node. This won't
1300 affect any existing callers because there were no existing callers.
1301 (-[WebCoreBridge previousKeyViewInsideWebFrameViews]):
1304 2004-08-02 David Hyatt <hyatt@apple.com>
1306 Create a #define for XSLT support that at the moment will only be enabled on Tiger.
1308 Reviewed by kocienda
1312 2004-08-02 Ken Kocienda <kocienda@apple.com>
1318 <rdar://problem/3747945> Deleting replaced element can cause crash
1320 * khtml/xml/dom_selection.cpp:
1321 (DOM::Selection::layoutCaret): The crux of the problem is that
1322 the caret drawing code tries to draw the caret at the image
1323 offset after it has been removed from the document. So, make
1324 sure the start node for the selection is in the document before
1325 trying to lay out the caret using that node.
1327 2004-07-31 Ken Kocienda <kocienda@apple.com>
1331 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
1332 <rdar://problem/3746408> HTMLCompose: cannot type in message body of new messages (and tabbing causes a crash.)
1334 * kwq/KWQKHTMLPart.mm:
1335 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Add in some smarts to look around for
1336 a good place to put the caret if focus is turning "on", the part is contentEditable,
1337 and it does not currently have a selection. This has the effect of flashing the caret
1338 in a contentEditable view automatically without requiring the programmer to set a
1339 selection explicitly. This also fixes the bug listed above. Both are cases where the
1340 bad behavior happened since the editing code tried to process input without an active
1341 selection. I always took the extra step of setting the selection explicitly when
1342 opening new windows in programs like Blot, but it seems silly to require developers to
1343 do this in general. With this patch, they no longer need to.
1345 2004-07-30 Ken Kocienda <kocienda@apple.com>
1351 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
1353 * khtml/xml/dom_selection.cpp:
1354 (DOM::Selection::layoutCaret): Don't bail when the start position of the selection is not in rendered
1355 content. The validate() bottleneck function will do all it can to make sure that the start is
1356 moved to rendered content if at all possible before this function runs. If no rendered position can
1357 be found, like in the case of an empty body element, we still want to flash the caret there.
1358 (DOM::Selection::validate): Look for rendered positions for the base and extent, but save off the
1359 base before making this move, and set the selection to the enclosing block flow element of this
1360 original base if no rendered positions can be found. This has the effect of flashing the caret
1361 someplace in an editable block, even if it does not contain any rendered content.
1363 2004-07-30 Ken Kocienda <kocienda@apple.com>
1367 Fix a large number of editing layout test regressions.
1369 * khtml/misc/khtml_text_operations.cpp:
1370 (khtml::TextIterator::TextIterator): Use a new way to compute the end offset of a node for
1371 purposes of text iteration. The end offset is either child count of a node with children,
1372 or the maxOffset() of a node that does not.
1373 * khtml/xml/dom_nodeimpl.cpp: Remove maxOffset() implementation from NodeBaseImpl. This
1374 conflicted with the usage of this function that is needed for editing.
1375 * khtml/xml/dom_nodeimpl.h: Ditto.
1377 2004-07-30 Trey Matteson <trey@apple.com>
1379 Next steps for spell checking: We have data structures for the marked pieces of
1380 text and the smarts to draw them (although at this point, they just get a green
1381 underline instead of using the real AppKit pattern.)
1383 Note we don't call this code outside of development, since at this point I suspect
1384 it could be made to crash by mixing spelling and editing.
1388 * khtml/rendering/render_text.cpp:
1389 (InlineTextBox::paintMarker): Paint one marker's intersection with a text run
1390 (RenderText::paint): Find intersections of all markers and runs, call paintMarker
1391 * khtml/rendering/render_text.h:
1392 * khtml/xml/dom_docimpl.cpp:
1393 (DocumentImpl::addMarker): Adds a marker to a DOM Range.
1394 (DocumentImpl::removeMarker): Removes a marker from a DOM Range.
1395 (DocumentImpl::addMarker): Adds a marker to a single DOM Node, merging previous
1397 (DocumentImpl::removeMarker): Removes a marker from a single DOM Node, breaking
1398 up previous markers as needed.
1399 (DocumentImpl::markersForNode): Return markers for a Node.
1400 * khtml/xml/dom_docimpl.h:
1401 (DOM::DocumentMarker::): New marker struct
1402 (DOM::DocumentMarker::operator == ):
1403 (DOM::DocumentMarker::operator != ):
1404 * kwq/KWQKHTMLPart.mm:
1405 (KWQKHTMLPart::advanceToNextMisspelling): Mark misspelled ranges when we find them.
1408 2004-07-29 Maciej Stachowiak <mjs@apple.com>
1412 <rdar://problem/3745808> Seed: WebKit: Table's caption broken
1414 * khtml/html/htmlparser.cpp:
1415 (KHTMLParser::insertNode): When a caption appears in an illegal
1416 place in a table, pop blocks until we hit a place where it's
1421 2004-07-29 Darin Adler <darin@apple.com>
1425 - added constants for motion across entire document for use in operations like
1426 move to beginning of document
1428 * khtml/xml/dom_selection.h: Added DOCUMENT to ETextGranularity.
1429 * khtml/xml/dom_selection.cpp:
1430 (DOM::Selection::modifyExtendingRightForward): Added case for DOCUMENT.
1431 (DOM::Selection::modifyMovingRightForward): Added case for DOCUMENT.
1432 (DOM::Selection::modifyExtendingLeftBackward): Added case for DOCUMENT.
1433 (DOM::Selection::modifyMovingLeftBackward): Added case for DOCUMENT.
1434 (DOM::Selection::validate): Changed if statements into switch statement,
1435 added case for DOCUMENT.
1437 * kwq/WebCoreBridge.h: Added WebCoreBridge to WebSelectionGranularity.
1439 2004-07-28 Trey Matteson <trey@apple.com>
1441 Small refinement of last checkin. The text iterators now return reasonable values
1442 for range() when atEnd, which gets rid of special cases and pitfalls in the client.
1446 * khtml/misc/khtml_text_operations.cpp:
1447 (khtml::TextIterator::TextIterator): Set endOffset to a valid value instead of
1449 (khtml::TextIterator::range): Implement when atEnd.
1450 (khtml::CharacterIterator::range): Don't massage result when atEnd.
1451 (khtml::WordAwareIterator::WordAwareIterator): Now that this is fixed, we no
1452 longer need this special case.
1453 (khtml::WordAwareIterator::advance): Always set range, even when atEnd, now that
1454 TextIterator::range() always works.
1455 * khtml/xml/dom_nodeimpl.cpp:
1456 (NodeImpl::childNodeCount): Made const
1457 (NodeBaseImpl::maxOffset): Add missing implementation
1458 * khtml/xml/dom_nodeimpl.h:
1459 * kwq/KWQKHTMLPart.mm:
1460 (KWQKHTMLPart::advanceToNextMisspelling): Get rid of special cases, always call
1461 range on our iterator even when it is atEnd.
1463 2004-07-28 Maciej Stachowiak <mjs@apple.com>
1467 <rdar://problem/3678534> controls on page at http://help.sap.com don't work properly
1469 To fix this I implemented the various JavaScript BarInfo properties in JavaScript.
1471 * khtml/ecma/kjs_window.cpp:
1473 (Window::locationbar):
1475 (Window::personalbar):
1476 (Window::statusbar):
1478 (Window::scrollbars):
1481 (SelectionFunc::tryCall):
1483 (BarInfo::~BarInfo):
1486 * khtml/ecma/kjs_window.h:
1489 (KJS::BarInfo::part):
1490 (KJS::BarInfo::classInfo):
1491 * khtml/ecma/kjs_window.lut.h:
1493 * kwq/KWQKHTMLPart.h:
1494 * kwq/KWQKHTMLPart.mm:
1495 (KWQKHTMLPart::locationbarVisible):
1496 (KWQKHTMLPart::menubarVisible):
1497 (KWQKHTMLPart::personalbarVisible):
1498 (KWQKHTMLPart::scrollbarsVisible):
1499 (KWQKHTMLPart::statusbarVisible):
1500 (KWQKHTMLPart::toolbarVisible):
1502 2004-07-28 Ken Kocienda <kocienda@apple.com>
1506 Added more layout tests.
1508 * layout-tests/editing/style/style-3681552-fix-001-expected.txt: Added.
1509 * layout-tests/editing/style/style-3681552-fix-001.html: Added.
1510 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Added.
1511 * layout-tests/editing/style/style-3681552-fix-002.html: Added.
1512 * layout-tests/editing/style/style-3690704-fix-expected.txt: Added.
1513 * layout-tests/editing/style/style-3690704-fix.html: Added.
1514 * layout-tests/editing/style/typing-style-001-expected.txt: Added.
1515 * layout-tests/editing/style/typing-style-001.html: Added.
1516 * layout-tests/editing/style/typing-style-002-expected.txt: Added.
1517 * layout-tests/editing/style/typing-style-002.html: Added.
1519 2004-07-28 Ken Kocienda <kocienda@apple.com>
1523 Added some layout tests.
1525 * layout-tests/editing/selection/select-all-001-expected.txt: Added.
1526 * layout-tests/editing/selection/select-all-001.html: Added.
1527 * layout-tests/editing/selection/select-all-002-expected.txt: Added.
1528 * layout-tests/editing/selection/select-all-002.html: Added.
1529 * layout-tests/editing/selection/select-all-003-expected.txt: Added.
1530 * layout-tests/editing/selection/select-all-003.html: Added.
1532 2004-07-28 Trey Matteson <trey@apple.com>
1534 Spellchecking, Part I. Basic spellcheck is working. Spelling panel is hooked up.
1536 At this point, no special marking of misspellings, no grammar check, no context
1537 menu integration, no "check continually" mode.
1539 Much of the TextIterator and CharacterIterator interface got published outside
1540 of khtml_text_operations.cpp, with a little API rationalizing.
1544 * khtml/misc/khtml_text_operations.cpp:
1545 (khtml::TextIterator::range): Name changes.
1546 (khtml::CharacterIterator::CharacterIterator): Ditto.
1547 (khtml::CharacterIterator::range): Ditto.
1548 (khtml::CharacterIterator::advance): Ditto.
1549 (khtml::CharacterIterator::string): New method to consume chars into a string.
1550 (khtml::WordAwareIterator::WordAwareIterator): New class that iterates over
1551 the text respecting word boundaries.
1552 (khtml::WordAwareIterator::advance):
1553 (khtml::WordAwareIterator::length):
1554 (khtml::WordAwareIterator::characters):
1555 (khtml::plainText): Name changes.
1556 (khtml::findPlainText): Ditto.
1558 API moved from cpp to header file.
1559 * khtml/misc/khtml_text_operations.h:
1560 (khtml::TextIterator::atEnd):
1561 (khtml::TextIterator::length):
1562 (khtml::TextIterator::characters):
1563 (khtml::CharacterIterator::atBreak):
1564 (khtml::CharacterIterator::atEnd):
1565 (khtml::CharacterIterator::length):
1566 (khtml::CharacterIterator::characters):
1567 (khtml::CharacterIterator::characterOffset):
1568 (khtml::WordAwareIterator::atEnd):
1569 (khtml::WordAwareIterator::range):
1571 * khtml/xml/dom_position.cpp:
1572 (DOM::Position::previousWordBoundary): New name for the old routine. This routines semantics
1573 match the current behavior of this code.
1574 (DOM::Position::nextWordBoundary): Ditto.
1575 (DOM::Position::previousWordPosition): Call old code with the new name. When we fix
1576 word advancement, this routine will have its own impl.
1577 (DOM::Position::nextWordPosition): Ditto.
1578 * khtml/xml/dom_position.h:
1579 * khtml/xml/dom_selection.h:
1580 (DOM::Selection::rangeStart): New convenience methods
1581 (DOM::Selection::rangeEnd):
1582 * kwq/KWQKHTMLPart.h:
1583 * kwq/KWQKHTMLPart.mm:
1584 (KWQKHTMLPart::findString): Ensure we use range-compatible positions.
1585 (KWQKHTMLPart::advanceToNextMisspelling): Brand new.
1586 * kwq/WebCoreBridge.h:
1587 * kwq/WebCoreBridge.mm:
1588 (-[WebCoreBridge advanceToNextMisspelling]): Typical bridge glue.
1590 2004-07-28 Ken Kocienda <kocienda@apple.com>
1596 <rdar://problem/3690704> marking partly bold text italic across blocks wrongly extends the bold section
1598 * khtml/editing/htmlediting_impl.cpp:
1599 (khtml::ApplyStyleCommandImpl::doApply): Fixed loop that gathers up groups of nodes to
1600 pass off to the function that applies styles. While this is meant to be conservative in
1601 order to leave the DOM well-formed in all cases, it contained an error where the set
1602 of nodes to be styled together erroneously could include a node that was meant for
1603 the next set. Fixed.
1604 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Unrelated change to remove DOM:: scope
1605 resolution qualifier. Unneeded here.
1607 2004-07-28 Darin Adler <darin@apple.com>
1611 - fixed <rdar://problem/3658471> REGRESSION: Node.appendChild( ) fails when parent already contains that child
1613 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::isAncestor): Restore the original meaning of this function.
1614 It returns true if the parameter is an ancestor of this, but had been changed to return true if this
1615 is an ancestor of the parameter. However, we do retain one change we made at the same time, which is
1616 that it does not consider a node an ancestor of itself.
1618 * khtml/editing/htmlediting_impl.cpp: (khtml::ApplyStyleCommandImpl::nodeFullySelected):
1619 * khtml/xml/dom2_traversalimpl.cpp: (DOM::NodeIteratorImpl::notifyBeforeNodeRemoval):
1620 Reverse parameters for callers who wanted the new meaning of isAncestor, with care to not use it in
1621 any cases where the pointer might be 0.
1623 * khtml/xml/dom_nodeimpl.h: Added const to the parameter to make things more symmetric and allow the
1624 new uses to all compile.
1626 2004-07-28 Ken Kocienda <kocienda@apple.com>
1632 <rdar://problem/3681552> html editing needs to preserve typing font when replacing selection
1634 * khtml/css/css_valueimpl.cpp:
1635 (CSSStyleDeclarationImpl::merge): New helper that merges styles together. Helpful for
1636 dealing with typing styles.
1637 * khtml/css/css_valueimpl.h:
1638 * khtml/editing/htmlediting_impl.cpp:
1639 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): New helper that updates the
1640 typing style based on the current selection. This is a convenient bottleneck for all
1641 the code that needs to worry about typing style.
1642 (khtml::DeleteSelectionCommandImpl::doApply): Update typing style before doing the delete.
1643 (khtml::InputNewlineCommandImpl::doApply): No need to redeclare exceptionCode local.
1645 (khtml::InputTextCommandImpl::prepareForTextInsertion): Remove unneeded complication when
1646 figuring out where to insert style node. Not even sure what I was trying to do here, but
1647 it does not seem to be needed any more.
1648 (khtml::InputTextCommandImpl::execute): Remove unneeded comment.
1649 * khtml/editing/htmlediting_impl.h: Declare new computeTypingStyle helper.
1650 * khtml/khtml_part.cpp:
1651 (KHTMLPart::setCaretVisible): Call selectionLayoutChanged instead of notifySelectionChanged
1652 in this function. The selection did not change simply by calling this function, but it
1654 (KHTMLPart::notifySelectionChanged): Treat clearing the typing style much like closing typing,
1655 instead of clearing it unconditionally.
1656 (KHTMLPart::applyStyle): In the case where the current selection is a caret, merge the
1657 style being applied with any current typing style that already exists.
1659 2004-07-28 Darin Adler <darin@apple.com>
1663 - fixed <rdar://problem/3711080> REGRESSION (125-146): form fields have shrunk by 1 pixel, and now clip descenders
1665 * kwq/KWQLineEdit.mm: (QLineEdit::sizeForCharacterWidth):
1666 Compute the size without ever calling cellSize. After talking with Andrew Platzer,
1667 we decided that hard-coding the size of the borders of a text field was the best
1668 way for WebCore to handle this.
1670 2004-07-28 Darin Adler <darin@apple.com>
1674 - fixed <rdar://problem/3743204> REGRESSION: crash at startribune.com in InlineBox::root()
1676 * khtml/rendering/render_flow.cpp: (RenderFlow::dirtyLinesFromChangedChild):
1677 Added a check for nil.
1679 2004-07-27 Darin Adler <darin@apple.com>
1683 - fixed <rdar://problem/3743138> opaque colors come out of getComputedStyle as "rgba", transparent ones as "rgb"
1685 * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cssText): Use "rgb" rather than
1686 "rgba" when alpha is 0xFF, not when alpha is 0.
1688 2004-07-27 Ken Kocienda <kocienda@apple.com>
1692 Fixed the problem where BR elements on lines by themselves don't paint when selected.
1694 * khtml/khtml_part.cpp:
1695 (KHTMLPart::selectAll): Related fix. Include BR's when figuring out what "all" is.
1696 * khtml/rendering/render_br.cpp:
1697 (RenderBR::paint): New function implementation. Teach BR's how to paint selections.
1698 * khtml/rendering/render_br.h:
1699 * khtml/rendering/render_text.cpp:
1700 (InlineTextBox::paintSelection): Fix some geometry calculations to be more readable (i.e. don't
1701 reuse function argument as a local). Also, improve the logic for determining whether to
1702 extend the selection to block boundaries.
1703 (RenderText::paint): Remove extendSelection argument from paintSelection. The logic to figure out
1704 extensions is now fully contained in paintSelection.
1705 * khtml/rendering/render_text.h:
1707 2004-07-27 David Hyatt <hyatt@apple.com>
1709 Fix for 3665211 (again). Make sure not to leave child line boxes pointing to deleted ancestor line boxes.
1711 Reviewed by kocienda
1713 * khtml/rendering/render_block.cpp:
1714 (khtml::RenderBlock::removeChild):
1716 2004-07-26 Chris Blumenberg <cblu@apple.com>
1718 Fixed: WebView scrolls to the top after making an editing change via drag & drop
1720 Fixed by Ken, reviewed by me.
1722 * kwq/WebCoreBridge.mm:
1723 (-[WebCoreBridge ensureCaretVisible]): do nothing if the selection is not a caret
1727 2004-07-26 Maciej Stachowiak <mjs@apple.com>
1731 <rdar://problem/3740855> REGRESSION: Flash incorrectly positioned at macromedia.com
1733 * khtml/html/htmltokenizer.cpp:
1734 (khtml::HTMLTokenizer::scriptExecution): Do the prepending-src
1735 trick as for inline script execution.
1737 Added new layout tests covering this and other recent tokenizer
1740 * layout-tests/fast/tokenizer/001-expected.txt: Added.
1741 * layout-tests/fast/tokenizer/001.html: Added.
1742 * layout-tests/fast/tokenizer/002-expected.txt: Added.
1743 * layout-tests/fast/tokenizer/002.html: Added.
1744 * layout-tests/fast/tokenizer/003-expected.txt: Added.
1745 * layout-tests/fast/tokenizer/003.html: Added.
1746 * layout-tests/fast/tokenizer/resources/003-script.js: Added.
1748 2004-07-23 Ken Kocienda <kocienda@apple.com>
1754 <rdar://problem/3738920> Caret blinks in inactive window
1756 As part of the fix, I cleaned up the way we handle special drawing that needs
1757 to be done in the HTML view that is first responder in the key window (e.g the
1758 drawing of text selection highlight and caret blinking).
1760 * khtml/khtml_part.cpp: Removed setCaretVisible function. Updating caret visibility
1761 is now done in setDisplaysWithFocusAttributes, described below.
1762 * khtml/khtml_part.h: Ditto.
1763 * khtml/khtmlpart_p.h:
1764 (KHTMLPartPrivate::KHTMLPartPrivate): m_caretVisible now defaults to false. This prevents
1765 the caret from blinking when an app is started from the command line and remains in the
1767 * khtml/khtmlview.cpp:
1768 (KHTMLView::focusInEvent): Remove caret code from here. Not needed.
1769 (KHTMLView::focusOutEvent): Ditto.
1770 * kwq/KWQKHTMLPart.h:
1771 (KWQKHTMLPart::displaysWithFocusAttributes): New accessor to return cached value to other code
1773 * kwq/KWQKHTMLPart.mm:
1774 (KWQKHTMLPart::KWQKHTMLPart):
1775 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Renamed from setShowsFirstResponder and modified
1776 to do the display updating in a clearer way....and now has comments!
1777 * kwq/WebCoreBridge.h: Remove several obsolete functions that use to try to do the work of the new
1778 setDisplaysWithFocusAttributes function (and did so less well).
1779 * kwq/WebCoreBridge.mm:
1780 (-[WebCoreBridge drawRect:]): Now calls displaysWithFocusAttributes to figure out how to draw the
1781 text selection background.
1782 (-[WebCoreBridge setDisplaysWithFocusAttributes:]): Calls through to setDisplaysWithFocusAttributes in
1784 (-[WebCoreBridge selectionColor]): Flipped the value of this ternary expression to accommodate the
1785 change from usesInactiveTextBackgroundColor to setDisplaysWithFocusAttributes.
1786 (-[WebCoreBridge setCaretVisible:]): Removed.
1788 2004-07-23 John Sullivan <sullivan@apple.com>
1792 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
1793 now also extends selection (even if there wasn't one before)
1795 * khtml/khtml_part.cpp:
1796 (KHTMLPart::handleMousePressEventSingleClick):
1797 Uh, duh. Got a ! wrong last time somehow, so it did even more the wrong thing
1798 than ever. I did test this before, so my best guess is an accidental undo or
1799 something before committing.
1801 2004-07-23 David Hyatt <hyatt@apple.com>
1803 Fix for 3735084 and 3737209, when you can find no line boxes in your previous sibling, the line box to dirty
1804 should be the *first* line box and not the last.
1806 Reviewed by kocienda
1808 * khtml/rendering/render_flow.cpp:
1809 (RenderFlow::dirtyLinesFromChangedChild):
1811 2004-07-23 Ken Kocienda <kocienda@apple.com>
1815 * khtml/xml/dom_selection.cpp:
1816 (DOM::Selection::validate): Not exactly a fix of anything per se, but more of a refinement
1817 of how selection validation works. The idea is to let the selection validation process
1818 end up with an empty selection given real DOM position inputs if the validation code
1819 cannot find a rendered position. Since selection is all about display, this makes sense.
1820 Currently, the code will allow the selection to be placed in a location that is not
1821 rendered, and this does nobody any good, as it can lead to bugs like accepting key input
1822 in a div that is set to display:none.
1824 2004-07-23 Ken Kocienda <kocienda@apple.com>
1828 Updated layout tests with new expected results.
1830 * layout-tests/editing/execCommand/boldSelection-expected.txt
1831 * layout-tests/editing/selection/extend-by-character-001-expected.txt
1832 * layout-tests/editing/selection/extend-by-character-003-expected.txt
1833 * layout-tests/editing/selection/unrendered-005-expected.txt
1835 2004-07-22 Maciej Stachowiak <mjs@apple.com>
1839 <rdar://problem/3725467> REGRESSION(140-142) nothing displayed at http://Ye-Olde-Movies.tripod.com
1840 <rdar://problem/3599494> REGRESSION (100-125): Frame does not refresh until user clicks on browser.
1842 * khtml/rendering/render_frames.cpp:
1843 (RenderFrameSet::layout): When returning early because there are
1844 no children, make sure to mark self as no longer needing
1845 layout. Otherwise, when children are added, we'll fail to
1846 propagate childrenNeedLayout to our own parent! This is almost
1847 certainly a long-standing bug that was just masked by our old
1850 2004-07-22 Kevin Decker <kdecker@apple.com>
1854 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1856 * khtml/ecma/kjs_events.cpp:
1857 (JSLazyEventListener::JSLazyEventListener):
1858 (JSLazyEventListener::parseCode):
1859 * khtml/ecma/kjs_events.h:
1860 * khtml/ecma/kjs_proxy.cpp:
1861 (KJSProxyImpl::createHTMLEventHandler):
1862 * khtml/ecma/kjs_window.cpp:
1863 (Window::getJSLazyEventListener):
1864 * khtml/ecma/kjs_window.h:
1866 2004-07-22 Ken Kocienda <kocienda@apple.com>
1872 <rdar://problem/3724344> Bolding and unbolding creates extraneous tags
1874 * khtml/editing/htmlediting_impl.cpp:
1875 (khtml::ApplyStyleCommandImpl::doApply): Move the start of the selection upstream
1876 before calling removeStyle. This makes sure we remove all styles that could apply to the
1877 selection, and not just ones in from the start position of the selection passed to us.
1879 * khtml/xml/dom_selection.cpp:
1880 (DOM::Selection::validate): Related fix to "constrain" the selection to be the
1881 smallest equivalent range of nodes, in effect making a "canonical" version of the
1882 selection. While this is not strictly necessary to fix the bug, it is a step I have been
1883 wanting to take this step for a long time, and some recent improvements made it
1884 possible for me to do now in just two lines of code.
1886 2004-07-22 Ken Kocienda <kocienda@apple.com>
1892 <rdar://problem/3711264> difficult (impossible?) to get cursor in an editable webview containing only tags
1894 * khtml/rendering/render_container.cpp:
1895 (RenderContainer::positionForCoordinates): Don't assume you can pass off
1896 the check to a first child if there is one, since the child can be an element
1897 we do not want to place the caret in, like a table row with no cells (the case
1898 in the bug above). So now, we iterate of the renderer's children looking for
1899 the closest one, but only consider those renderers which either have children
1900 themselves, or are render block flows or are render inlines.
1902 2004-07-22 Darin Adler <darin@apple.com>
1904 - remove a bunch of now-unused code
1906 * ForwardingHeaders/qxml.h: Removed.
1907 * kwq/KWQXmlAttributes.h: Removed.
1908 * kwq/KWQXmlAttributes.mm: Removed.
1909 * kwq/KWQXmlDefaultHandler.h: Removed.
1910 * kwq/KWQXmlDefaultHandler.mm: Removed.
1911 * kwq/KWQXmlSimpleReader.h: Removed.
1912 * kwq/KWQXmlSimpleReader.mm: Removed.
1914 2004-07-22 Darin Adler <darin@apple.com>
1918 - got rid of QXml classes and changed XML parsing to use libxml directly
1920 This is the first step toward more direct use of libxml and libxslt.
1921 Dave is planning to build on this to implement XSLT and to improve our handling
1922 of XML documents (faster and more feature complete, including DTDs).
1924 * khtml/html/html_elementimpl.cpp:
1925 (HTMLElementImpl::createContextualFragment):
1926 * khtml/html/htmltokenizer.cpp:
1927 (khtml::HTMLTokenizer::HTMLTokenizer):
1928 * khtml/html/htmltokenizer.h:
1929 * khtml/xml/dom_docimpl.cpp:
1930 (DocumentImpl::createTokenizer):
1931 (DocumentImpl::open):
1932 * khtml/xml/dom_docimpl.h:
1933 (DOM::DocumentImpl::tokenizer):
1934 * khtml/xml/dom_xmlimpl.cpp:
1935 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1936 * khtml/xml/dom_xmlimpl.h:
1937 * khtml/xml/xml_tokenizer.h:
1938 * khtml/xml/xml_tokenizer.cpp: Redid this all to use libxml directly.
1940 * WebCore.pbproj/project.pbxproj: Removed a bunch of files.
1942 2004-07-21 Trey Matteson <trey@apple.com>
1944 DHTML dragging should use UTI for MIME-pboard type conversion
1948 * kwq/KWQClipboard.mm:
1949 (cocoaTypeFromMIMEType): Use UTI, except for cases we need to hardwire. Only cut off
1950 MIME args following a semi-colon for text/plain.
1951 (MIMETypeFromCocoaType): Use UTI, except for cases we need to hardwire.
1952 (KWQClipboard::types): Filter out ancient NSAsciiPboardType so DHTML never sees this cruft.
1954 2004-07-21 Ken Kocienda <kocienda@apple.com>
1958 Remove handling of HTML editing key events from WebCore.
1959 This now happens in WebKit if an event passes all the
1960 way through WebCore without being handled by the DOM.
1962 In each case below, function were removed, as their
1963 only purpose was to handle editing key events.
1965 * khtml/xml/dom_elementimpl.cpp
1966 * khtml/xml/dom_elementimpl.h
1967 * kwq/KWQKHTMLPart.h
1968 * kwq/KWQKHTMLPart.mm
1969 * kwq/WebCoreBridge.h
1971 2004-07-21 Ken Kocienda <kocienda@apple.com>
1975 * khtml/xml/dom_selection.cpp:
1976 (DOM::Selection::modifyExtendingRightForward): Add LINE_BOUNDARY case to the switch statement in this
1977 function. Use the startAndEndLineNodesIncludingNode helper which already existed to get the right
1979 (DOM::Selection::modifyMovingRightForward): Ditto
1980 (DOM::Selection::modifyExtendingLeftBackward): Ditto
1981 (DOM::Selection::modifyMovingLeftBackward): Ditto
1982 * khtml/xml/dom_selection.h:
1983 (DOM::Selection::): Add LINE_BOUNDARY constant to ETextGranularity enum. This
1984 specifies a new kind of movement that we need to implement the "move-to beggining/end of line"
1985 behavior which AppKit binds to cmd+left/right arrow keys.
1986 * kwq/WebCoreBridge.h: Add WebSelectToLineBoundary constant. This matches
1988 2004-07-20 David Hyatt <hyatt@apple.com>
1990 Fix for 3714434, user stylesheet is always parsed in strict mode, when it should honor the document's setting.
1994 * khtml/css/cssstyleselector.cpp:
1995 (khtml::CSSStyleSelector::CSSStyleSelector):
1997 2004-07-20 Ken Kocienda <kocienda@apple.com>
2001 * khtml/xml/dom_elementimpl.cpp:
2002 (ElementImpl::defaultEventHandler): No longer check whether
2003 the command key is modifying the key event. This check is
2004 now done elsewhere in the code. See the WebKit checkin that
2005 added the _web_keyBindingManagerHasBinding method to
2008 2004-07-20 Chris Blumenberg <cblu@apple.com>
2011 <rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
2012 <rdar://problem/3612691> Missing image icons (blue ?) lack context menu
2016 * kwq/WebCoreBridge.mm:
2017 (-[WebCoreBridge elementAtPoint:]): if there is no image, put the image URL on the element anyway
2019 2004-07-20 David Hyatt <hyatt@apple.com>
2021 Fix for alt text not working on images.
2025 * khtml/rendering/render_image.cpp:
2026 (RenderImage::RenderImage):
2027 (RenderImage::setPixmap):
2028 (RenderImage::paint):
2029 (RenderImage::calcReplacedWidth):
2030 (RenderImage::calcReplacedHeight):
2032 2004-07-20 Maciej Stachowiak <mjs@apple.com>
2036 <rdar://problem/3720111> REGRESSION(125-152): map fails to load depending on banner ad; weather.com (works in IE and Firefox)
2038 * khtml/html/htmltokenizer.cpp:
2039 (khtml::HTMLTokenizer::begin): Initialize currentPrependingSrc.
2040 (khtml::HTMLTokenizer::scriptHandler): Store a pointer to the currently
2041 active prependingSrc variable on the stack, the better to handle weird cases
2042 of scripts writing out additional script tags and so forth.
2043 (khtml::HTMLTokenizer::write): Deal with the above.
2044 * khtml/html/htmltokenizer.h: Declare new member field.
2046 2004-07-20 David Hyatt <hyatt@apple.com>
2048 Fix for layer positioning error that occurs when absolute positioned blocks are inside static positioned overflow:auto
2053 * khtml/rendering/render_layer.cpp:
2054 (RenderLayer::updateLayerPosition):
2056 2004-07-20 Trey Matteson <trey@apple.com>
2058 3705624 REGRESSION: can't rearrange photos on homepage.mac.com album
2060 A subtle problem stemming from some interaction between focus handing and
2061 event propagation. We previously made it so when a focus shift fails we
2062 don't propagate the event to KHTML. The fix is to get rid of the inverse
2063 effect, so now even if a focus shift succeeds, we don't propagate to KHTML if
2064 the page already canceled default behavior.
2066 In this specific case, the page is cancelling default behavior since it
2067 does its own dragging, and the bug was our new system dragging was
2072 * khtml/khtmlview.cpp:
2073 (KHTMLView::dispatchMouseEvent): What he said.
2075 2004-07-20 Ken Kocienda <kocienda@apple.com>
2081 <rdar://problem/3695240> pasting plain text with newlines in it turns them into spaces
2083 * kwq/WebCoreBridge.mm:
2084 (-[WebCoreBridge documentFragmentWithText:]): Refine this function to be smart about converting
2085 line endings into BR elements.
2087 2004-07-20 Ken Kocienda <kocienda@apple.com>
2093 <rdar://problem/3707505> HTMLCompose: blinking cursor in both an address text field and the message body
2095 * khtml/khtml_part.cpp:
2096 (KHTMLPart::setCaretVisible): This method renamed from setSelectionVisible. Since it really only operates
2097 on the caret, this seems like a better name.
2098 * khtml/khtml_part.h:
2099 * khtml/khtmlview.cpp:
2100 (KHTMLView::focusInEvent): Call setCaretVisible(true)
2101 (KHTMLView::focusOutEvent): Call setCaretVisible(false)
2102 * kwq/KWQKHTMLPart.mm:
2103 (KWQKHTMLPart::setShowsFirstResponder): Name change: setSelectionVisible becomes setCaretVisible.
2104 * kwq/WebCoreBridge.h: Expose setCaretVisible as a bridge method.
2105 * kwq/WebCoreBridge.mm:
2106 (-[WebCoreBridge setCaretVisible:]): Ditto.
2108 2004-07-19 Maciej Stachowiak <mjs@apple.com>
2112 <rdar://problem/3721428> REGRESSION (125.8-146): external javascript statements produce extra garbage character (sina.com)
2114 * khtml/misc/stringit.h:
2115 (khtml::TokenizerSubstring::TokenizerSubstring): For the apple branch, use the new
2116 stableUnicode() method to get the unicode pointer.
2119 (QString::detachIfInternal): Reorganize this to be a bit less wacky about refcounts.
2120 It does not leave around a zombie internal data handle but rather destroys it right away,
2121 and leaves the object pointing to the new handle (which it can then deref). This makes
2122 the code more clear.
2123 (QString::~QString): Simplify.
2124 (QString::stableUnicode): New method that detaches a copy of the KWQStringData if it
2125 is internal to a string besides this one. This guarantees that if you get the unicode()
2126 pointer, it won't go bad so long as this string is still alive.
2128 2004-07-19 David Hyatt <hyatt@apple.com>
2130 Fix for 3715117, crash from a bug in removeChildren. Clean up node removal and fix an n-squared removal
2131 bug. Also clean up checks in removeChild and in the dispatch of removedFromDocument mutation events to
2132 make node removal more efficient.
2134 Reviewed by kocienda
2136 * khtml/xml/dom_nodeimpl.cpp:
2138 2004-07-19 John Sullivan <sullivan@apple.com>
2142 - fixed <rdar://problem/3141150> can't undo in form textarea fields
2144 * kwq/KWQTextArea.mm:
2145 (-[KWQTextArea _createTextView]):
2146 call setAllowsUndo:YES. My, wasn't this easy?
2148 2004-07-19 David Hyatt <hyatt@apple.com>
2150 Merge @import fix for CSS1 test suite from Stephan Kulow.
2154 * khtml/css/parser.cpp:
2155 * khtml/css/parser.y:
2156 * layout-tests/css1/basic/containment-expected.txt:
2158 2004-07-19 David Hyatt <hyatt@apple.com>
2160 Fix for 3718697, crash clicking on JS tab at alaskaair.com.
2162 Reviewed by kocienda
2164 * khtml/rendering/render_flow.cpp:
2165 (RenderFlow::detach):
2166 (RenderFlow::dirtyLinesFromChangedChild):
2167 * khtml/rendering/render_flow.h:
2168 * khtml/rendering/render_object.cpp:
2169 (RenderObject::dirtyLinesFromChangedChild):
2170 * khtml/rendering/render_object.h:
2172 2004-07-16 David Hyatt <hyatt@apple.com>
2174 Fix for 3726471, need to ensure that it's safe to do updateRendering from within layout, since isContentEditable
2175 relies on it. The fix is to just recalcStyle up front before beginning the layout, so that all of our renderobjects
2180 * khtml/khtmlview.cpp:
2181 (KHTMLView::layout):
2183 2004-07-16 Ken Kocienda <kocienda@apple.com>
2189 <rdar://problem/3722153> Random crash while typing (DOM::NodeImpl::parentNode (this=0x0))
2191 * khtml/editing/htmlediting_impl.cpp:
2192 (khtml::DeleteSelectionCommandImpl::doApply): This check merely makes the code
2193 more robust. I do not understand how Grant ended up with null start or end
2194 blocks in the case of his bug report, but by adding two null checks, the code is
2195 now hardened a bit in case it happens again.
2197 2004-07-16 Ken Kocienda <kocienda@apple.com>
2203 <rdar://problem/3730785> Crash when arrow navigation goes to empty table cell
2204 <rdar://problem/3730790> Caret does not blink when placed in empty table cell
2206 * khtml/rendering/render_block.cpp:
2207 (khtml::RenderBlock::paintObject): Caret node's renderer might be this block, so
2208 don't block the painting of the caret in this case. This was the case in 3730790.
2209 We had the right geometry for the caret but blocked its painting.
2210 * khtml/xml/dom_position.cpp:
2211 (DOM::Position::previousLinePosition): Rework the logic here. This function asserted
2212 that the new position we would navigate to had a line box, but empty table cells, for
2213 instance will not. So, deal with this situation as well. The end result is a
2214 function that worked like it did before in cases where the previous line position has
2215 a line box, but now also will allow navigation to work when it does not.
2216 (DOM::Position::nextLinePosition): Ditto.
2218 2004-07-16 Ken Kocienda <kocienda@apple.com>
2224 <rdar://problem/3687216> editable inline causes crash when focused
2226 * khtml/xml/dom_docimpl.cpp:
2227 (DocumentImpl::relinquishesEditingFocus): Add null check for rootEditableElement.
2228 (DocumentImpl::acceptsEditingFocus): Ditto.
2230 2004-07-16 David Hyatt <hyatt@apple.com>
2232 Fix for 3709337, crash when using display: compact. Need to make sure that the isCompact() check in bidi.cpp is
2233 also checking for RenderBlocks, since otherwise you match text nodes (and that's just wrong).
2235 Reviewed by kocienda
2237 * khtml/rendering/bidi.cpp:
2238 (khtml::RenderBlock::layoutInlineChildren):
2242 2004-07-15 David Hyatt <hyatt@apple.com>
2244 Fix for 3625611, images offset on first visit to page. The method for determining the last clean line was
2245 flawed and would incorrectly miss dirty lines that occurred after the first clean line.
2249 * khtml/rendering/bidi.cpp:
2250 (khtml::RenderBlock::determineEndPosition):
2252 2004-07-15 Ken Kocienda <kocienda@apple.com>
2257 <rdar://problem/3587601> reproducible assertion failure in Blot deleting text, then image at Yahoo.com
2259 * khtml/editing/htmlediting_impl.cpp:
2260 (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): Relax assertion
2261 that nodes are text nodes during the walk of eligible nodes that could possibly be
2262 deleted. Change the assertion to an conditional check for text nodes. We may have
2263 unrendered nodes in the mix here (as is the case in the bug where the assertion
2264 failed on an AREA element), and the conditional check is sufficient to
2265 skip them while leaving the delete logic we want unperturbed.
2267 2004-07-14 Ken Kocienda <kocienda@apple.com>
2271 * khtml/rendering/render_block.cpp:
2272 (khtml::RenderBlock::paintObject): Add null check on DOM node before
2273 asking if it is contentEditable.
2275 2004-07-14 David Hyatt <hyatt@apple.com>
2277 Fix for 3595073, setting innerHTML on a <table> should work.
2281 * khtml/html/html_elementimpl.cpp:
2282 (HTMLElementImpl::createContextualFragment):
2284 2004-07-14 Ken Kocienda <kocienda@apple.com>
2288 Updated these layout tests as a result of the last patch.
2289 These results are better.
2291 * layout-tests/editing/execCommand/selectAll-expected.txt
2292 * layout-tests/editing/selection/extend-by-character-006-expected.txt
2293 * layout-tests/editing/selection/unrendered-001-expected.txt
2294 * layout-tests/editing/selection/unrendered-003-expected.txt
2296 2004-07-14 Ken Kocienda <kocienda@apple.com>
2300 * khtml/rendering/render_block.cpp:
2301 (khtml::RenderBlock::paintObject): Change back to start() from caretPosition().
2302 Since the policy is now to move the selection to rendered content, if possible,
2303 when the selection is set, there is no longer any reason to have the additional
2304 caretPosition() function to store where the caret should be drawn.
2305 * khtml/xml/dom_docimpl.cpp:
2306 (DocumentImpl::updateSelection): No longer any need to call closestRenderedPosition here.
2307 This is done in Selection::validate.
2308 * khtml/xml/dom_position.cpp:
2309 (DOM::Position::closestRenderedPosition): Improved algorithm. Now much simpler.
2310 * khtml/xml/dom_selection.cpp:
2311 (DOM::Selection::Selection): caretPosition() and m_caretPosition now obsolete.
2312 (DOM::Selection::init): Ditto.
2313 (DOM::Selection::modifyExtendingRightForward): No longer any need to call
2314 closestRenderedPosition here. This is done in Selection::validate.
2315 (DOM::Selection::modifyMovingRightForward): Ditto.
2316 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
2317 (DOM::Selection::modifyMovingLeftBackward): Ditto.
2318 (DOM::Selection::layoutCaret): Ditto.
2319 (DOM::Selection::validate): Add code to move the selection to rendered content if possible.
2320 * khtml/xml/dom_selection.h: caretPosition() and m_caretPosition now obsolete.
2322 2004-07-14 David Hyatt <hyatt@apple.com>
2324 Fix for 3716082, assert when you dynamically remove float or position styles.
2328 * khtml/rendering/render_object.cpp:
2329 (RenderObject::setStyle):
2331 2004-07-14 David Hyatt <hyatt@apple.com>
2333 Fix for various table regressions (malumovies.com and cityofheroes.gameamp.com) involving bungling of
2336 Reviewed by kocienda
2338 * khtml/rendering/render_box.cpp:
2339 (RenderBox::calcPercentageHeight):
2340 (RenderBox::availableHeightUsing):
2341 * khtml/rendering/render_table.cpp:
2342 (RenderTable::layout):
2343 (RenderTableSection::calcRowHeight):
2344 (RenderTableSection::layoutRows):
2345 (RenderTableCell::updateFromElement):
2346 * khtml/rendering/render_table.h:
2348 2004-07-14 Ken Kocienda <kocienda@apple.com>
2352 * khtml/xml/dom_position.cpp:
2353 (DOM::Position::equivalentDeepPosition): New helper function to improve selection handling.
2354 Soon, I plan to land some changes that use this new function.
2355 * khtml/xml/dom_position.h:
2357 2004-07-14 Ken Kocienda <kocienda@apple.com>
2361 * WebCore-combined.exp: Added QString.at symbol to tests exports to facilitate debugging
2362 data formatting change that is to come.
2363 * WebCore-tests.exp:
2365 2004-07-13 John Sullivan <sullivan@apple.com>
2369 - fixed <rdar://problem/3705500> REGRESSION (125.8-146): Cmd-E on an
2370 HTML page puts a trailing space on Find pasteboard
2372 * khtml/misc/khtml_text_operations.cpp:
2373 (khtml::TextIterator::handleTextBox):
2374 In the case where a subrun doesn't extend to the end of the text box,
2375 the well-commented code was supposed to return from this routine, but
2376 the wrong variable was being compared. This would send us through another
2377 pass of the loop, which would end up worrying about collapsed space at the
2378 end of the current box, even though we only cared about the beginning of the
2381 2004-07-12 Richard Williamson <rjw@apple.com>
2383 Fixed 3717982. Implemented navigator.language!
2387 * khtml/ecma/kjs_navigator.cpp:
2388 (Navigator::getValueProperty):
2390 2004-07-12 Ken Kocienda <kocienda@apple.com>
2394 * khtml/xml/dom_position.cpp:
2395 (DOM::Position::inRenderedContent): I broke selection drawing with my last patch. This
2396 function is now used in selection drawing, and it was making an unneeded check to see
2397 that content was editable to answer whether or not is was rendered. Bad. Fixed.
2399 2004-07-12 David Hyatt <hyatt@apple.com>
2401 Fix for 3621138, crash on hrweb.apple.com. Make sure that in the case where objects get pulled up from merging
2402 blocks that we just delete all line boxes.
2404 Reviewed by kocienda
2406 * khtml/rendering/render_block.cpp:
2407 (khtml::RenderBlock::removeChild):
2409 2004-07-10 Maciej Stachowiak <mjs@apple.com>
2413 <rdar://problem/3706080>: (REGRESSION (125.8-147u): Nested <ul> do not display bullets)
2414 <rdar://problem/3676376>: (Second level bullets not printed when printing Xcode release notes)
2417 * kwq/KWQPainter.mm:
2418 (CGColorFromNSColor):
2419 (QPainter::drawEllipse):
2420 (QPainter::setShadow):
2422 2004-07-12 Ken Kocienda <kocienda@apple.com>
2426 Added new editing-related layout tests
2428 * layout-tests/editing/deleting/delete-after-span-ws-001-expected.txt: Added.
2429 * layout-tests/editing/deleting/delete-after-span-ws-001.html: Added.
2430 * layout-tests/editing/deleting/delete-after-span-ws-002-expected.txt: Added.
2431 * layout-tests/editing/deleting/delete-after-span-ws-002.html: Added.
2432 * layout-tests/editing/deleting/delete-after-span-ws-003-expected.txt: Added.
2433 * layout-tests/editing/deleting/delete-after-span-ws-003.html: Added.
2434 * layout-tests/editing/selection/unrendered-001-expected.txt: Added.
2435 * layout-tests/editing/selection/unrendered-001.html: Added.
2436 * layout-tests/editing/selection/unrendered-002-expected.txt: Added.
2437 * layout-tests/editing/selection/unrendered-002.html: Added.
2438 * layout-tests/editing/selection/unrendered-003-expected.txt: Added.
2439 * layout-tests/editing/selection/unrendered-003.html: Added.
2440 * layout-tests/editing/selection/unrendered-004-expected.txt: Added.
2441 * layout-tests/editing/selection/unrendered-004.html: Added.
2442 * layout-tests/editing/selection/unrendered-005-expected.txt: Added.
2443 * layout-tests/editing/selection/unrendered-005.html: Added.
2444 * layout-tests/traversal/node-iterator-008-expected.txt: Added.
2445 * layout-tests/traversal/node-iterator-008.html: Added.
2446 * layout-tests/traversal/tree-walker-005-expected.txt: Added.
2447 * layout-tests/traversal/tree-walker-005.html: Added.
2449 2004-07-12 Ken Kocienda <kocienda@apple.com>
2453 Fixes for these bugs:
2455 <rdar://problem/3723359> Extending then "unextending" selection with arrow keys should draw caret but doesn't
2456 <rdar://problem/3724626> White-space deletion code deletes wrong character when space follows span
2458 * khtml/editing/htmlediting_impl.cpp:
2459 (khtml::DeleteSelectionCommandImpl::doApply): Modify special-case white-space deletion code so it runs
2460 only in the special case. It was throwing its net too widely, catching the case described in 3724626.
2461 By tightening up the special-case white-space deletion, and allowing the more general-purpose code to run,
2463 * khtml/xml/dom_docimpl.cpp:
2464 (DocumentImpl::updateSelection): Use recently-added closestRenderedPosition helper in Position class
2465 to figure out the start and end positions for selection drawing.
2466 * khtml/xml/dom_position.cpp:
2467 (DOM::Position::equivalentUpstreamPosition): Added code to handle white-space that causes line breaks.
2468 (DOM::Position::equivalentDownstreamPosition): Ditto.
2469 (DOM::Position::closestRenderedPosition): Trap empty selections at function entry, return *this.
2470 (DOM::Position::isFirstRenderedPositionOnLine): Can't be first rendered position on line if not rendered.
2472 (DOM::Position::isLastRenderedPositionOnLine): Ditto, but s/first/last/
2473 * khtml/xml/dom_selection.cpp:
2474 (DOM::Selection::validate): A selection is in caret state if the start and end are equal *or* equivalent.
2475 The equivalence case is new, and fixes 3723359.
2477 2004-07-09 Kevin Decker <kdecker@apple.com>
2481 fixes the width:auto problem in
2482 <rdar://problem/3698344> REGRESSION (143?-144): macrumors.com tabs are compressed and illegible
2484 * khtml/css/cssstyleselector.cpp:
2485 (khtml::CSSStyleSelector::applyProperty):
2487 2004-07-09 Ken Kocienda <kocienda@apple.com>
2491 Updated some layout test results.
2493 * layout-tests/editing/deleting/delete-image-004-expected.txt:
2494 * layout-tests/editing/selection/extend-by-character-006-expected.txt:
2496 2004-07-09 Chris Blumenberg <cblu@apple.com>
2498 Allowed my change for 3715785 to compile on Jaguar.
2500 Reviewed by kocienda.
2502 * kwq/WebCoreBridge.h:
2503 * kwq/WebCoreBridge.mm:
2504 (-[WebCoreBridge domain]): new, allows access to the domain without using the DOM API which doesn't exist on Jaguar
2506 2004-07-09 Ken Kocienda <kocienda@apple.com>
2510 Some improvements to fix:
2512 <rdar://problem/3723111> Caret not drawn when selection set to unrendered content
2514 * khtml/editing/htmlediting_impl.cpp:
2515 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Adjust selection to delete if
2516 selected position is not rendered.
2517 * khtml/rendering/render_block.cpp:
2518 (khtml::RenderBlock::paintObject): Use new caretPosition() function on Selection to
2519 figure out whether to paint.
2520 * khtml/xml/dom_position.cpp:
2521 (DOM::Position::previousCharacterPosition): Now correctly deals with a start
2522 position that is not rendered.
2523 (DOM::Position::nextCharacterPosition): Ditto.
2524 (DOM::Position::closestRenderedPosition): New helper.
2525 * khtml/xml/dom_position.h:
2526 (DOM::): Moved in EAffinity from Selection header. Now used in closestRenderedPosition function.
2527 * khtml/xml/dom_selection.cpp:
2528 (DOM::Selection::Selection): Added new m_caretPosition member. This is the position of the caret
2529 after a caret layout. This may be different from start or end if start and end are not rendered.
2530 (DOM::Selection::init):
2531 (DOM::Selection::modifyExtendingRightForward): New helper to clean up modify() and make it more readble.
2532 (DOM::Selection::modifyMovingRightForward): Ditto.
2533 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
2534 (DOM::Selection::modifyMovingLeftBackward): Ditto.
2535 (DOM::Selection::modify): Use new helpers to make this more readble.
2536 (DOM::Selection::layoutCaret): Uses new closestRenderedPosition helper to place the caret if in unrendered
2538 (DOM::Selection::paintCaret): Remove moveToRenderedContent. obsolete.
2539 * khtml/xml/dom_selection.h:
2540 (DOM::Selection::caretPosition): New accessor.
2541 * kwq/WebCoreBridge.mm:
2542 (-[WebCoreBridge setSelectedDOMRange:affinity:]): EAffinity no longer a member enum of Selection class.
2544 2004-07-08 David Hyatt <hyatt@apple.com>
2546 Fix for the table layout test that failed because of a change in how innerText worked. We need to do
2547 updateLayout now when using innerText, since the method has been changed to use line boxes in the render tree
2548 that might otherwise be out of date.
2550 Reviewed by kocienda
2552 * khtml/html/html_elementimpl.cpp:
2553 (HTMLElementImpl::innerText):
2555 2004-07-08 John Sullivan <sullivan@apple.com>
2559 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
2560 now also extends selection (even if there wasn't one before)
2562 * khtml/khtml_part.cpp:
2563 (KHTMLPart::handleMousePressEventSingleClick):
2564 if there's a URL associated with the event, don't extend the selection
2566 2004-07-08 Ken Kocienda <kocienda@apple.com>
2570 Added some helper functions which provide strings to display in the
2571 Xcode debugger's variable inspector window. These functions are called
2572 from the LabyrinthDataFormatter debugger plugin I just checked in to
2573 the Labyrinth/Tools directory.
2575 Note that these functions are compiled in on Development builds only.
2577 * WebCore-combined.exp:
2578 * WebCore-tests.exp: Export all the formatForDebugger symbols so the
2579 debugger program can link with them.
2580 * khtml/xml/dom2_rangeimpl.cpp:
2581 (DOM::RangeImpl::formatForDebugger):
2582 * khtml/xml/dom2_rangeimpl.h:
2583 * khtml/xml/dom_elementimpl.cpp:
2584 (ElementImpl::formatForDebugger):
2585 * khtml/xml/dom_elementimpl.h:
2586 * khtml/xml/dom_nodeimpl.cpp:
2587 * khtml/xml/dom_nodeimpl.h:
2588 * khtml/xml/dom_position.cpp:
2589 (DOM::Position::formatForDebugger):
2590 * khtml/xml/dom_position.h:
2591 * khtml/xml/dom_selection.cpp:
2592 (DOM::Selection::formatForDebugger):
2593 * khtml/xml/dom_selection.h:
2594 * khtml/xml/dom_textimpl.cpp:
2595 (TextImpl::formatForDebugger):
2596 * khtml/xml/dom_textimpl.h:
2598 2004-07-08 John Sullivan <sullivan@apple.com>
2602 - fixed <rdar://problem/3721544> crash increasing font size;
2603 entrezeroetun.com (works in IE and Firefox)
2605 * khtml/rendering/render_block.cpp:
2606 (khtml::RenderBlock::updateFirstLetter):
2607 Check for nil originalString() before dereffing
2609 2004-07-08 David Hyatt <hyatt@apple.com>
2611 Fix for 3721453, CSS3 initial property caused crashes because the macros were not written correctly.
2615 * khtml/css/cssstyleselector.cpp:
2619 2004-07-07 David Hyatt <hyatt@apple.com>
2621 Fix for 3712133, crash from first-line pseudo-style use.
2623 Reviewed by kocienda
2625 * khtml/css/cssstyleselector.cpp:
2626 (khtml::CSSStyleSelector::styleForElement):
2627 * khtml/css/cssstyleselector.h:
2628 * khtml/rendering/render_object.cpp:
2629 (RenderObject::getPseudoStyle):
2631 2004-07-07 Ken Kocienda <kocienda@apple.com>
2637 <rdar://problem/3716479> calling setInnerHTML during a webViewDidChange delegate call causes a crash
2639 The fix involves some rearrangement of code in TypingCommand and TypingCommandImpl.
2640 Formerly, new TypingCommands would apply themselves (which was a no-op) and then
2641 do their action in some code a way different than other commands. This type of command
2642 application is different than for all other commands since TypingCommands can be coalesced.
2643 The crash occurred as a result of the "no-op" TypingCommand having the unconsidered
2644 consequence of causing editing delegate notifications to be sent before the command
2645 has actually run. This change takes a small step towards making TypingCommandImpl function like
2646 other commands, where the command work is done in doApply. This makes the notification
2647 happen in the right order.
2649 * khtml/editing/htmlediting.cpp:
2650 (khtml::TypingCommand::TypingCommand):
2651 (khtml::TypingCommand::insertText):
2652 (khtml::TypingCommand::insertNewline):
2653 (khtml::TypingCommand::deleteKeyPressed):
2654 * khtml/editing/htmlediting.h:
2655 (khtml::TypingCommand::):
2656 * khtml/editing/htmlediting_impl.cpp:
2657 (khtml::TypingCommandImpl::TypingCommandImpl):
2658 (khtml::TypingCommandImpl::doApply):
2659 * khtml/editing/htmlediting_impl.h:
2661 2004-07-06 Ken Kocienda <kocienda@apple.com>
2665 * khtml/html/html_tableimpl.cpp:
2666 (HTMLTableElementImpl::addChild): Added a better comment in the
2667 code I just checked in a few minutes ago.
2669 2004-07-06 Ken Kocienda <kocienda@apple.com>
2675 <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply
2676 due to non-0 exception code trying to insert a DIV markup string
2678 The solution was to revert to the code that was rolled out, and removing
2679 the child checks from NodeImpl::checkAddChild. However, this time, I added
2680 code very similar to this check into the code that runs while HTML is
2681 being parsed to build up tables. This code relies on child-add failure
2682 to ensure the proper construction of well-formed tables (as gross as that
2683 sounds), so the check needs to be retained there. No other code seems to
2684 be so affected. Layout tests are unchanged by this patch.
2686 * khtml/html/html_tableimpl.cpp:
2687 (HTMLTableElementImpl::addChild):
2688 * khtml/xml/dom_nodeimpl.cpp:
2689 (NodeImpl::checkAddChild):
2691 2004-07-06 Ken Kocienda <kocienda@apple.com>
2695 Simple change. I switched the arguments of the appendNode helper function
2696 and the AppendNodeCommand and AppendNodeCommandImpl classes. The node to
2697 insert now comes before the parent node in the argument list. I did this
2698 to make this function match the convention of others in the HTML editing code.
2699 This was the only one that was "different" in the way that it ordered arguments.
2700 As a result, I was always looking to see that I was passing things in the right
2703 * khtml/editing/htmlediting.cpp:
2704 (khtml::AppendNodeCommand::AppendNodeCommand):
2705 (khtml::AppendNodeCommand::appendChild):
2706 (khtml::AppendNodeCommand::parentNode):
2707 * khtml/editing/htmlediting.h:
2708 * khtml/editing/htmlediting_impl.cpp:
2709 (khtml::CompositeEditCommandImpl::insertNodeAfter):
2710 (khtml::CompositeEditCommandImpl::insertNodeAt):
2711 (khtml::CompositeEditCommandImpl::appendNode):
2712 (khtml::AppendNodeCommandImpl::AppendNodeCommandImpl):
2713 (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl):
2714 (khtml::AppendNodeCommandImpl::doApply):
2715 (khtml::AppendNodeCommandImpl::doUnapply):
2716 (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
2717 (khtml::DeleteSelectionCommandImpl::doApply):
2718 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition):
2719 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition):
2720 (khtml::InputTextCommandImpl::prepareForTextInsertion):
2721 * khtml/editing/htmlediting_impl.h:
2722 (khtml::AppendNodeCommandImpl::parentNode):
2724 2004-07-06 Ken Kocienda <kocienda@apple.com>
2728 Fixed several problems with traversal classes. For one, NodeIterators treat
2729 FILTER_REJECT and FILTER_SKIP the same, since it treats the DOM tree as a
2730 flat collection of nodes free of hierarchy. The code before this change did
2731 not do this correctly. It sure pays to go back and read the specs. :)
2733 Also, the code to traverse from node to node when filters were applied was
2734 not working correctly. My first attemmpt to implement this was just plain
2735 buggy, as I discovered when I tried to write tests for my WWDC talk. I have
2736 settled on an implementation which is much simpler and worked for all the
2737 tests I threw at it.
2739 * khtml/xml/dom2_traversalimpl.cpp:
2740 (DOM::NodeIteratorImpl::findNextNode):
2741 (DOM::NodeIteratorImpl::nextNode):
2742 (DOM::NodeIteratorImpl::findPreviousNode):
2743 (DOM::NodeIteratorImpl::previousNode):
2744 (DOM::TreeWalkerImpl::parentNode):
2745 (DOM::TreeWalkerImpl::firstChild):
2746 (DOM::TreeWalkerImpl::lastChild):
2747 (DOM::TreeWalkerImpl::previousSibling):
2748 (DOM::TreeWalkerImpl::nextSibling):
2749 (DOM::TreeWalkerImpl::previousNode):
2750 (DOM::TreeWalkerImpl::nextNode):
2751 (DOM::TreeWalkerImpl::ancestorRejected):
2752 * khtml/xml/dom2_traversalimpl.h:
2754 2004-07-06 Vicki Murley <vicki@apple.com>
2756 Reviewed by kocienda.
2758 - added backColorCommand, foreColorCommand, fontNameCommand,
2761 * layout-tests/editing/editing.js:
2763 2004-07-06 Trey Matteson <trey@apple.com>
2765 3716053 - www.theage.com.au has extra back/forward items due to ads
2767 This turned out to be easily fixed by generalizing the fix to 3438441. We prevent
2768 addition to the b/f list not just during an onload event, but during any non-user
2769 gesture, which includes top level script executing.
2771 Reviewed by Richard.
2773 * kwq/KWQKHTMLPart.mm:
2774 (KWQKHTMLPart::openURL): Only real change - prevent adding to b/f list if not
2776 (KWQKHTMLPart::openURLRequest): Rename "onLoadEvent" to "userGesture", swap sense
2777 (KWQKHTMLPart::submitForm): Ditto
2778 (KWQKHTMLPart::urlSelected): Ditto
2779 * kwq/KWQKHTMLPartBrowserExtension.mm:
2780 (KHTMLPartBrowserExtension::createNewWindow): Ditto
2781 * kwq/WebCoreBridge.h:
2783 2004-07-02 Darin Adler <darin@apple.com>
2787 - fixed half of <rdar://problem/3709244> utf-8 meta tag not parsed when page title contains angle brackets or if </meta> tag used
2789 * khtml/misc/decoder.cpp: (Decoder::decode): Allow </meta> tags without deciding we
2790 are done with the header.
2792 2004-06-30 Trey Matteson <trey@apple.com>
2794 Dragging within a web view should be allowed to start when the window isn't key.
2796 A few months ago, Chris made this work, but it relied on the fact that all dragging
2797 was done in WebKit. When WebCore got involved in dragging, it was broken. Now we
2798 have a new scheme that gets it working again that properly involves WebCore.
2800 The general idea is that when AK asks us whether to accept the first mouse and do
2801 "delayed window ordering", we must consult WC to see if we might start a drag. In
2802 addition, instead of these drags in non-active windows being started as a special
2803 case in WK, they go through the normal WK-WC drag machinery.
2807 * khtml/khtml_part.cpp:
2808 (KHTMLPart::shouldDragAutoNode): New x,y args.
2809 * khtml/khtml_part.h:
2810 * khtml/rendering/render_object.cpp:
2811 (RenderObject::draggableNode): Pass through new x,y args.
2812 * khtml/rendering/render_object.h:
2813 * kwq/KWQKHTMLPart.h:
2814 (KWQKHTMLPart::setActivationEventNumber): New setter.
2815 * kwq/KWQKHTMLPart.mm:
2816 (KWQKHTMLPart::KWQKHTMLPart): Init new ivar.
2817 (KWQKHTMLPart::eventMayStartDrag): New routine that checks if we might start
2818 a drag in response to a mouseDown.
2819 (KWQKHTMLPart::khtmlMouseMoveEvent): Pass x,y to the routine that finds a draggable
2820 node. This eventually gets back up to WK's _mayStartDragAtEventLocation:.
2821 Delay requirement when dragging the selection now implemented here.
2822 (KWQKHTMLPart::khtmlMouseReleaseEvent): Must avoid changing the selection if we
2823 wind up here as part of the first click in a window (because we started handling
2824 the click to possible start a drag, but that never came through).
2825 (KWQKHTMLPart::mouseDown): Save away event timestamp.
2826 (KWQKHTMLPart::shouldDragAutoNode): Pass location up to WK instead of the
2827 most recent event we stashed.
2828 * kwq/WebCoreBridge.h:
2829 * kwq/WebCoreBridge.mm:
2830 (-[WebCoreBridge setActivationEventNumber:]): Trivial glue.
2831 (-[WebCoreBridge eventMayStartDrag:]): Ditto.
2833 2004-06-29 Trey Matteson <trey@apple.com>
2835 Need to tighten up JS error checking for requesting drag props
2840 * khtml/ecma/kjs_events.cpp:
2841 (Clipboard::getValueProperty): Assert if someone somehow set
2842 dropEffect or effectAllowed and it's a copy/paste clipboard
2843 instead of a dragging clipboard.
2844 (Clipboard::putValue): Don't let anyone set dropEffect or
2845 effectAllowed on a copy/paste clipboard.
2846 (ClipboardProtoFunc::tryCall): Disallow setting dragImage on
2847 a copy/paste clipboard.
2849 2004-06-29 Trey Matteson <trey@apple.com>
2851 DHTML dragging - source should have access to the operation chosen
2856 * kwq/KWQKHTMLPart.h:
2857 * kwq/KWQKHTMLPart.mm:
2858 (KWQKHTMLPart::dragSourceEndedAt): Set the destination's operation
2860 * kwq/WebCoreBridge.mm:
2861 (-[WebCoreBridge dragExitedWithDraggingInfo:]): For completeness
2862 we set the source op for the ondragexit event.
2863 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto for the
2865 (-[WebCoreBridge dragSourceEndedAt:operation:]): Pass through of operation.
2867 2004-06-24 Trey Matteson <trey@apple.com>
2869 3710422 - REGRESSION: Safari crashes trying to send onbeforecut event at about://blank
2871 Simple fix - don't try to send the event to the body element if we have no body element.
2875 * kwq/KWQKHTMLPart.mm:
2876 (KWQKHTMLPart::dispatchCPPEvent):
2878 2004-06-24 Trey Matteson <trey@apple.com>
2880 3704950 drag image in DB ConfigBar has horizontal graphics turd WebCore JavaScript
2882 When we generate a drag image (or a selection image too, for that matter) we
2883 translate the CTM using a CG call. Later, WebImageRenderer adjusts the pattern
2884 phase based on the CTM of the focused view, which doesn't include our translate.
2885 So we must inform WebKit about the additional phase adjustment.
2889 * kwq/KWQKHTMLPart.mm: Tell WebKit about the phase adjustment.
2890 (KWQKHTMLPart::imageFromRect):
2891 * kwq/WebCoreGraphicsBridge.h:
2892 * kwq/WebCoreGraphicsBridge.m:
2893 (-[WebCoreGraphicsBridge setAdditionalPatternPhase:]): New routine to receive
2894 the phase adjustment.
2896 2004-06-24 Trey Matteson <trey@apple.com>
2898 3679986 - screenX and screenY are flipped and relative to the bottom left of the WebView, rather than the screen
2899 3699510 - synthesized click events have bogus screen coords
2903 * khtml/khtmlview.cpp:
2904 (KHTMLView::dispatchDragEvent): Generate screen coords for drag events using new func.
2905 (KHTMLView::dispatchMouseEvent): Ditto.
2906 * khtml/khtmlview.h:
2907 * khtml/xml/dom_nodeimpl.cpp:
2908 (NodeImpl::dispatchMouseEvent): Comment tricky semantics.
2909 Calc screen coords in apple-specific way.
2910 * kwq/KWQKHTMLView.mm:
2911 (KHTMLView::viewportToGlobal): Passthrough to window widget.
2912 * kwq/KWQScrollView.mm:
2913 * kwq/KWQWindowWidget.h:
2914 * kwq/KWQWindowWidget.mm:
2915 (KWQWindowWidget::mapToGlobal): Call former code factored to new method below.
2916 (KWQWindowWidget::viewportToGlobal): New method to convert "viewport" (which for us
2917 really means NSWindow coords) to screen coords.
2919 2004-06-24 Trey Matteson <trey@apple.com>
2921 3693420 - onbeforecut and onbeforepaste need real implementaion
2925 * kwq/KWQKHTMLPart.h:
2926 * kwq/KWQKHTMLPart.mm:
2927 (KWQKHTMLPart::mayCut): Dispatch event to DHTML.
2928 (KWQKHTMLPart::mayCopy): Ditto
2929 (KWQKHTMLPart::mayPaste): Ditto
2930 (KWQKHTMLPart::tryCut): No more need to send fake onbefore event
2931 (KWQKHTMLPart::tryCopy): Ditto
2932 (KWQKHTMLPart::tryPaste): Ditto
2933 * kwq/WebCoreBridge.h:
2934 * kwq/WebCoreBridge.mm:
2935 (-[WebCoreBridge mayDHTMLCut]): Standard glue
2936 (-[WebCoreBridge mayDHTMLCopy]): Ditto
2937 (-[WebCoreBridge mayDHTMLPaste]): Ditto
2939 2004-06-24 Darin Adler <darin@apple.com>
2943 - fixed <rdar://problem/3709385> Find on page doesn't find a string at the very end of the file
2945 * khtml/misc/khtml_text_operations.cpp: (khtml::findPlainText): Rearrange loop to avoid an early
2946 exit once we have all the characters we need, but are at the end of the range we are searching.
2948 - fixed <rdar://problem/3102271>: (text areas have scroll bars even when they don't need them)
2949 - fixed <rdar://problem/3665430>: (horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode)
2951 * kwq/KWQTextArea.mm:
2952 (-[KWQTextArea _configureTextViewForWordWrapMode]): Added. Helper method that sets up the
2953 view for a new word wrap mode.
2954 (-[KWQTextArea _createTextView]): Moved much of the code inside _configureTextViewForWordWrapMode.
2955 (-[KWQTextArea _frameSizeChanged]): Added. Method shared by setFrame: and initWithFrame: to
2956 avoid duplicate code that was there before. The old code also had redundant code to update
2957 the text container size, but NSText handles that automatically.
2958 (-[KWQTextArea initWithFrame:]): Set wrap to YES by default, which is the key to fixing bug 3665430.
2959 Call setAutohidesScrollers:YES, which fixes bug 3102271. Also call the new _frameSizeChanged method.
2960 (-[KWQTextArea setWordWrap:]): Call _configureTextViewForWordWrapMode instead of trying
2961 to do the work here. The old version did both too little and too much.
2962 (-[KWQTextArea setFrame:]): Call _frameSizeChanged instead of trying to do the work here.
2963 The old version did both too little and too much.
2965 2004-06-24 John Sullivan <sullivan@apple.com>
2967 Darin made this change on my machine; I reviewed it.
2969 - fixed <rdar://problem/3698333> Find on page doesn't find a particular string
2970 with a newline in the source
2972 * khtml/misc/khtml_text_operations.cpp:
2973 (khtml::TextIterator::handleTextBox):
2974 Clear m_lastTextNodeEndedWithCollapsedSpace after taking it into account.
2976 2004-06-23 Richard Williamson <rjw@apple.com>
2978 Implemented changes for latest npruntime.h.
2982 * kwq/KWQKHTMLPart.h:
2983 * kwq/KWQKHTMLPart.mm:
2984 (KWQKHTMLPart::KWQKHTMLPart):
2985 (KWQKHTMLPart::windowScriptNPObject):
2986 (KWQKHTMLPart::getEmbedInstanceForView):
2987 * kwq/WebCoreBridge.h:
2988 * kwq/WebCoreBridge.mm:
2989 (-[WebCoreBridge windowScriptObject]):
2990 (-[WebCoreBridge windowScriptNPObject]):
2992 2004-06-22 Richard Williamson <rjw@apple.com>
2994 Fixed <rdar://problem/3707162>: accessing embeds[] plug-in interface may crash
2996 embedInstance was uninitialized.
3000 * khtml/html/html_objectimpl.cpp:
3001 (HTMLEmbedElementImpl::HTMLEmbedElementImpl):
3003 2004-06-18 John Sullivan <sullivan@apple.com>
3007 - fixed <rdar://problem/3534851> Pop up windows not showing up within SAP's
3008 BW Module (changing location.href on new window created by window.open)
3010 * khtml/khtml_part.cpp:
3011 (KHTMLPart::scheduleRedirection):
3012 allow new redirect to win if delay <= current delay, not just <
3014 === WebCore-146.1 ===
3016 2004-06-18 Trey Matteson <trey@apple.com>
3018 3702053 - DHTML dragging destination can't control the cursor (by setting the drop operation)
3020 Fallout from security work, but an easy fix.
3024 * kwq/KWQClipboard.mm:
3025 (KWQClipboard::setDropEffect): Allow dest side to set dropEffect.
3027 2004-06-18 Darin Adler <darin@apple.com>
3031 - re-fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)
3033 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
3034 Check !isInlineFlow rather than checking hasMarkupTruncation. Otherwise, we break
3035 plain old non-markup truncation.
3037 2004-06-18 Darin Adler <darin@apple.com>
3041 - fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)
3043 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
3044 Only walk the ellipsis list if hasMarkupTruncation is true.
3048 2004-06-17 Richard Williamson <rjw@apple.com>
3050 Fixed <rdar://problem/3698867> setting the canvas or parent to display:none and updating the causes a nil-deref
3052 Ensured that we have a renderer before rendering.
3056 * khtml/ecma/kjs_html.cpp:
3057 (KJS::Context2DFunction::tryCall):
3059 2004-06-17 David Hyatt <hyatt@apple.com>
3061 Fix for 3674601, "Read More..." links should trail articles in Emerson.
3065 * khtml/rendering/bidi.cpp:
3066 (khtml::RenderBlock::layoutInlineChildren):
3067 (khtml::RenderBlock::deleteEllipsisLineBoxes):
3068 (khtml::RenderBlock::checkLinesForTextOverflow):
3069 * khtml/rendering/render_block.cpp:
3070 (khtml:::RenderFlow):
3071 (khtml::RenderBlock::paintEllipsisBoxes):
3072 (khtml::RenderBlock::nodeAtPoint):
3073 (khtml::shouldCheckLines):
3074 (khtml::getLineAtIndex):
3075 (khtml::getHeightForLineCount):
3076 (khtml::RenderBlock::lineAtIndex):
3077 (khtml::RenderBlock::lineCount):
3078 (khtml::RenderBlock::heightForLineCount):
3079 (khtml::RenderBlock::clearTruncation):
3080 * khtml/rendering/render_block.h:
3081 (khtml::RenderBlock::setHasMarkupTruncation):
3082 (khtml::RenderBlock::hasMarkupTruncation):
3083 * khtml/rendering/render_flexbox.cpp:
3084 (khtml::RenderFlexibleBox::layoutVerticalBox):
3085 * khtml/rendering/render_line.cpp:
3086 (khtml::EllipsisBox::m_str):
3087 (khtml::InlineBox::adjustPosition):
3088 (khtml::InlineFlowBox::adjustPosition):
3089 (khtml::InlineFlowBox::clearTruncation):
3090 (khtml::EllipsisBox::paint):
3091 (khtml::EllipsisBox::nodeAtPoint):
3092 (khtml::RootInlineBox::clearTruncation):
3093 (khtml::RootInlineBox::placeEllipsis):
3094 (khtml::RootInlineBox::paintEllipsisBox):
3095 (khtml::RootInlineBox::hitTestEllipsisBox):
3096 (khtml::RootInlineBox::adjustPosition):
3097 (khtml::RootInlineBox::childRemoved):
3098 * khtml/rendering/render_line.h:
3099 (khtml::InlineBox::clearTruncation):
3100 * khtml/rendering/render_text.cpp:
3101 * khtml/rendering/render_text.h:
3102 (khtml::InlineTextBox::clearTruncation):
3104 2004-06-17 Trey Matteson <trey@apple.com>
3106 3698514 - coordinates in ondragstart and ondrag events are wrong
3108 This part fixes the ondragstart coords. We salt away the window-based mouseDown
3109 location, since we need that when we dispatch the ondragstart event. Previously
3110 we were errantly using a mouseDown point that had already been converted to view
3111 coords, and then the dispatch converted it again.
3115 * kwq/KWQKHTMLPart.h:
3116 * kwq/KWQKHTMLPart.mm:
3117 (KWQKHTMLPart::khtmlMouseMoveEvent): Use window based mouse event coords to dispatch event.
3118 (KWQKHTMLPart::mouseDown): Save window based mouse event coords .
3120 2004-06-16 David Hyatt <hyatt@apple.com>
3122 Fix for 3596620, implement a subset of CSS3 text truncation for Emerson.
3126 * khtml/rendering/bidi.cpp:
3127 (khtml::RenderBlock::checkLinesForTextOverflow):
3128 * khtml/rendering/font.cpp:
3129 (Font::checkSelectionPoint):
3130 * khtml/rendering/font.h:
3131 * khtml/rendering/render_block.cpp:
3132 (khtml::RenderBlock::paintObject):
3133 (khtml::RenderBlock::paintFloats):
3134 (khtml::RenderBlock::paintEllipsisBoxes):
3135 * khtml/rendering/render_block.h:
3136 * khtml/rendering/render_line.cpp:
3137 (InlineBox::canAccommodateEllipsis):
3138 (InlineBox::placeEllipsisBox):
3139 (InlineFlowBox::paintDecorations):
3140 (InlineFlowBox::placeEllipsisBox):
3141 (EllipsisBox::paint):
3142 (RootInlineBox::placeEllipsis):
3143 (RootInlineBox::placeEllipsisBox):
3144 * khtml/rendering/render_line.h:
3145 (khtml::EllipsisBox::m_str):
3146 (khtml::RootInlineBox::ellipsisBox):
3147 * khtml/rendering/render_text.cpp:
3148 (InlineTextBox::placeEllipsisBox):
3149 (InlineTextBox::paintDecoration):
3150 (InlineTextBox::offsetForPosition):
3151 (RenderText::positionForCoordinates):
3152 (RenderText::paint):
3153 * khtml/rendering/render_text.h:
3154 * kwq/KWQFontMetrics.h:
3155 * kwq/KWQFontMetrics.mm:
3156 (QFontMetrics::checkSelectionPoint):
3157 * kwq/WebCoreTextRenderer.h:
3159 === WebCore-145.1 ===
3161 2004-06-16 Maciej Stachowiak <mjs@apple.com>
3165 <rdar://problem/3697602> REGRESSION (144.2-TOT) Selection highlight does not draw
3167 * khtml/rendering/render_canvas.cpp:
3168 (RenderCanvas::setSelection):
3172 2004-06-16 Richard Williamson <rjw@apple.com>
3174 Fixed 3695730: Added support for embeds[], much like
3175 applets[], to allow access to a plugin's exported interface.
3179 * khtml/dom/html_document.cpp:
3180 (HTMLDocument::embeds):
3181 * khtml/dom/html_document.h:
3182 * khtml/ecma/kjs_dom.cpp:
3183 (KJS::getRuntimeObject):
3184 * khtml/ecma/kjs_html.cpp:
3185 (KJS::HTMLDocument::tryGet):
3186 (KJS::HTMLElement::tryGet):
3187 (KJS::HTMLCollection::tryGet):
3188 (KJS::HTMLCollection::getNamedItems):
3189 * khtml/ecma/kjs_html.h:
3190 (KJS::HTMLDocument::):
3191 * khtml/ecma/kjs_html.lut.h:
3193 * khtml/html/html_miscimpl.cpp:
3194 (HTMLCollectionImpl::calcLength):
3195 (HTMLCollectionImpl::getItem):
3196 (HTMLCollectionImpl::getNamedItem):
3197 * khtml/html/html_miscimpl.h:
3198 (DOM::HTMLCollectionImpl::):
3199 * khtml/html/html_objectimpl.cpp:
3200 (HTMLEmbedElementImpl::getEmbedInstance):
3201 * khtml/html/html_objectimpl.h:
3202 * kwq/KWQKHTMLPart.h:
3203 * kwq/KWQKHTMLPart.mm:
3204 (KWQKHTMLPart::getEmbedInstanceForView):
3206 2004-06-15 Maciej Stachowiak <mjs@apple.com>
3210 <rdar://problem/3695907>: (can't enable selection inside parent where it is disabled via CSS)
3212 * khtml/css/cssparser.cpp:
3213 (CSSParser::parseValue):
3214 * khtml/css/cssstyleselector.cpp:
3215 (khtml::CSSStyleSelector::applyProperty):
3216 * khtml/rendering/render_object.cpp:
3217 (RenderObject::shouldSelect):
3218 * khtml/rendering/render_style.h:
3220 (khtml::RenderStyle::userSelect):
3221 (khtml::RenderStyle::setUserSelect):
3222 (khtml::RenderStyle::initialUserSelect):
3224 2004-06-15 David Hyatt <hyatt@apple.com>
3226 Initial impl of the EllipsisBox. This code just gets the box created and gets it placed vertically. The next
3227 stage will be to position the box horizontally as well.
3231 * khtml/rendering/bidi.cpp:
3232 (khtml::RenderBlock::checkLinesForTextOverflow):
3233 * khtml/rendering/render_line.cpp:
3234 (RootInlineBox::placeEllipsis):
3235 * khtml/rendering/render_line.h:
3236 (khtml::EllipsisBox::m_str):
3238 2004-06-15 David Hyatt <hyatt@apple.com>
3240 Implement canAccommodateEllipsis. The basic idea is that everything on a line will allow an ellipsis to be
3241 drawn on top of it unless it's a replaced element. Then, if the replaced element overlaps, the ellipsis won't
3246 * khtml/rendering/bidi.cpp:
3247 (khtml::RenderBlock::checkLinesForTextOverflow):
3248 * khtml/rendering/render_line.cpp:
3249 (InlineBox::closestLeafChildForXPos):
3250 (InlineBox::canAccommodateEllipsis):
3251 (InlineFlowBox::canAccommodateEllipsis):
3252 (RootInlineBox::canAccommodateEllipsis):
3253 * khtml/rendering/render_line.h:
3255 2004-06-15 Vicki Murley <vicki@apple.com>
3257 - added a few layout tests, rdar://3694510
3259 * layout-tests/editing/deleting/delete-image-004-expected.txt: Added.
3260 * layout-tests/editing/deleting/delete-image-004.html: Added.
3261 * layout-tests/editing/selection/extend-by-character-006-expected.txt: Added.
3262 * layout-tests/editing/selection/extend-by-character-006.html: Added.
3264 2004-06-15 Trey Matteson <trey@apple.com>
3266 Dragging tweak: We pass the mouse down coords instead of the
3267 latest mouse drag coords to the ondragstart event. This makes it
3268 easy for the client to figure the correct drag image offset,
3269 whereas the mouse drag location is next to useless for that.
3273 * kwq/KWQKHTMLPart.mm:
3274 (KWQKHTMLPart::khtmlMouseMoveEvent):
3276 2004-06-15 Maciej Stachowiak <mjs@apple.com>
3280 <rdar://problem/3685236>: (Safari does not support onselectstart event handler)
3282 * khtml/ecma/kjs_dom.cpp:
3283 (DOMNode::getValueProperty):
3284 (DOMNode::putValue):
3285 * khtml/ecma/kjs_dom.h:
3287 * khtml/ecma/kjs_dom.lut.h:
3289 * khtml/html/html_elementimpl.cpp:
3290 (HTMLElementImpl::parseHTMLAttribute):
3291 * khtml/misc/htmlattrs.c:
3294 * khtml/misc/htmlattrs.h:
3295 * khtml/misc/htmlattrs.in:
3296 * khtml/rendering/render_object.cpp:
3297 (RenderObject::shouldSelect):
3298 * khtml/xml/dom2_eventsimpl.cpp:
3299 (EventImpl::typeToId):
3300 (EventImpl::idToType):
3301 * khtml/xml/dom2_eventsimpl.h:
3304 2004-06-15 Maciej Stachowiak <mjs@apple.com>
3308 Fix crash with last checkin.
3310 * khtml/ecma/kjs_binding.cpp:
3311 (ScriptInterpreter::domObjectsPerDocument): check the same
3312 property we want to initialize.
3314 2004-06-15 Maciej Stachowiak <mjs@apple.com>
3318 <rdar://problem/3685309>: (properties not shared for JS wrappers of same DOM object, accessed from different frames)
3320 * khtml/ecma/kjs_binding.cpp:
3321 (ScriptInterpreter::domObjects):
3322 (ScriptInterpreter::domObjectsPerDocument):
3323 (ScriptInterpreter::ScriptInterpreter):
3324 (ScriptInterpreter::forgetDOMObject):
3325 (ScriptInterpreter::getDOMObjectForDocument):
3326 (ScriptInterpreter::putDOMObjectForDocument):
3327 (ScriptInterpreter::deleteDOMObjectsForDocument):
3328 (ScriptInterpreter::mark):
3329 (ScriptInterpreter::forgetDOMObjectsForDocument):
3330 (ScriptInterpreter::updateDOMObjectDocument):
3331 * khtml/ecma/kjs_binding.h:
3332 (KJS::ScriptInterpreter::getDOMObject):
3333 (KJS::ScriptInterpreter::putDOMObject):
3334 (KJS::ScriptInterpreter::deleteDOMObject):
3336 2004-06-15 Darin Adler <darin@apple.com>
3338 - rolled out Ken's fix for <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply due to non-0 exception code trying to insert a DIV markup string
3339 (it was making most layout tests fail)
3341 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::checkAddChild): Rolled check back in.
3343 2004-06-15 David Hyatt <hyatt@apple.com>
3345 Add a truncation variable to text run boxes that will eventually be used to know how to cut out some of the glyphs when
3350 * khtml/rendering/render_text.cpp:
3351 (RenderText::clearTextOverflowTruncation):
3352 * khtml/rendering/render_text.h:
3353 (khtml::InlineTextBox:::InlineRunBox):
3354 (khtml::InlineTextBox::clearTruncation):
3356 2004-06-14 Darin Adler <darin@apple.com>
3360 - fixed some things for GC that Patrick missed, or that happened after the branch
3363 (-[DOMStyleSheet finalize]): Added.
3364 (-[DOMStyleSheetList finalize]): Added.
3365 (-[DOMCSSStyleSheet finalize]): Added.
3366 (-[DOMMediaList finalize]): Added.