1 2004-08-16 Maciej Stachowiak <mjs@apple.com>
5 * khtml/khtml_part.cpp:
6 (KHTMLPart::isImmediateRedirectPending):
8 2004-08-16 Richard Williamson <rjw@apple.com>
10 Fixed <rdar://problem/3704339> Context2D forces integer positions in drawImage
12 Use floats instead of ints to draw images.
16 * khtml/ecma/kjs_html.cpp:
17 (KJS::Context2DFunction::tryCall):
20 (QPainter::drawPixmap):
21 (QPainter::drawFloatPixmap):
23 2004-08-13 Maciej Stachowiak <mjs@apple.com>
27 - 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)
29 (actually the previous fix for this bug was mostly correct, but
30 this additional change is needed to avoid the regression in
31 <rdar://problem/3751025> REGRESSION: website rejects Safari 125.9
32 as "need to upgrade to IE 6", but didn't reject 125.8
34 So if merging for a software update, make sure to include both
35 this and the previous fix.
37 * khtml/html/htmltokenizer.cpp:
38 (khtml::HTMLTokenizer::write): When there is an immediate reidrect pending,
39 make sure to stop tokenizing, because we need to make sure no further
40 script tags are processed beyond the one that triggered the redirect.
41 * khtml/khtml_part.cpp:
42 (KHTMLPart::isImmediateRedirectPending): New method to allow
43 checking if a redirect is pending.
46 2004-08-15 David Hyatt <hyatt@apple.com>
48 Fix the blank textarea problem by ensuring that any change to a <textarea>'s DOM children causes the form control
49 to resync with the DOM. This behavior matches WinIE.
53 * khtml/html/html_formimpl.cpp:
54 (HTMLTextAreaElementImpl::childrenChanged):
55 * khtml/html/html_formimpl.h:
57 2004-08-13 Trey Matteson <trey@apple.com>
59 3761794 Slider doesn't call onmouseup handler
63 * khtml/rendering/render_form.cpp:
64 (RenderSlider::RenderSlider): Listen for signal.
65 (RenderSlider::slotClicked): Pass to superclass.
66 * khtml/rendering/render_form.h:
69 (-[KWQSlider mouseDown:]): Generate mouseUp and clicked events,
70 since AK consumes the mouseUp event in a modal tracking loop.
71 (QSlider::QSlider): Make signal.
72 (QSlider::clicked): Send signal.
74 2004-08-12 Trey Matteson <trey@apple.com>
76 3761329 - query result links all dead in ingrammicro.com (sometimes)
77 3761328 - links in some docs dead when doc is loaded from WebArchive
79 Make sure to get part to completed state when end is called,
80 even if we have no doc. See WebKit changelog for more info.
82 Reviewed by Richard and Darin.
84 * khtml/khtml_part.cpp:
87 2004-08-13 Trey Matteson <trey@apple.com>
89 3761098 - red dotted underline for misspelled words shows up in drag image
93 * khtml/rendering/render_text.cpp:
94 (RenderText::paint): Don't draw misspelling when creating selection image.
96 2004-08-12 Richard Williamson <rjw@apple.com>
98 Bring npruntime.h and friends closer to compliance with
103 * kwq/KWQKHTMLPart.mm:
104 (KWQKHTMLPart::windowScriptNPObject):
106 2004-08-12 Maciej Stachowiak <mjs@apple.com>
110 <rdar://problem/3245706> URLs with backslashes instead of slashes work on WinIE; should work on Safari (SAP)
111 <rdar://problem/3506429> <BASE> tag containing backslash is breaking images with absolute URLs
114 (substituteBackslashes): Helper method
115 (KURL::KURL): If the URL contains any backslashes, substitute all
116 that appear before the query or fragment.
118 2004-08-12 Ken Kocienda <kocienda@apple.com>
124 <rdar://problem/3761014> command-down-arrow takes you to start of document instead of end of document
126 * khtml/xml/dom_selection.cpp:
127 (DOM::Selection::modifyExtendingRightForward): Code used to assume, incorrectly, that index 1 of the
128 document element was beyond the last node in the document. But this is not true, since the document
129 element is the HTML element (generally). Instead, move to the index equal to the number of children
130 of the document element. This puts us past everything.
131 (DOM::Selection::modifyMovingRightForward): Ditto.
133 2004-08-12 Ken Kocienda <kocienda@apple.com>
139 <rdar://problem/3695446> shift-down-arrow on last line of editable text should select to end of document
141 Detect when current position is on first or last line and move to the
142 start or end of that line, respectively.
144 * khtml/xml/dom_position.cpp:
145 (DOM::Position::previousLinePosition)
146 (DOM::Position::nextLinePosition)
150 2004-08-12 Ken Kocienda <kocienda@apple.com>
154 Some consolidation in style application code.
156 * khtml/editing/htmlediting_impl.cpp:
157 (khtml::StyleChange::StyleChange): Made this a full-on class and added a couple of
158 members and a constructors to make a StyleChange from a CSSStyleDeclarationImpl, as
159 well as from a CSSStyleDeclarationImpl and a Position.
160 (khtml::StyleChange::init): Common init function for StyleChange constructors.
161 (khtml::StyleChange::currentlyHasStyle): Moved this here from ApplyStyleCommandImpl.
162 (khtml::CompositeEditCommandImpl::applyTypingStyle): Tweak to adjust to new StyleChange
164 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Ditto.
165 * khtml/editing/htmlediting_impl.h:
166 (khtml::StyleChange::StyleChange):
167 (khtml::StyleChange::cssStyle): New accessor.
168 (khtml::StyleChange::applyBold): Ditto.
169 (khtml::StyleChange::applyItalic): Ditto.
170 * khtml/xml/dom_position.cpp:
171 (DOM::Position::computedStyle): New helper.
172 * khtml/xml/dom_position.h: Ditto.
174 2004-08-12 Ken Kocienda <kocienda@apple.com>
179 <rdar://problem/3751098> HTML email has one set of SPAN tags per character in the message
181 Progress on this bug:
182 <rdar://problem/3755562> Typing styles do not use same tag application conventions as font and color panel
184 * khtml/editing/htmlediting_impl.cpp:
185 (khtml::CompositeEditCommandImpl::applyTypingStyle): Name changed from createTypingStyleElement.
186 Also, interface changed to take the node to which the typing style is to be applied.
187 This makes it easier to apply what may be up to three levels of nested tags to get the
188 desired style (<B>, <I>, and <SPAN STYLE="">).
189 Also, Borrow some of the style change smarts from ApplyStyleCommandImpl to use bold and
190 italic tags for applying styles when that is apprpriate. This creates on opportunity to
191 factor the code to do this so that this function and the ApplyStyleCommandImpl class can
192 share the implementation. I will follow up with a change to do that after landing this
193 change. Some future code factoring could be done here to bring together some similar code
195 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Add comment about code factoring work.
196 (khtml::ApplyStyleCommandImpl::computeStyleChange): StyleChange struct no longer a member of the
197 ApplyStyleCommandImpl class. CompositeEditCommandImpl needs it now in its applyTypingStyle()
199 (khtml::InputNewlineCommandImpl::doApply): Pass along node to style to applyTypingStyle.
200 (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
201 * khtml/editing/htmlediting_impl.h:
202 (khtml::StyleChange::StyleChange): Pull this struct out of ApplyStyleCommandImpl so
203 CompositeEditCommandImpl can use it.
204 * khtml/khtml_part.cpp:
205 (KHTMLPart::notifySelectionChanged): Always clear typing style when the selection
206 changes, not only when closing typing. This fixes 3751098.
208 These three tests actually had results that treated the buggy behavior as correct!
210 * layout-tests/editing/style/style-3681552-fix-001-expected.txt
211 * layout-tests/editing/style/style-3681552-fix-002-expected.txt
212 * layout-tests/editing/style/typing-style-002-expected.txt
214 2004-08-12 Darin Adler <darin@apple.com>
218 - fixed <rdar://problem/3740485> Repro crash involving replacing content that includes form field
220 * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Since this function calls selectText: which has a side
221 effect of making the text field be first responder, call to bridge first to make it first responder.
222 The bridge version lets WebHTMLView know we are changing the responder, avoiding some unpleasantness
223 because it sets the "changing focus programmatically" flag. Without that flag set, we were getting
224 an additional setFocusNode(0) call, which is unnecessary and incorrect.
226 2004-08-12 Darin Adler <darin@apple.com>
230 - fixed <rdar://problem/3758756> copying text selected with down arrow results in all text to end of document
232 * khtml/xml/dom2_rangeimpl.h: Make startNode and pastEndNode public.
233 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::pastEndNode): Fix bug where this would return
234 one node too far in the case where the end container was not a text node.
236 * khtml/xml/dom_nodeimpl.cpp:
237 (NodeImpl::recursive_toHTMLWithOptions): Rewrite loop, using startNode and pastEndNode,
238 to fix bug where it would run past the end node, including too many nodes in the generated
239 HTML. Nice side benefit: easier to read the code.
241 2004-08-11 Chris Blumenberg <cblu@apple.com>
243 Fixed: <rdar://problem/3758216> PARENTAL: buttons on parental controls page only work once
247 * kwq/KWQKHTMLPart.mm:
248 (KWQKHTMLPart::submitForm): prevent a form from being submitted more than once only if it uses a scheme of http or https
250 2004-08-11 Darin Adler <darin@apple.com>
254 - fixed <rdar://problem/3715878> 8A162: connect.apple.com password field showed in cleartext
256 * kwq/KWQTextField.mm: (-[KWQSecureTextField textDidEndEditing:]):
257 Enhanced workaround for shifting focus from one secure text field to another so that it works
258 even for the case of shifting focus from a secure text field back to itself.
260 2004-08-11 Ken Kocienda <kocienda@apple.com>
264 Missed adding this file before.
266 * kwq/KWQTextUtilities.mm: Added.
267 (KWQFindNextWordFromIndex):
269 2004-08-11 Ken Kocienda <kocienda@apple.com>
273 Efficiency improvements on string manipulations in these two new function
274 implementations. Use the versions of QString append/prepend that take
275 (QChar *c, uint length) instead of creating new strings each time.
277 * khtml/xml/dom_position.cpp:
278 (DOM::Position::previousWordPosition): Changed, as described above.
279 (DOM::Position::nextWordPosition): Ditto.
281 2004-08-11 Ken Kocienda <kocienda@apple.com>
286 <rdar://problem/3675812> Moving a word at a time does not use the correct conception of "word"
288 I have implemented versions of previousWordPosition and nextWordPosition that are now
289 different than previousWordBoundary and nextWordBoundary. The behavior of the new
290 functions attempts to match what Cocoa does as closely as it can. Let the bug filing begin!
292 * WebCore.pbproj/project.pbxproj: Added KWQTextUtilities.mm
293 * khtml/misc/helper.cpp:
294 (khtml::nextWordFromIndex): Glue to call through to KWQFindNextWordFromIndex.
295 * khtml/misc/helper.h: Declare the function above.
296 * khtml/misc/khtml_text_operations.cpp: Added SimplifiedBackwardsTextIterator class.
297 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): New
298 (khtml::SimplifiedBackwardsTextIterator::advance): Ditto.
299 (khtml::SimplifiedBackwardsTextIterator::handleTextNode): Ditto.
300 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement): Ditto.
301 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Ditto.
302 (khtml::SimplifiedBackwardsTextIterator::exitNode): Ditto.
303 (khtml::SimplifiedBackwardsTextIterator::emitCharacter): Ditto.
304 (khtml::SimplifiedBackwardsTextIterator::range): Ditto.
305 * khtml/misc/khtml_text_operations.h:
306 (khtml::SimplifiedBackwardsTextIterator::atEnd): Ditto.
307 (khtml::SimplifiedBackwardsTextIterator::length): Ditto.
308 (khtml::SimplifiedBackwardsTextIterator::characters): Ditto.
309 * khtml/xml/dom_position.cpp:
310 (DOM::Position::previousWordBoundary): Updated to gather appropriate text and call through to
311 AppKit to perform the same calculations NSText uses.
312 (DOM::Position::nextWordBoundary): Ditto.
313 (DOM::Position::previousWordPosition): Unrelated change to fix case where the function could get "stuck".
314 (DOM::Position::nextWordPosition): Ditto
315 (DOM::Position::equivalentDeepPosition): Changed to look backwards if the position's offset is equal
316 to the number of child nodes it has. This handles more cases correctly, like when the position is
317 gives as one beyond the end of a document element's last child.
318 * kwq/KWQTextUtilities.h: Declared KWQFindNextWordFromIndex.
319 * kwq/KWQTextUtilities.mm: Added.
320 (KWQFindNextWordFromIndex): New function.
322 2004-08-11 Ken Kocienda <kocienda@apple.com>
328 <rdar://problem/3732702> crash in CSSComputedStyleDeclarationImpl running devtools.com editing sample code
330 * khtml/khtml_part.cpp:
331 (KHTMLPart::selectionComputedStyle): Added a null check.
333 2004-08-10 Darin Adler <darin@apple.com>
337 - fixed <rdar://problem/3710123> Loading iframe that replaces content in the parent document crashes Safari
339 I fixed three problems:
341 1) script interpreter destroyed while it was interpreting scripts, caused random havoc
342 2) code trying to get to view after view was detached from part, caused nil-deref
343 3) signals sent to parent after child was no longer in the parent's frames list, caused nil-deref
345 Now the test page works fine. Hope the real sites do too.
347 * khtml/khtml_part.h: Add connectChild and disconnectChild helper functions (private).
348 * khtml/khtml_part.cpp:
349 (KHTMLPart::clear): Call disconnectChild on each frame as we detach it (see below).
350 (KHTMLPart::end): Ref the part at the start, and deref the part at the end, of this function.
351 Otherwise, we can end up destroying the part, and hence the interpreter, inside a script that
352 the interpreter itself is running.
353 (KHTMLPart::slotFinishedParsing): Add another check for a nil m_view, after the call to
355 (KHTMLPart::checkCompleted): Remove bogus if statement with empty body.
356 (KHTMLPart::processObjectRequest): Call disconnectChild to disconnect the child <-> parent signals of the
357 old child that the new one is replacing, and connectChild to connect the signals (nicer factoring).
358 (KHTMLPart::slotChildCompleted): Fixed up a confusing boolean if/expression to be simpler. Not related to
359 the bug fix, but an earlier version of the fix had changes in this function.
360 (KHTMLPart::connectChild): Added. Connects the appropriate signals for a child frame.
361 (KHTMLPart::disconnectChild): Added. Disconnects the same signals that connectChild connects.
363 * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Added a call to disconnectChild before removing the
364 child from the frames list.
366 2004-08-09 Maciej Stachowiak <mjs@apple.com>
372 - made basic marked text highlighting work to complete basic level of <rdar://problem/3704359> input method support not yet implemented for HTML editing
374 * kwq/WebCoreBridge.mm:
375 (-[WebCoreBridge setMarkedDOMRange:]): Added this new call to support storing
376 a marked range in WebCore. The provided DOMRange must start and end in the same
377 node, which must be a text node.
378 (-[WebCoreBridge markedDOMRange]): New call to get the marked range.
379 (-[WebCoreBridge clearMarkedDOMRange]): New call to clear the marked range.
380 * kwq/WebCoreBridge.h: Prototype new methods.
381 * kwq/KWQKHTMLPart.mm:
382 (KWQKHTMLPart::markedRange): Implementation of WebCore call above.
383 (KWQKHTMLPart::setMarkedRange): Implementation of WebCore call above -
384 store the marked range, and repaint new and old nodes if needed.
385 (KWQKHTMLPart::clear): Clear marked range.
386 * kwq/KWQKHTMLPart.h: Prototype new methods.
387 * khtml/rendering/render_text.cpp:
388 (InlineTextBox::paintMarkedTextBackground): New method to paint the background
389 for marked text, modeled on paintSelection.
390 (RenderText::paint): Optionally handle painting marked text
391 background as well as selection background in the marked text
393 * khtml/rendering/render_text.h: Prototype new method.
395 2004-08-10 Darin Adler <darin@apple.com>
399 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
402 (QRegExp::KWQRegExpPrivate::compile): Null-terminate the pattern and pass it.
403 (QRegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
405 2004-08-10 Darin Adler <darin@apple.com>
411 * khtml/editing/jsediting.cpp: Capitalize command names to match Windows.
412 The dictionary lookup is case insensitive.
414 * kwq/KWQFoundationExtras.h: Remove inaccurate comment.
416 2004-08-10 Trey Matteson <trey@apple.com>
418 3757094 - crash spell checking after a paste
422 * khtml/rendering/render_text.cpp:
423 (InlineTextBox::paintSelection): Add nil check.
425 2004-08-09 Trey Matteson <trey@apple.com>
427 3756195 - spell checking leaves misspelling marker behind after bad word is deleted
428 ... and other follow-on spell check fixes
432 * khtml/rendering/render_text.cpp:
433 (InlineTextBox::paintMarker): Close inspection shows we were drawing the
434 misspelling marker one pixel lower than AK, and one pixel outside the selection
435 rect we draw, in the case of Times-16. So move it up one. Still not an exact
436 match for AK, but less bad.
437 * khtml/xml/dom_docimpl.cpp:
438 (DocumentImpl::removeMarker): Track whether we make any changes, so we only
439 repaint if something actually changed.
440 (DocumentImpl::removeAllMarkers): New utility.
441 (DocumentImpl::removeAllMarkers): Use clear() instead of (errant)
442 hand-rolled loop to empty array.
443 (DocumentImpl::shiftMarkers): Track whether we make any changes, so we only
444 repaint if something actually changed.
445 * khtml/xml/dom_docimpl.h:
446 * khtml/xml/dom_textimpl.cpp:
447 (CharacterDataImpl::deleteData): Along with shifting existing markers around,
448 remove any markers in the deleted range. Fixes 3756195.
449 (CharacterDataImpl::replaceData): Ditto for the replaced range.
450 * kwq/KWQKHTMLPart.mm:
451 (KWQKHTMLPart::updateSpellChecking): comment
453 2004-08-08 Trey Matteson <trey@apple.com>
455 3745023 - Safari crashes trying to access anchor while downloading
457 I bet this is behind a few other crashers as well. In this bug the start of the
458 download leaves a KWQPageState hanging around, and when that is freed it damages
459 the part and view. If you're still using that page, you're dead.
461 The fix is to properly invalidate the PageState when we receive an error before
462 reaching WebFrameCommitted state. Normally this happens when a page is reheated
463 from the PageState, but in this case we never manage to leave the page to begin
464 with, although we've already created the PageState.
466 Other errors besides the synthetic one download generates would have caused similar
467 crashing. Another example would be clicking on a second link before the load
468 caused by clicking on the first link reached committed state.
472 * kwq/WebCoreBridge.h:
473 * kwq/WebCoreBridge.mm:
474 (-[WebCoreBridge didNotOpenURL:pageCache:]): Invalidate the pageCache state
475 when a load doesn't get off the ground.
477 2004-08-06 Ken Kocienda <kocienda@apple.com>
481 Finish off spellchecking support to HTML editing. Includes work to
482 enable continuous spellchecking.
484 * khtml/editing/htmlediting_impl.cpp:
485 (khtml::EditCommandImpl::markMisspellingsInSelection): Basically, a one-liner convenience to
486 make the call over to the KWQKHTMLPart.
487 (khtml::ReplaceSelectionCommandImpl::doApply): Did some rearranging of code so that the
488 inserted content can be spell-checked. The function is basically the same, except for
489 the addition of calls to markMisspellingsInSelection.
490 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): New function. Takes a look at the
491 selection that results after typing and determines whether it needs to spellcheck.
492 Since the word containing the current selection is never marked, this does a check to
493 see if typing made a new word that is not in the current selection. Basically, you
494 get this by being at the end of a word and typing a space.
495 (khtml::TypingCommandImpl::typingAddedToOpenCommand): Call markMisspellingsAfterTyping.
496 * khtml/editing/htmlediting_impl.h: Add new function declarations.
497 * khtml/khtml_part.cpp:
498 (KHTMLPart::setSelection): Since spell checks are updated when the selection changes,
499 and every selection change passes through here, this is a good place to put the call
501 * khtml/rendering/render_text.cpp:
502 (InlineTextBox::paintMarker): Remove temporary misspelling line drawing code. Replace with
503 call that does AppKit-style drawing. Fix up some comments.
504 * khtml/xml/dom_docimpl.cpp:
505 (DocumentImpl::addMarker): Repaint the node that had the marker added. This makes it show
507 (DocumentImpl::removeMarker): Ditto.
508 (DocumentImpl::removeAllMarkers): New function. Convenience for clearing all markers.
509 Used when not in continuous spellchecking mode.
510 (DocumentImpl::shiftMarkers): Moves markers in response to changes in a node's contents.
511 This shifts the marker offsets by a given amount. This keeps the markers in the right
512 place when a user types in a node with markers already set on it.
513 * khtml/xml/dom_docimpl.h: Added new functions. Removed unnecessary enum qualifier from some
515 * khtml/xml/dom_position.cpp:
516 (DOM::Position::previousWordBoundary): This function was susceptible to endless loops...and
517 needlessly so. Basically, if the current position is at a word boundary, run the code again
518 to find the previous word boundary.
519 (DOM::Position::nextWordBoundary): Same as above, but for next word boundary.
520 * khtml/xml/dom_textimpl.cpp:
521 (CharacterDataImpl::setData): Call shiftMarkers to update markers when this node changes.
522 (CharacterDataImpl::insertData): Ditto.
523 (CharacterDataImpl::deleteData): Ditto.
524 (CharacterDataImpl::replaceData): Ditto.
525 * kwq/KWQKHTMLPart.h:
526 * kwq/KWQKHTMLPart.mm:
527 (KWQKHTMLPart::advanceToNextMisspelling):
528 (KWQKHTMLPart::markMisspellingsInSelection):
529 (KWQKHTMLPart::updateSpellChecking):
530 (KWQKHTMLPart::respondToChangedSelection):
533 (QPainter::drawLineForMisspelling): New function. Call over to WebKit to do the drawing.
534 * kwq/WebCoreBridge.h:
535 * kwq/WebCoreBridge.mm:
536 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Pass markMisspellings flag to
538 * kwq/WebCoreTextRenderer.h:
542 2004-08-05 David Hyatt <hyatt@apple.com>
544 Fix for 3752542, stack overflow that crashes Safari at www.dr.dk. This bug is a regression caused by a fix that
545 attempted to repair <caption> behavior to make it behave like Panther. This fix was incorrect, and in addition
546 even our <caption> behavior on Panther was incorrect.
548 The patch that fixes this bug also makes <caption> handling work when <caption>s are contained inside a <td>, a <tr>,
549 a <th>, or various table section tags (<tbody>, <tfoot>, <thead>). The <caption> is pulled out and inserted just before
550 the relevant ancestor table section. This behavior matches other browsers.
554 * khtml/html/htmlparser.cpp:
555 (KHTMLParser::insertNode):
557 2004-08-04 David Hyatt <hyatt@apple.com>
559 The top-level XSL sheet is now loaded and shows up in the activity window. It is not yet parsed.
563 * WebCore.pbproj/project.pbxproj:
564 * khtml/css/css_base.h:
565 (DOM::StyleBaseImpl::isXSLStyleSheet):
566 * khtml/css/css_stylesheetimpl.cpp:
567 (CSSStyleSheetImpl::CSSStyleSheetImpl):
568 * khtml/css/css_stylesheetimpl.h:
569 (DOM::StyleSheetImpl::isLoading):
570 * khtml/misc/loader.cpp:
571 * khtml/xml/dom_xmlimpl.cpp:
572 (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
573 (DOM::ProcessingInstructionImpl::checkStyleSheet):
574 (DOM::ProcessingInstructionImpl::sheet):
575 (DOM::ProcessingInstructionImpl::isLoading):
576 (DOM::ProcessingInstructionImpl::setStyleSheet):
577 * khtml/xml/dom_xmlimpl.h:
579 2004-08-04 David Hyatt <hyatt@apple.com>
581 Add XSL Stylesheets to the WebCore cache.
585 * khtml/misc/loader.cpp:
586 (CachedXSLStyleSheet::CachedXSLStyleSheet):
587 (CachedXSLStyleSheet::ref):
588 (CachedXSLStyleSheet::deref):
589 (CachedXSLStyleSheet::data):
590 (CachedXSLStyleSheet::checkNotify):
591 (CachedXSLStyleSheet::error):
592 (DocLoader::requestXSLStyleSheet):
593 (Cache::requestXSLStyleSheet):
594 (Cache::getStatistics):
595 * khtml/misc/loader.h:
596 (khtml::CachedObject::):
597 (khtml::CachedXSLStyleSheet::sheet):
598 (khtml::CachedXSLStyleSheet::schedule):
600 2004-08-03 Ken Kocienda <kocienda@apple.com>
604 Changes to improve our handling of object tags during editing, including
607 <rdar://problem/3744533> Problem editing <OBJECT> elements displayed by WebPlugIns
609 Part of the fix for this bug involves removing the close() function from render objects.
610 It was decided that this code was no longer needed, as the work it did could be moved
611 to other, more modern, places.
615 <rdar://problem/3748537> crash due to nil node passed into parentNode in computeTypingStyle deleting text
617 Finally, I filed and fixed this bug I discovered while fixing the one above:
619 <rdar://problem/3749338> Select-all + delete leaves editing view without blinking caret
621 * khtml/editing/htmlediting_impl.cpp:
622 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Fix for 3748537. Put in some more null
623 checks. Bail, returning 0 for typing style if any null checks yield a null.
624 (khtml::DeleteSelectionCommandImpl::doApply): Fix for 3749338. A removeNodeAndPrune call may wind
625 up deleting the node where we calculated that we wanted to put the selection after deleting.
626 If this happens, move this ending selection to a sensible alternative.
627 (khtml::RemoveNodeAndPruneCommandImpl::doApply): Call previousNodeConsideringAtomicNodes instead
628 of traversePreviousNode when doing the prune.
629 * khtml/html/html_objectimpl.cpp:
630 (HTMLObjectElementImpl::attach): Part of the fix for 3744533.
631 (HTMLObjectElementImpl::recalcStyle): Change old strcmp check for type of renderer to be a call
632 to canRenderImageType.
633 (HTMLObjectElementImpl::childrenChanged): New function. Helps to keep object tags up to date
634 as their children change. This also will help to make object tags respond properly to having their
635 params changed by DOM calls.
636 * khtml/html/html_objectimpl.h: Cosmetic change.
637 * khtml/html/htmlparser.cpp:
638 (KHTMLParser::insertNode): Remove call to obsolete closeRenderer() function.
639 (KHTMLParser::popOneBlock): Ditto.
640 * khtml/rendering/render_block.cpp:
641 (khtml::RenderBlock::makeChildrenNonInline): Remove call to obsolete close() function.
642 * khtml/rendering/render_container.cpp:
643 (RenderContainer::updatePseudoChild): Ditto.
644 * khtml/rendering/render_form.cpp: Remove obsolete close() function.
645 * khtml/rendering/render_form.h: Ditto.
646 * khtml/rendering/render_frames.cpp: Ditto.
647 * khtml/rendering/render_frames.h: Ditto.
648 * khtml/rendering/render_inline.cpp:
649 (RenderInline::splitFlow): Remove calls to obsolete close() function.
650 * khtml/rendering/render_object.h: Remove obsolete close() function.
651 * khtml/rendering/render_table.cpp:
652 (RenderTableCell::layout): Ditto.
653 * khtml/rendering/render_table.h: Ditto.
654 * khtml/xml/dom_docimpl.cpp:
655 (DocumentImpl::closeInternal): Remove call to obsolete close() function.
656 * khtml/xml/dom_nodeimpl.cpp: Remove obsolete m_rendererNeedsClose initialization.
657 (NodeImpl::NodeImpl): Remove obsolete closeRenderer() function.
658 (NodeImpl::attach): Remove call to obsolete close() function.
659 (NodeImpl::isAtomicNode): New function. Helps to fix 3744533. Determines if a node should
660 be treated as an atomic node for the purposes of editing.
661 (NodeImpl::previousNodeConsideringAtomicNodes): New helper to traverse tree taking atomic nodes
663 (NodeImpl::nextNodeConsideringAtomicNodes): Ditto.
664 (NodeImpl::previousLeafNode): Now calls nextNodeConsideringAtomicNodes to iterate. This helps to
665 prevent deleting PARAM tag portions of object tags erroneously.
666 (NodeImpl::nextLeafNode): Ditto.
667 * khtml/xml/dom_nodeimpl.h: Removed m_rendererNeedsClose bit. Added declarations for new functions.
668 * khtml/xml/dom_position.cpp:
669 (DOM::Position::equivalentDeepPosition): Now takes atomic nodes into account as it drills down into the
671 * khtml/xml/xml_tokenizer.cpp:
672 (khtml::XMLTokenizer::endElement): Remove call to obsolete closeRenderer() function.
674 2004-08-03 David Hyatt <hyatt@apple.com>
676 Add the deprecated text/xsl MIME type (introduced by Internet Explorer 5) as an acceptable MIME type for XML
681 * khtml/ecma/xmlhttprequest.cpp:
682 (KJS::XMLHttpRequest::getValueProperty):
683 * khtml/khtml_part.cpp:
685 * khtml/misc/loader.cpp:
686 (CachedXBLDocument::CachedXBLDocument):
688 2004-08-03 Maciej Stachowiak <mjs@apple.com>
692 - remove assertions that asserted text is non-empty, just avoid
693 doing anything for the empty case; this is needed because input
694 methods like to insert empty text in various cases.
696 * khtml/editing/htmlediting_impl.cpp:
697 (khtml::InsertTextCommandImpl::InsertTextCommandImpl):
698 (khtml::InsertTextCommandImpl::doApply):
699 (khtml::InsertTextCommandImpl::doUnapply):
701 2004-08-03 Darin Adler <darin@apple.com>
705 - fixed <rdar://problem/3740937> ER: A way to turn a DOMRange into text (equivalent of -innerText)
707 * khtml/xml/dom2_rangeimpl.h: Added text function. Like innerText, but on a range.
708 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::text): Added.
710 * kwq/DOM.mm: (-[DOMRange _text]): Added. Calls DOM::RangeImpl::text.
711 * kwq/DOMPrivate.h: Added.
713 * WebCore.pbproj/project.pbxproj: Added DOMPrivate.h, an internal header (private in WebKit, internal here).
715 2004-08-02 John Sullivan <sullivan@apple.com>
719 WebCore part of fix for <rdar://problem/3631868> NSToolbar adoption:
720 Tab key should cycle around toolbar and page content
722 * kwq/WebCoreBridge.mm:
723 (-[WebCoreBridge nextKeyViewInsideWebFrameViews]):
724 Made this method start looking from the current focus node. This won't
725 affect any existing callers because there were no existing callers.
726 (-[WebCoreBridge previousKeyViewInsideWebFrameViews]):
729 2004-08-02 David Hyatt <hyatt@apple.com>
731 Create a #define for XSLT support that at the moment will only be enabled on Tiger.
737 2004-08-02 Ken Kocienda <kocienda@apple.com>
743 <rdar://problem/3747945> Deleting replaced element can cause crash
745 * khtml/xml/dom_selection.cpp:
746 (DOM::Selection::layoutCaret): The crux of the problem is that
747 the caret drawing code tries to draw the caret at the image
748 offset after it has been removed from the document. So, make
749 sure the start node for the selection is in the document before
750 trying to lay out the caret using that node.
752 2004-07-31 Ken Kocienda <kocienda@apple.com>
756 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
757 <rdar://problem/3746408> HTMLCompose: cannot type in message body of new messages (and tabbing causes a crash.)
759 * kwq/KWQKHTMLPart.mm:
760 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Add in some smarts to look around for
761 a good place to put the caret if focus is turning "on", the part is contentEditable,
762 and it does not currently have a selection. This has the effect of flashing the caret
763 in a contentEditable view automatically without requiring the programmer to set a
764 selection explicitly. This also fixes the bug listed above. Both are cases where the
765 bad behavior happened since the editing code tried to process input without an active
766 selection. I always took the extra step of setting the selection explicitly when
767 opening new windows in programs like Blot, but it seems silly to require developers to
768 do this in general. With this patch, they no longer need to.
770 2004-07-30 Ken Kocienda <kocienda@apple.com>
776 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
778 * khtml/xml/dom_selection.cpp:
779 (DOM::Selection::layoutCaret): Don't bail when the start position of the selection is not in rendered
780 content. The validate() bottleneck function will do all it can to make sure that the start is
781 moved to rendered content if at all possible before this function runs. If no rendered position can
782 be found, like in the case of an empty body element, we still want to flash the caret there.
783 (DOM::Selection::validate): Look for rendered positions for the base and extent, but save off the
784 base before making this move, and set the selection to the enclosing block flow element of this
785 original base if no rendered positions can be found. This has the effect of flashing the caret
786 someplace in an editable block, even if it does not contain any rendered content.
788 2004-07-30 Ken Kocienda <kocienda@apple.com>
792 Fix a large number of editing layout test regressions.
794 * khtml/misc/khtml_text_operations.cpp:
795 (khtml::TextIterator::TextIterator): Use a new way to compute the end offset of a node for
796 purposes of text iteration. The end offset is either child count of a node with children,
797 or the maxOffset() of a node that does not.
798 * khtml/xml/dom_nodeimpl.cpp: Remove maxOffset() implementation from NodeBaseImpl. This
799 conflicted with the usage of this function that is needed for editing.
800 * khtml/xml/dom_nodeimpl.h: Ditto.
802 2004-07-30 Trey Matteson <trey@apple.com>
804 Next steps for spell checking: We have data structures for the marked pieces of
805 text and the smarts to draw them (although at this point, they just get a green
806 underline instead of using the real AppKit pattern.)
808 Note we don't call this code outside of development, since at this point I suspect
809 it could be made to crash by mixing spelling and editing.
813 * khtml/rendering/render_text.cpp:
814 (InlineTextBox::paintMarker): Paint one marker's intersection with a text run
815 (RenderText::paint): Find intersections of all markers and runs, call paintMarker
816 * khtml/rendering/render_text.h:
817 * khtml/xml/dom_docimpl.cpp:
818 (DocumentImpl::addMarker): Adds a marker to a DOM Range.
819 (DocumentImpl::removeMarker): Removes a marker from a DOM Range.
820 (DocumentImpl::addMarker): Adds a marker to a single DOM Node, merging previous
822 (DocumentImpl::removeMarker): Removes a marker from a single DOM Node, breaking
823 up previous markers as needed.
824 (DocumentImpl::markersForNode): Return markers for a Node.
825 * khtml/xml/dom_docimpl.h:
826 (DOM::DocumentMarker::): New marker struct
827 (DOM::DocumentMarker::operator == ):
828 (DOM::DocumentMarker::operator != ):
829 * kwq/KWQKHTMLPart.mm:
830 (KWQKHTMLPart::advanceToNextMisspelling): Mark misspelled ranges when we find them.
833 2004-07-29 Maciej Stachowiak <mjs@apple.com>
837 <rdar://problem/3745808> Seed: WebKit: Table's caption broken
839 * khtml/html/htmlparser.cpp:
840 (KHTMLParser::insertNode): When a caption appears in an illegal
841 place in a table, pop blocks until we hit a place where it's
846 2004-07-29 Darin Adler <darin@apple.com>
850 - added constants for motion across entire document for use in operations like
851 move to beginning of document
853 * khtml/xml/dom_selection.h: Added DOCUMENT to ETextGranularity.
854 * khtml/xml/dom_selection.cpp:
855 (DOM::Selection::modifyExtendingRightForward): Added case for DOCUMENT.
856 (DOM::Selection::modifyMovingRightForward): Added case for DOCUMENT.
857 (DOM::Selection::modifyExtendingLeftBackward): Added case for DOCUMENT.
858 (DOM::Selection::modifyMovingLeftBackward): Added case for DOCUMENT.
859 (DOM::Selection::validate): Changed if statements into switch statement,
860 added case for DOCUMENT.
862 * kwq/WebCoreBridge.h: Added WebCoreBridge to WebSelectionGranularity.
864 2004-07-28 Trey Matteson <trey@apple.com>
866 Small refinement of last checkin. The text iterators now return reasonable values
867 for range() when atEnd, which gets rid of special cases and pitfalls in the client.
871 * khtml/misc/khtml_text_operations.cpp:
872 (khtml::TextIterator::TextIterator): Set endOffset to a valid value instead of
874 (khtml::TextIterator::range): Implement when atEnd.
875 (khtml::CharacterIterator::range): Don't massage result when atEnd.
876 (khtml::WordAwareIterator::WordAwareIterator): Now that this is fixed, we no
877 longer need this special case.
878 (khtml::WordAwareIterator::advance): Always set range, even when atEnd, now that
879 TextIterator::range() always works.
880 * khtml/xml/dom_nodeimpl.cpp:
881 (NodeImpl::childNodeCount): Made const
882 (NodeBaseImpl::maxOffset): Add missing implementation
883 * khtml/xml/dom_nodeimpl.h:
884 * kwq/KWQKHTMLPart.mm:
885 (KWQKHTMLPart::advanceToNextMisspelling): Get rid of special cases, always call
886 range on our iterator even when it is atEnd.
888 2004-07-28 Maciej Stachowiak <mjs@apple.com>
892 <rdar://problem/3678534> controls on page at http://help.sap.com don't work properly
894 To fix this I implemented the various JavaScript BarInfo properties in JavaScript.
896 * khtml/ecma/kjs_window.cpp:
898 (Window::locationbar):
900 (Window::personalbar):
903 (Window::scrollbars):
906 (SelectionFunc::tryCall):
911 * khtml/ecma/kjs_window.h:
914 (KJS::BarInfo::part):
915 (KJS::BarInfo::classInfo):
916 * khtml/ecma/kjs_window.lut.h:
918 * kwq/KWQKHTMLPart.h:
919 * kwq/KWQKHTMLPart.mm:
920 (KWQKHTMLPart::locationbarVisible):
921 (KWQKHTMLPart::menubarVisible):
922 (KWQKHTMLPart::personalbarVisible):
923 (KWQKHTMLPart::scrollbarsVisible):
924 (KWQKHTMLPart::statusbarVisible):
925 (KWQKHTMLPart::toolbarVisible):
927 2004-07-28 Ken Kocienda <kocienda@apple.com>
931 Added more layout tests.
933 * layout-tests/editing/style/style-3681552-fix-001-expected.txt: Added.
934 * layout-tests/editing/style/style-3681552-fix-001.html: Added.
935 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Added.
936 * layout-tests/editing/style/style-3681552-fix-002.html: Added.
937 * layout-tests/editing/style/style-3690704-fix-expected.txt: Added.
938 * layout-tests/editing/style/style-3690704-fix.html: Added.
939 * layout-tests/editing/style/typing-style-001-expected.txt: Added.
940 * layout-tests/editing/style/typing-style-001.html: Added.
941 * layout-tests/editing/style/typing-style-002-expected.txt: Added.
942 * layout-tests/editing/style/typing-style-002.html: Added.
944 2004-07-28 Ken Kocienda <kocienda@apple.com>
948 Added some layout tests.
950 * layout-tests/editing/selection/select-all-001-expected.txt: Added.
951 * layout-tests/editing/selection/select-all-001.html: Added.
952 * layout-tests/editing/selection/select-all-002-expected.txt: Added.
953 * layout-tests/editing/selection/select-all-002.html: Added.
954 * layout-tests/editing/selection/select-all-003-expected.txt: Added.
955 * layout-tests/editing/selection/select-all-003.html: Added.
957 2004-07-28 Trey Matteson <trey@apple.com>
959 Spellchecking, Part I. Basic spellcheck is working. Spelling panel is hooked up.
961 At this point, no special marking of misspellings, no grammar check, no context
962 menu integration, no "check continually" mode.
964 Much of the TextIterator and CharacterIterator interface got published outside
965 of khtml_text_operations.cpp, with a little API rationalizing.
969 * khtml/misc/khtml_text_operations.cpp:
970 (khtml::TextIterator::range): Name changes.
971 (khtml::CharacterIterator::CharacterIterator): Ditto.
972 (khtml::CharacterIterator::range): Ditto.
973 (khtml::CharacterIterator::advance): Ditto.
974 (khtml::CharacterIterator::string): New method to consume chars into a string.
975 (khtml::WordAwareIterator::WordAwareIterator): New class that iterates over
976 the text respecting word boundaries.
977 (khtml::WordAwareIterator::advance):
978 (khtml::WordAwareIterator::length):
979 (khtml::WordAwareIterator::characters):
980 (khtml::plainText): Name changes.
981 (khtml::findPlainText): Ditto.
983 API moved from cpp to header file.
984 * khtml/misc/khtml_text_operations.h:
985 (khtml::TextIterator::atEnd):
986 (khtml::TextIterator::length):
987 (khtml::TextIterator::characters):
988 (khtml::CharacterIterator::atBreak):
989 (khtml::CharacterIterator::atEnd):
990 (khtml::CharacterIterator::length):
991 (khtml::CharacterIterator::characters):
992 (khtml::CharacterIterator::characterOffset):
993 (khtml::WordAwareIterator::atEnd):
994 (khtml::WordAwareIterator::range):
996 * khtml/xml/dom_position.cpp:
997 (DOM::Position::previousWordBoundary): New name for the old routine. This routines semantics
998 match the current behavior of this code.
999 (DOM::Position::nextWordBoundary): Ditto.
1000 (DOM::Position::previousWordPosition): Call old code with the new name. When we fix
1001 word advancement, this routine will have its own impl.
1002 (DOM::Position::nextWordPosition): Ditto.
1003 * khtml/xml/dom_position.h:
1004 * khtml/xml/dom_selection.h:
1005 (DOM::Selection::rangeStart): New convenience methods
1006 (DOM::Selection::rangeEnd):
1007 * kwq/KWQKHTMLPart.h:
1008 * kwq/KWQKHTMLPart.mm:
1009 (KWQKHTMLPart::findString): Ensure we use range-compatible positions.
1010 (KWQKHTMLPart::advanceToNextMisspelling): Brand new.
1011 * kwq/WebCoreBridge.h:
1012 * kwq/WebCoreBridge.mm:
1013 (-[WebCoreBridge advanceToNextMisspelling]): Typical bridge glue.
1015 2004-07-28 Ken Kocienda <kocienda@apple.com>
1021 <rdar://problem/3690704> marking partly bold text italic across blocks wrongly extends the bold section
1023 * khtml/editing/htmlediting_impl.cpp:
1024 (khtml::ApplyStyleCommandImpl::doApply): Fixed loop that gathers up groups of nodes to
1025 pass off to the function that applies styles. While this is meant to be conservative in
1026 order to leave the DOM well-formed in all cases, it contained an error where the set
1027 of nodes to be styled together erroneously could include a node that was meant for
1028 the next set. Fixed.
1029 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Unrelated change to remove DOM:: scope
1030 resolution qualifier. Unneeded here.
1032 2004-07-28 Darin Adler <darin@apple.com>
1036 - fixed <rdar://problem/3658471> REGRESSION: Node.appendChild( ) fails when parent already contains that child
1038 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::isAncestor): Restore the original meaning of this function.
1039 It returns true if the parameter is an ancestor of this, but had been changed to return true if this
1040 is an ancestor of the parameter. However, we do retain one change we made at the same time, which is
1041 that it does not consider a node an ancestor of itself.
1043 * khtml/editing/htmlediting_impl.cpp: (khtml::ApplyStyleCommandImpl::nodeFullySelected):
1044 * khtml/xml/dom2_traversalimpl.cpp: (DOM::NodeIteratorImpl::notifyBeforeNodeRemoval):
1045 Reverse parameters for callers who wanted the new meaning of isAncestor, with care to not use it in
1046 any cases where the pointer might be 0.
1048 * khtml/xml/dom_nodeimpl.h: Added const to the parameter to make things more symmetric and allow the
1049 new uses to all compile.
1051 2004-07-28 Ken Kocienda <kocienda@apple.com>
1057 <rdar://problem/3681552> html editing needs to preserve typing font when replacing selection
1059 * khtml/css/css_valueimpl.cpp:
1060 (CSSStyleDeclarationImpl::merge): New helper that merges styles together. Helpful for
1061 dealing with typing styles.
1062 * khtml/css/css_valueimpl.h:
1063 * khtml/editing/htmlediting_impl.cpp:
1064 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): New helper that updates the
1065 typing style based on the current selection. This is a convenient bottleneck for all
1066 the code that needs to worry about typing style.
1067 (khtml::DeleteSelectionCommandImpl::doApply): Update typing style before doing the delete.
1068 (khtml::InputNewlineCommandImpl::doApply): No need to redeclare exceptionCode local.
1070 (khtml::InputTextCommandImpl::prepareForTextInsertion): Remove unneeded complication when
1071 figuring out where to insert style node. Not even sure what I was trying to do here, but
1072 it does not seem to be needed any more.
1073 (khtml::InputTextCommandImpl::execute): Remove unneeded comment.
1074 * khtml/editing/htmlediting_impl.h: Declare new computeTypingStyle helper.
1075 * khtml/khtml_part.cpp:
1076 (KHTMLPart::setCaretVisible): Call selectionLayoutChanged instead of notifySelectionChanged
1077 in this function. The selection did not change simply by calling this function, but it
1079 (KHTMLPart::notifySelectionChanged): Treat clearing the typing style much like closing typing,
1080 instead of clearing it unconditionally.
1081 (KHTMLPart::applyStyle): In the case where the current selection is a caret, merge the
1082 style being applied with any current typing style that already exists.
1084 2004-07-28 Darin Adler <darin@apple.com>
1088 - fixed <rdar://problem/3711080> REGRESSION (125-146): form fields have shrunk by 1 pixel, and now clip descenders
1090 * kwq/KWQLineEdit.mm: (QLineEdit::sizeForCharacterWidth):
1091 Compute the size without ever calling cellSize. After talking with Andrew Platzer,
1092 we decided that hard-coding the size of the borders of a text field was the best
1093 way for WebCore to handle this.
1095 2004-07-28 Darin Adler <darin@apple.com>
1099 - fixed <rdar://problem/3743204> REGRESSION: crash at startribune.com in InlineBox::root()
1101 * khtml/rendering/render_flow.cpp: (RenderFlow::dirtyLinesFromChangedChild):
1102 Added a check for nil.
1104 2004-07-27 Darin Adler <darin@apple.com>
1108 - fixed <rdar://problem/3743138> opaque colors come out of getComputedStyle as "rgba", transparent ones as "rgb"
1110 * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cssText): Use "rgb" rather than
1111 "rgba" when alpha is 0xFF, not when alpha is 0.
1113 2004-07-27 Ken Kocienda <kocienda@apple.com>
1117 Fixed the problem where BR elements on lines by themselves don't paint when selected.
1119 * khtml/khtml_part.cpp:
1120 (KHTMLPart::selectAll): Related fix. Include BR's when figuring out what "all" is.
1121 * khtml/rendering/render_br.cpp:
1122 (RenderBR::paint): New function implementation. Teach BR's how to paint selections.
1123 * khtml/rendering/render_br.h:
1124 * khtml/rendering/render_text.cpp:
1125 (InlineTextBox::paintSelection): Fix some geometry calculations to be more readable (i.e. don't
1126 reuse function argument as a local). Also, improve the logic for determining whether to
1127 extend the selection to block boundaries.
1128 (RenderText::paint): Remove extendSelection argument from paintSelection. The logic to figure out
1129 extensions is now fully contained in paintSelection.
1130 * khtml/rendering/render_text.h:
1132 2004-07-27 David Hyatt <hyatt@apple.com>
1134 Fix for 3665211 (again). Make sure not to leave child line boxes pointing to deleted ancestor line boxes.
1136 Reviewed by kocienda
1138 * khtml/rendering/render_block.cpp:
1139 (khtml::RenderBlock::removeChild):
1141 2004-07-26 Chris Blumenberg <cblu@apple.com>
1143 Fixed: WebView scrolls to the top after making an editing change via drag & drop
1145 Fixed by Ken, reviewed by me.
1147 * kwq/WebCoreBridge.mm:
1148 (-[WebCoreBridge ensureCaretVisible]): do nothing if the selection is not a caret
1152 2004-07-26 Maciej Stachowiak <mjs@apple.com>
1156 <rdar://problem/3740855> REGRESSION: Flash incorrectly positioned at macromedia.com
1158 * khtml/html/htmltokenizer.cpp:
1159 (khtml::HTMLTokenizer::scriptExecution): Do the prepending-src
1160 trick as for inline script execution.
1162 Added new layout tests covering this and other recent tokenizer
1165 * layout-tests/fast/tokenizer/001-expected.txt: Added.
1166 * layout-tests/fast/tokenizer/001.html: Added.
1167 * layout-tests/fast/tokenizer/002-expected.txt: Added.
1168 * layout-tests/fast/tokenizer/002.html: Added.
1169 * layout-tests/fast/tokenizer/003-expected.txt: Added.
1170 * layout-tests/fast/tokenizer/003.html: Added.
1171 * layout-tests/fast/tokenizer/resources/003-script.js: Added.
1173 2004-07-23 Ken Kocienda <kocienda@apple.com>
1179 <rdar://problem/3738920> Caret blinks in inactive window
1181 As part of the fix, I cleaned up the way we handle special drawing that needs
1182 to be done in the HTML view that is first responder in the key window (e.g the
1183 drawing of text selection highlight and caret blinking).
1185 * khtml/khtml_part.cpp: Removed setCaretVisible function. Updating caret visibility
1186 is now done in setDisplaysWithFocusAttributes, described below.
1187 * khtml/khtml_part.h: Ditto.
1188 * khtml/khtmlpart_p.h:
1189 (KHTMLPartPrivate::KHTMLPartPrivate): m_caretVisible now defaults to false. This prevents
1190 the caret from blinking when an app is started from the command line and remains in the
1192 * khtml/khtmlview.cpp:
1193 (KHTMLView::focusInEvent): Remove caret code from here. Not needed.
1194 (KHTMLView::focusOutEvent): Ditto.
1195 * kwq/KWQKHTMLPart.h:
1196 (KWQKHTMLPart::displaysWithFocusAttributes): New accessor to return cached value to other code
1198 * kwq/KWQKHTMLPart.mm:
1199 (KWQKHTMLPart::KWQKHTMLPart):
1200 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Renamed from setShowsFirstResponder and modified
1201 to do the display updating in a clearer way....and now has comments!
1202 * kwq/WebCoreBridge.h: Remove several obsolete functions that use to try to do the work of the new
1203 setDisplaysWithFocusAttributes function (and did so less well).
1204 * kwq/WebCoreBridge.mm:
1205 (-[WebCoreBridge drawRect:]): Now calls displaysWithFocusAttributes to figure out how to draw the
1206 text selection background.
1207 (-[WebCoreBridge setDisplaysWithFocusAttributes:]): Calls through to setDisplaysWithFocusAttributes in
1209 (-[WebCoreBridge selectionColor]): Flipped the value of this ternary expression to accommodate the
1210 change from usesInactiveTextBackgroundColor to setDisplaysWithFocusAttributes.
1211 (-[WebCoreBridge setCaretVisible:]): Removed.
1213 2004-07-23 John Sullivan <sullivan@apple.com>
1217 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
1218 now also extends selection (even if there wasn't one before)
1220 * khtml/khtml_part.cpp:
1221 (KHTMLPart::handleMousePressEventSingleClick):
1222 Uh, duh. Got a ! wrong last time somehow, so it did even more the wrong thing
1223 than ever. I did test this before, so my best guess is an accidental undo or
1224 something before committing.
1226 2004-07-23 David Hyatt <hyatt@apple.com>
1228 Fix for 3735084 and 3737209, when you can find no line boxes in your previous sibling, the line box to dirty
1229 should be the *first* line box and not the last.
1231 Reviewed by kocienda
1233 * khtml/rendering/render_flow.cpp:
1234 (RenderFlow::dirtyLinesFromChangedChild):
1236 2004-07-23 Ken Kocienda <kocienda@apple.com>
1240 * khtml/xml/dom_selection.cpp:
1241 (DOM::Selection::validate): Not exactly a fix of anything per se, but more of a refinement
1242 of how selection validation works. The idea is to let the selection validation process
1243 end up with an empty selection given real DOM position inputs if the validation code
1244 cannot find a rendered position. Since selection is all about display, this makes sense.
1245 Currently, the code will allow the selection to be placed in a location that is not
1246 rendered, and this does nobody any good, as it can lead to bugs like accepting key input
1247 in a div that is set to display:none.
1249 2004-07-23 Ken Kocienda <kocienda@apple.com>
1253 Updated layout tests with new expected results.
1255 * layout-tests/editing/execCommand/boldSelection-expected.txt
1256 * layout-tests/editing/selection/extend-by-character-001-expected.txt
1257 * layout-tests/editing/selection/extend-by-character-003-expected.txt
1258 * layout-tests/editing/selection/unrendered-005-expected.txt
1260 2004-07-22 Maciej Stachowiak <mjs@apple.com>
1264 <rdar://problem/3725467> REGRESSION(140-142) nothing displayed at http://Ye-Olde-Movies.tripod.com
1265 <rdar://problem/3599494> REGRESSION (100-125): Frame does not refresh until user clicks on browser.
1267 * khtml/rendering/render_frames.cpp:
1268 (RenderFrameSet::layout): When returning early because there are
1269 no children, make sure to mark self as no longer needing
1270 layout. Otherwise, when children are added, we'll fail to
1271 propagate childrenNeedLayout to our own parent! This is almost
1272 certainly a long-standing bug that was just masked by our old
1275 2004-07-22 Kevin Decker <kdecker@apple.com>
1279 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1281 * khtml/ecma/kjs_events.cpp:
1282 (JSLazyEventListener::JSLazyEventListener):
1283 (JSLazyEventListener::parseCode):
1284 * khtml/ecma/kjs_events.h:
1285 * khtml/ecma/kjs_proxy.cpp:
1286 (KJSProxyImpl::createHTMLEventHandler):
1287 * khtml/ecma/kjs_window.cpp:
1288 (Window::getJSLazyEventListener):
1289 * khtml/ecma/kjs_window.h:
1291 2004-07-22 Ken Kocienda <kocienda@apple.com>
1297 <rdar://problem/3724344> Bolding and unbolding creates extraneous tags
1299 * khtml/editing/htmlediting_impl.cpp:
1300 (khtml::ApplyStyleCommandImpl::doApply): Move the start of the selection upstream
1301 before calling removeStyle. This makes sure we remove all styles that could apply to the
1302 selection, and not just ones in from the start position of the selection passed to us.
1304 * khtml/xml/dom_selection.cpp:
1305 (DOM::Selection::validate): Related fix to "constrain" the selection to be the
1306 smallest equivalent range of nodes, in effect making a "canonical" version of the
1307 selection. While this is not strictly necessary to fix the bug, it is a step I have been
1308 wanting to take this step for a long time, and some recent improvements made it
1309 possible for me to do now in just two lines of code.
1311 2004-07-22 Ken Kocienda <kocienda@apple.com>
1317 <rdar://problem/3711264> difficult (impossible?) to get cursor in an editable webview containing only tags
1319 * khtml/rendering/render_container.cpp:
1320 (RenderContainer::positionForCoordinates): Don't assume you can pass off
1321 the check to a first child if there is one, since the child can be an element
1322 we do not want to place the caret in, like a table row with no cells (the case
1323 in the bug above). So now, we iterate of the renderer's children looking for
1324 the closest one, but only consider those renderers which either have children
1325 themselves, or are render block flows or are render inlines.
1327 2004-07-22 Darin Adler <darin@apple.com>
1329 - remove a bunch of now-unused code
1331 * ForwardingHeaders/qxml.h: Removed.
1332 * kwq/KWQXmlAttributes.h: Removed.
1333 * kwq/KWQXmlAttributes.mm: Removed.
1334 * kwq/KWQXmlDefaultHandler.h: Removed.
1335 * kwq/KWQXmlDefaultHandler.mm: Removed.
1336 * kwq/KWQXmlSimpleReader.h: Removed.
1337 * kwq/KWQXmlSimpleReader.mm: Removed.
1339 2004-07-22 Darin Adler <darin@apple.com>
1343 - got rid of QXml classes and changed XML parsing to use libxml directly
1345 This is the first step toward more direct use of libxml and libxslt.
1346 Dave is planning to build on this to implement XSLT and to improve our handling
1347 of XML documents (faster and more feature complete, including DTDs).
1349 * khtml/html/html_elementimpl.cpp:
1350 (HTMLElementImpl::createContextualFragment):
1351 * khtml/html/htmltokenizer.cpp:
1352 (khtml::HTMLTokenizer::HTMLTokenizer):
1353 * khtml/html/htmltokenizer.h:
1354 * khtml/xml/dom_docimpl.cpp:
1355 (DocumentImpl::createTokenizer):
1356 (DocumentImpl::open):
1357 * khtml/xml/dom_docimpl.h:
1358 (DOM::DocumentImpl::tokenizer):
1359 * khtml/xml/dom_xmlimpl.cpp:
1360 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1361 * khtml/xml/dom_xmlimpl.h:
1362 * khtml/xml/xml_tokenizer.h:
1363 * khtml/xml/xml_tokenizer.cpp: Redid this all to use libxml directly.
1365 * WebCore.pbproj/project.pbxproj: Removed a bunch of files.
1367 2004-07-21 Trey Matteson <trey@apple.com>
1369 DHTML dragging should use UTI for MIME-pboard type conversion
1373 * kwq/KWQClipboard.mm:
1374 (cocoaTypeFromMIMEType): Use UTI, except for cases we need to hardwire. Only cut off
1375 MIME args following a semi-colon for text/plain.
1376 (MIMETypeFromCocoaType): Use UTI, except for cases we need to hardwire.
1377 (KWQClipboard::types): Filter out ancient NSAsciiPboardType so DHTML never sees this cruft.
1379 2004-07-21 Ken Kocienda <kocienda@apple.com>
1383 Remove handling of HTML editing key events from WebCore.
1384 This now happens in WebKit if an event passes all the
1385 way through WebCore without being handled by the DOM.
1387 In each case below, function were removed, as their
1388 only purpose was to handle editing key events.
1390 * khtml/xml/dom_elementimpl.cpp
1391 * khtml/xml/dom_elementimpl.h
1392 * kwq/KWQKHTMLPart.h
1393 * kwq/KWQKHTMLPart.mm
1394 * kwq/WebCoreBridge.h
1396 2004-07-21 Ken Kocienda <kocienda@apple.com>
1400 * khtml/xml/dom_selection.cpp:
1401 (DOM::Selection::modifyExtendingRightForward): Add LINE_BOUNDARY case to the switch statement in this
1402 function. Use the startAndEndLineNodesIncludingNode helper which already existed to get the right
1404 (DOM::Selection::modifyMovingRightForward): Ditto
1405 (DOM::Selection::modifyExtendingLeftBackward): Ditto
1406 (DOM::Selection::modifyMovingLeftBackward): Ditto
1407 * khtml/xml/dom_selection.h:
1408 (DOM::Selection::): Add LINE_BOUNDARY constant to ETextGranularity enum. This
1409 specifies a new kind of movement that we need to implement the "move-to beggining/end of line"
1410 behavior which AppKit binds to cmd+left/right arrow keys.
1411 * kwq/WebCoreBridge.h: Add WebSelectToLineBoundary constant. This matches
1413 2004-07-20 David Hyatt <hyatt@apple.com>
1415 Fix for 3714434, user stylesheet is always parsed in strict mode, when it should honor the document's setting.
1419 * khtml/css/cssstyleselector.cpp:
1420 (khtml::CSSStyleSelector::CSSStyleSelector):
1422 2004-07-20 Ken Kocienda <kocienda@apple.com>
1426 * khtml/xml/dom_elementimpl.cpp:
1427 (ElementImpl::defaultEventHandler): No longer check whether
1428 the command key is modifying the key event. This check is
1429 now done elsewhere in the code. See the WebKit checkin that
1430 added the _web_keyBindingManagerHasBinding method to
1433 2004-07-20 Chris Blumenberg <cblu@apple.com>
1436 <rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
1437 <rdar://problem/3612691> Missing image icons (blue ?) lack context menu
1441 * kwq/WebCoreBridge.mm:
1442 (-[WebCoreBridge elementAtPoint:]): if there is no image, put the image URL on the element anyway
1444 2004-07-20 David Hyatt <hyatt@apple.com>
1446 Fix for alt text not working on images.
1450 * khtml/rendering/render_image.cpp:
1451 (RenderImage::RenderImage):
1452 (RenderImage::setPixmap):
1453 (RenderImage::paint):
1454 (RenderImage::calcReplacedWidth):
1455 (RenderImage::calcReplacedHeight):
1457 2004-07-20 Maciej Stachowiak <mjs@apple.com>
1461 <rdar://problem/3720111> REGRESSION(125-152): map fails to load depending on banner ad; weather.com (works in IE and Firefox)
1463 * khtml/html/htmltokenizer.cpp:
1464 (khtml::HTMLTokenizer::begin): Initialize currentPrependingSrc.
1465 (khtml::HTMLTokenizer::scriptHandler): Store a pointer to the currently
1466 active prependingSrc variable on the stack, the better to handle weird cases
1467 of scripts writing out additional script tags and so forth.
1468 (khtml::HTMLTokenizer::write): Deal with the above.
1469 * khtml/html/htmltokenizer.h: Declare new member field.
1471 2004-07-20 David Hyatt <hyatt@apple.com>
1473 Fix for layer positioning error that occurs when absolute positioned blocks are inside static positioned overflow:auto
1478 * khtml/rendering/render_layer.cpp:
1479 (RenderLayer::updateLayerPosition):
1481 2004-07-20 Trey Matteson <trey@apple.com>
1483 3705624 REGRESSION: can't rearrange photos on homepage.mac.com album
1485 A subtle problem stemming from some interaction between focus handing and
1486 event propagation. We previously made it so when a focus shift fails we
1487 don't propagate the event to KHTML. The fix is to get rid of the inverse
1488 effect, so now even if a focus shift succeeds, we don't propagate to KHTML if
1489 the page already canceled default behavior.
1491 In this specific case, the page is cancelling default behavior since it
1492 does its own dragging, and the bug was our new system dragging was
1497 * khtml/khtmlview.cpp:
1498 (KHTMLView::dispatchMouseEvent): What he said.
1500 2004-07-20 Ken Kocienda <kocienda@apple.com>
1506 <rdar://problem/3695240> pasting plain text with newlines in it turns them into spaces
1508 * kwq/WebCoreBridge.mm:
1509 (-[WebCoreBridge documentFragmentWithText:]): Refine this function to be smart about converting
1510 line endings into BR elements.
1512 2004-07-20 Ken Kocienda <kocienda@apple.com>
1518 <rdar://problem/3707505> HTMLCompose: blinking cursor in both an address text field and the message body
1520 * khtml/khtml_part.cpp:
1521 (KHTMLPart::setCaretVisible): This method renamed from setSelectionVisible. Since it really only operates
1522 on the caret, this seems like a better name.
1523 * khtml/khtml_part.h:
1524 * khtml/khtmlview.cpp:
1525 (KHTMLView::focusInEvent): Call setCaretVisible(true)
1526 (KHTMLView::focusOutEvent): Call setCaretVisible(false)
1527 * kwq/KWQKHTMLPart.mm:
1528 (KWQKHTMLPart::setShowsFirstResponder): Name change: setSelectionVisible becomes setCaretVisible.
1529 * kwq/WebCoreBridge.h: Expose setCaretVisible as a bridge method.
1530 * kwq/WebCoreBridge.mm:
1531 (-[WebCoreBridge setCaretVisible:]): Ditto.
1533 2004-07-19 Maciej Stachowiak <mjs@apple.com>
1537 <rdar://problem/3721428> REGRESSION (125.8-146): external javascript statements produce extra garbage character (sina.com)
1539 * khtml/misc/stringit.h:
1540 (khtml::TokenizerSubstring::TokenizerSubstring): For the apple branch, use the new
1541 stableUnicode() method to get the unicode pointer.
1544 (QString::detachIfInternal): Reorganize this to be a bit less wacky about refcounts.
1545 It does not leave around a zombie internal data handle but rather destroys it right away,
1546 and leaves the object pointing to the new handle (which it can then deref). This makes
1547 the code more clear.
1548 (QString::~QString): Simplify.
1549 (QString::stableUnicode): New method that detaches a copy of the KWQStringData if it
1550 is internal to a string besides this one. This guarantees that if you get the unicode()
1551 pointer, it won't go bad so long as this string is still alive.
1553 2004-07-19 David Hyatt <hyatt@apple.com>
1555 Fix for 3715117, crash from a bug in removeChildren. Clean up node removal and fix an n-squared removal
1556 bug. Also clean up checks in removeChild and in the dispatch of removedFromDocument mutation events to
1557 make node removal more efficient.
1559 Reviewed by kocienda
1561 * khtml/xml/dom_nodeimpl.cpp:
1563 2004-07-19 John Sullivan <sullivan@apple.com>
1567 - fixed <rdar://problem/3141150> can't undo in form textarea fields
1569 * kwq/KWQTextArea.mm:
1570 (-[KWQTextArea _createTextView]):
1571 call setAllowsUndo:YES. My, wasn't this easy?
1573 2004-07-19 David Hyatt <hyatt@apple.com>
1575 Merge @import fix for CSS1 test suite from Stephan Kulow.
1579 * khtml/css/parser.cpp:
1580 * khtml/css/parser.y:
1581 * layout-tests/css1/basic/containment-expected.txt:
1583 2004-07-19 David Hyatt <hyatt@apple.com>
1585 Fix for 3718697, crash clicking on JS tab at alaskaair.com.
1587 Reviewed by kocienda
1589 * khtml/rendering/render_flow.cpp:
1590 (RenderFlow::detach):
1591 (RenderFlow::dirtyLinesFromChangedChild):
1592 * khtml/rendering/render_flow.h:
1593 * khtml/rendering/render_object.cpp:
1594 (RenderObject::dirtyLinesFromChangedChild):
1595 * khtml/rendering/render_object.h:
1597 2004-07-16 David Hyatt <hyatt@apple.com>
1599 Fix for 3726471, need to ensure that it's safe to do updateRendering from within layout, since isContentEditable
1600 relies on it. The fix is to just recalcStyle up front before beginning the layout, so that all of our renderobjects
1605 * khtml/khtmlview.cpp:
1606 (KHTMLView::layout):
1608 2004-07-16 Ken Kocienda <kocienda@apple.com>
1614 <rdar://problem/3722153> Random crash while typing (DOM::NodeImpl::parentNode (this=0x0))
1616 * khtml/editing/htmlediting_impl.cpp:
1617 (khtml::DeleteSelectionCommandImpl::doApply): This check merely makes the code
1618 more robust. I do not understand how Grant ended up with null start or end
1619 blocks in the case of his bug report, but by adding two null checks, the code is
1620 now hardened a bit in case it happens again.
1622 2004-07-16 Ken Kocienda <kocienda@apple.com>
1628 <rdar://problem/3730785> Crash when arrow navigation goes to empty table cell
1629 <rdar://problem/3730790> Caret does not blink when placed in empty table cell
1631 * khtml/rendering/render_block.cpp:
1632 (khtml::RenderBlock::paintObject): Caret node's renderer might be this block, so
1633 don't block the painting of the caret in this case. This was the case in 3730790.
1634 We had the right geometry for the caret but blocked its painting.
1635 * khtml/xml/dom_position.cpp:
1636 (DOM::Position::previousLinePosition): Rework the logic here. This function asserted
1637 that the new position we would navigate to had a line box, but empty table cells, for
1638 instance will not. So, deal with this situation as well. The end result is a
1639 function that worked like it did before in cases where the previous line position has
1640 a line box, but now also will allow navigation to work when it does not.
1641 (DOM::Position::nextLinePosition): Ditto.
1643 2004-07-16 Ken Kocienda <kocienda@apple.com>
1649 <rdar://problem/3687216> editable inline causes crash when focused
1651 * khtml/xml/dom_docimpl.cpp:
1652 (DocumentImpl::relinquishesEditingFocus): Add null check for rootEditableElement.
1653 (DocumentImpl::acceptsEditingFocus): Ditto.
1655 2004-07-16 David Hyatt <hyatt@apple.com>
1657 Fix for 3709337, crash when using display: compact. Need to make sure that the isCompact() check in bidi.cpp is
1658 also checking for RenderBlocks, since otherwise you match text nodes (and that's just wrong).
1660 Reviewed by kocienda
1662 * khtml/rendering/bidi.cpp:
1663 (khtml::RenderBlock::layoutInlineChildren):
1667 2004-07-15 David Hyatt <hyatt@apple.com>
1669 Fix for 3625611, images offset on first visit to page. The method for determining the last clean line was
1670 flawed and would incorrectly miss dirty lines that occurred after the first clean line.
1674 * khtml/rendering/bidi.cpp:
1675 (khtml::RenderBlock::determineEndPosition):
1677 2004-07-15 Ken Kocienda <kocienda@apple.com>
1682 <rdar://problem/3587601> reproducible assertion failure in Blot deleting text, then image at Yahoo.com
1684 * khtml/editing/htmlediting_impl.cpp:
1685 (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): Relax assertion
1686 that nodes are text nodes during the walk of eligible nodes that could possibly be
1687 deleted. Change the assertion to an conditional check for text nodes. We may have
1688 unrendered nodes in the mix here (as is the case in the bug where the assertion
1689 failed on an AREA element), and the conditional check is sufficient to
1690 skip them while leaving the delete logic we want unperturbed.
1692 2004-07-14 Ken Kocienda <kocienda@apple.com>
1696 * khtml/rendering/render_block.cpp:
1697 (khtml::RenderBlock::paintObject): Add null check on DOM node before
1698 asking if it is contentEditable.
1700 2004-07-14 David Hyatt <hyatt@apple.com>
1702 Fix for 3595073, setting innerHTML on a <table> should work.
1706 * khtml/html/html_elementimpl.cpp:
1707 (HTMLElementImpl::createContextualFragment):
1709 2004-07-14 Ken Kocienda <kocienda@apple.com>
1713 Updated these layout tests as a result of the last patch.
1714 These results are better.
1716 * layout-tests/editing/execCommand/selectAll-expected.txt
1717 * layout-tests/editing/selection/extend-by-character-006-expected.txt
1718 * layout-tests/editing/selection/unrendered-001-expected.txt
1719 * layout-tests/editing/selection/unrendered-003-expected.txt
1721 2004-07-14 Ken Kocienda <kocienda@apple.com>
1725 * khtml/rendering/render_block.cpp:
1726 (khtml::RenderBlock::paintObject): Change back to start() from caretPosition().
1727 Since the policy is now to move the selection to rendered content, if possible,
1728 when the selection is set, there is no longer any reason to have the additional
1729 caretPosition() function to store where the caret should be drawn.
1730 * khtml/xml/dom_docimpl.cpp:
1731 (DocumentImpl::updateSelection): No longer any need to call closestRenderedPosition here.
1732 This is done in Selection::validate.
1733 * khtml/xml/dom_position.cpp:
1734 (DOM::Position::closestRenderedPosition): Improved algorithm. Now much simpler.
1735 * khtml/xml/dom_selection.cpp:
1736 (DOM::Selection::Selection): caretPosition() and m_caretPosition now obsolete.
1737 (DOM::Selection::init): Ditto.
1738 (DOM::Selection::modifyExtendingRightForward): No longer any need to call
1739 closestRenderedPosition here. This is done in Selection::validate.
1740 (DOM::Selection::modifyMovingRightForward): Ditto.
1741 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
1742 (DOM::Selection::modifyMovingLeftBackward): Ditto.
1743 (DOM::Selection::layoutCaret): Ditto.
1744 (DOM::Selection::validate): Add code to move the selection to rendered content if possible.
1745 * khtml/xml/dom_selection.h: caretPosition() and m_caretPosition now obsolete.
1747 2004-07-14 David Hyatt <hyatt@apple.com>
1749 Fix for 3716082, assert when you dynamically remove float or position styles.
1753 * khtml/rendering/render_object.cpp:
1754 (RenderObject::setStyle):
1756 2004-07-14 David Hyatt <hyatt@apple.com>
1758 Fix for various table regressions (malumovies.com and cityofheroes.gameamp.com) involving bungling of
1761 Reviewed by kocienda
1763 * khtml/rendering/render_box.cpp:
1764 (RenderBox::calcPercentageHeight):
1765 (RenderBox::availableHeightUsing):
1766 * khtml/rendering/render_table.cpp:
1767 (RenderTable::layout):
1768 (RenderTableSection::calcRowHeight):
1769 (RenderTableSection::layoutRows):
1770 (RenderTableCell::updateFromElement):
1771 * khtml/rendering/render_table.h:
1773 2004-07-14 Ken Kocienda <kocienda@apple.com>
1777 * khtml/xml/dom_position.cpp:
1778 (DOM::Position::equivalentDeepPosition): New helper function to improve selection handling.
1779 Soon, I plan to land some changes that use this new function.
1780 * khtml/xml/dom_position.h:
1782 2004-07-14 Ken Kocienda <kocienda@apple.com>
1786 * WebCore-combined.exp: Added QString.at symbol to tests exports to facilitate debugging
1787 data formatting change that is to come.
1788 * WebCore-tests.exp:
1790 2004-07-13 John Sullivan <sullivan@apple.com>
1794 - fixed <rdar://problem/3705500> REGRESSION (125.8-146): Cmd-E on an
1795 HTML page puts a trailing space on Find pasteboard
1797 * khtml/misc/khtml_text_operations.cpp:
1798 (khtml::TextIterator::handleTextBox):
1799 In the case where a subrun doesn't extend to the end of the text box,
1800 the well-commented code was supposed to return from this routine, but
1801 the wrong variable was being compared. This would send us through another
1802 pass of the loop, which would end up worrying about collapsed space at the
1803 end of the current box, even though we only cared about the beginning of the
1806 2004-07-12 Richard Williamson <rjw@apple.com>
1808 Fixed 3717982. Implemented navigator.language!
1812 * khtml/ecma/kjs_navigator.cpp:
1813 (Navigator::getValueProperty):
1815 2004-07-12 Ken Kocienda <kocienda@apple.com>
1819 * khtml/xml/dom_position.cpp:
1820 (DOM::Position::inRenderedContent): I broke selection drawing with my last patch. This
1821 function is now used in selection drawing, and it was making an unneeded check to see
1822 that content was editable to answer whether or not is was rendered. Bad. Fixed.
1824 2004-07-12 David Hyatt <hyatt@apple.com>
1826 Fix for 3621138, crash on hrweb.apple.com. Make sure that in the case where objects get pulled up from merging
1827 blocks that we just delete all line boxes.
1829 Reviewed by kocienda
1831 * khtml/rendering/render_block.cpp:
1832 (khtml::RenderBlock::removeChild):
1834 2004-07-10 Maciej Stachowiak <mjs@apple.com>
1838 <rdar://problem/3706080>: (REGRESSION (125.8-147u): Nested <ul> do not display bullets)
1839 <rdar://problem/3676376>: (Second level bullets not printed when printing Xcode release notes)
1842 * kwq/KWQPainter.mm:
1843 (CGColorFromNSColor):
1844 (QPainter::drawEllipse):
1845 (QPainter::setShadow):
1847 2004-07-12 Ken Kocienda <kocienda@apple.com>
1851 Added new editing-related layout tests
1853 * layout-tests/editing/deleting/delete-after-span-ws-001-expected.txt: Added.
1854 * layout-tests/editing/deleting/delete-after-span-ws-001.html: Added.
1855 * layout-tests/editing/deleting/delete-after-span-ws-002-expected.txt: Added.
1856 * layout-tests/editing/deleting/delete-after-span-ws-002.html: Added.
1857 * layout-tests/editing/deleting/delete-after-span-ws-003-expected.txt: Added.
1858 * layout-tests/editing/deleting/delete-after-span-ws-003.html: Added.
1859 * layout-tests/editing/selection/unrendered-001-expected.txt: Added.
1860 * layout-tests/editing/selection/unrendered-001.html: Added.
1861 * layout-tests/editing/selection/unrendered-002-expected.txt: Added.
1862 * layout-tests/editing/selection/unrendered-002.html: Added.
1863 * layout-tests/editing/selection/unrendered-003-expected.txt: Added.
1864 * layout-tests/editing/selection/unrendered-003.html: Added.
1865 * layout-tests/editing/selection/unrendered-004-expected.txt: Added.
1866 * layout-tests/editing/selection/unrendered-004.html: Added.
1867 * layout-tests/editing/selection/unrendered-005-expected.txt: Added.
1868 * layout-tests/editing/selection/unrendered-005.html: Added.
1869 * layout-tests/traversal/node-iterator-008-expected.txt: Added.
1870 * layout-tests/traversal/node-iterator-008.html: Added.
1871 * layout-tests/traversal/tree-walker-005-expected.txt: Added.
1872 * layout-tests/traversal/tree-walker-005.html: Added.
1874 2004-07-12 Ken Kocienda <kocienda@apple.com>
1878 Fixes for these bugs:
1880 <rdar://problem/3723359> Extending then "unextending" selection with arrow keys should draw caret but doesn't
1881 <rdar://problem/3724626> White-space deletion code deletes wrong character when space follows span
1883 * khtml/editing/htmlediting_impl.cpp:
1884 (khtml::DeleteSelectionCommandImpl::doApply): Modify special-case white-space deletion code so it runs
1885 only in the special case. It was throwing its net too widely, catching the case described in 3724626.
1886 By tightening up the special-case white-space deletion, and allowing the more general-purpose code to run,
1888 * khtml/xml/dom_docimpl.cpp:
1889 (DocumentImpl::updateSelection): Use recently-added closestRenderedPosition helper in Position class
1890 to figure out the start and end positions for selection drawing.
1891 * khtml/xml/dom_position.cpp:
1892 (DOM::Position::equivalentUpstreamPosition): Added code to handle white-space that causes line breaks.
1893 (DOM::Position::equivalentDownstreamPosition): Ditto.
1894 (DOM::Position::closestRenderedPosition): Trap empty selections at function entry, return *this.
1895 (DOM::Position::isFirstRenderedPositionOnLine): Can't be first rendered position on line if not rendered.
1897 (DOM::Position::isLastRenderedPositionOnLine): Ditto, but s/first/last/
1898 * khtml/xml/dom_selection.cpp:
1899 (DOM::Selection::validate): A selection is in caret state if the start and end are equal *or* equivalent.
1900 The equivalence case is new, and fixes 3723359.
1902 2004-07-09 Kevin Decker <kdecker@apple.com>
1906 fixes the width:auto problem in
1907 <rdar://problem/3698344> REGRESSION (143?-144): macrumors.com tabs are compressed and illegible
1909 * khtml/css/cssstyleselector.cpp:
1910 (khtml::CSSStyleSelector::applyProperty):
1912 2004-07-09 Ken Kocienda <kocienda@apple.com>
1916 Updated some layout test results.
1918 * layout-tests/editing/deleting/delete-image-004-expected.txt:
1919 * layout-tests/editing/selection/extend-by-character-006-expected.txt:
1921 2004-07-09 Chris Blumenberg <cblu@apple.com>
1923 Allowed my change for 3715785 to compile on Jaguar.
1925 Reviewed by kocienda.
1927 * kwq/WebCoreBridge.h:
1928 * kwq/WebCoreBridge.mm:
1929 (-[WebCoreBridge domain]): new, allows access to the domain without using the DOM API which doesn't exist on Jaguar
1931 2004-07-09 Ken Kocienda <kocienda@apple.com>
1935 Some improvements to fix:
1937 <rdar://problem/3723111> Caret not drawn when selection set to unrendered content
1939 * khtml/editing/htmlediting_impl.cpp:
1940 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Adjust selection to delete if
1941 selected position is not rendered.
1942 * khtml/rendering/render_block.cpp:
1943 (khtml::RenderBlock::paintObject): Use new caretPosition() function on Selection to
1944 figure out whether to paint.
1945 * khtml/xml/dom_position.cpp:
1946 (DOM::Position::previousCharacterPosition): Now correctly deals with a start
1947 position that is not rendered.
1948 (DOM::Position::nextCharacterPosition): Ditto.
1949 (DOM::Position::closestRenderedPosition): New helper.
1950 * khtml/xml/dom_position.h:
1951 (DOM::): Moved in EAffinity from Selection header. Now used in closestRenderedPosition function.
1952 * khtml/xml/dom_selection.cpp:
1953 (DOM::Selection::Selection): Added new m_caretPosition member. This is the position of the caret
1954 after a caret layout. This may be different from start or end if start and end are not rendered.
1955 (DOM::Selection::init):
1956 (DOM::Selection::modifyExtendingRightForward): New helper to clean up modify() and make it more readble.
1957 (DOM::Selection::modifyMovingRightForward): Ditto.
1958 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
1959 (DOM::Selection::modifyMovingLeftBackward): Ditto.
1960 (DOM::Selection::modify): Use new helpers to make this more readble.
1961 (DOM::Selection::layoutCaret): Uses new closestRenderedPosition helper to place the caret if in unrendered
1963 (DOM::Selection::paintCaret): Remove moveToRenderedContent. obsolete.
1964 * khtml/xml/dom_selection.h:
1965 (DOM::Selection::caretPosition): New accessor.
1966 * kwq/WebCoreBridge.mm:
1967 (-[WebCoreBridge setSelectedDOMRange:affinity:]): EAffinity no longer a member enum of Selection class.
1969 2004-07-08 David Hyatt <hyatt@apple.com>
1971 Fix for the table layout test that failed because of a change in how innerText worked. We need to do
1972 updateLayout now when using innerText, since the method has been changed to use line boxes in the render tree
1973 that might otherwise be out of date.
1975 Reviewed by kocienda
1977 * khtml/html/html_elementimpl.cpp:
1978 (HTMLElementImpl::innerText):
1980 2004-07-08 John Sullivan <sullivan@apple.com>
1984 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
1985 now also extends selection (even if there wasn't one before)
1987 * khtml/khtml_part.cpp:
1988 (KHTMLPart::handleMousePressEventSingleClick):
1989 if there's a URL associated with the event, don't extend the selection
1991 2004-07-08 Ken Kocienda <kocienda@apple.com>
1995 Added some helper functions which provide strings to display in the
1996 Xcode debugger's variable inspector window. These functions are called
1997 from the LabyrinthDataFormatter debugger plugin I just checked in to
1998 the Labyrinth/Tools directory.
2000 Note that these functions are compiled in on Development builds only.
2002 * WebCore-combined.exp:
2003 * WebCore-tests.exp: Export all the formatForDebugger symbols so the
2004 debugger program can link with them.
2005 * khtml/xml/dom2_rangeimpl.cpp:
2006 (DOM::RangeImpl::formatForDebugger):
2007 * khtml/xml/dom2_rangeimpl.h:
2008 * khtml/xml/dom_elementimpl.cpp:
2009 (ElementImpl::formatForDebugger):
2010 * khtml/xml/dom_elementimpl.h:
2011 * khtml/xml/dom_nodeimpl.cpp:
2012 * khtml/xml/dom_nodeimpl.h:
2013 * khtml/xml/dom_position.cpp:
2014 (DOM::Position::formatForDebugger):
2015 * khtml/xml/dom_position.h:
2016 * khtml/xml/dom_selection.cpp:
2017 (DOM::Selection::formatForDebugger):
2018 * khtml/xml/dom_selection.h:
2019 * khtml/xml/dom_textimpl.cpp:
2020 (TextImpl::formatForDebugger):
2021 * khtml/xml/dom_textimpl.h:
2023 2004-07-08 John Sullivan <sullivan@apple.com>
2027 - fixed <rdar://problem/3721544> crash increasing font size;
2028 entrezeroetun.com (works in IE and Firefox)
2030 * khtml/rendering/render_block.cpp:
2031 (khtml::RenderBlock::updateFirstLetter):
2032 Check for nil originalString() before dereffing
2034 2004-07-08 David Hyatt <hyatt@apple.com>
2036 Fix for 3721453, CSS3 initial property caused crashes because the macros were not written correctly.
2040 * khtml/css/cssstyleselector.cpp:
2044 2004-07-07 David Hyatt <hyatt@apple.com>
2046 Fix for 3712133, crash from first-line pseudo-style use.
2048 Reviewed by kocienda
2050 * khtml/css/cssstyleselector.cpp:
2051 (khtml::CSSStyleSelector::styleForElement):
2052 * khtml/css/cssstyleselector.h:
2053 * khtml/rendering/render_object.cpp:
2054 (RenderObject::getPseudoStyle):
2056 2004-07-07 Ken Kocienda <kocienda@apple.com>
2062 <rdar://problem/3716479> calling setInnerHTML during a webViewDidChange delegate call causes a crash
2064 The fix involves some rearrangement of code in TypingCommand and TypingCommandImpl.
2065 Formerly, new TypingCommands would apply themselves (which was a no-op) and then
2066 do their action in some code a way different than other commands. This type of command
2067 application is different than for all other commands since TypingCommands can be coalesced.
2068 The crash occurred as a result of the "no-op" TypingCommand having the unconsidered
2069 consequence of causing editing delegate notifications to be sent before the command
2070 has actually run. This change takes a small step towards making TypingCommandImpl function like
2071 other commands, where the command work is done in doApply. This makes the notification
2072 happen in the right order.
2074 * khtml/editing/htmlediting.cpp:
2075 (khtml::TypingCommand::TypingCommand):
2076 (khtml::TypingCommand::insertText):
2077 (khtml::TypingCommand::insertNewline):
2078 (khtml::TypingCommand::deleteKeyPressed):
2079 * khtml/editing/htmlediting.h:
2080 (khtml::TypingCommand::):
2081 * khtml/editing/htmlediting_impl.cpp:
2082 (khtml::TypingCommandImpl::TypingCommandImpl):
2083 (khtml::TypingCommandImpl::doApply):
2084 * khtml/editing/htmlediting_impl.h:
2086 2004-07-06 Ken Kocienda <kocienda@apple.com>
2090 * khtml/html/html_tableimpl.cpp:
2091 (HTMLTableElementImpl::addChild): Added a better comment in the
2092 code I just checked in a few minutes ago.
2094 2004-07-06 Ken Kocienda <kocienda@apple.com>
2100 <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply
2101 due to non-0 exception code trying to insert a DIV markup string
2103 The solution was to revert to the code that was rolled out, and removing
2104 the child checks from NodeImpl::checkAddChild. However, this time, I added
2105 code very similar to this check into the code that runs while HTML is
2106 being parsed to build up tables. This code relies on child-add failure
2107 to ensure the proper construction of well-formed tables (as gross as that
2108 sounds), so the check needs to be retained there. No other code seems to
2109 be so affected. Layout tests are unchanged by this patch.
2111 * khtml/html/html_tableimpl.cpp:
2112 (HTMLTableElementImpl::addChild):
2113 * khtml/xml/dom_nodeimpl.cpp:
2114 (NodeImpl::checkAddChild):
2116 2004-07-06 Ken Kocienda <kocienda@apple.com>
2120 Simple change. I switched the arguments of the appendNode helper function
2121 and the AppendNodeCommand and AppendNodeCommandImpl classes. The node to
2122 insert now comes before the parent node in the argument list. I did this
2123 to make this function match the convention of others in the HTML editing code.
2124 This was the only one that was "different" in the way that it ordered arguments.
2125 As a result, I was always looking to see that I was passing things in the right
2128 * khtml/editing/htmlediting.cpp:
2129 (khtml::AppendNodeCommand::AppendNodeCommand):
2130 (khtml::AppendNodeCommand::appendChild):
2131 (khtml::AppendNodeCommand::parentNode):
2132 * khtml/editing/htmlediting.h:
2133 * khtml/editing/htmlediting_impl.cpp:
2134 (khtml::CompositeEditCommandImpl::insertNodeAfter):
2135 (khtml::CompositeEditCommandImpl::insertNodeAt):
2136 (khtml::CompositeEditCommandImpl::appendNode):
2137 (khtml::AppendNodeCommandImpl::AppendNodeCommandImpl):
2138 (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl):
2139 (khtml::AppendNodeCommandImpl::doApply):
2140 (khtml::AppendNodeCommandImpl::doUnapply):
2141 (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
2142 (khtml::DeleteSelectionCommandImpl::doApply):
2143 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition):
2144 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition):
2145 (khtml::InputTextCommandImpl::prepareForTextInsertion):
2146 * khtml/editing/htmlediting_impl.h:
2147 (khtml::AppendNodeCommandImpl::parentNode):
2149 2004-07-06 Ken Kocienda <kocienda@apple.com>
2153 Fixed several problems with traversal classes. For one, NodeIterators treat
2154 FILTER_REJECT and FILTER_SKIP the same, since it treats the DOM tree as a
2155 flat collection of nodes free of hierarchy. The code before this change did
2156 not do this correctly. It sure pays to go back and read the specs. :)
2158 Also, the code to traverse from node to node when filters were applied was
2159 not working correctly. My first attemmpt to implement this was just plain
2160 buggy, as I discovered when I tried to write tests for my WWDC talk. I have
2161 settled on an implementation which is much simpler and worked for all the
2162 tests I threw at it.
2164 * khtml/xml/dom2_traversalimpl.cpp:
2165 (DOM::NodeIteratorImpl::findNextNode):
2166 (DOM::NodeIteratorImpl::nextNode):
2167 (DOM::NodeIteratorImpl::findPreviousNode):
2168 (DOM::NodeIteratorImpl::previousNode):
2169 (DOM::TreeWalkerImpl::parentNode):
2170 (DOM::TreeWalkerImpl::firstChild):
2171 (DOM::TreeWalkerImpl::lastChild):
2172 (DOM::TreeWalkerImpl::previousSibling):
2173 (DOM::TreeWalkerImpl::nextSibling):
2174 (DOM::TreeWalkerImpl::previousNode):
2175 (DOM::TreeWalkerImpl::nextNode):
2176 (DOM::TreeWalkerImpl::ancestorRejected):
2177 * khtml/xml/dom2_traversalimpl.h:
2179 2004-07-06 Vicki Murley <vicki@apple.com>
2181 Reviewed by kocienda.
2183 - added backColorCommand, foreColorCommand, fontNameCommand,
2186 * layout-tests/editing/editing.js:
2188 2004-07-06 Trey Matteson <trey@apple.com>
2190 3716053 - www.theage.com.au has extra back/forward items due to ads
2192 This turned out to be easily fixed by generalizing the fix to 3438441. We prevent
2193 addition to the b/f list not just during an onload event, but during any non-user
2194 gesture, which includes top level script executing.
2196 Reviewed by Richard.
2198 * kwq/KWQKHTMLPart.mm:
2199 (KWQKHTMLPart::openURL): Only real change - prevent adding to b/f list if not
2201 (KWQKHTMLPart::openURLRequest): Rename "onLoadEvent" to "userGesture", swap sense
2202 (KWQKHTMLPart::submitForm): Ditto
2203 (KWQKHTMLPart::urlSelected): Ditto
2204 * kwq/KWQKHTMLPartBrowserExtension.mm:
2205 (KHTMLPartBrowserExtension::createNewWindow): Ditto
2206 * kwq/WebCoreBridge.h:
2208 2004-07-02 Darin Adler <darin@apple.com>
2212 - fixed half of <rdar://problem/3709244> utf-8 meta tag not parsed when page title contains angle brackets or if </meta> tag used
2214 * khtml/misc/decoder.cpp: (Decoder::decode): Allow </meta> tags without deciding we
2215 are done with the header.
2217 2004-06-30 Trey Matteson <trey@apple.com>
2219 Dragging within a web view should be allowed to start when the window isn't key.
2221 A few months ago, Chris made this work, but it relied on the fact that all dragging
2222 was done in WebKit. When WebCore got involved in dragging, it was broken. Now we
2223 have a new scheme that gets it working again that properly involves WebCore.
2225 The general idea is that when AK asks us whether to accept the first mouse and do
2226 "delayed window ordering", we must consult WC to see if we might start a drag. In
2227 addition, instead of these drags in non-active windows being started as a special
2228 case in WK, they go through the normal WK-WC drag machinery.
2232 * khtml/khtml_part.cpp:
2233 (KHTMLPart::shouldDragAutoNode): New x,y args.
2234 * khtml/khtml_part.h:
2235 * khtml/rendering/render_object.cpp:
2236 (RenderObject::draggableNode): Pass through new x,y args.
2237 * khtml/rendering/render_object.h:
2238 * kwq/KWQKHTMLPart.h:
2239 (KWQKHTMLPart::setActivationEventNumber): New setter.
2240 * kwq/KWQKHTMLPart.mm:
2241 (KWQKHTMLPart::KWQKHTMLPart): Init new ivar.
2242 (KWQKHTMLPart::eventMayStartDrag): New routine that checks if we might start
2243 a drag in response to a mouseDown.
2244 (KWQKHTMLPart::khtmlMouseMoveEvent): Pass x,y to the routine that finds a draggable
2245 node. This eventually gets back up to WK's _mayStartDragAtEventLocation:.
2246 Delay requirement when dragging the selection now implemented here.
2247 (KWQKHTMLPart::khtmlMouseReleaseEvent): Must avoid changing the selection if we
2248 wind up here as part of the first click in a window (because we started handling
2249 the click to possible start a drag, but that never came through).
2250 (KWQKHTMLPart::mouseDown): Save away event timestamp.
2251 (KWQKHTMLPart::shouldDragAutoNode): Pass location up to WK instead of the
2252 most recent event we stashed.
2253 * kwq/WebCoreBridge.h:
2254 * kwq/WebCoreBridge.mm:
2255 (-[WebCoreBridge setActivationEventNumber:]): Trivial glue.
2256 (-[WebCoreBridge eventMayStartDrag:]): Ditto.
2258 2004-06-29 Trey Matteson <trey@apple.com>
2260 Need to tighten up JS error checking for requesting drag props
2265 * khtml/ecma/kjs_events.cpp:
2266 (Clipboard::getValueProperty): Assert if someone somehow set
2267 dropEffect or effectAllowed and it's a copy/paste clipboard
2268 instead of a dragging clipboard.
2269 (Clipboard::putValue): Don't let anyone set dropEffect or
2270 effectAllowed on a copy/paste clipboard.
2271 (ClipboardProtoFunc::tryCall): Disallow setting dragImage on
2272 a copy/paste clipboard.
2274 2004-06-29 Trey Matteson <trey@apple.com>
2276 DHTML dragging - source should have access to the operation chosen
2281 * kwq/KWQKHTMLPart.h:
2282 * kwq/KWQKHTMLPart.mm:
2283 (KWQKHTMLPart::dragSourceEndedAt): Set the destination's operation
2285 * kwq/WebCoreBridge.mm:
2286 (-[WebCoreBridge dragExitedWithDraggingInfo:]): For completeness
2287 we set the source op for the ondragexit event.
2288 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto for the
2290 (-[WebCoreBridge dragSourceEndedAt:operation:]): Pass through of operation.
2292 2004-06-24 Trey Matteson <trey@apple.com>
2294 3710422 - REGRESSION: Safari crashes trying to send onbeforecut event at about://blank
2296 Simple fix - don't try to send the event to the body element if we have no body element.
2300 * kwq/KWQKHTMLPart.mm:
2301 (KWQKHTMLPart::dispatchCPPEvent):
2303 2004-06-24 Trey Matteson <trey@apple.com>
2305 3704950 drag image in DB ConfigBar has horizontal graphics turd WebCore JavaScript
2307 When we generate a drag image (or a selection image too, for that matter) we
2308 translate the CTM using a CG call. Later, WebImageRenderer adjusts the pattern
2309 phase based on the CTM of the focused view, which doesn't include our translate.
2310 So we must inform WebKit about the additional phase adjustment.
2314 * kwq/KWQKHTMLPart.mm: Tell WebKit about the phase adjustment.
2315 (KWQKHTMLPart::imageFromRect):
2316 * kwq/WebCoreGraphicsBridge.h:
2317 * kwq/WebCoreGraphicsBridge.m:
2318 (-[WebCoreGraphicsBridge setAdditionalPatternPhase:]): New routine to receive
2319 the phase adjustment.
2321 2004-06-24 Trey Matteson <trey@apple.com>
2323 3679986 - screenX and screenY are flipped and relative to the bottom left of the WebView, rather than the screen
2324 3699510 - synthesized click events have bogus screen coords
2328 * khtml/khtmlview.cpp:
2329 (KHTMLView::dispatchDragEvent): Generate screen coords for drag events using new func.
2330 (KHTMLView::dispatchMouseEvent): Ditto.
2331 * khtml/khtmlview.h:
2332 * khtml/xml/dom_nodeimpl.cpp:
2333 (NodeImpl::dispatchMouseEvent): Comment tricky semantics.
2334 Calc screen coords in apple-specific way.
2335 * kwq/KWQKHTMLView.mm:
2336 (KHTMLView::viewportToGlobal): Passthrough to window widget.
2337 * kwq/KWQScrollView.mm:
2338 * kwq/KWQWindowWidget.h:
2339 * kwq/KWQWindowWidget.mm:
2340 (KWQWindowWidget::mapToGlobal): Call former code factored to new method below.
2341 (KWQWindowWidget::viewportToGlobal): New method to convert "viewport" (which for us
2342 really means NSWindow coords) to screen coords.
2344 2004-06-24 Trey Matteson <trey@apple.com>
2346 3693420 - onbeforecut and onbeforepaste need real implementaion
2350 * kwq/KWQKHTMLPart.h:
2351 * kwq/KWQKHTMLPart.mm:
2352 (KWQKHTMLPart::mayCut): Dispatch event to DHTML.
2353 (KWQKHTMLPart::mayCopy): Ditto
2354 (KWQKHTMLPart::mayPaste): Ditto
2355 (KWQKHTMLPart::tryCut): No more need to send fake onbefore event
2356 (KWQKHTMLPart::tryCopy): Ditto
2357 (KWQKHTMLPart::tryPaste): Ditto
2358 * kwq/WebCoreBridge.h:
2359 * kwq/WebCoreBridge.mm:
2360 (-[WebCoreBridge mayDHTMLCut]): Standard glue
2361 (-[WebCoreBridge mayDHTMLCopy]): Ditto
2362 (-[WebCoreBridge mayDHTMLPaste]): Ditto
2364 2004-06-24 Darin Adler <darin@apple.com>
2368 - fixed <rdar://problem/3709385> Find on page doesn't find a string at the very end of the file
2370 * khtml/misc/khtml_text_operations.cpp: (khtml::findPlainText): Rearrange loop to avoid an early
2371 exit once we have all the characters we need, but are at the end of the range we are searching.
2373 - fixed <rdar://problem/3102271>: (text areas have scroll bars even when they don't need them)
2374 - fixed <rdar://problem/3665430>: (horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode)
2376 * kwq/KWQTextArea.mm:
2377 (-[KWQTextArea _configureTextViewForWordWrapMode]): Added. Helper method that sets up the
2378 view for a new word wrap mode.
2379 (-[KWQTextArea _createTextView]): Moved much of the code inside _configureTextViewForWordWrapMode.
2380 (-[KWQTextArea _frameSizeChanged]): Added. Method shared by setFrame: and initWithFrame: to
2381 avoid duplicate code that was there before. The old code also had redundant code to update
2382 the text container size, but NSText handles that automatically.
2383 (-[KWQTextArea initWithFrame:]): Set wrap to YES by default, which is the key to fixing bug 3665430.
2384 Call setAutohidesScrollers:YES, which fixes bug 3102271. Also call the new _frameSizeChanged method.
2385 (-[KWQTextArea setWordWrap:]): Call _configureTextViewForWordWrapMode instead of trying
2386 to do the work here. The old version did both too little and too much.
2387 (-[KWQTextArea setFrame:]): Call _frameSizeChanged instead of trying to do the work here.
2388 The old version did both too little and too much.
2390 2004-06-24 John Sullivan <sullivan@apple.com>
2392 Darin made this change on my machine; I reviewed it.
2394 - fixed <rdar://problem/3698333> Find on page doesn't find a particular string
2395 with a newline in the source
2397 * khtml/misc/khtml_text_operations.cpp:
2398 (khtml::TextIterator::handleTextBox):
2399 Clear m_lastTextNodeEndedWithCollapsedSpace after taking it into account.
2401 2004-06-23 Richard Williamson <rjw@apple.com>
2403 Implemented changes for latest npruntime.h.
2407 * kwq/KWQKHTMLPart.h:
2408 * kwq/KWQKHTMLPart.mm:
2409 (KWQKHTMLPart::KWQKHTMLPart):
2410 (KWQKHTMLPart::windowScriptNPObject):
2411 (KWQKHTMLPart::getEmbedInstanceForView):
2412 * kwq/WebCoreBridge.h:
2413 * kwq/WebCoreBridge.mm:
2414 (-[WebCoreBridge windowScriptObject]):
2415 (-[WebCoreBridge windowScriptNPObject]):
2417 2004-06-22 Richard Williamson <rjw@apple.com>
2419 Fixed <rdar://problem/3707162>: accessing embeds[] plug-in interface may crash
2421 embedInstance was uninitialized.
2425 * khtml/html/html_objectimpl.cpp:
2426 (HTMLEmbedElementImpl::HTMLEmbedElementImpl):
2428 2004-06-18 John Sullivan <sullivan@apple.com>
2432 - fixed <rdar://problem/3534851> Pop up windows not showing up within SAP's
2433 BW Module (changing location.href on new window created by window.open)
2435 * khtml/khtml_part.cpp:
2436 (KHTMLPart::scheduleRedirection):
2437 allow new redirect to win if delay <= current delay, not just <
2439 === WebCore-146.1 ===
2441 2004-06-18 Trey Matteson <trey@apple.com>
2443 3702053 - DHTML dragging destination can't control the cursor (by setting the drop operation)
2445 Fallout from security work, but an easy fix.
2449 * kwq/KWQClipboard.mm:
2450 (KWQClipboard::setDropEffect): Allow dest side to set dropEffect.
2452 2004-06-18 Darin Adler <darin@apple.com>
2456 - re-fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)
2458 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
2459 Check !isInlineFlow rather than checking hasMarkupTruncation. Otherwise, we break
2460 plain old non-markup truncation.
2462 2004-06-18 Darin Adler <darin@apple.com>
2466 - fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)
2468 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
2469 Only walk the ellipsis list if hasMarkupTruncation is true.
2473 2004-06-17 Richard Williamson <rjw@apple.com>
2475 Fixed <rdar://problem/3698867> setting the canvas or parent to display:none and updating the causes a nil-deref
2477 Ensured that we have a renderer before rendering.
2481 * khtml/ecma/kjs_html.cpp:
2482 (KJS::Context2DFunction::tryCall):
2484 2004-06-17 David Hyatt <hyatt@apple.com>
2486 Fix for 3674601, "Read More..." links should trail articles in Emerson.
2490 * khtml/rendering/bidi.cpp:
2491 (khtml::RenderBlock::layoutInlineChildren):
2492 (khtml::RenderBlock::deleteEllipsisLineBoxes):
2493 (khtml::RenderBlock::checkLinesForTextOverflow):
2494 * khtml/rendering/render_block.cpp:
2495 (khtml:::RenderFlow):
2496 (khtml::RenderBlock::paintEllipsisBoxes):
2497 (khtml::RenderBlock::nodeAtPoint):
2498 (khtml::shouldCheckLines):
2499 (khtml::getLineAtIndex):
2500 (khtml::getHeightForLineCount):
2501 (khtml::RenderBlock::lineAtIndex):
2502 (khtml::RenderBlock::lineCount):
2503 (khtml::RenderBlock::heightForLineCount):
2504 (khtml::RenderBlock::clearTruncation):
2505 * khtml/rendering/render_block.h:
2506 (khtml::RenderBlock::setHasMarkupTruncation):
2507 (khtml::RenderBlock::hasMarkupTruncation):
2508 * khtml/rendering/render_flexbox.cpp:
2509 (khtml::RenderFlexibleBox::layoutVerticalBox):
2510 * khtml/rendering/render_line.cpp:
2511 (khtml::EllipsisBox::m_str):
2512 (khtml::InlineBox::adjustPosition):
2513 (khtml::InlineFlowBox::adjustPosition):
2514 (khtml::InlineFlowBox::clearTruncation):
2515 (khtml::EllipsisBox::paint):
2516 (khtml::EllipsisBox::nodeAtPoint):
2517 (khtml::RootInlineBox::clearTruncation):
2518 (khtml::RootInlineBox::placeEllipsis):
2519 (khtml::RootInlineBox::paintEllipsisBox):
2520 (khtml::RootInlineBox::hitTestEllipsisBox):
2521 (khtml::RootInlineBox::adjustPosition):
2522 (khtml::RootInlineBox::childRemoved):
2523 * khtml/rendering/render_line.h:
2524 (khtml::InlineBox::clearTruncation):
2525 * khtml/rendering/render_text.cpp:
2526 * khtml/rendering/render_text.h:
2527 (khtml::InlineTextBox::clearTruncation):
2529 2004-06-17 Trey Matteson <trey@apple.com>
2531 3698514 - coordinates in ondragstart and ondrag events are wrong
2533 This part fixes the ondragstart coords. We salt away the window-based mouseDown
2534 location, since we need that when we dispatch the ondragstart event. Previously
2535 we were errantly using a mouseDown point that had already been converted to view
2536 coords, and then the dispatch converted it again.
2540 * kwq/KWQKHTMLPart.h:
2541 * kwq/KWQKHTMLPart.mm:
2542 (KWQKHTMLPart::khtmlMouseMoveEvent): Use window based mouse event coords to dispatch event.
2543 (KWQKHTMLPart::mouseDown): Save window based mouse event coords .
2545 2004-06-16 David Hyatt <hyatt@apple.com>
2547 Fix for 3596620, implement a subset of CSS3 text truncation for Emerson.
2551 * khtml/rendering/bidi.cpp:
2552 (khtml::RenderBlock::checkLinesForTextOverflow):
2553 * khtml/rendering/font.cpp:
2554 (Font::checkSelectionPoint):
2555 * khtml/rendering/font.h:
2556 * khtml/rendering/render_block.cpp:
2557 (khtml::RenderBlock::paintObject):
2558 (khtml::RenderBlock::paintFloats):
2559 (khtml::RenderBlock::paintEllipsisBoxes):
2560 * khtml/rendering/render_block.h:
2561 * khtml/rendering/render_line.cpp:
2562 (InlineBox::canAccommodateEllipsis):
2563 (InlineBox::placeEllipsisBox):
2564 (InlineFlowBox::paintDecorations):
2565 (InlineFlowBox::placeEllipsisBox):
2566 (EllipsisBox::paint):
2567 (RootInlineBox::placeEllipsis):
2568 (RootInlineBox::placeEllipsisBox):
2569 * khtml/rendering/render_line.h:
2570 (khtml::EllipsisBox::m_str):
2571 (khtml::RootInlineBox::ellipsisBox):
2572 * khtml/rendering/render_text.cpp:
2573 (InlineTextBox::placeEllipsisBox):
2574 (InlineTextBox::paintDecoration):
2575 (InlineTextBox::offsetForPosition):
2576 (RenderText::positionForCoordinates):
2577 (RenderText::paint):
2578 * khtml/rendering/render_text.h:
2579 * kwq/KWQFontMetrics.h:
2580 * kwq/KWQFontMetrics.mm:
2581 (QFontMetrics::checkSelectionPoint):
2582 * kwq/WebCoreTextRenderer.h:
2584 === WebCore-145.1 ===
2586 2004-06-16 Maciej Stachowiak <mjs@apple.com>
2590 <rdar://problem/3697602> REGRESSION (144.2-TOT) Selection highlight does not draw
2592 * khtml/rendering/render_canvas.cpp:
2593 (RenderCanvas::setSelection):
2597 2004-06-16 Richard Williamson <rjw@apple.com>
2599 Fixed 3695730: Added support for embeds[], much like
2600 applets[], to allow access to a plugin's exported interface.
2604 * khtml/dom/html_document.cpp:
2605 (HTMLDocument::embeds):
2606 * khtml/dom/html_document.h:
2607 * khtml/ecma/kjs_dom.cpp:
2608 (KJS::getRuntimeObject):
2609 * khtml/ecma/kjs_html.cpp:
2610 (KJS::HTMLDocument::tryGet):
2611 (KJS::HTMLElement::tryGet):
2612 (KJS::HTMLCollection::tryGet):
2613 (KJS::HTMLCollection::getNamedItems):
2614 * khtml/ecma/kjs_html.h:
2615 (KJS::HTMLDocument::):
2616 * khtml/ecma/kjs_html.lut.h:
2618 * khtml/html/html_miscimpl.cpp:
2619 (HTMLCollectionImpl::calcLength):
2620 (HTMLCollectionImpl::getItem):
2621 (HTMLCollectionImpl::getNamedItem):
2622 * khtml/html/html_miscimpl.h:
2623 (DOM::HTMLCollectionImpl::):
2624 * khtml/html/html_objectimpl.cpp:
2625 (HTMLEmbedElementImpl::getEmbedInstance):
2626 * khtml/html/html_objectimpl.h:
2627 * kwq/KWQKHTMLPart.h:
2628 * kwq/KWQKHTMLPart.mm:
2629 (KWQKHTMLPart::getEmbedInstanceForView):
2631 2004-06-15 Maciej Stachowiak <mjs@apple.com>
2635 <rdar://problem/3695907>: (can't enable selection inside parent where it is disabled via CSS)
2637 * khtml/css/cssparser.cpp:
2638 (CSSParser::parseValue):
2639 * khtml/css/cssstyleselector.cpp:
2640 (khtml::CSSStyleSelector::applyProperty):
2641 * khtml/rendering/render_object.cpp:
2642 (RenderObject::shouldSelect):
2643 * khtml/rendering/render_style.h:
2645 (khtml::RenderStyle::userSelect):
2646 (khtml::RenderStyle::setUserSelect):
2647 (khtml::RenderStyle::initialUserSelect):
2649 2004-06-15 David Hyatt <hyatt@apple.com>
2651 Initial impl of the EllipsisBox. This code just gets the box created and gets it placed vertically. The next
2652 stage will be to position the box horizontally as well.
2656 * khtml/rendering/bidi.cpp:
2657 (khtml::RenderBlock::checkLinesForTextOverflow):
2658 * khtml/rendering/render_line.cpp:
2659 (RootInlineBox::placeEllipsis):
2660 * khtml/rendering/render_line.h:
2661 (khtml::EllipsisBox::m_str):
2663 2004-06-15 David Hyatt <hyatt@apple.com>
2665 Implement canAccommodateEllipsis. The basic idea is that everything on a line will allow an ellipsis to be
2666 drawn on top of it unless it's a replaced element. Then, if the replaced element overlaps, the ellipsis won't
2671 * khtml/rendering/bidi.cpp:
2672 (khtml::RenderBlock::checkLinesForTextOverflow):
2673 * khtml/rendering/render_line.cpp:
2674 (InlineBox::closestLeafChildForXPos):
2675 (InlineBox::canAccommodateEllipsis):
2676 (InlineFlowBox::canAccommodateEllipsis):
2677 (RootInlineBox::canAccommodateEllipsis):
2678 * khtml/rendering/render_line.h:
2680 2004-06-15 Vicki Murley <vicki@apple.com>
2682 - added a few layout tests, rdar://3694510
2684 * layout-tests/editing/deleting/delete-image-004-expected.txt: Added.
2685 * layout-tests/editing/deleting/delete-image-004.html: Added.
2686 * layout-tests/editing/selection/extend-by-character-006-expected.txt: Added.
2687 * layout-tests/editing/selection/extend-by-character-006.html: Added.
2689 2004-06-15 Trey Matteson <trey@apple.com>
2691 Dragging tweak: We pass the mouse down coords instead of the
2692 latest mouse drag coords to the ondragstart event. This makes it
2693 easy for the client to figure the correct drag image offset,
2694 whereas the mouse drag location is next to useless for that.
2698 * kwq/KWQKHTMLPart.mm:
2699 (KWQKHTMLPart::khtmlMouseMoveEvent):
2701 2004-06-15 Maciej Stachowiak <mjs@apple.com>
2705 <rdar://problem/3685236>: (Safari does not support onselectstart event handler)
2707 * khtml/ecma/kjs_dom.cpp:
2708 (DOMNode::getValueProperty):
2709 (DOMNode::putValue):
2710 * khtml/ecma/kjs_dom.h:
2712 * khtml/ecma/kjs_dom.lut.h:
2714 * khtml/html/html_elementimpl.cpp:
2715 (HTMLElementImpl::parseHTMLAttribute):
2716 * khtml/misc/htmlattrs.c:
2719 * khtml/misc/htmlattrs.h:
2720 * khtml/misc/htmlattrs.in:
2721 * khtml/rendering/render_object.cpp:
2722 (RenderObject::shouldSelect):
2723 * khtml/xml/dom2_eventsimpl.cpp:
2724 (EventImpl::typeToId):
2725 (EventImpl::idToType):
2726 * khtml/xml/dom2_eventsimpl.h:
2729 2004-06-15 Maciej Stachowiak <mjs@apple.com>
2733 Fix crash with last checkin.
2735 * khtml/ecma/kjs_binding.cpp:
2736 (ScriptInterpreter::domObjectsPerDocument): check the same
2737 property we want to initialize.
2739 2004-06-15 Maciej Stachowiak <mjs@apple.com>
2743 <rdar://problem/3685309>: (properties not shared for JS wrappers of same DOM object, accessed from different frames)
2745 * khtml/ecma/kjs_binding.cpp:
2746 (ScriptInterpreter::domObjects):
2747 (ScriptInterpreter::domObjectsPerDocument):
2748 (ScriptInterpreter::ScriptInterpreter):
2749 (ScriptInterpreter::forgetDOMObject):
2750 (ScriptInterpreter::getDOMObjectForDocument):
2751 (ScriptInterpreter::putDOMObjectForDocument):
2752 (ScriptInterpreter::deleteDOMObjectsForDocument):
2753 (ScriptInterpreter::mark):
2754 (ScriptInterpreter::forgetDOMObjectsForDocument):
2755 (ScriptInterpreter::updateDOMObjectDocument):
2756 * khtml/ecma/kjs_binding.h:
2757 (KJS::ScriptInterpreter::getDOMObject):
2758 (KJS::ScriptInterpreter::putDOMObject):
2759 (KJS::ScriptInterpreter::deleteDOMObject):
2761 2004-06-15 Darin Adler <darin@apple.com>
2763 - 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
2764 (it was making most layout tests fail)
2766 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::checkAddChild): Rolled check back in.
2768 2004-06-15 David Hyatt <hyatt@apple.com>
2770 Add a truncation variable to text run boxes that will eventually be used to know how to cut out some of the glyphs when
2775 * khtml/rendering/render_text.cpp:
2776 (RenderText::clearTextOverflowTruncation):
2777 * khtml/rendering/render_text.h:
2778 (khtml::InlineTextBox:::InlineRunBox):
2779 (khtml::InlineTextBox::clearTruncation):
2781 2004-06-14 Darin Adler <darin@apple.com>
2785 - fixed some things for GC that Patrick missed, or that happened after the branch
2788 (-[DOMStyleSheet finalize]): Added.
2789 (-[DOMStyleSheetList finalize]): Added.
2790 (-[DOMCSSStyleSheet finalize]): Added.
2791 (-[DOMMediaList finalize]): Added.
2792 (-[DOMCSSRuleList finalize]): Added.
2793 (-[DOMCSSRule finalize]): Added.
2794 (-[DOMCSSStyleDeclaration finalize]): Added.
2795 (-[DOMCSSValue finalize]): Added.
2796 (-[DOMRGBColor finalize]): Added.
2797 (-[DOMRect finalize]): Added.
2798 (-[DOMCounter finalize]): Added.
2800 (-[DOMObject finalize]): Added.
2801 (-[DOMNode finalize]): Added.
2802 (-[DOMNamedNodeMap finalize]): Added.
2803 (-[DOMNodeList finalize]): Added.
2804 (-[DOMImplementation finalize]): Added.
2805 (-[DOMRange finalize]): Added.
2806 (-[DOMNodeFilter finalize]): Added.
2807 (-[DOMNodeIterator finalize]): Added.
2808 (-[DOMTreeWalker dealloc]): Removed unneeded nil check.
2809 (-[DOMTreeWalker finalize]): Added.
2811 (-[DOMHTMLCollection finalize]): Added.
2812 (-[DOMHTMLOptionsCollection finalize]): Added.
2813 * kwq/KWQClipboard.mm:
2814 (KWQClipboard::KWQClipboard): Use KWQRetain instead of retain.
2815 (KWQClipboard::~KWQClipboard): Use KWQRelease instead of release.
2816 * kwq/KWQEditCommand.mm:
2817 (-[KWQEditCommand finalize]): Added.
2819 (QFont::~QFont): Use KWQRelease instead of release.
2820 * kwq/KWQKHTMLPart.mm:
2821 (KWQKHTMLPart::keyEvent): Use KWQRetain instead of retain, and KWQRelease instead of release.
2822 (KWQKHTMLPart::mouseDown): Use KWQRetain instead of retain, and KWQRelease instead of release.
2823 (KWQKHTMLPart::mouseDragged): Use KWQRetain instead of retain, and KWQRelease instead of release.
2824 (KWQKHTMLPart::mouseUp): Use KWQRetain instead of retain, and KWQRelease instead of release.
2825 (KWQKHTMLPart::mouseMoved): Use KWQRetain instead of retain, and KWQRelease instead of release.
2826 (KWQKHTMLPart::sendContextMenuEvent): Use KWQRetain instead of retain, and KWQRelease instead of release.
2827 * kwq/KWQPageState.mm:
2828 (-[KWQPageState finalize]): Added. Filed <rdar://problem/3694163> about the fact that this is not right.
2830 (-[KWQSingleShotTimerTarget finalize]): Added.
2831 * kwq/WebCoreBridge.mm:
2832 (-[WebCoreBridge finalize]): Added. Filed <rdar://problem/3694165> about the fact that this is not right.
2834 2004-06-15 David Hyatt <hyatt@apple.com>
2836 Initial work on text truncation. Working top-down, I think I've made all the changes I will need to bidi.cpp
2837 and to the block code itself. The rest of the code can be concentrated in the render_line and render_text files.
2841 * khtml/rendering/bidi.cpp:
2842 (khtml::RenderBlock::layoutInlineChildren):
2843 (khtml::RenderBlock::findNextLineBreak):
2844 (khtml::RenderBlock::deleteEllipsisLineBoxes):
2845 (khtml::RenderBlock::checkLinesForTextOverflow):
2846 * khtml/rendering/render_block.h:
2847 * khtml/rendering/render_line.cpp:
2848 (RootInlineBox::detach):
2849 (RootInlineBox::detachEllipsisBox):
2850 (RootInlineBox::canAccommodateEllipsis):
2851 (RootInlineBox::placeEllipsis):
2852 * khtml/rendering/render_line.h:
2853 (khtml::RootInlineBox::RootInlineBox):
2854 * khtml/rendering/render_text.cpp:
2855 (RenderText::clearTextOverflowTruncation):
2856 * khtml/rendering/render_text.h:
2858 2004-06-14 Trey Matteson <trey@apple.com>
2860 3692690 - REGRESSION: canceling drag from WebView cause link to load
2861 Just need to take extra care to cancel any click handling in
2862 all cases once we're committed to doing the drag.
2866 * kwq/KWQKHTMLPart.mm:
2867 (KWQKHTMLPart::khtmlMouseMoveEvent): Call invalidateClick once
2868 we're past the hysteresis point, and definitely going to try
2869 to start a drag and drop.
2871 2004-06-14 Darin Adler <darin@apple.com>
2873 - fixed crash on boot
2875 * kwq/KWQFoundationExtras.h: (KWQRetainNSRelease):
2876 Fixed return value of this method; was uninitialized.
2878 2004-06-14 Trey Matteson <trey@apple.com>
2880 Dashboard wants access to pastboard data during the drag gesture.
2882 We address this need be allowing docs that are local files to access the
2883 pasteboard data during a drag, while other pages can only get at the types
2884 list until the drop happens. This is deemed safe because local files already
2885 have such broad super powers.
2891 (KURL::isLocalFile): Implement this QT method to look for the file scheme.
2892 * kwq/WebCoreBridge.mm:
2893 (-[WebCoreBridge dragOperationForDraggingInfo:]): Use more relaxed clipboard
2894 security for local file pages.
2895 (-[WebCoreBridge dragExitedWithDraggingInfo:]): Ditto.
2897 2004-06-14 Darin Adler <darin@apple.com>
2899 Reviewed by me, code changes by Patrick Beard.
2901 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
2903 * WebCore.pbproj/project.pbxproj: Added KWQFoundationExtras.h.
2904 * kwq/KWQFoundationExtras.h: Added.
2905 (KWQRetain): Cover for CFRetain that is tolerant of nil.
2906 (KWQRelease): Cover for CFRelease that is tolerant of nil.
2907 (KWQRetainNSRelease): Combination of a CFRetain and an -[NSObject release] that is tolerant of nil.
2908 Also includes a declaration of finalize so we can call [super finalize] without warnings on Panther.
2911 (ObjCNodeFilterCondition::ObjCNodeFilterCondition): Use CFRetain instead of retain.
2912 (ObjCNodeFilterCondition::~ObjCNodeFilterCondition): Use CFRelease instead of release.
2913 * kwq/KWQComboBox.mm:
2914 (QComboBox::~QComboBox): Use KWQRelease instead of release.
2915 (QComboBox::setFont): Use KWQRelease instead of release.
2916 (QComboBox::labelFont): Use KWQRetain instead of retain.
2918 (QCursor::QCursor): Use KWQRetain instead of retain.
2919 (QCursor::~QCursor): Use KWQRelease instead of release.
2920 (QCursor::operator=): More of the same.
2921 * kwq/KWQFileButton.mm:
2922 (KWQFileButton::KWQFileButton): Use KWQRetainNSRelease to retain a newly-allocated object.
2923 (KWQFileButton::~KWQFileButton): Use CFRelease instead of release.
2925 (QFont::QFont): Use KWQRetain instead of retain.
2926 (QFont::operator=): More of the same.
2927 (QFont::setFamily): Use KWQRelease instead of release.
2928 (QFont::setFirstFamily): Use KWQRelease instead of release.
2929 (QFont::setPixelSize): Use KWQRelease instead of release.
2930 (QFont::setWeight): Use KWQRelease instead of release.
2931 (QFont::setItalic): Use KWQRelease instead of release.
2932 (QFont::getNSFont): Use KWQRetain instead of retain.
2933 * kwq/KWQFontMetrics.mm:
2934 (QFontMetricsPrivate::~QFontMetricsPrivate): Use KWQRelease instead of release.
2935 (QFontMetricsPrivate::getRenderer): Use KWQRetain instead of retain.
2936 (QFontMetricsPrivate::setFont): Use KWQRelease instead of release.
2937 * kwq/KWQKHTMLPart.mm:
2938 (KWQKHTMLPart::~KWQKHTMLPart): Use KWQRelease instead of release.
2939 (KWQKHTMLPart::clearRecordedFormValues): Use KWQRelease instead of release.
2940 (KWQKHTMLPart::recordFormValue): Use KWQRetainNSRelease and use KWQRetain instead of retain.
2941 (KWQKHTMLPart::windowScriptObject): Use KWQRetainNSRelease.
2942 * kwq/KWQKJobClasses.mm:
2943 (KIO::TransferJobPrivate::TransferJobPrivate): Use KWQRetainNSRelease.
2944 (KIO::TransferJobPrivate::~TransferJobPrivate): Use KWQRelease instead of release.
2945 (KIO::TransferJob::setLoader): More of the same.
2947 (KWQRetainResponse): Use KWQRetain instead of retain.
2948 (KWQReleaseResponse): Use KWQRelease instead of release.
2949 * kwq/KWQPainter.mm:
2950 (QPainterPrivate::~QPainterPrivate): Use KWQRelease instead of release.
2951 (QPainter::_updateRenderer): More of the same.
2952 (QPainter::initFocusRing): Use KWQRetainNSRelease.
2953 (QPainter::clearFocusRing): Use KWQRelease instead of release.
2955 (QPixmap::QPixmap): Use KWQRetain instead of retain.
2956 (QPixmap::~QPixmap): Use KWQRelease instead of release.
2957 (QPixmap::receivedData): Use KWQRetain instead of retain.
2958 (QPixmap::resize): Use KWQRetainNSRelease and use KWQRelease instead of release.
2959 (QPixmap::operator=): More of the same.
2961 (QRegion::QRegion): Use KWQRetain instead of retain.
2962 (QRegion::~QRegion): Use KWQRelease instead of release.
2963 (QRegion::operator=): More of the same.
2965 (QTimer::start): Use KWQRetain instead of retain.
2966 (QTimer::stop): Use KWQRelease instead of release.
2967 (QTimer::fire): Use KWQRelease instead of release.
2969 (QWidget::QWidget): Use KWQRetain instead of retain.
2970 (QWidget::~QWidget): Use KWQRelease instead of release.
2971 (QWidget::setView): More of the same.
2972 * kwq/WebCoreSettings.mm: (-[WebCoreSettings finalize]):
2973 Delete the storage here, as well as in dealloc.
2975 2004-06-14 Maciej Stachowiak <mjs@apple.com>
2979 <rdar://problem/3693818>: (Safari should use CG calls for circle drawing for better performance)
2981 * kwq/KWQPainter.mm:
2982 (QPainter::drawEllipse): Use CG calls instead of NS calls for faster circle drawing.
2983 (QPainter::drawArc): Ditto.
2985 2004-06-14 Ken Kocienda <kocienda@apple.com>
2991 <rdar://problem/3690115> Crash deleting text out of iChat's profile (an editable Webview)
2993 * khtml/html/html_elementimpl.cpp:
2994 (HTMLElementImpl::isFocusable): Added null-check of parent node before deref'ing it.
2996 2004-06-14 Trey Matteson <trey@apple.com>
2998 Two tweaks to recently added "drag" pseudo-class, as suggested by
2999 Dave. The class is renamed to "-khtml-drag", and we update layout
3000 when using it, instead of only updating styles.
3004 * khtml/css/css_base.cpp:
3005 (CSSSelector::extractPseudoType):
3006 * kwq/KWQKHTMLPart.mm:
3007 (KWQKHTMLPart::snapshotDragImage):
3009 2004-06-13 Trey Matteson <trey@apple.com>
3011 Support for DHTML cut/copy/paste. We now support oncut, oncopy, onpaste. The events
3012 are sent to the first node in the selection, or else the body. Current holes are
3013 that we do not send events for operations in text fields or text areas (because it
3014 is hard to get the right hooks into the AppKit).
3016 We also send onbeforecut, onbeforecopy, onbeforepaste before the other events, which
3017 isn't really WinIE compatible, but is close. WinIE uses these to enable cut/paste
3018 menu items in its UI. DB doesn't need this for now.
3022 * khtml/ecma/kjs_dom.cpp:
3023 (DOMNode::getValueProperty): Boilerplate for new events
3024 (DOMNode::putValue): Boilerplate for new events
3025 * khtml/ecma/kjs_dom.h:
3026 (KJS::DOMNode::): Boilerplate for new events
3027 * khtml/ecma/kjs_dom.lut.h:
3028 * khtml/ecma/kjs_events.cpp:
3029 (DOMEvent::DOMEvent): "dataTransfer" and "clipboardData" properties are conditionally
3030 defined on DOMEvent, depending on if the event is a dragging or clipboard event.
3031 (DOMMouseEvent::mark): Pass mark along to any clipboard object we have.
3032 (DOMEvent::getValueProperty): Return "dataTransfer" or "clipboardData".
3033 (DOMMouseEvent::getValueProperty): Returning "dataTransfer" now handled by
3035 * khtml/ecma/kjs_events.h:
3037 (KJS::DOMMouseEvent::DOMMouseEvent):
3038 (KJS::DOMMouseEvent::):
3039 (KJS::DOMMouseEvent::toMouseEvent):
3040 * khtml/ecma/kjs_events.lut.h:
3041 * khtml/html/html_elementimpl.cpp:
3042 (HTMLElementImpl::parseHTMLAttribute): Boilerplate for new events
3043 * khtml/misc/htmlattrs.c:
3044 * khtml/misc/htmlattrs.h:
3045 * khtml/misc/htmlattrs.in: Boilerplate for new events
3046 * khtml/xml/dom2_eventsimpl.cpp:
3047 (EventImpl::typeToId): Boilerplate for new events
3048 (EventImpl::idToType): Boilerplate for new events
3049 (EventImpl::isDragEvent): New utility
3050 (EventImpl::isClipboardEvent): New utility
3051 (MouseEventImpl::isDragEvent): New utility
3052 (ClipboardEventImpl::ClipboardEventImpl): ref optional clipboard
3053 (ClipboardEventImpl::~ClipboardEventImpl): deref optional clipboard
3054 (ClipboardEventImpl::isClipboardEvent): New utility
3055 * khtml/xml/dom2_eventsimpl.h:
3056 (DOM::EventImpl::): Boilerplate for new events
3057 (DOM::ClipboardEventImpl::clipboard):
3058 * kwq/KWQClipboard.h: Monkey business so this file is includable in C++.
3059 * kwq/KWQClipboard.mm:
3060 * kwq/KWQKHTMLPart.h:
3061 * kwq/KWQKHTMLPart.mm:
3062 (KWQKHTMLPart::dispatchCPPEvent): Send one of the new events.
3063 (KWQKHTMLPart::tryCut): Declare pasteboard types, send cut events.
3064 (KWQKHTMLPart::tryCopy): Declare pasteboard types, send copy events.
3065 (KWQKHTMLPart::tryPaste): Send paste events.
3066 * kwq/WebCoreBridge.h:
3067 * kwq/WebCoreBridge.mm:
3068 (-[WebCoreBridge tryDHTMLCut]): Pass through to part
3069 (-[WebCoreBridge tryDHTMLCopy]): Ditto
3070 (-[WebCoreBridge tryDHTMLPaste]): Ditto
3072 2004-06-14 Trey Matteson <trey@apple.com>
3074 A new CSS pseudo-class ".drag" is added. Analogous to the "hover" class,
3075 this class determines styles used while an element is generating a drag
3080 * khtml/css/css_base.cpp:
3081 (CSSSelector::extractPseudoType): Boilerplate for adding new class.
3082 * khtml/css/css_base.h: Boilerplate for adding new class.
3083 * khtml/css/cssstyleselector.cpp:
3084 (khtml::CSSStyleSelector::checkOneSelector): Match new class against
3085 elements being dragged.
3086 * khtml/css/cssstyleselector.h:
3087 (khtml::StyleSelector::): Boilerplate for adding new class.
3088 * khtml/rendering/render_object.cpp:
3089 (RenderObject::RenderObject): Init new member.
3090 (RenderObject::isDragging): Return whether this object is being dragged.
3091 (RenderObject::updateDragState): Paint us an all children with a new dragged state.
3092 * khtml/rendering/render_object.h:
3093 * khtml/rendering/render_style.h: Boilerplate for adding new class.
3094 (khtml::RenderStyle::NonInheritedFlags::operator==):
3095 (khtml::RenderStyle::setBitDefaults):
3096 (khtml::RenderStyle::affectedByDragRules):
3097 (khtml::RenderStyle::setAffectedByDragRules):
3098 * kwq/KWQClipboard.mm:
3099 (KWQClipboard::dragNSImage): Method rename.
3100 * kwq/KWQKHTMLPart.h:
3101 * kwq/KWQKHTMLPart.mm:
3102 (KWQKHTMLPart::snapshotDragImage): Mark the element as being dragged before
3103 we snapshot it, so new style class will apply.
3105 2004-06-14 Ken Kocienda <kocienda@apple.com>
3109 Added a few more editing-related layout tests.
3111 * layout-tests/editing/inserting/insert-3654864-fix-expected.txt: Added.
3112 * layout-tests/editing/inserting/insert-3654864-fix.html: Added.
3113 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt: Added.
3114 * layout-tests/editing/inserting/insert-3659587-fix.html: Added.
3115 * layout-tests/editing/inserting/insert-after-delete-001-expected.txt: Added.
3116 * layout-tests/editing/inserting/insert-after-delete-001.html: Added.
3117 * layout-tests/editing/inserting/insert-br-case1-expected.txt: Added.
3118 * layout-tests/editing/inserting/insert-br-case1.html: Added.
3119 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Added.
3120 * layout-tests/editing/inserting/insert-br-case2.html: Added.
3121 * layout-tests/editing/inserting/insert-br-case3-expected.txt: Added.
3122 * layout-tests/editing/inserting/insert-br-case3.html: Added.
3124 2004-06-14 Ken Kocienda <kocienda@apple.com>
3128 Regarding the bug below, removing some tests since we have removed the execCommand("paste")
3129 feature, at least for now.
3131 <rdar://problem/3684792>: (JavaScript execCommand("paste") presents security issues)
3133 * layout-tests/editing/pasteboard/copy-paste-text-001-expected.txt: Removed.
3134 * layout-tests/editing/pasteboard/copy-paste-text-001.html: Removed.
3135 * layout-tests/editing/pasteboard/cut-paste-text-002-expected.txt: Removed.
3136 * layout-tests/editing/pasteboard/cut-paste-text-002.html: Removed.
3138 2004-06-14 Ken Kocienda <kocienda@apple.com>
3144 <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply due to non-0 exception code trying to insert a DIV markup string
3146 * khtml/xml/dom_nodeimpl.cpp:
3147 (NodeImpl::checkAddChild): This function was being too strict in disallowing certain nodes
3148 to be added as other child nodes, applying rules we typically use for parsing. However,
3149 those parsing rules are primarily for dealing with "bad" HTML, and should not be
3150 applied to programmatic DOM operations. The fix involves removing calls to childAllowed().
3152 2004-06-12 Trey Matteson <trey@apple.com>
3154 The drag image may be updated during a DHTML drag. This includes updating
3155 from a Timer instead of a drag event handler. In addition, an arbitrary
3156 element can be set as the one to snapshot for the drag image.
3160 * khtml/ecma/kjs_events.cpp:
3161 (ClipboardProtoFunc::tryCall): setDragImage accepts a node. Previously,
3162 it had to be an Image object.
3163 * khtml/rendering/render_object.cpp:
3164 (RenderObject::paintingRootRect): Also returns top element's rect.
3165 * khtml/rendering/render_object.h:
3166 * khtml/xml/dom2_eventsimpl.h:
3167 * kwq/KWQClipboard.h: New security mode where image is still writable, but
3170 (KWQClipboard::setDragHasStarted):
3171 * kwq/KWQClipboard.mm:
3172 (KWQClipboard::KWQClipboard): Part may be passed. Needed in the source
3173 case to generate an image from an element.
3174 (KWQClipboard::setAccessPolicy): New, replaces former becomeNumb method
3175 which wasn't flexible enough.
3176 (KWQClipboard::accessPolicy): New getter.
3177 (KWQClipboard::dragImage): No change, diff confusion.
3178 (KWQClipboard::setDragImage): Call new helper, below.
3179 (KWQClipboard::dragImageElement): New, return any element set.
3180 (KWQClipboard::setDragImageElement): New, call new helper.
3181 (KWQClipboard::setDragImage): New helper, set the image via either a
3182 pixmap or an element to snapshot, pushes the result to WebKit if we've
3183 already started the drag.
3184 (KWQClipboard::dragNSImage): Generate an NSImage and mouse offset, no
3185 matter how the drag image was set (Image or element).
3186 * kwq/KWQKHTMLPart.h: A single clipboard is kept over the life of a
3187 source drag instead of making one for each event.
3188 * kwq/KWQKHTMLPart.mm:
3189 (KWQKHTMLPart::KWQKHTMLPart): Init clipboard.
3190 (KWQKHTMLPart::~KWQKHTMLPart): Free clipboard.
3191 (KWQKHTMLPart::freeClipboard): New helper.
3192 (KWQKHTMLPart::dispatchDragSrcEvent): Most code moved to caller.
3193 (KWQKHTMLPart::khtmlMouseMoveEvent): Make clipboard for this drag session.
3194 Init clipboard to make an image from the dragSource element. Mark the
3195 drag as having started.
3196 (KWQKHTMLPart::dragSourceMovedTo): Clipboard will update WK with any new
3197 drag image, so we don't need to.
3198 (KWQKHTMLPart::dragSourceEndedAt): Ditto.
3199 (KWQKHTMLPart::elementImage): Also return element rect.
3200 * kwq/WebCoreBridge.h: Glue moved to WebCoreGraphicsBridge.
3201 * kwq/WebCoreBridge.mm:
3202 (-[WebCoreBridge dragOperationForDraggingInfo:]): Use new method.
3203 (-[WebCoreBridge dragExitedWithDraggingInfo:]): Ditto
3204 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto
3205 * kwq/WebCoreGraphicsBridge.h:
3206 * kwq/WebCoreGraphicsBridge.m:
3207 (-[WebCoreGraphicsBridge setDraggingImage:at:]): Glue moved from WebBridge
3209 2004-06-11 Chris Blumenberg <cblu@apple.com>
3211 Support for WebKit drag & drop API.
3215 * kwq/WebCoreBridge.h:
3216 * kwq/WebCoreBridge.mm:
3217 (-[WebCoreBridge _positionForPoint:]): new
3218 (-[WebCoreBridge moveDragCaretToPoint:]): call _positionForPoint
3219 (-[WebCoreBridge editableDOMRangeForPoint:]): new
3221 2004-06-11 Darin Adler <darin@apple.com>
3225 - fixed <rdar://problem/3645846>: (REGRESSION: Stuck "Loading" when logging into Google's Gmail on newer versions of Safari)
3227 * khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::parseHTMLAttribute):
3228 Call through to base class for ATTR_ID so the "has ID" bit gets set.
3229 * khtml/html/html_imageimpl.cpp:
3230 (HTMLImageElementImpl::parseHTMLAttribute): Move ATTR_COMPOSITE code up and out of the way so
3231 it doesn't screw up ATTR_ID parsing.
3232 (HTMLMapElementImpl::parseHTMLAttribute): Call through to base class for ATTR_ID
3233 so the "has ID" bit gets set.
3234 * khtml/html/html_objectimpl.cpp:
3235 (HTMLAppletElementImpl::parseHTMLAttribute): Remove ATTR_ID case; not needed.
3236 (HTMLParamElementImpl::parseHTMLAttribute): Call through to base class for ATTR_ID
3237 so the "has ID" bit gets set.
3239 2004-06-11 Ken Kocienda <kocienda@apple.com>
3245 <rdar://problem/3659587>: "when typing in Blot, bold style does not carry over to next line after pressing 'return'"
3247 Did some work to improve the insert newline command. The refinement is to insert the newline
3248 at the upstream position of the caret, ensuring that the newline takes on the
3249 appropriate style, and does not let the caret "escape" from an element that is
3252 * khtml/editing/htmlediting_impl.cpp:
3253 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition): New helper. Adds smarts about adding
3254 newlines when the selection is a caret in a block.
3255 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition): Ditto.
3256 (khtml::InputNewlineCommandImpl::doApply): Simplified cases. One case in the code could not
3258 * khtml/editing/htmlediting_impl.h:
3262 <rdar://problem/3654864>: "Pasting content at start of line places it at end of previous line"
3264 (khtml::InputTextCommandImpl::prepareForTextInsertion): Simple code mistake. Content was indeed
3265 being added to the line before. Fixed to add new content after the line break.
3267 2004-07-10 Trey Matteson <trey@apple.com>
3269 Prep work for latest delegate API for dragging. In addition, I also straightened out all
3270 the cases of DHTML setting a drag image or setting pasteboard data, and how that would
3271 override WebKit's default behavior (which follows how WinIE does things).
3275 * khtml/rendering/render_object.cpp:
3276 (RenderObject::draggableNode): Obey new params for whether a DHTML or UserAgent (i.e.,
3277 WebKit) drag source is allowed.
3278 * khtml/rendering/render_object.h:
3279 * kwq/KWQKHTMLPart.h:
3280 * kwq/KWQKHTMLPart.mm:
3281 (KWQKHTMLPart::dispatchDragSrcEvent): Setting pasteboard data was moved out of here, now
3282 caller's responsibility.
3283 (KWQKHTMLPart::khtmlMouseMoveEvent): Ask bridge for allowable drag actions (DHTML vs UA).
3284 Only send drag events if DHTML is allowed. Only generate a drag image if the source is
3285 a DHTML element. Note whether event handler set any pasteboard data, and pass that fact
3287 (KWQKHTMLPart::dragSourceMovedTo): Only send drag events if DHTML is allowed.
3288 (KWQKHTMLPart::dragSourceEndedAt): Only send drag events if DHTML is allowed.
3289 * kwq/WebCoreBridge.h:
3291 2004-06-11 Ken Kocienda <kocienda@apple.com>
3295 Lay some groundwork for better testing of inserting newlines. Layout
3296 tests that use this new code will be coming soon.
3298 * khtml/editing/jsediting.cpp: Add commands for bold and inserting newlines.
3299 * layout-tests/editing/editing.js: Added new insertNewline command.
3300 which calls through to TypingCommand::insertNewline. There was no way to get
3301 to this command from JS before this addition.
3303 2004-06-11 Ken Kocienda <kocienda@apple.com>
3307 Javascript execCommand system wants to use case-insensitive QDict.
3308 The interface for QDict offers this feature, but it was never implemented.
3311 * kwq/KWQDictImpl.h: Declare bool to store case-sensitive bit.
3312 * kwq/KWQDictImpl.mm:
3313 (KWQDictImpl::KWQDictImpl): No longer drops caseSensitive on the floor; stores
3314 it in instance variable.
3315 (KWQDictImpl::insert): Make lowercase version of key for operation, if necessary.
3316 (KWQDictImpl::remove): Ditto.
3317 (KWQDictImpl::find): Ditto.
3318 (KWQDictIteratorImpl::currentStringKey): Whitespace cleanup.
3322 2004-06-10 Ken Kocienda <kocienda@apple.com>
3328 <rdar://problem/3654850>: "Style changes do not work across blocks"
3330 Now, applying styles works across blocks. I did quite a bit
3331 of internal redsign on the member functions of this class to
3332 make this work. As a bonus, from an architectural standpoint,
3333 all style changes are now done "in place". There is no more
3334 copying of content in order to perform style changes.
3336 * khtml/editing/htmlediting_impl.cpp:
3337 (khtml::ApplyStyleCommandImpl::doApply):
3338 (khtml::ApplyStyleCommandImpl::removeHTMLStyleNode):
3339 (khtml::ApplyStyleCommandImpl::removeCSSStyle):
3340 (khtml::ApplyStyleCommandImpl::removeStyle):
3341 (khtml::ApplyStyleCommandImpl::nodeFullySelected):
3342 (khtml::ApplyStyleCommandImpl::splitTextAtStartIfNeeded):
3343 (khtml::ApplyStyleCommandImpl::splitTextAtEndIfNeeded):
3344 (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
3345 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded):
3346 (khtml::ApplyStyleCommandImpl::positionInsertionPoint):
3347 * khtml/editing/htmlediting_impl.h: