1 2007-09-04 Antti Koivisto <antti@apple.com>
5 Fix <rdar://problem/5452112>
6 REGRESSION: Initially focused textfield on www.mac.com login page has no insertion point, and doesn't accept typed characters
8 Use updateLayoutIgnorePendingStylesheets() instead of updateLayout(). We need to have rendering to set input focus.
10 Test: fast/forms/focus-style-pending.html
13 (WebCore::Element::focus):
15 2007-09-04 Girish Ramakrishnan <girish@trolltech.com>
19 Fixed Qt build on Windows
21 * html/HTMLFormElement.cpp:
22 (WebCore::pathGetFilename):
24 2007-09-03 David Harrison <harrison@apple.com>
26 Reviewed by Kevin Decker.
28 <rdar://problem/5456785> REGRESSION (r15963-r15970): Heading text not placed in VoiceOver Item Chooser (15132)
30 * bridge/mac/WebCoreAXObject.mm:
31 (-[WebCoreAXObject title]):
32 For headings, return the text under the element instead of nil.
34 2007-08-20 Oleg Sukhodolsky <son.two@gmail.com>
38 WebKitQt/WebCoreSupport should not be added to INCLUDEPATH for gdk-port
42 2007-09-03 Mark Rowe <mrowe@apple.com>
44 Reviewed by Tim Hatcher.
46 <rdar://problem/5452164> Production build with in symbols directory has no debug info
48 Enable debug symbol generation on all build configurations. Production builds are stripped
49 of symbols by Xcode during deployment post-processing.
51 * Configurations/Base.xcconfig:
52 * WebCore.xcodeproj/project.pbxproj:
54 2007-09-02 Brady Eidson <beidson@apple.com>
56 Reviewed by John Sullivan and Mark Rowe
58 Groundwork for support for monitoring IconDatabase in-memory statistics
61 * loader/icon/IconDatabase.cpp:
62 (WebCore::IconDatabase::pageURLMappingCount): Stub for now
63 (WebCore::IconDatabase::retainedPageURLCount): Ditto
64 (WebCore::IconDatabase::iconRecordCount): Ditto
65 (WebCore::IconDatabase::iconRecordCountWithData): Ditto
66 * loader/icon/IconDatabase.h:
68 2007-09-02 Mark Rowe <mrowe@apple.com>
72 <rdar://problem/5454704> WebKit seems to get too-narrow widths for "Monotype Corsiva", so lays out incorrectly
74 * platform/mac/FontDataMac.mm:
75 (WebCore::FontData::determinePitch): Work around NSFont incorrectly reporting Monotype Corsiva as fixed pitch.
77 2007-09-01 Darin Adler <darin@apple.com>
79 - rolled out fix for bug 12988 because it broke getElementById in a layout test
80 I'm working on a new fix.
82 * dom/Document.cpp: Rolled out.
84 2007-09-01 Oliver Hunt <oliver@apple.com>
88 <rdar://problem/5344848> IME is incorrectly used for key events when on non-editable regions
90 Adding a new EditorClient method so it is possible to inform WebKit of focus changes.
91 Also added new virtual method Node::shouldUseInputMethod to allow us to trivially check
92 whether an input method should be used when processing input for the currently focused
95 * bridge/EditorClient.h:
97 (WebCore::Node::shouldUseInputMethod):
99 * html/HTMLInputElement.cpp:
100 (WebCore::HTMLInputElement::shouldUseInputMethod):
101 * html/HTMLInputElement.h:
102 * html/HTMLTextAreaElement.cpp:
103 (WebCore::HTMLTextAreaElement::shouldUseInputMethod):
104 * html/HTMLTextAreaElement.h:
105 * page/FocusController.cpp:
106 (WebCore::FocusController::setFocusedNode):
107 * platform/graphics/svg/SVGImageEmptyClients.h:
108 (WebCore::SVGEmptyEditorClient::setInputMethodState):
110 2007-09-01 Rob Buis <buis@kde.org>
114 http://bugs.webkit.org/show_bug.cgi?id=12988
115 First element (in document order) is not returned when other duplicate ID-ed elements were created first
117 Reset the element id cache when id's are added or removed and there
118 are duplicates for that id.
120 Tests: fast/dom/duplicate-ids-document-order.html
123 (WebCore::Document::getElementById):
124 (WebCore::Document::addElementById):
125 (WebCore::Document::removeElementById):
127 2007-09-01 Rob Buis <buis@kde.org>
131 http://bugs.webkit.org/show_bug.cgi?id=15083
132 Some symbols in WebKit do not need to be exported
134 Do not export these symbols.
136 * dom/QualifiedName.cpp:
137 (WebCore::hashComponents):
138 * dom/XMLTokenizer.cpp:
140 (WebCore::getTokenizer):
141 * history/HistoryItem.cpp:
142 (WebCore::defaultNotifyHistoryItemChanged):
143 * platform/Arena.cpp:
144 (WebCore::CeilingLog2):
145 * platform/graphics/Color.cpp:
147 * platform/graphics/Path.cpp:
148 (WebCore::pathLengthApplierFunction):
149 * platform/graphics/cg/PathCG.cpp:
150 (WebCore::CGPathToCFStringApplierFunction):
151 (WebCore::CFStringFromCGPath):
152 * rendering/RenderText.cpp:
153 (WebCore::isSpaceAccordingToStyle):
155 2007-08-31 Alice Liu <alice.liu@apple.com>
157 Reviewed by Tim Hatcher.
159 Fixed <rdar://problem/5420682> Mail crashes at WebCore::InsertLineBreakCommand::doApply() after dropping a selected image over container's close box
161 * editing/DeleteButtonController.cpp:
162 (WebCore::DeleteButtonController::show):
163 Factored out the code in ::show() that created and styled the elements of the Deletion UI
165 (WebCore::DeleteButtonController::createDeletionUI):
166 Neglecting to move the append of the deletionUI elements into the same clause that handles the creation
167 of them ended up creating multiple elements at were repeatedly appended to the target, resulting in a
168 bloated table deletion UI which was slow to show and hide.
170 * editing/DeleteButtonController.h:
171 (WebCore::DeleteButtonController::enabled):
172 Restore this function to how it used to be pre-r25305, sans asserts
174 * editing/EditCommand.cpp:
175 Add disable/enable sandwich when undoing/redoing commands too
176 (WebCore::EditCommand::unapply):
177 (WebCore::EditCommand::reapply):
179 2007-08-31 Antti Koivisto <antti@apple.com>
183 Fix <rdar://problem/5452943>
184 REGRESSION (r25283): Reproducible crash in HTMLObjectElement::getInstance under guard malloc
186 Calling updateLayoutIgnorePendingStylesheets() may do arbitrary things to render tree so
187 no RenderObjects can be cached over it.
189 * html/HTMLEmbedElement.cpp:
190 (WebCore::findWidgetRenderer):
191 (WebCore::HTMLEmbedElement::getInstance):
192 * html/HTMLObjectElement.cpp:
193 (WebCore::HTMLObjectElement::getInstance):
195 2007-08-31 Anders Carlsson <andersca@apple.com>
199 <rdar://problem/5443936>
200 Crash after QT movie completes playback at apple.com/imac
202 If the plug-in or one of its children have focus, set it to NULL to prevent the web view window from getting the focus,
203 which can cause a layout to happen while in HTMLObjectElement::detach. (This is what we do on the Mac).
205 * plugins/win/PluginViewWin.cpp:
206 (WebCore::PluginViewWin::setParent):
208 2007-08-30 Adele Peterson <adele@apple.com>
212 Fix for <rdar://problem/5450600> REGRESSION: can't paste in textfield if its in a body that has user-select:none set (affects widgets)
214 Test: editing/pasteboard/paste-plaintext-user-select-none.html
216 * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplacementFragment::insertFragmentForTestRendering):
217 Copy the user-select style from the current selection node and apply it so it is considered during the test rendering.
218 This is important since we recently changed user-select to be inherited. When we consider valid VisiblePositions for the test rendering,
219 we need to have the correct user-select value that will actually be used for the real insertion.
221 2007-08-31 Anders Carlsson <andersca@apple.com>
225 <rdar://problem/5423939>
226 http://bugs.webkit.org/show_bug.cgi?id=15013
227 ASSERTION FAILED !m_inDestructor in WebCore::Shared<WebCore::PluginStreamWin>::ref() on Windows
229 Protect the stream in case it's destroyed by the plug-in.
231 * plugins/win/PluginStreamWin.cpp:
232 (WebCore::PluginStreamWin::didReceiveData):
234 a2007-08-31 Darin Adler <darin@apple.com>
238 - http://bugs.webkit.org/show_bug.cgi?id=15122
240 * editing/htmlediting.cpp: (WebCore::avoidIntersectionWithNode):
241 Change assertion so that it only fires when actually modifying the selection.
242 This isn't nearly as helpful, because the old assertion could catch potential
243 problems in more cases, but it's not obvious how to do better.
245 2007-08-30 Oliver Hunt <oliver@apple.com>
249 <rdar://problem/5430772> REGRESSION(303-310A5) list items do not show with mouse over on istweb.apple.com/quack.apple.com
251 VC++ treats bitfields as signed members, so Node::m_styleChange would be
252 sign extended if it was assigned the value FullStyleChange. This caused
253 style recalculation to stop propagating.
255 We work around this VC++ oddity by storing the enum as an unsigned, and
256 casting back to StyleChangeType in the getter.
258 Test: fast/css/hover-affects-child.html
261 (WebCore::Node::styleChangeType):
263 2007-08-29 Justin Garcia <justin.garcia@apple.com>
267 <rdar://problem/5368833>
268 REGRESSION: Pasting a triple-clicked line of quoted text at the top of a message adds an extra, quoted line
270 * editing/CompositeEditCommand.cpp:
271 (WebCore::CompositeEditCommand::insertParagraphSeparator): Added an option for
272 using a plain div to hold the new paragraph, instead of a clone of the previous
274 * editing/CompositeEditCommand.h:
275 * editing/InsertParagraphSeparatorCommand.cpp: Ditto.
276 (WebCore::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Ditto.
277 (WebCore::InsertParagraphSeparatorCommand::doApply): Ditto.
278 * editing/InsertParagraphSeparatorCommand.h:
279 * editing/ReplaceSelectionCommand.cpp:
280 (WebCore::ReplaceSelectionCommand::doApply): Use a default block element when creating
281 new paragraphs, so that empty paragraphs don't contain the block style of the previous
283 Don't expand collapsed brs at the end of inserted content, this was the root of the bug.
284 We'd copy <blockquote>hello<br></blockquote><br class="Apple-interchange-newline">
285 and get an extra paragraph. The removed code used to make sure that if the copied
286 selection ends with a paragraph break that is represented in the copied markup by a
287 regular br (not an interchange newline br), that that paragraph break appears in the
288 pasted content, but shouldMergeEnd, which was introduced after this code was written,
289 now takes care of that.
290 (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Inserted content should always
291 displace placeholder brs, even if that inserted content ends with a br.
292 * editing/markup.cpp:
293 (WebCore::needInterchangeNewlineAfter): This code failed to add an interchange newline
294 if the user copied <div>hello</div><br>, only don't add an interchange newline when
295 copying ^hello<br>^<br>, because then the copied paragraph break will already be
296 represented in the copied markup by a br.
297 (WebCore::createMarkup):
299 2007-08-30 David Harrison <harrison@apple.com>
303 <rdar://problem/5423900> Seed: safari crashes on submit feedback page in -[WebCoreAXObject isAttachment]
305 * bridge/mac/WebCoreAXObject.mm:
306 (-[WebCoreAXObject isAttachment]):
307 Add nil check since element could be detached.
309 2007-08-30 Mitz Pettel <mitz@webkit.org>
311 Reviewed by Dave Hyatt.
313 - fix http://bugs.webkit.org/show_bug.cgi?id=13282
314 <rdar://problem/5126392> REGRESSION (NativePopUp): Rightmost character cut off in pop-up menu
316 * rendering/RenderMenuList.cpp:
317 (WebCore::RenderMenuList::updateOptionsWidth): When measuring option text, use
318 the same WebCore run rounding behavior that is used to draw it in the popup button.
320 2007-08-30 Riku Voipio <riku.voipio@iki.fi>
322 Reviewed by Dave Kilzer.
326 * platform/DeprecatedString.h: Update comments to reflect the
327 change and update test to fit changes to Platform.h.
329 2007-08-30 Darin Adler <darin@apple.com>
331 Reviewed by Tim Hatcher.
333 - fix http://bugs.webkig.org/show_bug.cgi?id=14981
334 DEBUG builds of WebKit hang videwing Yahoo! Mail messages
335 with ~5 MB text attachment
337 * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::checkConsistency):
338 * rendering/RenderFlow.cpp: (WebCore::RenderFlow::checkConsistency):
339 * rendering/RenderText.cpp: (WebCore::RenderText::checkConsistency):
340 Put the actual consistency check inside an ifdef. If you need it you can
341 turn it on. There's still some function call overhead in builds that don't
342 have NDEBUG defined, but that's worth it so we can turn this on and off
343 without recompiling the world.
345 - small code style improvement to recently changed function
347 * editing/TextIterator.cpp: (WebCore::plainTextToMallocAllocatedBuffer):
348 Use a typedef and make_pair to make the code dealing with the pair simpler to read.
350 2007-08-30 Simon Hausmann <hausmann@kde.org>
354 Fix Qt/Gdk build. gcc on Linux at least doesn't like initializing
355 variables between jumps with goto ("jump to label foo crosses
356 initialization of bar").
358 * editing/TextIterator.cpp:
359 (WebCore::plainTextToMallocAllocatedBuffer):
361 2007-08-30 Darin Adler <darin@apple.com>
365 - fix <rdar://problem/5423270> CrashTracer: [USER] 1 crash in Safari at com.apple.WebCore:
366 WebCore::plainTextToMallocAllocatedBuffer + 762
368 * editing/TextIterator.cpp: (WebCore::plainTextToMallocAllocatedBuffer):
369 Check for a malloc failure and exit the function if it failed.
371 2007-08-29 Anders Carlsson <andersca@apple.com>
375 <rdar://problem/5404329>
376 Plugin content starves WM_TIMER events on UI thread (affects idle behavior of app) on http://www.vincent-vella.com/, http://www.sagmeister.com/
378 Add a tiny delay to invalidation timer to prevent it from starving other timers.
380 * plugins/win/PluginViewWin.cpp:
381 (WebCore::PluginViewWin::invalidateRect):
383 2007-08-29 Darin Adler <darin@apple.com>
387 * editing/htmlediting.cpp: (WebCore::avoidIntersectionWithNode):
388 Fix an assert that was firing for me all the time when doing editing operations.
390 2007-08-29 Anders Carlsson <andersca@apple.com>
394 <rdar://problem/5386098>
395 Repro hang with some Flash plugin content (http://dougmccune.com/blog/2007/07/25/coming-to-flexcamp-at-adobe/)
397 In some cases, Flash ends up starving the main loop by sending a lot of WM_USER + 1 messages. Throttle these
398 messages so they won't end up hanging the web browser.
400 * plugins/win/PluginViewWin.cpp:
401 (WebCore::PluginMessageThrottlerWin::PluginMessageThrottlerWin):
402 (WebCore::PluginMessageThrottlerWin::~PluginMessageThrottlerWin):
403 (WebCore::PluginMessageThrottlerWin::appendMessage):
404 (WebCore::PluginMessageThrottlerWin::messageThrottleTimerFired):
405 (WebCore::PluginMessageThrottlerWin::allocateMessage):
406 (WebCore::PluginMessageThrottlerWin::isInlineMessage):
407 (WebCore::PluginMessageThrottlerWin::freeMessage):
408 (WebCore::PluginViewWndProc):
409 (WebCore::PluginViewWin::wndProc):
410 (WebCore::PluginViewWin::determineQuirks):
411 * plugins/win/PluginViewWin.h:
413 (WebCore::PluginViewWin::pluginWndProc):
415 2007-08-29 Beth Dakin <bdakin@apple.com>
419 Fix for <rdar://problem/5436800> REGRESSION: PLT is 1.5% slower due
422 In r25098, we only called setCreatedByParser for XML! This patch
423 calls it for HTML too, and takes care of the performance
426 * html/HTMLElementFactory.cpp:
427 (WebCore::styleConstructor):
429 2007-08-29 Antti Koivisto <antti@apple.com>
433 Fix <rdar://problem/5425951>
434 REGRESSION: change to updateLayoutIgnorePendingStylesheets causes SAP Portal page to render wrong
436 If new nodes have been added or style recalc has been done with style sheets still pending, some nodes
437 may not have had their real style calculated yet. Normally this state gets cleaned when style sheets arrive
438 but in updateLayoutIgnorePendingStylesheets() we need to do full style recalc to get up-to-date style immediatly.
440 Added a document flag to track if there are any nodes that did not have their real style calculated due to
443 Test: fast/dynamic/style-access-late-stylesheet-load.html
445 * css/CSSStyleSelector.cpp:
446 (WebCore::CSSStyleSelector::styleForElement):
448 (WebCore::Document::Document):
449 (WebCore::Document::recalcStyle):
450 (WebCore::Document::updateLayoutIgnorePendingStylesheets):
452 (WebCore::Document::setHasNodesWithPlaceholderStyle):
454 2007-08-29 Alice Liu <alice.liu@apple.com>
458 We disable the DeleteButton UI before applying any editing commands.
459 This patch simply moves those disable/enable calls to a more correct place, closer to the actual application of the editing command.
461 * editing/EditCommand.cpp:
462 (WebCore::EditCommand::apply):
463 (WebCore::applyCommand):
465 2007-08-28 Alice Liu <alice.liu@apple.com>
467 fixed <rdar://problem/5420682> Mail crashes at WebCore::InsertLineBreakCommand::doApply()
468 after dropping a selected image over container's close box
470 Reviewed by Darin and Maciej.
472 * editing/DeleteButtonController.cpp:
473 (WebCore::DeleteButtonController::show):
474 (WebCore::DeleteButtonController::hide):
475 * editing/DeleteButtonController.h:
476 (WebCore::DeleteButtonController::enabled):
477 General changes made to DeleteButtonController: when hiding, it's not necessary to clear out
478 the m_containerElement and m_target, especially since to fix this bug we need to keep
479 their values around. It's sufficient to just detach the container from target.
481 * editing/EditCommand.cpp:
482 (WebCore::EditCommand::EditCommand):
483 Move the selection out of the deletion UI since we don't want to expose the deletion UI to any editing.
485 * editing/Editor.cpp:
486 (WebCore::Editor::rangeForPoint):
487 Move the range out of the deletion UI since we don't want to expose the deletion UI to any editing.
489 * editing/htmlediting.cpp:
490 * editing/htmlediting.h:
491 (WebCore::avoidIntersectionWithNode):
492 Moved function that operates on Range from markup.cpp to here
493 Added new implementation for function that operates on Selection
495 * editing/markup.cpp:
496 (WebCore::createMarkup):
497 Moved function out of this file to htmlediting.cpp, and renamed to avoidIntersectionWithNode
499 2007-08-29 David Hyatt <hyatt@apple.com>
501 Fix for 5441281, remove our dependency on cursor rects and drag margins
502 in AppKit for a large performance boost on the PLT and iBench.
506 * platform/mac/WidgetMac.mm:
507 (WebCore::safeRemoveFromSuperview):
508 (WebCore::Widget::addToSuperview):
509 Suppress the resetting of drag margins when views are added and removed.
511 (WebCore::Widget::setCursor):
512 Just use NSCursor's set method to immediately set the cursor. We no longer
513 rely on NSScrollView/NSClipView setDocumentCursor, since that is implemented
516 2007-08-29 Rick <rick@writhe.org.uk>
518 Reviewed by Tim Hatcher.
520 Fix http://bugs.webkit.org/show_bug.cgi?id=14853
521 Bug 14853: Incorrect implementation of ArrayImpl's equality operator
523 * platform/ArrayImpl.cpp:
524 (WebCore::ArrayImpl::operator==):
525 Fixed typo so that correct variable is used in equality comparison.
527 2007-08-29 Peter Kasting <zerodpx@gmail.com>
531 - fix http://bugs.webkit.org/show_bug.cgi?id=15096
532 Move the GIF frame duration minimum check into the various
533 ImageSource*.cpp backends and use the same values as
536 * platform/graphics/cairo/ImageSourceCairo.cpp:
537 (WebCore::ImageSource::frameDurationAtIndex):
538 * platform/graphics/qt/ImageSourceQt.cpp:
539 (WebCore::ImageSource::frameDurationAtIndex):
540 * platform/image-decoders/gif/GIFImageReader.cpp:
541 (GIFImageReader::read):
543 2007-08-29 Peter Kasting <zerodpx@gmail.com>
547 - fix http://bugs.webkit.org/show_bug.cgi?id=15097
548 Make PNGImageDecoder.cpp size its frame buffer vector in its
549 constructor, so it never throws decoded image data away no matter
550 what order its functions are called in.
552 * platform/image-decoders/png/PNGImageDecoder.cpp:
553 (WebCore::PNGImageDecoder::PNGImageDecoder):
554 (WebCore::PNGImageDecoder::frameBufferAtIndex):
555 (WebCore::PNGImageDecoder::decode):
556 (WebCore::PNGImageDecoder::rowAvailable):
557 (WebCore::PNGImageDecoder::pngComplete):
559 2007-08-29 Peter Kasting <zerodpx@gmail.com>
563 - fix http://bugs.webkit.org/show_bug.cgi?id=15104
564 Don't double-compensate for sizeof(unsigned) when making a buffer
565 overflow check in the GIF decoder. Now interlaced GIFs don't
566 sometimes get nothing/garbage in some of the bottom rows.
568 * platform/image-decoders/gif/GIFImageDecoder.cpp:
569 (WebCore::GIFImageDecoder::haveDecodedRow):
571 2007-08-28 Sam Weinig <sam@webkit.org>
575 Update fix landed in r25249 to account for XMLHttpRequest, which can also be EventTargets.
577 Tests: http/tests/security/listener/xss-XMLHttpRequest-addEventListener.html
578 http/tests/security/listener/xss-XMLHttpRequest-shortcut.html
580 * bindings/js/JSXMLHttpRequest.cpp:
581 (KJS::JSXMLHttpRequest::putValueProperty): Use the Window object associated with document's frame, not the active Window.
582 (KJS::JSXMLHttpRequestPrototypeFunction::callAsFunction): ditto
583 * xml/XMLHttpRequest.h:
584 (WebCore::XMLHttpRequest::document): Expose Document member so bindings can access the correct frame.
586 2007-08-28 Anders Carlsson <andersca@apple.com>
590 <rdar://problem/5424866> Bottom portion of any Web Clip widget appears transparent
592 Restore the previous behavior, creating plug-ins on attach, for WebKit plug-ins. Netscape plug-ins
593 are still created during the first layout.
595 * html/HTMLEmbedElement.cpp:
596 (WebCore::HTMLEmbedElement::getInstance):
597 Only call layout if the renderer doesn't have a widget.
599 * html/HTMLObjectElement.cpp:
600 (WebCore::HTMLObjectElement::getInstance):
603 * loader/FrameLoader.cpp:
604 (WebCore::FrameLoader::shouldUsePlugin):
605 Update for enum change.
607 * loader/FrameLoaderTypes.h:
608 Add ObjectContentNetscapePlugin and ObjectContentOtherPlugin.
610 * page/mac/WebCoreFrameBridge.h:
611 Get rid of the enum here, we can use the one in FrameLoaderTypes.h
613 * rendering/RenderPartObject.cpp:
614 (WebCore::RenderPartObject::updateWidget):
615 Only create the plug-in if it's not a Netscape plug-in.
617 (WebCore::RenderPartObject::layout):
620 2007-08-28 David Harrison <harrison@apple.com>
624 <rdar://problem/5415006> Command Left in a To Do causes caret to disappear
626 The selection was ending up inside non-editable content at the To Do Options
627 arrow image, rather then at the editable position just to the left of that image.
628 The problem was that startPositionForLine looked only at line boxes, and there
629 is no linebox for the editable position at the far left of a To Do, which is
630 a table. Addressed by having startPositionForLine use table offset 0 instead
631 of the first VisiblePosition inside the table.
633 Found and fixed the similar case with option-left (move by word position).
636 * editing/selection/mixed-editability-8.html: Added.
637 * editing/selection/mixed-editability-9.html: Added.
640 * editing/SelectionController.cpp:
641 (WebCore::SelectionController::modifyMovingLeftBackward):
643 * editing/VisiblePosition.cpp:
644 (WebCore::VisiblePosition::next):
645 (WebCore::VisiblePosition::previous):
646 (WebCore::VisiblePosition::stayInEditableContentLeft):
647 (WebCore::VisiblePosition::stayInEditableContentRight):
648 Factored stayInEditableContentLeft() and stayInEditableContentRight()
649 out of previous() and next().
651 * editing/VisiblePosition.h:
652 Declare stayInEditableContentLeft() and stayInEditableContentRight().
654 * editing/visible_units.cpp:
655 (WebCore::previousWordPosition):
656 (WebCore::nextWordPosition):
657 (WebCore::startOfLine):
658 (WebCore::endOfLine):
659 (WebCore::previousSentencePosition):
660 (WebCore::nextSentencePosition):
661 Call stayInEditableContentLeft() or stayInEditableContentRight(), as
662 appropriate, so prevent crossing from editable content into
665 (WebCore::startPositionForLine):
666 Use table offset 0 instead of the first VisiblePosition in the table.
668 2007-08-28 Mark Rowe <mrowe@apple.com>
670 Reviewed by Darin Adler.
672 <rdar://problem/5443453> Decreasing history expiration time from 1 year to 1 week can lead to long hang while icon database syncs
674 Perform the sync inside a SQLite transaction. This drops the time taken for the sync from over 90s to under half a second in the
675 extreme case of over 90,000 URLs being pruned.
677 * loader/icon/IconDatabase.cpp:
678 (WebCore::IconDatabase::syncDatabase):
680 2007-08-28 Mark Rowe <mrowe@apple.com>
682 Reviewed by Darin Adler.
684 <rdar://problem/5437983> Loading history containing 100,000 entries adds 20s to Safari's startup
686 Add a new constructor for HistoryItem that initializes the alternate title. This prevents WebHistoryItem
687 in WebKit from having explicitly set the display title, which triggers a history item changed notification
688 to be posted, for each history item loaded.
691 * history/HistoryItem.cpp:
692 (WebCore::HistoryItem::HistoryItem):
693 * history/HistoryItem.h:
695 2007-08-28 Anders Carlsson <andersca@apple.com>
699 <rdar://problem/5298296> XMLHttpRequest readyState 3 & responseText buffer issues
701 Add a shouldContentSniff flag to ResourceLoader and ResourceHandle and have XMLHttpRequest
702 pass in false when creating its subresource loader.
705 * loader/MainResourceLoader.cpp:
706 (WebCore::MainResourceLoader::MainResourceLoader):
707 (WebCore::MainResourceLoader::loadNow):
708 * loader/ResourceLoader.cpp:
709 (WebCore::ResourceLoader::ResourceLoader):
710 (WebCore::ResourceLoader::load):
711 * loader/ResourceLoader.h:
712 * loader/SubresourceLoader.cpp:
713 (WebCore::SubresourceLoader::SubresourceLoader):
714 (WebCore::SubresourceLoader::create):
715 * loader/SubresourceLoader.h:
716 * loader/mac/NetscapePlugInStreamLoaderMac.mm:
717 (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
718 * platform/mac/WebCoreSystemInterface.h:
719 * platform/mac/WebCoreSystemInterface.mm:
720 * platform/network/ResourceHandle.cpp:
721 (WebCore::ResourceHandle::ResourceHandle):
722 (WebCore::ResourceHandle::create):
723 * platform/network/ResourceHandle.h:
724 * platform/network/ResourceHandleInternal.h:
725 (WebCore::ResourceHandleInternal::ResourceHandleInternal):
726 * platform/network/mac/ResourceHandleMac.mm:
727 (WebCore::ResourceHandle::start):
728 * xml/XMLHttpRequest.cpp:
729 (WebCore::XMLHttpRequest::send):
731 2007-08-27 Steve Falkenburg <sfalken@apple.com>
733 Added getter for committedFirstRealDocumentLoad.
737 * loader/FrameLoader.h: Added committedFirstRealDocumentLoad.
738 (WebCore::FrameLoader::committedFirstRealDocumentLoad): Added.
740 2007-08-27 Antti Koivisto <antti@apple.com>
744 Fix <rdar://problem/5433144>
745 REGRESSION: Unable to click "Select" link at Expedia for car rentals
747 javascript: URLs need special handling when serializing. Escaping them like
748 normal attribute values can do bad things. Try hard to not escape anything,
749 escape quote characters only if really necessary. Try to match Firefox.
751 Test: fast/innerHTML/javascript-url.html
753 * editing/markup.cpp:
754 (WebCore::urlAttributeToQuotedString):
755 (WebCore::startMarkup):
757 2007-08-27 David Hyatt <hyatt@apple.com>
759 Fix for 5441224, micro-optimizations to improve the PLT by 1%.
763 * css/CSSStyleSelector.cpp:
764 (WebCore::CSSStyleSelector::canShareStyleWithElement):
765 * platform/mac/FontMac.mm:
766 (WebCore::Font::drawGlyphs):
767 * rendering/RenderInline.cpp:
768 (WebCore::RenderInline::requiresLayer):
769 * rendering/RenderObject.cpp:
770 (WebCore::RenderObject::isBody):
771 * rendering/RenderObject.h:
772 (WebCore::RenderObject::renderArena):
773 (WebCore::RenderObject::isRoot):
775 2007-08-27 Mitz Pettel <mitz@webkit.org>
779 - fix http://bugs.webkit.org/show_bug.cgi?id=15091
780 Crash in RenderBlock::skipWhitespace during layout <rdar://problem/5439631>
782 Test: fast/replaced/applet-disabled-positioned.html
784 * html/HTMLAppletElement.cpp:
785 (WebCore::HTMLAppletElement::createRenderer): Changed to call
786 RenderObject::createObject(), which accounts for style.
788 2007-08-26 Antti Koivisto <antti@apple.com>
792 Fix for <rdar://problem/5433726>
793 Mail crash at WebCore::Frame::styleForSelectionStart() when deleting a selection in a HTML message (http://www.yahoo.com/)
795 Test: editing/style/temporary-span-crash.html
798 (WebCore::Frame::styleForSelectionStart):
799 Temporary span created here might not have renderer if document has style sheet that makes it display:none.
800 Set display:inline explicitly in spans style attribute. This temporary span does not need to get its display
801 value from actual document style sheets. Null check the renderer too to be sure.
804 2007-08-24 Sam Weinig <sam@webkit.org>
808 Fix for <rdar://problem/5426142>
810 Use the EventTarget's frame when creating the EventListener.
812 Tests: http/tests/security/listener/xss-JSTargetNode-onclick-addEventListener.html
813 http/tests/security/listener/xss-JSTargetNode-onclick-shortcut.html
814 http/tests/security/listener/xss-window-onclick-addEventListener.html
815 http/tests/security/listener/xss-window-onclick-shortcut.html
817 * bindings/js/JSEventTargetNode.cpp:
818 (WebCore::JSEventTargetNode::setListener):
819 (WebCore::JSEventTargetNodePrototypeFunction::callAsFunction):
820 * bindings/js/kjs_window.cpp:
821 (KJS::WindowFunc::callAsFunction):
823 2007-08-25 Mitz Pettel <mitz@webkit.org>
825 Reviewed by Sam Weinig.
827 - fix http://bugs.webkit.org/show_bug.cgi?id=15077
828 REGRESSION: Cannot drag selected text out of a background window
830 * manual-tests/drag-out-of-background-window.html: Added.
831 * page/EventHandler.cpp:
832 (WebCore::EventHandler::eventMayStartDrag): Added missing coordinate
835 2007-08-25 Rob Buis <buis@kde.org>
839 http://bugs.webkit.org/show_bug.cgi?id=14848
840 DOM table rules are not updated when changed
842 On a dynamic rules attr change, mark the table cells and
843 their ancestors (up to and including the table tag) as
846 Tests: fast/table/rules-attr-dynchange1.html
847 fast/table/rules-attr-dynchange2.html
849 * html/HTMLTableElement.cpp:
850 (WebCore::isTableCellAncestor):
851 (WebCore::setTableCellsChanged):
852 (WebCore::HTMLTableElement::parseMappedAttribute):
854 2007-08-25 Adele Peterson <adele@apple.com>
858 Fix for http://bugs.webkit.org/show_bug.cgi?id=15073
859 <rdar://problem/5426557> REGRESSION: Can no longer drag text from textareas
861 Test: fast/forms/drag-out-of-textarea.html
863 * rendering/RenderTextControl.cpp: (WebCore::RenderTextControlInnerBlock::nodeAtPoint):
864 Only restricts hit testing if the placeholder text is visible.
865 * rendering/RenderTextControl.h: (WebCore::RenderTextControl::placeholderIsVisible): Added.
867 2007-08-25 Peter Kasting <zerodpx@gmail.org>
869 Reviewed by Sam Weinig.
871 Part 2 of http://bugs.webkit.org/show_bug.cgi?id=14967.
872 Eliminate all remaining implicit conversions of wtf::Vector<T> to T*. Where code was
873 previously checking that the Vector's data pointer was non-NULL, check !Vector::isEmpty()
876 * bindings/js/kjs_navigator.cpp:
877 (KJS::PluginBase::cachePluginDataIfNecessary):
878 * loader/mac/LoaderNSURLExtras.m:
879 (suggestedFilenameWithMIMEType):
880 * page/FrameView.cpp:
881 (WebCore::FrameView::~FrameView):
882 (WebCore::FrameView::pauseScheduledEvents):
883 (WebCore::FrameView::resumeScheduledEvents):
884 (WebCore::FrameView::dispatchScheduledEvents):
885 * platform/mac/PlugInInfoStoreMac.mm:
886 (WebCore::PlugInInfoStore::createPluginInfoForPluginAtIndex):
888 2007-08-25 Mitz Pettel <mitz@webkit.org>
890 Rubber-stamped by Adam Roben
894 * platform/win/MouseEventWin.cpp: Removed.
896 2007-08-25 Jasper Bryant-Greene <m@ni.ac.nz>
898 Reviewed by Oliver Hunt.
900 Set paintingDisabled to true in Cairo's GraphicsContext constructor
901 when passed a null PlatformGraphicsContext.
903 * platform/graphics/cairo/GraphicsContextCairo.cpp:
904 (WebCore::GraphicsContext::GraphicsContext):
906 2007-08-25 Mitz Pettel <mitz@webkit.org>
908 Reviewed by Dave Hyatt.
910 - fix http://bugs.webkit.org/show_bug.cgi?id=15056
911 REGRESSION (r21472): Digg Podcasts Episodes Render "Digg" counter incorrectly
913 Covered by fast/parser/residual-style-close-across-n-blocks.html
915 * html/HTMLParser.cpp:
916 (WebCore::HTMLParser::handleResidualStyleCloseTagAcrossBlocks): If the
917 residual style was closed before anything else in the block (so it does
918 not apply to anything inside the block) avoid creating an empty element for
921 2007-08-25 Mitz Pettel <mitz@webkit.org>
923 Reviewed by Dave Hyatt.
925 - fix http://bugs.webkit.org/show_bug.cgi?id=14972
926 Moving cursor down in contentEditable section fails if styled line-height:1em
928 Test: editing/selection/move-by-line-003.html
930 * rendering/RenderText.cpp:
931 (WebCore::RenderText::positionForCoordinates): Changed hit testing so that each
932 line is tested for hits between its overflow top and the next line's overflow top.
933 This matches RenderBlock::positionForCoordinates.
935 2007-08-25 Mitz Pettel <mitz@webkit.org>
939 - fix http://bugs.webkit.org/show_bug.cgi?id=14792
940 <rdar://problem/5367763> REGRESSION: Copy inserts carriage return in middle of selection
942 Test: editing/pasteboard/newlines-around-floating-or-positioned.html
944 * editing/TextIterator.cpp:
945 (WebCore::shouldEmitNewlinesBeforeAndAfterNode): Do not emit newlines around
946 floating or positioned blocks. This behavior seems to match WinIE's.
948 2007-08-23 Justin Garcia <justin.garcia@apple.com>
952 <rdar://problem/5432254> GoogleDocs: A hang occurs when applying list style to selected table
954 * editing/DeleteSelectionCommand.cpp:
955 (WebCore::DeleteSelectionCommand::handleGeneralDelete): If the position
956 that marked the start of the range to delete has been removed from the
957 document, and it was inside the node that holds the position that marks
958 the end of the range to delete, don't remove any children of that node,
959 because we don't know how many to remove. For example, if the end is
960 [a, 5] and the start was in some descendant of a and was removed, don't
961 remove any of the children of a. We will now refuse to remove some content
962 incorrectly, but that's less dangerous than removing content incorrectly.
963 Long term we need to update these positions as we remove content from the
964 document, but that seems like a more risky change. Added a testcase.
965 * editing/InsertListCommand.cpp:
966 (WebCore::InsertListCommand::modifyRange): If the end of the selection to
967 modify is just after a table, and if the start of the selection is inside
968 that table, the last paragraph that we'll want modify is the last one inside
969 the table, not the paragraph that contains the table itself. Adjust
970 startOfLastParagraph here to avoid infinite recursion.
972 2007-08-24 Anders Carlsson <andersca@apple.com>
976 <rdar://problem/5430165>
977 REGRESSION: Dynamically loaded images fail to load
979 * html/HTMLImageLoader.cpp:
980 (WebCore::HTMLImageLoader::HTMLImageLoader):
981 Initialize the m_elementIsProtected member.
983 (WebCore::HTMLImageLoader::~HTMLImageLoader):
984 Assert that the element is not protected.
986 (WebCore::HTMLImageLoader::setLoadingImage):
987 If the image is not null, protect the element. Otherwise, unprotect it.
989 (WebCore::HTMLImageLoader::dispatchLoadEvent):
990 Unprotect the element here.
992 (WebCore::HTMLImageLoader::protectElement):
993 (WebCore::HTMLImageLoader::unprotectElement):
994 New methods which protect and unprotect the element.
996 * html/HTMLImageLoader.h:
998 2007-08-24 Kevin McCullough <kmccullough@apple.com>
1002 2007-08-24 Beth Dakin <bdakin@apple.com>
1004 Reviewed by Hyatt and Adele.
1006 Fix for <rdar://problem/5417203> Google Gmail 1.0 widget - unread
1009 * rendering/FixedTableLayout.cpp:
1010 (WebCore::FixedTableLayout::calcWidthArray): Calc pref widths for
1011 our cells, if needed.
1013 2007-08-24 Kevin McCullough <kmccullough@apple.com>
1017 <rdar://problem/5437038> 1 credential object leaked for each call to credentialWithUser:password:persistence
1018 - Use initWithUser instead of credentialWithUser because credentialWithUser leaks.
1020 * platform/network/mac/AuthenticationMac.mm:
1022 * platform/network/mac/ResourceHandleMac.mm:
1023 (-[WebCoreResourceHandleAsDelegate connection:didReceiveAuthenticationChallenge:]):
1024 (-[WebCoreSynchronousLoader connection:didReceiveAuthenticationChallenge:]):
1026 2007-08-24 Jon Honeycutt <jhoneycutt@apple.com>
1030 <rdar://problem/5433236> Print preview of empty txt file crashes Safari
1031 Fix: Adjust computePageRectsForFrame to always return at least one
1032 page rect, even if document height is zero.
1034 * WebCore.vcproj/WebCore.vcproj:
1035 * bridge/win/FrameWin.h: Added Vector& parameter to
1036 computePagesRectsForFrame; changed its return type to void.
1037 * bridge/win/FrameWin.cpp:
1038 (WebCore::computePageRectsForFrame): Reordered the loop that inserts
1039 rects into the vector.
1041 2007-08-24 Antti Koivisto <antti@apple.com>
1045 Fix <rdar://problem/5393758>
1046 Crash in WebCore::FontData::platformInit
1048 Null check glyph page.
1050 If font has somehow failed to initialize it is possible to have null glyph page. Based on
1051 crash dumps this seems to occasionally happen when running Mail under guard malloc.
1053 No test case, I don't know how to get to this state.
1055 * platform/FontData.cpp:
1056 (WebCore::FontData::FontData):
1057 * platform/mac/FontDataMac.mm:
1058 (WebCore::FontData::platformInit):
1060 2007-08-24 George Wright <george.wright@collabora.co.uk>
1064 http://bugs.webkit.org/show_bug.cgi?id=15071
1065 [cairo] SVG skews are incorrect
1067 Fix Cairo implementation of AffineTransform::shear so that shearing is
1068 done in the correct direction.
1070 * platform/graphics/cairo/AffineTransformCairo.cpp:
1071 (WebCore::AffineTransform::shear):
1073 2007-08-23 Anders Carlsson <andersca@apple.com>
1077 If necessary, re-set the window proc after each call to NPP_SetWindow. This is to ensure that
1078 our window proc is always run even if a plug-in subclasses the window and replaces the window proc.
1080 Also, make sure that the default window proc is of type ASCII so we can eliminate the
1081 * plugins/win/PluginViewWin.cpp:
1082 (WebCore::registerPluginView):
1083 (WebCore::PluginViewWndProc):
1084 (WebCore::PluginViewWin::setNPWindowRect):
1085 (WebCore::PluginViewWin::stop):
1086 (WebCore::PluginViewWin::determineQuirks):
1087 (WebCore::PluginViewWin::PluginViewWin):
1088 (WebCore::PluginViewWin::init):
1089 * plugins/win/PluginViewWin.h:
1091 (WebCore::PluginViewWin::pluginWndProc):
1093 2007-08-23 Justin Garcia <justin.garcia@apple.com>
1097 <rdar://problem/5156801> REGRESSION: Crash at DeleteSelectionCommand::doApply() when deleting table content
1099 * editing/DeleteSelectionCommand.cpp:
1100 (WebCore::DeleteSelectionCommand::handleGeneralDelete): Use a RefPtr
1101 for node. If the node to be removed contains the selection, and if
1102 the next node to be removed (nextNode) is inside the deletion UI,
1103 removing node will remove nextNode from the document. nextNode is
1104 a RefPtr, but node isn't and when nextNode falls out of scope the node
1105 that node points to will be destroyed and we'll end up using a stale pointer.
1106 Long term we should probably just disable the deletion UI before editing
1107 operations because the undo of the removal of node in the situation
1108 described above relies on the presence of the deletion UI, but it isn't
1109 present because its added and removed in a non-undoable way.
1111 2007-08-23 Mitz Pettel <mitz@webkit.org>
1115 - fix http://bugs.webkit.org/show_bug.cgi?id=14899
1116 !d->m_view->needsLayout() in Frame::paint() (Causes assert)
1118 WebKit copies the width and height attributes of an <embed> to its
1119 nearest <object> ancestor. This used to be done in updateWidget(), but
1120 that could lead to the document being dirty right after layout and
1121 before painting. The patch moves the copying of the attributes to when
1122 the <embed> is inserted into the document or its attributes change.
1124 * html/HTMLEmbedElement.cpp:
1125 (WebCore::HTMLEmbedElement::insertedIntoDocument):
1126 (WebCore::HTMLEmbedElement::attributeChanged):
1127 * html/HTMLEmbedElement.h:
1128 * manual-tests/bugzilla-14899.html: Added.
1129 * rendering/RenderPartObject.cpp:
1130 (WebCore::RenderPartObject::updateWidget):
1132 2007-08-22 Anders Carlsson <andersca@apple.com>
1134 Reviewed by Darin and Oliver.
1136 <rdar://problem/5422410>
1137 http://bugs.webkit.org/show_bug.cgi?id=15019
1138 REGRESSION (r25124-r25140): New posts and hot topics won't show at mobile01.com
1140 Remove the call to checkCallImplicitClose(). Calling it in loadPlugin is bad for two reasons:
1142 1. It could cause onload to be dispatched even when the page has subresources that are still
1143 loading, such as images.
1145 2. Now that loadPlugin is called during layout, it could cause onload to be dispatched during
1146 layout, which can execute javascript and do pretty much anything while the render tree is in an
1149 * loader/FrameLoader.cpp:
1150 (WebCore::FrameLoader::loadPlugin):
1152 2007-08-22 Anders Carlsson <andersca@apple.com>
1156 <rdar://problem/5430584>
1157 http://bugs.webkit.org/show_bug.cgi?id=15053
1158 WebKit does not check Windows Registry HKEY_CURRENT_USER for NPAPI plugin locations
1160 * plugins/win/PluginDatabaseWin.cpp:
1161 (WebCore::addPluginsFromRegistry):
1162 (WebCore::PluginDatabaseWin::getPluginsInPaths):
1164 2007-08-22 Justin Garcia <justin.garcia@apple.com>
1168 <rdar://problem/5418891> CrashTracer: [USER] 1 crash in Mail at -[WebViewEditor webView:shouldInsertText:replacingDOMRange:givenAction:]
1170 * editing/BreakBlockquoteCommand.cpp:
1171 (WebCore::BreakBlockquoteCommand::doApply): We're reusing the topBlockquote
1172 variable. Null it out first. If there is no new topBlockquote and we don't null
1173 it out first, we'll assume that there was a new one and crash.
1175 2007-08-22 Kevin McCullough <kmccullough@apple.com>
1179 - rdar:5423067 Reapplyingthe change but only when the text area is in focus.
1181 * html/HTMLTextAreaElement.cpp:
1182 (WebCore::HTMLTextAreaElement::setValue):
1184 2007-08-21 David Hyatt <hyatt@apple.com>
1186 Fix for <rdar://problem/5249757> Painting of JPGs in WebKit is too slow.
1188 Use a new Leopard API for fast tiling of images. We only use this API
1189 when the whole image is being tiled and when the current CGImageRef to tile
1190 has a size that matches the size of the whole image.
1192 We can optimize border-image in the future by adding a cache of the 9
1197 * platform/graphics/cg/ImageCG.cpp:
1198 (WebCore::Image::drawPattern):
1200 2007-08-22 Kevin McCullough <kmccullough@apple.com>
1202 - Rolling back since I need to update some layouttests this change breaks.
1204 * html/HTMLTextAreaElement.cpp:
1205 (WebCore::HTMLTextAreaElement::setValue):
1207 2007-08-21 Kevin McCullough <kmccullough@apple.com>
1209 Reviewed by Geof, Adam, Hyatt, Maciej and Oliver.
1211 - In order to match the behavior of the other major browsers, selection is moved to the end of the text value when a change occurs to the contents of a text area instead of remembering the location of the selection.
1212 - <rdar://problem/5423067> gmail is super annoying when trying to add a new name to the TO, CC or BCC fields
1214 * html/HTMLTextAreaElement.cpp:
1215 (WebCore::HTMLTextAreaElement::setValue):
1217 2007-08-21 Adam Roben <aroben@apple.com>
1221 Keep FrameView::layoutIfNeededRecursive Windows- and Gtk-only for now
1222 (sadly). This will have to wait until we merge ScrollView and FrameView.
1226 * page/FrameView.cpp:
1229 2007-08-21 Adam Roben <aroben@apple.com>
1231 Fix an ASSERT when using Find in Page
1237 * bridge/win/FrameWin.cpp:
1238 (WebCore::imageFromSelection): Make sure to update layout before
1239 painting so we don't hit an ASSERT in painting code (Frame::selectionImage
1240 in FrameMac.mm does this as well).
1242 2007-08-21 Adam Roben <aroben@apple.com>
1244 Made FrameView::layoutIfNeededRecursive available to all platforms
1246 Currently it's only used on Gtk+ and Windows.
1250 * page/FrameView.cpp: Removed #ifdef.
1251 * page/FrameView.h: Ditto.
1253 2007-08-21 Adele Peterson <adele@apple.com>
1255 Build fix for release build.
1257 * rendering/AutoTableLayout.cpp:
1258 (WebCore::AutoTableLayout::calcEffectiveWidth):
1259 (WebCore::AutoTableLayout::layout):
1261 2007-08-21 Mitz Pettel <mitz@webkit.org>
1265 - fix http://bugs.webkit.org/show_bug.cgi?id=15010
1266 <rdar://problem/5423956> REGRESSION (r25000-r25065): Table rendering broken by a recent nightly
1268 Test: fast/table/max-width-integer-overflow.html
1270 Avoid integer overflows when dealing with maximum widths by
1271 1) using floating point arithmetic when summing or multiplying column max widths
1272 2) capping max widths at INT_MAX / 2
1274 * rendering/AutoTableLayout.cpp:
1275 (WebCore::AutoTableLayout::calcPrefWidths):
1276 (WebCore::AutoTableLayout::calcEffectiveWidth):
1277 (WebCore::AutoTableLayout::layout):
1279 2007-08-20 John Sullivan <sullivan@apple.com>
1281 Reviewed by Adam Roben
1283 WebCore part of fix for:
1284 <rdar://problem/5417777> WebKit focus ring color no longer matches system focus rings
1286 Adele wrote the first version of this patch. No test cases added because I made sure the
1287 layout tests are unaffected. Two additional bug fixes were made in passing, but neither
1288 of them had any effect on any known real-world case, and both were too difficult to write
1289 test cases for to be worthwhile.
1292 added symbols for these new functions so WebKit can call them
1294 * WebCore.xcodeproj/project.pbxproj:
1295 updated for new file
1297 * platform/graphics/mac/ColorMac.h: Added.
1298 New file to hold the increasing amount of Mac-specific color stuff.
1300 * platform/graphics/Color.h:
1301 removed #if PLATFORM(MAC) code, which is now in ColorMac.h
1303 * platform/graphics/mac/ColorMac.mm:
1304 (WebCore::makeRGBAFromNSColor):
1305 new static function to convert an NSColor object to an RGBA32 struct
1306 (WebCore::colorFromNSColor):
1307 new public function to convert an NSColor object to a WebCore-style Color object
1308 (WebCore::focusRingColor):
1309 Uses (cached) systemFocusRingColor instead of hardwired values, unless usesTestModeFocusRingColor is true,
1310 in which case it uses the old hardwired color
1311 (WebCore::usesTestModeFocusRingColor):
1312 returns value of global var
1313 (WebCore::setUsesTestModeFocusRingColor):
1314 sets value of global var
1315 (+[WebCoreControlTintObserver controlTintDidChange]):
1316 Uses [NSColor keyboardFocusIndicatorColor] to set systemFocusRingColor; don't compile if COLORMATCH_EVERYTHING
1317 is set since we don't know what it would take to satisfy this state.
1319 * bindings/objc/DOMRGBColor.mm:
1320 now includes ColorMac.h to account for moved declarations
1321 * bridge/mac/WebCoreAXObject.mm:
1324 * page/mac/FrameMac.mm:
1325 (WebCore::convertAttributesToUnderlines):
1326 now uses new colorFromNSColor. The old code was swapping G & B, but it didn't matter in practice because
1327 this function is only used to convert the color of an input manager's marked text underline, which is always black
1329 * page/mac/WebCoreFrameBridge.mm:
1330 (-[WebCoreFrameBridge setBaseBackgroundColor:]):
1331 now uses new colorFromNSColor. The old code was swapping G & B, but it didn't matter in practice because
1332 this function is only called with a grayscale color perhaps containing an alpha value
1334 * rendering/RenderView.cpp:
1335 (WebCore::RenderView::paintBoxDecorations):
1336 just updated a comment
1338 2007-08-20 Mitz Pettel <mitz@webkit.org>
1340 Reviewed by Dave Hyatt.
1342 - fix http://bugs.webkit.org/show_bug.cgi?id=15023
1343 REGRESSION (r21113-r21143): JavaScript tooltip rendering bug
1345 Test: fast/repaint/layer-visibility.html
1347 * rendering/RenderLayer.cpp:
1348 (WebCore::RenderLayer::setHasVisibleContent): Cache the layer's
1349 rects when it changes to visible.
1351 2007-08-20 Kevin Decker <kdecker@apple.com>
1355 Fixed: <rdar://problem/5325262> REGRESSION (Tiger-Leopard): PictureTalk plug-in doesn't work
1357 The problem was that this particular plug-in handles "text/ptf", but WebCore wasn't giving the plug-in a chance to load
1358 any type with "text/"
1360 * dom/DOMImplementation.cpp:
1361 (WebCore::DOMImplementation::createDocument): Allow plug-ins to once again use "text/" MIME types, but only if the MIME
1362 type is not "text/plain". Disallowing plug-ins to use text/plain prevents plug-ins from hijacking a fundamental type
1363 that the browser is expected to handle, and also serves as an optimization to prevent loading the plug-in database in
1366 2007-08-20 Adam Roben <aroben@apple.com>
1368 Remove workarounds for <rdar://problem/5386894> now that it's been fixed
1372 Tests: fast/loader/local-svg-parsed-as-svg.svg
1373 fast/loader/local-xhtml-parsed-as-xhtml.xhtml
1375 * platform/network/cf/ResourceResponseCFNet.cpp:
1376 (WebCore::ResourceResponse::doUpdateResourceResponse): Removed hackish
1379 2007-08-20 Anders Carlsson <andersca@apple.com>
1383 <rdar://problem/5412988>
1384 Crash when visiting http://www.rockonflash.com/blog/?p=58
1386 * plugins/win/PluginViewWin.cpp:
1387 (WebCore::PluginViewWin::updateWindow):
1388 Just return if the plugin view hasn't been inserted in the hierarchy yet.
1390 2007-08-20 Holger Hans Peter Freyther <zecke@selfish.org>
1394 Do not define svg as ImageMIMEType if we can use ksvg2.
1396 * platform/MIMETypeRegistry.cpp:
1397 (WebCore::initialiseSupportedImageMIMETypes):
1399 2007-08-19 Adam Roben <aroben@apple.com>
1403 * platform/gdk/TemporaryLinkStubs.cpp: Removed const.
1405 2007-08-19 Adam Roben <aroben@apple.com>
1407 Fix <rdar://5395835> REGRESSION (r24527): Context menu for edit fields is missing "Font & Writing Direction"
1409 The problem was that ContextMenuItem::setSubMenu was just copying the
1410 HMENU from the ContextMenu passed in on Windows, but that HMENU was
1411 later getting destroyed when the ContextMenu went out of scope.
1413 I added a new ContextMenu::releasePlatformDescription method that is
1414 used in setSubMenu instead. I think an ultimately better design would
1415 be for setSubMenu to take ownership of the ContextMenu that's passed in
1416 (as should insertItem and appendItem), but I decided to be conservative
1417 and just make the changes needed to fix the bug.
1423 * platform/ContextMenu.h: Added releasePlatformDescription.
1424 * platform/gdk/TemporaryLinkStubs.cpp: Added stub implementation.
1425 * platform/mac/ContextMenuMac.mm:
1426 (WebCore::ContextMenu::releasePlatformDescription): Implemented, though
1427 it's never called on this platform.
1428 * platform/qt/ContextMenuQt.cpp:
1429 (WebCore::ContextMenu::releasePlatformDescription): Ditto.
1430 * platform/win/ContextMenuItemWin.cpp:
1431 (WebCore::ContextMenuItem::setSubMenu): Call releasePlatformDescription
1432 since we need to take ownership of the HMENU.
1433 * platform/win/ContextMenuWin.cpp:
1434 (WebCore::ContextMenu::releasePlatformDescription): Implemented.
1436 2007-08-18 Maciej Stachowiak <mjs@apple.com>
1440 - fixed <rdar://problem/5198272> REGRESSION: PLT 1.5% slower due to r21367 (change to start frames with empty documents)
1442 There were three main cuases of extra time due to creating the initial empty document:
1444 1) Creating an extra WebHTMLView and swapping it for a new one for each frame created.
1445 2) Parsing the minimal markup for the initial document's contents.
1446 3) Clearing the Window object an extra time and dispatching the corresponding delegate method.
1448 The WebCore part of the fixes addresses 2 and 3.
1450 * loader/FrameLoader.cpp:
1451 (WebCore::FrameLoader::init): Don't parse "<html><body>" for the initial
1452 empty document; it turns out not to be needed.
1453 (WebCore::FrameLoader::dispatchWindowObjectAvailable): Don't
1454 dispatch the delegate if we haven't created a ScriptInterpreter yet.
1455 * bindings/js/kjs_proxy.cpp:
1456 (WebCore::KJSProxy::initScriptIfNeeded): Dispatch the window object
1457 delegate when we first create the interpreter, since that is now done
1459 * loader/FrameLoader.h:
1460 (WebCore::FrameLoader::committingFirstRealLoad): Helper for WebKit
1461 to know when to reuse a WebHTMLView.
1463 2007-08-19 Mitz Pettel <mitz@webkit.org>
1465 Reviewed by Adam Roben.
1467 - fix http://bugs.webkit.org/show_bug.cgi?id=15008
1468 ASSERTION FAILED: !firstLineBox() == !lastLineBox() setting content on image
1470 Test: fast/images/text-content-crash-2.html
1472 * html/HTMLImageLoader.cpp:
1473 (WebCore::HTMLImageLoader::setImage): Added a check that the renderer is an
1475 (WebCore::HTMLImageLoader::updateFromElement): Ditto.
1476 (WebCore::HTMLImageLoader::notifyFinished): Ditto.
1478 2007-08-17 Maciej Stachowiak <mjs@apple.com>
1482 - WebCore part of fix to scrollbar suppression hack for Leopard
1484 * loader/FrameLoader.cpp:
1485 (WebCore::FrameLoader::transitionToCommitted): Suppress scrollbars earlier, so it happens
1486 before any potential view swap.
1488 2007-08-17 Antti Koivisto <antti@apple.com>
1492 Fix <rdar://problem/5403773>
1493 CrashTracer: [USER] 88 crashes in Safari at com.apple.WebCore: WebCore::RenderTableSection::paint + 846
1495 * rendering/RenderBlock.cpp:
1496 (WebCore::RenderBlock::removePositionedObjects):
1498 Fix crash in http://www.infobae.com/interior/home.html
1499 Positioned objects removed from m_positionedObjects would in some cases not get added back to any
1500 positioned objects list. Adding objects happens in block layout but since layout was not invalidated
1501 correctly in removePositionedObjects() it would not get invoked. As a result some positioned objects
1502 would stay in layout dirty state leading to crashes and other bad things.
1504 * rendering/RenderTableSection.cpp:
1505 (WebCore::RenderTableSection::paint):
1507 Add needLayout() guard to eliminate this class of crashes from release builds.
1508 Assert commented out for now since one existing layout test can't handle it.
1510 2007-08-17 Kevin Decker <kdecker@apple.com>
1512 Code change by Darin, landed and reviewed by me.
1514 Fixed: <rdar://problem/5252836> Adobe Help Viewer: Japanese characters in the Help Tree structure are shown as garbage
1515 Added fast/encoding/namespace-tolerance.html test.
1517 * loader/TextResourceDecoder.cpp:
1518 (WebCore::TextResourceDecoder::checkForHeadCharset): Slightly loosen the charset decoder heuristic by tweaking it
1519 to ignore namespaces. This restores compatibility to documents which (1) use namespace prefixes on HTML elements
1520 (2) specify a non-latin charset and (3) contain non-latin characters.
1522 Added fast/encoding/namespace-tolerance.html test.
1524 2007-08-17 Anders Carlsson <andersca@apple.com>
1526 Reviewed by Dave Hyatt.
1528 <rdar://problem/5379040>
1529 REGRESSION (Tiger-Leopard): ADOBE: Safari calls NPP_SetWindow with bad values sometimes
1531 Instantiate plug-ins during the first layout instead of doing so when creating the renderer.
1532 This ensures that the plug-in widget will have a correct initial size.
1534 * html/HTMLEmbedElement.cpp:
1535 (WebCore::HTMLEmbedElement::getInstance):
1536 Force a layout if the plug-in doesn't have an instance.
1538 (WebCore::HTMLEmbedElement::attach):
1539 Pass true to updateWidget, causing it to only create a widget if it won't be a plug-in.
1541 * html/HTMLIFrameElement.cpp:
1542 (WebCore::HTMLIFrameElement::attach):
1543 Pass false to updateWidget, this will only create subframes anyway.
1545 * html/HTMLObjectElement.cpp:
1546 (WebCore::HTMLObjectElement::getInstance):
1547 Force a layout if the plug-in doesn't have an instance.
1549 (WebCore::HTMLObjectElement::attach):
1550 Pass true to updateWidget, causing it to only create a widget if it won't be a plug-in.
1552 * loader/FrameLoader.cpp:
1553 (WebCore::FrameLoader::loadPlugin):
1554 Get the size from the renderer and pass it to the client.
1556 * loader/FrameLoaderClient.h:
1557 * page/mac/WebCoreFrameBridge.h:
1558 * platform/graphics/svg/SVGImageEmptyClients.h:
1559 (WebCore::SVGEmptyFrameLoaderClient::createPlugin):
1560 Update declarations.
1562 * rendering/RenderPart.cpp:
1563 (WebCore::RenderPart::setWidget):
1564 No need to mark the renderer as dirty here.
1566 * rendering/RenderPartObject.h:
1567 * rendering/RenderPartObject.cpp:
1568 (WebCore::RenderPartObject::updateWidget):
1569 Add a parameter, onlyCreateNonPlugins. If this is true the widget
1570 will only be created if it's not a plug-in.
1572 (WebCore::RenderPartObject::layout):
1573 Call updateWidget here if m_widget is 0, causing the plug-in to be instantiated.
1575 2007-08-17 Oliver Hunt <oliver@apple.com>
1579 http://bugs.webkit.org/show_bug.cgi?id=14189
1580 <rdar://problem/5319511> REPRODUCIBLE CRASH: Canvas createPattern(canvas, ...) crashes on Windows (14189)
1582 Ensure that we actually retain the CG pattern correctly.
1584 Credit to Henry Mason <hmason@mac.com> for finding the cause of this.
1586 * html/CanvasPattern.cpp:
1587 (WebCore::CanvasPattern::~CanvasPattern):
1588 (WebCore::CanvasPattern::createPattern):
1589 * html/CanvasPattern.h:
1590 (WebCore::CanvasPattern::platformImage):
1592 2007-08-16 Geoffrey Garen <ggaren@apple.com>
1597 (WebCore::Cache::pruneLiveResources):
1598 (WebCore::Cache::pruneDeadResources):
1600 2007-08-16 Justin Garcia <justin.garcia@apple.com>
1602 Reviewed by Harrison.
1604 <rdar://problem/5378473>
1605 REGRESSION: Undoing a deletion that is part of an open typing command fails to reinsert the caret
1607 We recently made Undo of a series of deletes select all of the
1608 characters that were deleted, not just the most recently deleted
1609 character. But the code that did this set a new starting selection
1610 after every delete, even those that were part of an open typing
1611 command that started with character insertions or forward deletes,
1612 operations that when undone, remove the starting selection being
1613 set from the document.
1615 After this change we only set a new starting selection if the open typing
1616 command was opened by a backward delete. The new behavior matches TextEdit.
1617 We don't do something similar or forward deletes because TextEdit opens
1618 and closes a new typing command on forward delete (added a FIXME about this).
1620 * editing/TypingCommand.cpp:
1621 (WebCore::TypingCommand::TypingCommand): Initialize
1622 m_openedByBackwardDelete.
1623 (WebCore::TypingCommand::forwardDeleteKeyPressed): Added a FIXME about
1624 how in TextEdit, forward deletes open and close a new typing command.
1625 (WebCore::TypingCommand::doApply): Set m_openedByBackwardDelete
1627 (WebCore::TypingCommand::deleteKeyPressed): Only set the starting
1628 selection if this delete is the first one in an open typing command
1629 or one in a series of deletes that opened the typing command.
1630 * editing/TypingCommand.h: Added m_openedByBackwardDelete.
1632 2007-08-13 Geoffrey Garen <ggaren@apple.com>
1634 Reviewed by Dave Hyatt.
1636 Tweaked the cache eviction model to better balance between live and
1639 For the sake of avoiding evictions during the PLT, the old model
1640 required the sum of dead and live resources to grow to twice the cache
1641 capacity before evicting, and would then evict dead or live down to 0
1642 if necessary. This was a too-high high water mark, which would nullify
1643 much of the value of eviction, and a too-low low water mark, which
1644 would nullify much of the value of the LRU-SP strategy.
1646 This patch changes the model in 3 ways.
1648 1. The new model for dead resources is a flexible window with a fixed
1649 minimum and maximum. The dead resource window is big when live resource
1650 pressure is small, and vice versa. This has the immediate advantage of
1651 cutting the high water mark by up to 50%. It also enables the following
1652 tunable optimizations in future patches:
1653 a. A dead resource limit of 0 for clients who want that. (Just set
1654 the fixed maximum to 0.)
1655 b. A much higher low water mark. (Just set the fixed minimum to,
1656 say, 25% of the cache's capacity.)
1657 c. A much lower high water mark for users who browse simple pages
1658 in one tab. (Just set the fixed maximum to, say, 50% of the cache's
1661 I plan to make the changes that actually take advantage of these
1662 tunable optimizations in another check-in.
1664 The new model won't hurt the PLT because it will notice the PLT's low
1665 live resource size, and up the dead resource capacity in response. For
1666 the same reason, the new model should establish a good balance in
1669 2. Live resource eviction is now based on size(), not encodedSize().
1670 So, a page with lots of large, encoded images will start evicting
1671 resources, if necessary, even before all the images paint. This allows
1672 you to more accurately stipulate an exact high water mark.
1674 3. When pruning, prune to a small percentage below capacity, to avoid
1675 just having to prune again immediately.
1677 Layout tests pass. PLT shows no regression.
1679 * history/PageCache.cpp:
1680 (WebCore::PageCache::releaseAutoreleasedPagesNow): Updated for rename.
1682 * loader/Cache.cpp: Implemented the algorithm explained above.
1683 * loader/Cache.h: Removed explicit tracking of decoded data size, since
1686 * loader/CachedResource.cpp: ditto on tracking of decoded data size
1688 2007-08-16 Darin Adler <darin@apple.com>
1690 Reviewed by Tim Hatcher.
1692 - fix <rdar://problem/5415029> In Mail, a crash occurs at WebCore::Node::isDescendantOf()
1693 when attempting to delete a selection in a table
1695 The bug was caused by createMarkup trying to operate on a range that
1696 has an endpoint in the delete button DOM, because it removes that DOM
1697 during its operation! Still working on a regression test -- it's hard
1698 to make the kind of bad selection that's needed with the DOM, so I might
1699 have to use the eventSender.
1701 * editing/DeleteButtonController.h: Made some of the identifiers private.
1702 We can make them public if we need to use them. Added a getter function
1703 for the container element so we can figure out if a given node is inside
1704 the DOM added for the delete button.
1706 * editing/markup.cpp:
1707 (WebCore::moveEndpointsBeforeNode): Added. General purpose helper function
1708 that moves endpoints of a range to before a given node -- we do this before
1709 removing the delete button, so the endpoint is where the delete button was,
1710 rather than having an endpoint that's not in the document.
1711 (WebCore::createMarkup): Always return empty string, not null string.
1712 Get the document by calling ownerDocument on the range rather than getting
1713 the document of the commonAncestorContainer. That's because we need to
1714 get at the delete button before calling commonAncestorContainer. Call
1715 moveEndpointsBeforeNode to move the range endpoints out of the delete
1716 button interface before calling disable() which will remove it from the
1717 DOM if it's in there. Added an early return for the case where commonAncestor
1718 is non-0. If this happens, we would crash later because pastEndNode would
1719 not be in the tree. This change alone would prevent the crash, but we'd get
1720 bad markup, so we need the moveEndpointsBeforeNode fix. Added null checks
1721 for the frame to the range version as in the single-node version so this
1722 won't crash immediately on documents that are not in a frame. For the
1723 single-node version, added a check if a ndoe of 0 and a node inside the
1724 delete button user interface, and return the empty string for those cases.
1726 2007-08-16 Justin Garcia <justin.garcia@apple.com>
1730 <rdar://problem/5378847> After creating and removing a ToDo, the caret disappears as soon as I start to type
1732 * editing/InsertTextCommand.cpp:
1733 (WebCore::InsertTextCommand::input): A whitespace text node inserted by Mail
1734 when a ToDo is removed is completely removed by deleteInsignificantWhitespace,
1735 and since it contains the text insertion position, insertion fails.
1736 Save the position before the node where text insertion will occur,
1737 and if that node is removed, use the saved position for insertion.
1739 2007-08-16 Darin Adler <darin@apple.com>
1743 - fix <rdar://problem/5413488> REGRESSION: every DOM element is about 40
1744 bytes bigger because it has a Timer
1746 Moved the timer to the document from the element.
1748 * dom/Document.h: Made frame() inline. Added updateFocusApperanceSoon(),
1749 cancelFocusAppearanceUpdate(), m_updateFocusAppearanceTimer,
1750 clearXMLVersion(), and updateFocusAppearanceTimerFired(). Also made
1751 everything that was previously protected be private instead.
1753 (WebCore::Document::Document): Initialize m_updateFocusAppearanceTimer.
1754 (WebCore::Document::updateFocusAppearanceSoon): Added. Starts timer.
1755 (WebCore::Document::cancelFocusAppearanceUpdate): Added. Stops timer.
1756 (WebCore::Document::updateFocusAppearanceTimerFired): Added. If the
1757 focused node is a focusable element, then calls
1758 updateFocusAppearance(false) on it.
1760 * dom/Element.h: Removed default value of the boolean parameter to
1761 updateFocusAppareance. Removed needsFocusAppearanceUpdate(),
1762 setNeedsFocusAppearanceUpdate(), updateFocusAppearanceTimerFired(),
1763 stopUpdateFocusAppearanceTimer(), m_updateFocusAppearanceTimer, and
1764 m_needsFocusAppearanceUpdate. Added
1765 updateFocusAppearanceSoonAfterAttach() and cancelFocusAppearanceUpdate().
1767 (WebCore::ElementRareData::ElementRareData): Added initializer for
1768 m_needsFocusAppearanceUpdateSoonAfterAttach.
1769 (WebCore::Element::Element): Removed initializers for
1770 m_updateFocusAppearanceTimer and m_needsFocusAppearanceUpdate.
1771 (WebCore::Element::attach): Updated code that starts the focus
1772 appearance timer to instead call updateFocusAppearanceSoon() on the
1774 (WebCore::Element::detach): Replaced call to
1775 stopUpdateFocusAppearanceTimer with call to cancelFocusAppearanceUpdate.
1776 (WebCore::Element::focus): Added check for node that's already focused,
1777 to match the logic that's in the derived classes. This makes it safe for
1778 us to remove the override in the derived classes. Also replaced the code
1779 that called setNeedsFocusAppearanceUpdate(true) with code to set the
1780 rare data flag m_needsFocusAppearanceUpdateSoonAfterAttach and added a
1781 call to cancelFocusAppearanceUpdate() in the case where there's no focus
1783 (WebCore::Element::blur): Replaced call to
1784 stopUpdateFocusAppearanceTimer with call to cancelFocusAppearanceUpdate.
1785 (WebCore::Element::cancelFocusAppearanceUpdate): Added. Sets
1786 m_needsFocusAppearanceUpdateSoonAfterAttach to false, and then calls
1787 cancelFocusAppearanceUpdate() on the document, but only if the element
1788 is the focused node of the document.
1790 * html/HTMLDocument.cpp:
1791 (WebCore::HTMLDocument::HTMLDocument): Replaced code that sets
1792 m_xmlVersion directly with a call to a new inline clearXMLVersion()
1794 (WebCore::HTMLDocument::setCookie): Replaced use of m_policyBaseURL with
1796 (WebCore::HTMLDocument::createTokenizer): Replaced uses of m_frame with
1798 (WebCore::HTMLDocument::determineParseMode): Replaced code that sets
1799 pMode and hMode directly with calls to setParseMode and setHTMLMode.
1800 Replaced use of m_styleSelector with styleSelector().
1802 * html/HTMLInputElement.h: Removed now-unneed override of focus().
1803 Removed default value of the boolean parameter to updateFocusAppareance.
1804 * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::updateFocusAppearance):
1805 Pass the restorePreviousSelection boolean through -- while it's ignored,
1806 it no longer has a default value.
1808 * html/HTMLTextAreaElement.h: Removed now-unneed override of focus().
1809 Removed default value of the boolean parameter to updateFocusAppareance.
1810 * html/HTMLTextAreaElement.cpp: Ditto.
1812 * WebCore.exp: Removed the Document::frame() symbol, since it's now inline.
1814 2007-08-15 Antti Koivisto <antti@apple.com>
1818 Fix <rdar://problem/5388936>
1819 Crash while setting display:none for a table cell with selection
1821 Super class destroy() could (through some selection code in removeChild()) trigger section recalc
1822 in middle of RenderTableCell::destroy(), cleaning section dirty bit. This would later crash in
1823 layout since cell grid would still have refence to the dead cell.
1825 Ensure table sections are dirty when leaving destroy method.
1827 I can't figure out tests for row and section changes but they look like
1828 they could crash in similar way as cell.
1830 * rendering/RenderTableCell.cpp:
1831 (WebCore::RenderTableCell::destroy):
1832 * rendering/RenderTableRow.cpp:
1833 (WebCore::RenderTableRow::destroy):
1834 * rendering/RenderTableSection.cpp:
1835 (WebCore::RenderTableSection::destroy):
1837 2007-08-15 Maciej Stachowiak <mjs@apple.com>
1841 <rdar://problem/5389696> leak of 32-byte NSData object (and more?) in WebIconDatabase code path with each refresh of http://www.apple.com
1843 * platform/graphics/BitmapImage.h: Use RetainPtr for m_nsImage and m_tiffRep
1844 * platform/graphics/mac/ImageMac.mm:
1845 (WebCore::BitmapImage::initPlatformData): No need to do anything now
1846 (WebCore::BitmapImage::invalidatePlatformData): Simplify
1847 (WebCore::BitmapImage::getTIFFRepresentation): Use RetainPtr to avoid leaks
1848 (WebCore::BitmapImage::getNSImage): Use RetainPtr to avoid leaks
1850 2007-08-15 Darin Adler <darin@apple.com>
1854 - fix <rdar://problem/5094895> REGRESSION (r19094): JavaScript timers don't
1855 work inside showModalDialog; caret also doesn't blink
1857 * platform/Timer.h: Added fireTimersInNestedEventLoop.
1858 * platform/Timer.cpp:
1859 (WebCore::TimerBase::fireTimers): Added code to exit if the timersReadyToFire
1860 is cleared. This indicates that someone fired the timers in the nested event
1861 loop, so we should not fire any more timers ourselves.
1862 (WebCore::TimerBase::fireTimersInNestedEventLoop): Added. Sets timersReadyToFire
1863 to 0 so we won't return early and do nothing if the shared timer first. Then
1864 calls updateSharedTimer() so the shared timer will get scheduled as needed based
1865 on any pending timers.
1867 * page/Chrome.cpp: (WebCore::Chrome::runModal): Call
1868 fireTimersInNestedEventLoop before calling runModal on the client.
1870 * manual-tests/modal-dialog.html: Added a test that uses a timeout.
1871 * manual-tests/show-modal-dialog-test.html: Fixed a typo.
1873 2007-08-15 Justin Garcia <justin.garcia@apple.com>
1877 http://bugs.webkit.org/show_bug.cgi?id=14971
1878 REGRESSION: cannot select reporter's e-mail in bugzilla
1880 * page/EventHandler.cpp:
1881 (WebCore::EventHandler::canMouseDragExtendSelect): Allow drag-selecting inside
1882 a -webkit-user-select:ignore region.
1884 2007-08-15 Beth Dakin <bdakin@apple.com>
1888 Rolling back in. I made a silly mistake in XMLTokenizer that caused
1889 this patch to crash SVG tests. It's fixed now!
1891 Refactor of change for <rdar://problem/5404899> REGRESSION: Mail
1892 crash in WebCore::FontFallbackList::fontDataAt() after dragging
1893 image into text multiple times
1895 The original fix that I made last night prevents the pending style
1896 sheet count from being incremented until the element is in the
1897 document. This fix prevents the style sheet from loading at all
1898 until it is in the document.
1901 * dom/StyleElement.cpp:
1902 (WebCore::StyleElement::insertedIntoDocument): Call process.
1903 (WebCore::StyleElement::removedFromDocument): This can be reverted
1904 to its original state before my patch last night.
1905 (WebCore::StyleElement::process): childrenChanged is now called
1906 process. Return early if your not in the document.
1907 (WebCore::StyleElement::createSheet): Revert change from last
1908 night. The inDocument check is now in caller childrenChanged.
1909 * dom/StyleElement.h: insertedIntoDocument() must now accept an
1910 element in addition to a document.
1912 This is an optimization to prevent calling updateStyleSelector()
1914 * dom/XMLTokenizer.cpp:
1915 (WebCore::XMLTokenizer::startElementNs):
1916 * html/HTMLStyleElement.cpp:
1917 (WebCore::HTMLStyleElement::HTMLStyleElement):
1918 (WebCore::HTMLStyleElement::finishedParsing):
1919 (WebCore::HTMLStyleElement::insertedIntoDocument):
1920 (WebCore::HTMLStyleElement::childrenChanged):
1921 (WebCore::HTMLStyleElement::sheetLoaded):
1922 * html/HTMLStyleElement.h:
1923 * ksvg2/svg/SVGStyleElement.cpp:
1924 (WebCore::SVGStyleElement::SVGStyleElement):
1925 (WebCore::SVGStyleElement::finishedParsing):
1926 (WebCore::SVGStyleElement::insertedIntoDocument):
1927 (WebCore::SVGStyleElement::childrenChanged):
1928 (WebCore::SVGStyleElement::sheetLoaded):
1929 * ksvg2/svg/SVGStyleElement.h:
1930 (WebCore::SVGStyleElement::setCreatedByParser):
1932 This is a name change. Document::stylesheetLoaded()
1933 is now Document::removePendingSheet()
1935 (WebCore::Document::removePendingSheet):
1937 * dom/ProcessingInstruction.cpp:
1938 (WebCore::ProcessingInstruction::sheetLoaded):
1939 * html/HTMLLinkElement.cpp:
1940 (WebCore::HTMLLinkElement::~HTMLLinkElement):
1941 (WebCore::HTMLLinkElement::setDisabledState):
1942 (WebCore::HTMLLinkElement::process):
1943 (WebCore::HTMLLinkElement::sheetLoaded):
1945 (WebCore::UserStyleSheetLoader::~UserStyleSheetLoader):
1946 (WebCore::UserStyleSheetLoader::setCSSStyleSheet):
1948 This is another name change. closeRenderer() is now
1951 (WebCore::Node::finishedParsing):
1952 * dom/XMLTokenizer.cpp:
1953 (WebCore::XMLTokenizer::endElementNs):
1955 * html/HTMLAppletElement.cpp:
1956 (WebCore::HTMLAppletElement::finishedParsing):
1957 * html/HTMLAppletElement.h:
1958 * html/HTMLGenericFormElement.cpp:
1959 (WebCore::HTMLFormControlElementWithState::finishedParsing):
1960 * html/HTMLGenericFormElement.h:
1961 * html/HTMLObjectElement.cpp:
1962 (WebCore::HTMLObjectElement::finishedParsing):
1963 * html/HTMLObjectElement.h:
1964 * html/HTMLParser.cpp:
1965 (WebCore::HTMLParser::insertNode):
1966 (WebCore::HTMLParser::popOneBlockCommon):
1967 * html/HTMLScriptElement.cpp:
1968 (WebCore::HTMLScriptElement::finishedParsing):
1969 * html/HTMLScriptElement.h:
1970 (WebCore::HTMLStyleElement::setCreatedByParser):
1971 * ksvg2/svg/SVGAnimationElement.cpp:
1972 (WebCore::SVGAnimationElement::finishedParsing):
1973 * ksvg2/svg/SVGAnimationElement.h:
1974 * ksvg2/svg/SVGElement.cpp:
1975 (WebCore::SVGElement::finishedParsing):
1976 * ksvg2/svg/SVGElement.h:
1978 2007-08-15 David Harrison <harrison@apple.com>
1980 Reviewed by Antti Koivisto.
1982 <rdar://problem/5411803> Bumpercar crashes when loading a partial URL (FrameLoader::receivedMainResourceError())
1984 * loader/MainResourceLoader.cpp:
1985 (WebCore::MainResourceLoader::receivedError):
1986 Nil check for the FrameLoader.
1988 2007-08-14 Steve Falkenburg <sfalken@apple.com>
1990 <rdar://problem/5411482> Windows user agent language always returns "en"
1992 Implement defaultLanguage().
1996 * WebCore.vcproj/WebCore.vcproj: Added Language.cpp.
1997 * platform/win/Language.cpp: Added.
1998 (WebCore::localeInfo): Added.
1999 (WebCore::defaultLanguage): Added.
2000 * platform/win/TemporaryLinkStubs.cpp: Remove defaultLanguage stub.
2002 2007-08-14 Sam Weinig <sam@webkit.org>
2004 Reviewed by Geoff and Oliver.
2006 Fix for <rdar://problem/5267870>
2007 Mangleme: Reproducible assertion failure in -[WebCoreFrameBridge installInFrame:]
2009 - Change embed/plugin code path to detach the frame on willRemove instead of detach.
2010 This matches what frame and iframe do.
2012 Test: http/tests/misc/embedCrasher.html
2014 * html/HTMLPlugInElement.cpp:
2015 (WebCore::HTMLPlugInElement::willRemove):
2016 * html/HTMLPlugInElement.h:
2018 2007-08-14 Adele Peterson <adele@apple.com>
2022 Fix for <rdar://problem/5370059> REGRESSION: Cannot type into edit fields on a form (sccsheriff.org)
2024 This change makes -webkit-user-select an inherited css property. For "user-select: none" we were already
2025 acting like it was an inheritable property, where we let user-select:text on the children override its parent's user-select:none.
2026 By making user-select really inherited (instead of inherited for some values), we eliminate the need for crawling up the tree to see
2027 if an ancestor has user-select ignore set.
2029 * page/EventHandler.cpp: (WebCore::EventHandler::canMouseDownStartSelect):
2030 Now that user-select is inherited, you don't need to walk up the render tree looking for ancestors with user-select:ignore set.
2032 * css/CSSStyleSelector.cpp: Eliminate SELECT_AUTO.
2033 (WebCore::CSSStyleSelector::adjustRenderStyle):
2034 (WebCore::CSSStyleSelector::applyProperty):
2035 * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
2037 * rendering/RenderStyle.h:
2038 (WebCore::): Eliminate SELECT_AUTO. Make userSelect inherited.
2039 (WebCore::RenderStyle::userSelect):
2040 (WebCore::RenderStyle::setUserSelect):
2041 (WebCore::RenderStyle::initialUserSelect):
2042 * rendering/RenderStyle.cpp:
2043 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2044 (WebCore::StyleRareNonInheritedData::operator==):
2045 (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2046 (WebCore::StyleRareInheritedData::operator==):
2047 (WebCore::RenderStyle::diff):
2049 2007-08-15 Peter Kasting <zerodpx@gmail.org>
2053 http://bugs.webkit.org/show_bug.cgi?id=14967 part 1 - Eliminate most implicit
2054 conversions of wtf::Vector<T> to T* by explicitly calling .data()
2056 * html/HTMLSelectElement.cpp:
2057 (WebCore::HTMLSelectElement::saveState):
2058 * platform/KURL.cpp:
2059 (WebCore::KURL::KURL):
2060 (WebCore::KURL::init):
2061 (WebCore::KURL::decode_string):
2062 (WebCore::KURL::parse):
2063 (WebCore::KURL::encode_string):
2064 * platform/cf/KURLCFNet.cpp:
2065 (WebCore::KURL::KURL):
2066 * platform/mac/KURLMac.mm:
2067 (WebCore::KURL::KURL):
2068 * rendering/RenderFrameSet.cpp:
2069 (WebCore::RenderFrameSet::layOutAxis):
2071 2007-08-14 Ricci Adams <iccir@apple.com>
2073 Reviewed by Darin, Hyatt.
2075 - fix <rdar://problem/5407795> -apple-line-clamp should never display less than one line
2077 * rendering/RenderFlexibleBox.cpp:(WebCore::RenderFlexibleBox::layoutVerticalBox): Use
2078 max to make sure it never computes a minimum of less than one line.
2080 2007-08-14 Brady Eidson <beidson@apple.com>
2082 Reviewed by Darin, John, Maciej, Oliver, and Tim
2084 <rdar://problem/5394708> - Crash on launch with corrupt icon database
2086 The main part of the fix is to not disable SQLite's default level of protection - to leave the sync options at their normal,
2089 But in case lightning strikes at the exact right moment and someone ends up with a corrupt database, add some support code to
2090 detect that condition and recover from it.
2092 This is mainly accomplished by exposing the "PRAGMA integrity_check;" facilities of sqlite through IconDatabase SPI as well as
2093 running that integrity check if a journal file is detected at launch (a strong indication that the last quit was not clean).
2094 There's also a method exposed to allow clients to tell the icon database "I suspect something bad happened, please check integrity"
2096 * loader/icon/IconDatabase.cpp:
2097 (WebCore::IconDatabase::checkIntegrityBeforeOpening): Allow clients to suggest an integrity check
2098 (WebCore::IconDatabase::open): Add a check to see if the journal file for the database exists. If it does, run the integrity
2099 check. Also run the check if a client has suggested it to be necessary.
2100 If the integrity-check fails, we sadly have to destroy the database and recreate from scratch.
2101 Also - quite importantly - do not adjust the default sync preferences for the SQLDatabase. They were an optimization that
2102 might have been valid at one time but no longer affects any benchmarks we care about.
2103 (WebCore::IconDatabase::checkIntegrity): Perform the SQLite integrity_check pragma
2104 * loader/icon/IconDatabase.h:
2106 * loader/icon/IconDatabaseNone.cpp:
2107 (WebCore::IconDatabase::checkIntegrity): Keep IconDatabaseNone users building
2108 (WebCore::IconDatabase::checkIntegrityBeforeOpening): Ditto
2110 * loader/icon/SQLDatabase.cpp:
2111 (WebCore::SQLDatabase::open): Make a copy of the path string so we don't accidentally mutate anyone else's string on ::close()
2113 * platform/FileSystem.h: Added. Begin a long-needed platform file system abstraction
2114 * platform/mac/FileSystemMac.mm: Added.
2115 (WebCore::fileExists): Check if a file exists
2116 (WebCore::deleteFile): Delete a file
2118 * platform/gdk/TemporaryLinkStubs.cpp:
2119 (WebCore::fileExists):
2120 (WebCore::deleteFile):
2121 * platform/qt/TemporaryLinkStubs.cpp:
2122 (WebCore::fileExists):
2123 (WebCore::deleteFile):
2124 * platform/win/TemporaryLinkStubs.cpp:
2125 (WebCore::fileExists):
2126 (WebCore::deleteFile):
2129 * WebCore.xcodeproj/project.pbxproj:
2131 2007-08-14 Jon Honeycutt <jhoneycutt@apple.com>
2135 Build fix for Windows.
2137 * html/HTMLFormElement.cpp:
2139 2007-08-14 George Staikos <staikos@kde.org>
2141 Only connect the menu signal once.
2143 * platform/qt/ContextMenuQt.cpp:
2144 (WebCore::ContextMenu::ContextMenu):
2145 (WebCore::ContextMenu::insertItem):
2147 2007-08-14 Justin Garcia <justin.garcia@apple.com>
2151 <rdar://problem/5408255> REGRESSION: In Mail, clicking the containing element's UI closebox doesn't delete element
2153 * editing/DeleteButtonController.cpp:
2154 (WebCore::DeleteButtonController::show): Use -webkit-user-select:ignore for
2157 2007-08-14 Antti Koivisto <antti@apple.com>
2161 Fix <rdar://problem/5143183>
2162 Air Mail postmark shows up wrong in Firefox due to use of CSS background-position-x/y
2164 Safari was using non-standard background-position-x/y properties when serializing style, both normal
2165 and computed. As a result Safari generated CSS would not render correctly in Firefox.
2167 Use standard background-position property instead.
2169 * css/CSSComputedStyleDeclaration.cpp:
2171 * css/CSSMutableStyleDeclaration.cpp:
2172 (WebCore::CSSMutableStyleDeclaration::cssText):
2174 2007-08-14 Sam Weinig <sam@webkit.org>
2176 Reviewed by Brady and Dr. Harrison.
2178 Fix typo. 'whitespace' property is spelled 'white-space'.
2180 * page/inspector/inspector.css:
2182 2007-08-13 Beth Dakin <bdakin@apple.com>
2186 Fix for <rdar://problem/5404899> REGRESSION: Mail crash in
2187 WebCore::FontFallbackList::fontDataAt() after dragging image into
2190 We were crashing because style information was not up-to-date. This
2191 patch fixes the problem in two ways:
2193 Style information was not up to date at the time of the crash
2194 because the document thought there was still a pending style sheet.
2195 The pending style sheet counter was incremented when a call to
2196 cloneNode from Mail cloned a style node with an imported style
2197 sheet. Because Mail disables the cache, the style sheet did not
2198 load immediately for the cloned node, and we do not check again to
2199 see if it has loaded in time to decrement the pending style sheet
2200 counter before the crash point. The fix here is only to increment
2201 the pending style sheet counter for elements that are already in
2203 * dom/StyleElement.cpp:
2204 (WebCore::StyleElement::insertedIntoDocument): If we have a CSS
2205 style sheet that is currently loading, increment the pending style
2206 sheet counter. This should keep the counter accurate in the case
2207 where a style node is cloned and then immediately inserted into the
2209 (WebCore::StyleElement::removedFromDocument): If we have a CSS
2210 style sheet that is currently loading, decrement the pending style
2211 sheet count. This is required to keep the correct balance, given
2213 (WebCore::StyleElement::createSheet): Only addPendingSheet() and
2214 checkLoaded() if we are in the document.
2216 Here is Darin's original fix. It seems worth keeping this fix too.
2217 Font style information should not cause a crash if there are still
2218 pending style sheets. This is good belt-and-suspenders in case
2219 there is another way to run into this bug with a wacky timing
2221 * css/CSSStyleSelector.cpp:
2222 (WebCore::CSSStyleSelector::styleForElement): Update the font.
2224 2007-08-13 Alexey Proskuryakov <ap@webkit.org>
2228 http://bugs.webkit.org/show_bug.cgi?id=14635
2229 rdar://problem/5340188
2230 Uploading file with non-ASCII character in path fails
2232 File upload cannot be tested in DumpRenderTree.
2234 * html/HTMLFormElement.cpp:
2235 (WebCore::pathGetFilename): A cross-platform helper that extracts a file name from a path.
2236 (WebCore::HTMLFormElement::formData): Use the above helper instead of code that doesn't
2239 2007-08-13 Alexey Proskuryakov <ap@webkit.org>
2243 http://bugs.webkit.org/show_bug.cgi?id=14951
2244 REGRESSION: page interpreted as UTF-8 because of stray <?xml> after <head>
2246 Test: fast/encoding/misplaced-xml-declaration.html
2248 * loader/TextResourceDecoder.cpp:
2249 (WebCore::TextResourceDecoder::checkForHeadCharset): Only honor XML declaration
2250 at the very beginning of the file.
2252 2007-08-13 Oliver Hunt <oliver@apple.com>
2256 Correct accidentally modified code.
2258 * platform/mac/FontDataMac.mm:
2259 (WebCore::FontData::platformInit):
2261 2007-08-13 Adele Peterson <adele@apple.com>
2265 Fix for http://bugs.webkit.org/show_bug.cgi?id=14746
2266 <rdar://problem/5401041> REGRESSION: Form state not saved for forms that submit via HTTPS even if they do not contain a password field
2268 * loader/FrameLoader.cpp: (WebCore::FrameLoader::saveDocumentState): Restore our old behavior that will save form state for secure forms.
2269 This will also match Firefox behavior.
2271 * dom/Document.cpp: Removed secureFormAdded(), secureFormRemoved(), hasSecureForm() which are no longer used.
2273 * html/HTMLFormElement.cpp:
2274 (WebCore::HTMLFormElement::attach):
2275 (WebCore::HTMLFormElement::parseMappedAttribute):
2277 2007-08-13 Oliver Hunt <oliver@apple.com>
2281 <rdar://problem/5386183> REGRESSION (9A504-9A508): Underline of inline hole is too thin
2282 on Japanese DotMac page
2284 Hack the line metrics for the Hiragino font families so that they always allow space for
2285 the marked text underline.
2287 * platform/mac/FontDataMac.mm:
2288 (WebCore::FontData::platformInit):
2290 2007-08-13 David Hyatt <hyatt@apple.com>
2294 <rdar://problem/5400446> messed up content on calendar.yahoo.com and my.yahoo.com
2296 Fix some more bad assumptions about <html> being the first child of the document now that we
2297 properly support HTML5's model (where a comment node preceding <html> will in fact be its sibling).
2299 * html/HTMLParser.cpp:
2300 (WebCore::HTMLParser::handleError):
2301 (WebCore::HTMLParser::createHead):
2303 2007-08-13 Justin Garcia <justin.garcia@apple.com>
2307 <rdar://problem/5333725> -webkit-user-select: none makes selection difficult
2309 Let users create selections if they mouse down in a -webkit-user-select:none
2310 region, just (continue to) disallow selection endpoints in those regions, and
2311 don't paint those regions as selected if they are fully enclosed by a selection.
2312 For example, in xxyyyxx where x is -webkit-user-select:none, a user can mouse down
2313 between the first two xs and drag across yyy to the second two xs to create a
2314 selection xx^yyy^xx.
2316 * editing/SelectionController.cpp:
2317 (WebCore::SelectionController::selectAll): Allow selectAll inside a root
2318 that has -webkit-user-select:none, because it may contain content that
2319 is selectable (VisiblePosition and Selection creation will keep Selection
2320 endpoints out of -webkit-user-select:none regions).
2321 * page/EventHandler.cpp:
2322 (WebCore::EventHandler::selectClosestWordFromMouseEvent): Use canMouseDownStartSelect
2323 instead of the ambiguously named shouldSelect().
2324 (WebCore::EventHandler::handleMousePressEventTripleClick): Ditto.
2325 (WebCore::EventHandler::handleMousePressEventSingleClick): Ditto.
2326 (WebCore::EventHandler::updateSelectionForMouseDrag): Use canMouseDragExtendSelect.
2327 (WebCore::EventHandler::selectCursor): Paint an ibeam in -webkit-user-select:none regions,
2328 because you can click in those regions to create a selection.
2329 (WebCore::EventHandler::canMouseDownStartSelect): Now fires the selectStart event, and
2330 returns true in -webkit-user-select: none regions.
2331 (WebCore::EventHandler::canMouseDragExtendSelect): This is identical to
2332 canMouseDownStartSelect because of 12823, even though it seems strange that we would fire
2333 the selectStart event here.
2334 * page/EventHandler.h:
2335 * rendering/RenderObject.cpp:
2336 (WebCore::RenderObject::draggableNode): Only -webkit-user-select:ignore regions will
2337 prevent selection creation.
2338 * rendering/RenderObject.h:
2340 2007-08-13 Anders Carlsson <andersca@apple.com>
2344 <rdar://problem/5360748>
2345 REGRESSION (r21002-r21003): Flash widget sniffer doesn't work (affects iWeb)
2347 Don't check whether the document is being parsed or not, because the node list
2348 could be accessed after the document has finished parsing.
2351 (WebCore::Node::registerNodeList):
2353 2007-08-13 Lars Knoll <lars@trolltech.com>
2357 no need to update regions that are not visible on the webpage.
2359 * platform/qt/ScrollViewQt.cpp:
2360 (WebCore::ScrollView::updateContents):
2362 2007-08-12 Maciej Stachowiak <mjs@apple.com>
2364 Reviewed by Darin and Sam.
2366 <rdar://problem/5395213> cross-domain access to individual components of location object should be denied.
2368 * bindings/js/kjs_window.cpp:
2369 (KJS::Location::put): Add the appropriate cross-domain access checks.
2371 2007-08-12 Darin Adler <darin@apple.com>
2373 Reviewed by John Sullivan.
2375 - fix <rdar://problem/5403724> REGRESSION: text inputs are not scrolled to make inline input visible (14912)
2377 * editing/Editor.h: Made setIgnoreMarkedTextSelectionChange no longer inline.
2378 It now has a side effect of revealing the selection when you set it to false.
2379 Added private revealSelectionAfterEditingOperation helper.
2380 * editing/Editor.cpp:
2381 (WebCore::Editor::deleteRange): Calls revealSelectionAfterEditingOperation instead
2382 of calling m_frame->revealSelection directly.
2383 (WebCore::Editor::replaceSelectionWithFragment): Ditto.
2384 (WebCore::Editor::insertOrderedList): Ditto.
2385 (WebCore::Editor::insertUnorderedList): Ditto.
2386 (WebCore::Editor::increaseSelectionListLevel): Ditto.
2387 (WebCore::Editor::increaseSelectionListLevelOrdered): Ditto.
2388 (WebCore::Editor::increaseSelectionListLevelUnordered): Ditto.
2389 (WebCore::Editor::decreaseSelectionListLevel): Ditto.
2390 (WebCore::Editor::insertLineBreak): Ditto.
2391 (WebCore::Editor::insertParagraphSeparator): Ditto.
2392 (WebCore::Editor::replaceMarkedText): Ditto.
2393 (WebCore::Editor::revealSelectionAfterEditingOperation): Added. Calls revealSelection,
2394 unless we are in the ignoreMarkedTextSelectionChange state. If we are in that state,
2395 we're in the middle of a composite editing operation and we shouldn't try to scroll
2396 to reveal the selection until the operation is done.
2397 (WebCore::Editor::setIgnoreMarkedTextSelectionChange): Made no longer inline. If
2398 changing the state from true to false, then calls revealSelectionAfterEditingOperation.
2400 * WebCore.exp: Add new entry point for no-longer-inline setter function.
2402 2007-08-12 Geoffrey Garen <ggaren@apple.com>
2404 Reviewed by Maciej Stachowiak, Dave Hyatt.
2406 Changed the dead resource LRU-SP algorithm to measure an object's
2407 total size, not just its encoded size. This will allow us to make
2408 better decisions about what data to evict when the cache is small. For
2409 example, the PLT can now run with a 16MB cache without fully evicting
2412 (Previously, we had assumed that decoded size would be an OK estimate
2413 of encoded size, but that is not true of GIF, whose decoded size can be
2414 orders of magnitude greater than its encoded size.)
2416 Subtly, destroying a resource's decoded data now increases its recency
2417 by moving it to the head of a smaller LRU list. This is slightly odd,
2418 but, since all resources get the same treatment, it shouldn't hurt
2419 the eviction algorithm.
2421 * history/PageCache.cpp:
2422 (WebCore::PageCache::releaseAutoreleasedPagesNow): Make sure that a
2423 dead resource eviction doesn't happen until we've released all of our
2424 dead pages. Otherwise, the cache will make terrible decisions about
2425 what to evict because all of our dead resources will seem live.
2428 (WebCore::Cache::Cache):
2429 (WebCore::Cache::pruneLiveResources):
2430 (WebCore::Cache::pruneDeadResources): Removed call to
2431 removeFromLiveDecodedResourcesList because this happens automatically
2432 now as a part of the process of changing the resource's decoded size.
2433 (WebCore::Cache::lruListFor): *** The key change. *** Compute the
2434 appropriate LRU list based on total size, not encoded size.
2435 (WebCore::Cache::dumpLRULists): Added debug logging function to help
2436 visualize the cache.
2439 (WebCore::Cache::setDeadResourcePruneEnabled):
2440 (WebCore::Cache::deadResourcePruneEnabled):
2442 * loader/CachedImage.cpp: Moved decoded size tracking code from here
2443 up into the base class. Currently, only CachedImage has a use for that
2444 functionality, but other subclasses might need it in the future, and
2445 the base class is already responsible for similar code related to
2446 encoded size tracking.
2447 (WebCore::CachedImage::decodedSizeChanged):
2448 * loader/CachedImage.h:
2450 * loader/CachedResource.cpp:
2451 (WebCore::CachedResource::CachedResource):
2452 (WebCore::CachedResource::setDecodedSize): Move us in the LRU-SP list
2453 just like setEncodedSize does, since decoded size counts now, too.
2454 (WebCore::CachedResource::setEncodedSize): Changed slightly to match
2455 the style of setDecodedSize.
2457 * loader/CachedResource.h:
2458 (WebCore::CachedResource::decodedSize):
2460 2007-08-11 Mitz Pettel <mitz@webkit.org>
2464 - fix http://bugs.webkit.org/show_bug.cgi?id=13670
2465 <rdar://problem/5399619> Table misrender when one of the TDs has width=100%
2467 Tests: fast/table/100-percent-cell-width.html
2468 fast/table/percent-widths-stretch.html
2470 * rendering/AutoTableLayout.cpp:
2471 (WebCore::AutoTableLayout::calcPrefWidths): Changed the value used instead of
2472 0% to avoid division by zero from 1% to less than 0.01%. Removed code that
2473 added 0.5px to non-percent widths when calculating the scaling factor. The
2474 latter change is covered by the percent-widths-stretch test, where the new
2475 results match both WinIE 7 and Firefox 3.
2477 2007-08-11 Darin Adler <darin@apple.com>
2481 - fix <rdar://problem/5266535> REGRESSION: <img> inside <map> no longer allowed in strict mode
2482 (breaks chemicalelements.com)
2484 Test: fast/parser/strict-img-in-map.html
2486 * html/HTMLMapElement.cpp: (WebCore::HTMLMapElement::checkDTD): Removed FIXME saying this
2487 code is strange, since this code matches the HTML 4 specification almost exactly. Made
2488 <img> elements allowed even in strict mode and added small comments to clarify what comes
2489 from the DTD and what is non-standard.
2491 2007-08-11 Holger Hans Peter Freyther <zecke@selfish.org>
2495 Implement passing events to a subframe. The code is copied from
2496 the windows port and passSubframeEventToSubframe was removed as it
2497 is not called and it is not avilable in the windows port as well.
2499 * page/gdk/EventHandlerGdk.cpp:
2500 (WebCore::EventHandler::passMousePressEventToSubframe):
2501 (WebCore::EventHandler::passMouseMoveEventToSubframe):
2502 (WebCore::EventHandler::passMouseReleaseEventToSubframe):
2504 2007-08-11 Holger Hans Peter Freyther <zecke@selfish.org>
2508 GdkEventKey::string is not supposed to be used. The length
2509 of this string is zero for non ascii characters. Use the
2510 gdk_unicode_to_keyval to convert the keyval to a UChar and construct
2511 a String. This change makes it possible to input non ascii
2514 * platform/gdk/KeyEventGdk.cpp:
2515 (WebCore::keyIdentifierForGdkKeyCode):
2516 (WebCore::singleCharacterString):
2517 (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2519 2007-08-11 Andrew Wellington <proton@wiretapped.net>
2521 Reviewed by Mark Rowe.
2523 Fix http://bugs.webkit.org/show_bug.cgi?id=14645
2524 getPropertyValue should be case insensitive
2526 When we get the propertyID for a given string we convert to lowercase.
2528 This also applies to setProperty, removeProperty and others.
2530 * css/CSSStyleDeclaration.cpp:
2531 (WebCore::propertyID):
2533 2007-08-11 Mark Rowe <mrowe@apple.com>
2535 Build fix. Change "#ifdef PLATFORM(GDK)" to "#if PLATFORM(GDK)".
2537 * page/FrameView.cpp:
2540 2007-08-11 Holger Hans Peter Freyther <zecke@selfish.org>
2544 Copy the WebFrame::layoutIfNeededRecursive method of the windows port
2545 to FrameView to be used by the Gtk+ port. Simplify the implementation due
2546 moving it to the FrameView class.
2548 Implement the ScrollView::children() method for the Gtk+ port and make it
2549 available to the FrameView as children() is used within the layoutIfNeededRecursive method.
2551 * page/FrameView.cpp:
2552 (WebCore::FrameView::layoutIfNeededRecursive):
2554 * platform/ScrollView.h:
2555 * platform/gdk/ScrollViewGdk.cpp:
2557 2007-08-11 Holger Hans Peter Freyther <zecke@selfish.org>
2561 To fix text selection make the PlatformMouseEvent set the pressed
2562 button even when moving the mouse.
2564 Add building of the WebKit::DragClient stubs as they are needed to
2565 make text selection work.
2568 * platform/gdk/MouseEventGdk.cpp:
2569 (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2571 2007-08-10 Anders Carlsson <andersca@apple.com>
2573 Reviewed by Darin and Maciej.
2575 <rdar://problem/5360748>
2576 REGRESSION(r21002-r21003) Flash widget sniffer doesn't work
2578 Add a per-document NodeList counter. When parsing, only call notifyNodeListsChildrenChanged
2579 if the document has node lists. Also, make sure to reset the cache when the node list count has
2580 been 0 and a new node list is registered to avoid any stale cache information.
2582 * dom/ContainerNode.cpp:
2583 (WebCore::ContainerNode::addChild):
2585 (WebCore::Document::Document):
2587 (WebCore::Document::addNodeList):
2588 (WebCore::Document::removeNodeList):
2589 (WebCore::Document::hasNodeLists):
2591 (WebCore::Node::registerNodeList):
2592 (WebCore::Node::unregisterNodeList):
2594 2007-08-10 Timothy Hatcher <timothy@apple.com>
2598 <rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit
2600 Disable NPObject use in 64-bit on Mac OS X.
2602 * Configurations/WebCore.xcconfig: Add a framework search path to the sub-framworks of Carbon.
2603 * WebCore.xcodeproj/project.pbxproj: Filter out the Frame::windowScriptNPObject() symbol in 64-bit.
2604 * bindings/objc/DOM.mm:
2605 (-[DOMElement _NPObject]): Return null in 64-bit.
2606 * config.h: Set WTF_USE_NPOBJECT to 0 in 64-bit Mac OS X.
2608 (WebCore::Frame::cleanupScriptObjects): Add more #if USE(NPOBJECT) blocks where needed.
2609 * page/Frame.h: Ditto.
2610 * page/mac/FrameMac.mm:
2611 (WebCore::Frame::createScriptInstanceForWidget): Ditto.
2612 * page/mac/WebCoreFrameBridge.h: Ditto.
2613 * page/mac/WebCoreFrameBridge.mm: Ditto.
2615 2007-08-10 Mitz Pettel <mitz@webkit.org>
2619 - fix <rdar://problem/5397344> http://bugs.webkit.org/show_bug.cgi?id=14911
2620 REGRESSION: Clicking in pasted text doesn't position the insertion point correctly
2622 Test: editing/selection/inline-closest-leaf-child.html
2624 * rendering/RootInlineBox.cpp:
2625 (WebCore::RootInlineBox::closestLeafChildForXPos): Return the last leaf if
2626 it's the closest match, or if no other leaf matches (for example if all
2627 leaves are list markers or non-editable where editable is required).
2629 2007-08-10 Anders Carlsson <andersca@apple.com>
2633 <rdar://problem/5390568>
2634 REGRESSION: -[WebFrame loadHTMLString:baseURL:] leaks the data source.
2636 Revert the fix for <rdar://problem/5133420> which caused us to not cancel
2637 substitute data loads. It's better to remove the assertion in the WebKit layer.
2639 * loader/ResourceLoader.cpp:
2640 (WebCore::ResourceLoader::didCancel):
2642 2007-08-10 Sam Weinig <sam@webkit.org>
2644 Rubber-stamped by Adam Roben.
2646 Fix Windows, Qt and Gtk build.
2649 * WebCore.vcproj/WebCore.vcproj:
2651 2007-08-09 Sam Weinig <sam@webkit.org>
2655 Fix for <rdar://problem/5395618>
2657 Use checkNodeSecurity when setting the 'src' or 'location' attribute of an
2658 iframe or frame element.
2660 * WebCore.xcodeproj/project.pbxproj:
2661 * bindings/js/JSAttrCustom.cpp: Added.
2662 (WebCore::JSAttr::setValue): Call checkNodeSecurity for attributes with a current iframe or frame
2663 ownerElement when setting src to a javascript: URL.
2664 * bindings/js/JSElementCustom.cpp: Added.
2665 (WebCore::allowSettingSrcToJavascriptURL):
2666 (WebCore::JSElement::setAttribute): Call checkNodeSecurity when element is a frame or iframe and
2667 setting he src attribute to a javascript: URL.
2668 (WebCore::JSElement::setAttributeNode): Ditto.
2669 (WebCore::JSElement::setAttributeNS): Ditto.
2670 (WebCore::JSElement::setAttributeNodeNS): Ditto.
2671 * bindings/js/JSHTMLFrameElementCustom.cpp: Added.
2672 (WebCore::allowSettingJavascriptURL):
2673 (WebCore::JSHTMLFrameElement::setSrc): Call checkNodeSecurity when setting to a javascript: URL.
2674 (WebCore::JSHTMLFrameElement::setLocation): Ditto.
2675 * bindings/js/JSHTMLIFrameElementCustom.cpp: Added.
2676 (WebCore::JSHTMLIFrameElement::setSrc): Call checkNodeSecurity when setting to a javascript: URL.
2677 * bindings/scripts/CodeGeneratorJS.pm: Add support for [CustomGetter] and [CustomSetter]
2680 * html/HTMLFrameElement.idl:
2681 * html/HTMLIFrameElement.idl:
2683 2007-08-10 Holger Hans Peter Freyther <zecke@selfish.org>
2687 Make the containingWindow a GtkContainer and make use of the
2688 GtkWidget::window instead of the GtkLayout::bin_window.
2690 * platform/Widget.h:
2691 * platform/gdk/PlatformScreenGdk.cpp:
2692 (WebCore::screenDepth):
2693 * platform/gdk/ScrollViewGdk.cpp:
2694 (WebCore::ScrollView::updateContents):
2695 (WebCore::ScrollView::update):
2696 * platform/gdk/WidgetGdk.cpp:
2697 (WebCore::Widget::setContainingWindow):
2698 (WebCore::Widget::setCursor):
2700 2007-08-10 Simon Hausmann <hausmann@kde.org>
2704 Revert r24699 as it broke timers. The precision of QTime::toTime_t() is just seconds, which is not good enough. Revert back
2705 to the old implementation and use the simple implementation of currentTime() from win/ for the Qt/Windows build (fingers crossed :)
2708 * platform/qt/SystemTimeQt.cpp:
2709 (WebCore::currentTime):
2711 2007-08-10 Simon Hausmann <hausmann@kde.org>
2715 Recognize .htm as valid extension for text/html.
2717 * platform/qt/MIMETypeRegistryQt.cpp:
2720 2007-08-10 Lars Knoll <lars@trolltech.com>
2724 remove an assertion that leads to crashes. The whole design of WidgetQt and ScrollViewQt needs to be reevaluated soon anyways.
2726 * platform/qt/ScrollViewQt.cpp:
2728 2007-08-10 Mark Rowe <mrowe@apple.com>
2732 * ForwardingHeaders/bindings/runtime_object.h: Added.
2734 2007-08-10 Simon Hausmann <hausmann@kde.org>
2738 Make sure -fno-strict-aliasing is also added for mkspecs like linux-g++-64.
2742 2007-08-10 Simon Hausmann <hausmann@kde.org>
2746 Enable JavaScript bindings for HTML Object/Applet elements in the Qt port.
2749 * bindings/js/kjs_dom.cpp:
2750 * html/HTMLAppletElement.h:
2751 * html/HTMLEmbedElement.h:
2752 * page/qt/FrameQt.cpp:
2753 (WebCore::Frame::createScriptInstanceForWidget):
2755 2007-08-10 Mitz Pettel <mitz@webkit.org>
2757 Reviewed by Dave Hyatt.
2759 - fix http://bugs.webkit.org/show_bug.cgi?id=14798
2760 Incorrect bidi reordering of neutrals and digits after RTL embed
2761 and other bugs in the bidi algorithm.
2763 Test: fast/text/international/bidi-neutral-run.html
2765 Fixed several bugs in resolving the embedding level of runs of neutral
2766 characters. Changed the logic to rely on the eor direction only for
2767 the number types, and otherwise consider the last strong type.
2769 * platform/BidiContext.h:
2770 (WebCore::BidiContext::BidiContext): Added an ASSERT.
2771 * platform/BidiResolver.h:
2773 (WebCore::::createBidiRunsForLine):
2774 * platform/graphics/GraphicsContext.cpp:
2775 (WebCore::TextRunIterator::atEnd): Changed to return true instead of
2776 crashing when called on the empty iterator.
2778 2007-08-09 Mark Rowe <mrowe@apple.com>
2782 <rdar://problem/5400709> Versioning in debug and release builds should include minor and tiny version before +
2784 * Configurations/Version.xcconfig:
2785 * WebCore.xcodeproj/project.pbxproj: Add a shell script phase to make to dependency between
2786 Version.xcconfig and Info.plist explicit to Xcode.
2788 2007-08-09 Mitz Pettel <mitz@webkit.org>
2790 Reviewed by Justin Garcia.
2792 - fix http://bugs.webkit.org/show_bug.cgi?id=14347
2793 REGRESSION (r21291): Initiating a drag near the edge of a selection deselects it
2795 Test: editing/selection/contains-boundaries.html
2797 * editing/SelectionController.cpp:
2798 (WebCore::SelectionController::contains): Changed to return true for the
2799 selection boundaries too.
2801 2007-08-09 Mitz Pettel <mitz@webkit.org>
2803 Reviewed by Dave Hyatt.
2805 - fix http://bugs.webkit.org/show_bug.cgi?id=14742
2806 Document::recalcStyle(Force) called for every updateStyleIgnorePendingStylesheets while waiting for stylesheets
2807 <rdar://problem/5376306>
2809 updateStyleSelector() is normally called when something changes that factors
2810 into the style selector. However, updateLayoutIgnorePendingStylesheets() calls it for
2811 a different reason, namely to account for all the preceding changes that were ignored
2812 because of the early return in updateStyleSelector(). After that, the early return
2813 can no longer occur, so changes are accounted for as they happen, and
2814 updateLayoutIgnorePendingStylesheets() does not need to call updateStyleSelector()
2818 (WebCore::Document::updateLayoutIgnorePendingStylesheets): Call updateStyleSelector()
2819 only before the first layout.
2821 2007-08-09 Mitz Pettel <mitz@webkit.org>
2823 Reviewed by Adam Roben.
2825 - fix http://bugs.webkit.org/show_bug.cgi?id=14362
2826 Opening a select list always highlights first element in list
2828 * platform/win/PopupMenuWin.cpp:
2829 (WebCore::PopupWndProc): Track the mouse only inside the popup.
2831 2007-08-09 Mitz Pettel <mitz@webkit.org>
2833 Reviewed by Dave Hyatt.
2835 - fix http://bugs.webkit.org/show_bug.cgi?id=14875
2836 Textarea with nowrap - left/right nav, Up/down nav both hide text
2838 Test: fast/layers/scroll-rect-to-visible.html
2840 * rendering/RenderLayer.cpp:
2841 (WebCore::RenderLayer::scrollRectToVisible): Account for borders and scroll bars.
2843 2007-08-09 Geoffrey Garen <ggaren@apple.com>
2845 Reviewed by Dave Hyatt.
2847 Refactored live decoded resource eviction to be more modular /
2850 This fixes one known place where we forgot to hook into the live
2851 decoded eviction mechanism -- canvas. There might be other, unknown
2852 places. In a canvas test page, which I broke off from the Safari
2853 pageout test, I saw an RPRVT reduction of ~10MB.
2856 - "m_lastLiveAccessTime" => "m_lastDecodedAccessTime" because the data
2857 point we're recording is access to the resource in decoded form.
2859 - "liveResourceAccessed" => "didAccessDecodedData" for the same reason.
2861 - "pruneAllResources" => "pruneDeadResources" because this function
2862 does not prune live resources.
2865 Instead of updating cache metadata at the call site whenver drawing an
2866 image, just have an image notify its observer whenever it draws. The
2867 observer, which is a CachedResource, can then update the metadata.
2869 * loader/Cache.cpp: Renames
2870 * loader/Cache.h: Removed stale declarations, updated comments
2871 * loader/CachedImage.cpp:
2872 (WebCore::CachedImage::didDraw): Implemented didDraw to update cache
2873 metadata whenever our image draws.
2874 * loader/CachedImage.h: Grouped parts of the ImageObserver interface.
2875 * loader/CachedResource.cpp:
2876 (WebCore::CachedResource::CachedResource):
2877 (WebCore::CachedResource::deref):
2878 (WebCore::CachedResource::didAccessDecodedData): Made this function
2879 slightly more modular by allowing the caller to provide a time stamp.
2880 In theory, not all CachedResources will necessarily want to use the
2881 current paint time stamp.
2882 * platform/graphics/cg/ImageCG.cpp:
2883 (WebCore::BitmapImage::draw): Notify our observer that we drew.
2884 (WebCore::Image::drawPattern): ditto
2885 * platform/graphics/cg/PDFDocumentImage.cpp:
2886 (WebCore::PDFDocumentImage::draw): ditto
2887 * platform/graphics/svg/SVGImage.cpp:
2888 (WebCore::SVGImage::draw): ditto
2890 Removed old code at image drawing call sites:
2892 * rendering/RenderBox.cpp:
2893 (WebCore::RenderBox::paintBackgroundExtended):
2894 * rendering/RenderImage.cpp:
2895 (WebCore::RenderImage::paint):
2896 * rendering/RenderListMarker.cpp:
2897 (WebCore::RenderListMarker::paint):
2898 * rendering/RenderObject.cpp:
2899 (WebCore::RenderObject::paintBorderImage):
2901 2007-08-10 Holger Hans Peter Freyther <zecke@selfish.org>
2905 Move the various *ClientGdk.{h,cpp} away from the WebCore directory as
2906 of http://bugs.webkit.org/show_bug.cgi?id=14727.
2909 * platform/gdk/TemporaryLinkStubs.cpp:
2911 2007-08-09 Anders Carlsson <andersca@apple.com>
2915 <rdar://problem/5400029> iframes with an image src rarely load image
2917 Don't try to shrink standalone images in subframes. The resize event is not
2918 sent for subframes which screws up the shrink-to-fit logic.
2920 * loader/ImageDocument.cpp:
2921 (WebCore::ImageDocument::createDocumentStructure):
2922 (WebCore::ImageDocument::imageChanged):
2923 (WebCore::ImageDocument::shouldShrinkToFit):
2924 * loader/ImageDocument.h:
2926 2007-08-10 Holger Hans Peter Freyther <zecke@selfish.org>
2930 Implement FrameLoaderClientGdk::createFrame mostly by copying
2931 the windows implementation. A method similiar to WebFrame::loadURLIntoChild
2932 was not introduced instead we have a simplified version similiar to the
2935 Remove building of WebKit/gtk/webkitgtkframedata.{cpp,h}.
2938 * loader/gdk/FrameLoaderClientGdk.cpp:
2939 (WebCore::FrameLoaderClientGdk::createFrame):
2941 2007-08-10 Holger Hans Peter Freyther <zecke@selfish.org>
2945 Use the ScrollView/Widget design of the Windows port to only use one
2946 native window for the whole page. This will make it possible to implement
2947 FrameLoaderClientGdk::createFrame.
2949 In contrast to the windows port the ScrollBars are GtkWidgets. To paint them
2950 at the right position we need to position them correctly. To not scroll the
2951 ScrollBar's belonging to the ScrollView a ScrollViewScrollbar is introduced with
2952 a different geometryChanged method.
2954 To allow the Gtk+ way of scrolling the ScrollView allows to get GtkAdjustments
2955 set. In this case no ScrollViewScrollbar will be created.
2958 * platform/ScrollView.h:
2959 * platform/Widget.h:
2960 * platform/gdk/PlatformScreenGdk.cpp:
2961 (WebCore::screenDepth):
2962 * platform/gdk/PlatformScrollBar.h:
2963 * platform/gdk/PlatformScrollBarGdk.cpp:
2964 (PlatformScrollbar::PlatformScrollbar):
2965 (PlatformScrollbar::~PlatformScrollbar):
2966 (PlatformScrollbar::setRect):
2967 (PlatformScrollbar::geometryChanged):
2968 * platform/gdk/ScrollViewGdk.cpp:
2969 (WebCore::ScrollView::ScrollViewPrivate::ScrollViewPrivate):
2970 (WebCore::ScrollView::ScrollViewPrivate::~ScrollViewPrivate):
2971 (WebCore::ScrollViewScrollbar::ScrollViewScrollbar):
2972 (WebCore::ScrollViewScrollbar::geometryChanged):
2973 (WebCore::ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar):
2974 (WebCore::ScrollView::ScrollViewPrivate::setHasVerticalScrollbar):
2975 (WebCore::ScrollView::ScrollViewPrivate::scrollBackingStore):
2976 (WebCore::ScrollView::ScrollViewPrivate::adjustmentChanged):
2977 (WebCore::ScrollView::ScrollViewPrivate::valueChanged):
2978 (WebCore::ScrollView::ScrollViewPrivate::windowClipRect):
2979 (WebCore::ScrollView::setGtkAdjustments):
2980 (WebCore::ScrollView::updateContents):
2981 (WebCore::ScrollView::update):
2982 (WebCore::ScrollView::visibleWidth):
2983 (WebCore::ScrollView::resizeContents):
2984 (WebCore::ScrollView::contentsX):
2985 (WebCore::ScrollView::scrollOffset):
2986 (WebCore::ScrollView::maximumScroll):
2987 (WebCore::ScrollView::scrollBy):
2988 (WebCore::ScrollView::suppressScrollbars):
2989 (WebCore::ScrollView::setHScrollbarMode):
2990 (WebCore::ScrollView::setVScrollbarMode):
2991 (WebCore::ScrollView::setScrollbarsMode):
2992 (WebCore::ScrollView::setFrameGeometry):
2993 (WebCore::ScrollView::addChild):
2994 (WebCore::ScrollView::removeChild):
2995 (WebCore::ScrollView::scrollRectIntoViewRecursively):
2996 (WebCore::ScrollView::wheelEvent):
2997 (WebCore::ScrollView::updateScrollbars):
2998 (WebCore::ScrollView::windowToContents):
2999 (WebCore::ScrollView::contentsToWindow):
3000 (WebCore::ScrollView::scrollbarUnderMouse):
3001 (WebCore::ScrollView::convertChildToSelf):
3002 (WebCore::ScrollView::convertSelfToChild):
3003 (WebCore::ScrollView::paint):
3004 (WebCore::ScrollView::geometryChanged):
3005 (WebCore::ScrollView::scroll):
3006 (WebCore::ScrollView::addToDirtyRegion):
3007 (WebCore::ScrollView::scrollBackingStore):
3008 (WebCore::ScrollView::updateBackingStore):
3009 * platform/gdk/WidgetGdk.cpp:
3010 (WebCore::WidgetPrivate::gdkDrawable):
3011 (WebCore::Widget::Widget):
3012 (WebCore::Widget::setContainingWindow):
3013 (WebCore::Widget::containingWindow):
3014 (WebCore::Widget::frameGeometry):
3015 (WebCore::Widget::setFrameGeometry):
3016 (WebCore::Widget::setParent):
3017 (WebCore::Widget::parent):
3018 (WebCore::Widget::setCursor):
3019 (WebCore::Widget::show):
3020 (WebCore::Widget::hide):
3021 (WebCore::Widget::removeFromParent):
3022 (WebCore::Widget::paint):
3023 (WebCore::Widget::invalidate):
3024 (WebCore::Widget::invalidateRect):
3025 (WebCore::Widget::convertToContainingWindow):
3026 (WebCore::Widget::convertFromContainingWindow):
3027 (WebCore::Widget::convertChildToSelf):
3028 (WebCore::Widget::convertSelfToChild):
3029 (WebCore::Widget::suppressInvalidation):
3030 (WebCore::Widget::setSuppressInvalidation):
3032 2007-08-09 Adele Peterson <adele@apple.com>
3034 Fix by Brady, reviewed by me.
3036 Fix for <rdar://problem/5380697> connection:willSendRequest:redirectResponse: is called on every NSURLConnection
3038 * platform/network/mac/ResourceHandleMac.mm: (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]):
3039 Work around a behavior change in CFNetwork where willSendRequest gets called more often by returning early.
3041 2007-08-09 Darin Adler <darin@apple.com>
3045 - fix <rdar://problem/4889753> REGRESSION: Selection doesn't continue with drag selecting
3046 when autoscrolling vertically (in Notes as well as Safari)
3048 The bug doesn't happen inside DumpRenderTree, so I was unable to make an automated
3051 * manual-tests/autoscroll-when-outside-window.html: Added.
3053 * rendering/RenderLayer.cpp: (WebCore::RenderLayer::autoscroll): Removed unneeded null
3054 check for the layer's renderer and the document, neither of which can be null. Call
3055 the new updateSelectionForMouseDrag instead of doing selection updating here.
3057 * page/EventHandler.h:
3058 * page/EventHandler.cpp:
3059 (WebCore::EventHandler::handleMouseDraggedEvent): Refactored most of the logic
3060 about updating the selection into updateSelectionForMouseDrag.
3061 (WebCore::EventHandler::updateSelectionForMouseDrag): Added. The public version of
3062 this function takes no parameters, and is for use from auto-scrolling code. The
3063 private version of this function takes node and point parameters and contains the
3064 shared code, including everything from updateSelectionForMouseDragOverPosition.
3065 Aside from the code motion, variable name changes, and sharing more code, this
3066 differs from the old code in RenderLayer::autoscroll in the following ways:
3068 1) The old code did hit testing only in the layer that was auto-scrolling,
3069 and the new code instead starts the hit testing at the root layer, which is
3070 better because it's the same thing we do for mouse moved events. Further,
3071 the code to do this by calling convertToLayerCoords had a bug because the
3072 x and y variables were uninitialized.
3073 2) The old code passed false for active to HitTestRequest, which was wrong.
3074 The new code passes true. This flag needs to be true for hit testing done
3075 while the mouse is down and false for hit testing done while the mouse is up.
3076 3) The old code did not have the SVG-specific logic to match the mouse moved case.
3077 4) The old code wouldn't do any selection updating if the return value from hitTest
3078 was false, which is incorrect. The new code ignores the return value as it should.
3080 2007-08-08 Beth Dakin <bdakin@apple.com>
3082 Reviewed by Geoff Garen.
3084 Fx for <rdar://problem/5286443>, http://bugs.webkit.org/
3085 show_bug.cgi?id=14268 REGRESSION: Radio buttons don't stay selected
3086 due to unclosed <label> tags
3088 This patch maintains the behavior that allows <label> tags to nest.
3089 This matches WinIE, and appears to match the spec, since the spec
3090 does not explicitly say that they cannot nest. It fixes the bug
3091 instead by calling setDefaultHandled() in two places it should have
3092 been called anyway. This keeps the appropriate button checked as
3095 * html/HTMLInputElement.cpp:
3096 (WebCore::HTMLInputElement::postDispatchEventHandler):
3097 * html/HTMLLabelElement.cpp:
3098 (WebCore::HTMLLabelElement::defaultEventHandler):
3100 2007-08-08 Justin Garcia <justin.garcia@apple.com>
3104 <rdar://problem/5387578> Crash at ReplaceSelectionCommand::doApply() when pasting just after table cell content
3106 ReplaceSelectionCommand::doApply() inserts a line break before insertion
3107 to prevent block nesting. InsertLineBreakCommand::doApply was accidently
3108 destroying a text node when it removed insignificant whitespace and then
3109 setting a nil endingSelection().
3111 * editing/InsertLineBreakCommand.cpp:
3112 (WebCore::InsertLineBreakCommand::doApply): If insignificant whitespace
3113 removal removes textNode from the document, insert a text node containing
3114 the non-breaking space we were attempting to insert and then insert it
3115 at the position that the removed textNode occupied.
3117 2007-08-08 Geoffrey Garen <ggaren@apple.com>
3119 Reviewed by Maciej Stachowiak.
3121 Added a thrash check to live decoded resource eviction.
3123 Here's the strategy: Stamp every image with its paint time. Don't evict
3124 a live decoded resource until another resource paints with a reasonably
3125 (1 second) larger time stamp.
3127 If no other resource paints, or another resource paints, but very soon
3128 after the resource in question, the resource in question is very likely
3129 to paint again soon. In fact, it's probably still on screen. So we
3130 leave it alone. (Previously, we evicted it on a timer, but that would
3131 evict a resource that was still on screen, hurting speed without
3132 helping memory use.)
3134 In theory, this algorithm allows a single large resource or closely
3135 related set of resources to linger in the live decoded cache even
3136 though the cache is over its limit. However, that can only happen as
3137 long as no other resource ever paints again, which guarantees an
3138 absolute cap on cache memory usage from then on. Also, the resources
3139 will only linger as long as they remain live. Upon going dead, they
3140 will flush. Also, these circumstances are so rare that they are almost
3141 impossible to encounter in the wild. So don't sweat it.
3143 Stop evicting if the next resource painted too recently:
3146 (WebCore::Cache::pruneLiveResources):
3147 * loader/CachedResource.cpp:
3148 (WebCore::CachedResource::CachedResource):
3149 (WebCore::CachedResource::liveResourceAccessed):
3150 * loader/CachedResource.h:
3152 Track the paint time stamp in Frame. We do this to give a consistent
3153 stamp to all resources painted in a single paint operation (in case the
3154 operation takes a significant amount of time), and to avoid excessive
3155 calls to system time functions, which hurt the PLT:
3158 (WebCore::Frame::paint):
3160 (WebCore::Frame::currentPaintTimeStamp):
3162 2007-08-08 Sam Weinig <sam@webkit.org>
3164 Reviewed by Adam Roben.
3166 Update project file to reflect the moving of character-sets.txt
3167 and make-charset-table.pl to platform/mac a while ago.
3169 * WebCore.xcodeproj/project.pbxproj:
3171 2007-08-08 Justin Garcia <justin.garcia@apple.com>
3173 Reviewed by Harrison.
3175 <rdar://problem/5390681> WebKit asserts when deleting To Do content selected with a double-click
3178 (WebCore::Position::trailingWhitespacePosition): Use VisiblePosition::characterAfter
3179 to look for a trailing space. The old code would incorrectly return a position before
3180 a non-editable space if it had a collapsed space before it.
3182 2007-08-08 Sam Weinig <sam@webkit.org>
3186 Make protocol and host compares case-insensitive.
3188 * bindings/js/kjs_window.cpp:
3189 (KJS::Window::isSafeScript):
3191 (WebCore::Document::initSecurityPolicyURL):
3192 * platform/DeprecatedString.cpp:
3193 (WebCore::equalIgnoringCase):
3194 * platform/DeprecatedString.h:
3195 (WebCore::equalIgnoringCase):
3197 2007-08-08 Justin Garcia <justin.garcia@apple.com>
3199 Reviewed by Harrison.
3201 <rdar://problem/5390681> WebKit asserts when deleting To Do content selected with a double-click
3204 (WebCore::Position::leadingWhitespacePosition): Added checks to prevent expansion across editable an boundary.
3205 (WebCore::Position::trailingWhitespacePosition): Ditto.
3207 2007-08-08 Adele Peterson <adele@apple.com>
3211 Fix for <rdar://problem/5393798> 100% reproducible crash in WebCore::Scrollbar::setValue
3213 * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEvent):
3214 If the hit testing originally determined the event was in a scrollbar,
3215 refetch the MouseEventWithHitTestResults in case the scrollbar widget was destroyed when the mouse event was handled.
3217 2007-08-08 Sam Weinig <sam@webkit.org>
3219 Reviewed by Geoff Garen.
3221 Fix for <rdar://problem/5354635>
3223 Match Firefox's model for data: URLs by not allowing them script access
3224 to any frames other then itself.
3226 * bindings/js/kjs_window.cpp:
3227 (KJS::Window::isSafeScript):
3229 (WebCore::Document::initSecurityPolicyURL):
3231 2007-08-08 Darin Adler <darin@apple.com>
3233 Reviewed by Kevin Decker.
3235 - fix for <rdar://problem/5390708> CrashTracer: [USER] 27 crashes in Safari at
3236 com.apple.WebCore: WTF::HashMap<etc>::set + 68, beneath pruneUnretainedIconsAtStartup
3238 * loader/icon/IconDatabase.cpp: (WebCore::IconDatabase::pruneUnretainedIconsOnStartup):
3239 Eliminate an unnecessary HashMap from the implementation; we can just use the
3240 m_pageURLToRetainCount map directly. This simplifies the code and allows us to handle
3241 the empty string, which otherwise poses a problem for HashMap.
3243 2007-08-08 Antti Koivisto <antti@apple.com>
3247 Fix for <rdar://problem/5391576>
3248 Malformed table innerHTML causes Safari to crash in HTMLParser::handleError (14894)
3250 Add null checks to protect against
3252 e.innerHTML = "<tr>text</tr>";
3254 type cases. Normal assumptions about document tree structure don't hold when parsing
3255 fragments. Results don't match Firefox in all cases. It seems to have some sort of
3256 anything-goes fragment parsing mode.
3258 * html/HTMLParser.cpp:
3259 (WebCore::HTMLParser::handleError):
3261 2007-08-07 Kevin McCullough <kmccullough@apple.com>
3263 Reviewed by Maciej and Hyatt.
3265 - <rdar://problem/4976879> REGRESSION: Safari doesn't work with Zimbra enhanced login.
3266 - Reverting a previous change, and modifying how documents are created so that we better match other browsers behavior with respect to namespaceURIs.
3268 * WebCore.xcodeproj/project.pbxproj:
3269 * dom/DOMImplementation.cpp:
3270 (WebCore::DOMImplementation::createDocument):
3272 (WebCore::Document::Document):
3273 (WebCore::Document::createElement):
3275 * html/HTMLDocument.cpp:
3276 (WebCore::HTMLDocument::createElement):
3277 * html/HTMLDocument.h:
3279 2007-08-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3281 Reviewed and landed by Brady
3283 Fixes <http://bugs.webkit.org/show_bug.cgi?id=13422>
3285 Bug 13422: REGRESSION: Page reload loses page position
3287 * loader/FrameLoader.cpp:
3288 (WebCore::FrameLoader::updateHistoryForReload):
3290 2007-08-08 Holger Hans Peter Freyther <zecke@selfish.org>
3294 Be paranoid and disconnect from the signal before going away.
3296 * platform/gdk/PlatformScrollBarGdk.cpp:
3297 (PlatformScrollbar::~PlatformScrollbar):
3299 2007-08-08 Holger Hans Peter Freyther <zecke@selfish.org>
3303 Use GraphicsContext::translatePoint in RenderThemeGdk to paint at the
3305 This is needed as the Gtk+ theming code does not know about the translation
3306 of the GraphicsContext.
3308 * platform/gdk/RenderThemeGdk.cpp:
3309 (WebCore::RenderThemeGdk::paintCheckbox):
3310 (WebCore::RenderThemeGdk::paintRadio):
3311 (WebCore::RenderThemeGdk::paintButton):
3313 2007-08-08 Holger Hans Peter Freyther <zecke@selfish.org>
3317 Implement Widget::paint for the Gtk port. This is needed to paint
3318 Widgets in z-order. The original GdkEventExpose is stored within the
3319 GraphicsContext and then used to draw the children. This is similiar
3320 to gtk_container_propagate_expose but we try to honor the GraphicsConntext
3323 * platform/gdk/WidgetGdk.cpp:
3324 (WebCore::Widget::paint):
3325 * platform/graphics/GraphicsContext.h:
3326 * platform/graphics/cairo/GraphicsContextCairo.cpp:
3327 (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
3328 (WebCore::GraphicsContext::setGdkExposeEvent):
3329 (WebCore::GraphicsContext::gdkExposeEvent):
3330 (WebCore::GraphicsContext::gdkDrawable):
3331 (WebCore::GraphicsContext::translatePoint):
3333 2007-08-08 Holger Hans Peter Freyther <zecke@selfish.org>
3335 Reviewed by Oliver Hunt.
3337 Implement PlatformScrollbar by calling ScrollBar::setValue from
3338 gtkValueChange connected to the value-changed signal of the
3340 Update 'value' of the GtkAdjustment in updateThumbPosition and
3341 set upper, page-increment, step-increment and page_size in
3342 updateThumbProportion.
3344 This is from bug http://bugs.webkit.org/show_bug.cgi?id=14795.
3346 * platform/gdk/PlatformScrollBar.h:
3347 * platform/gdk/PlatformScrollBarGdk.cpp:
3348 (PlatformScrollbar::PlatformScrollbar):
3349 (PlatformScrollbar::updateThumbPosition):
3350 (PlatformScrollbar::updateThumbProportion):
3351 (PlatformScrollbar::gtkValueChanged):
3353 2007-08-07 Geoffrey Garen <ggaren@apple.com>
3355 Reviewed by Maciej Stachowiak. Based on earlier review from Dave Hyatt.
3357 First chunk of work for <rdar://problem/5326009> Make non-browser
3358 WebKit clients have no memory cache, or a very tiny one
3362 Removed decodedSizeWillChange mechanism because my last patch to
3363 change the live resources list to a strict LRU model made that code
3366 Renamed "liveResourcesList" and related stuff =>
3367 "liveDecodedResourcesList" because only live resources with decoded
3368 data are kept in the list.
3370 * loader/CachedImage.cpp:
3371 (WebCore::CachedImage::decodedSizeChanged): Only add ourselves to the
3372 list if we're live, our decoded size has grown, and we're not in the
3373 list already. (Otherwise, either we're not live, we're not decoded,
3374 or we're already in the list.)
3376 * loader/CachedResource.cpp:
3377 (WebCore::CachedResource::liveResourceAccessed): Only re-insert
3378 ourselves into the list if we're already there. (In theory, this should
3379 be always, but it's a little more clear to check.)
3381 2007-08-08 Holger Hans Peter Freyther <zecke@selfish.org>
3385 Kill class FrameGdk and move the stubs to page/gdk/FrameGdk.cpp and the
3386 remainings into WebKitGtkFrame.
3387 The DRT functionality of class FrameGdk is currently lost.
3390 * loader/gdk/FrameLoaderClientGdk.cpp:
3391 * loader/gdk/FrameLoaderClientGdk.h:
3392 * page/gdk/FrameGdk.cpp: Renamed from WebCore/platform/gdk/FrameGdk.cpp.
3393 (WebCore::Frame::issueTransposeCommand):
3394 (WebCore::Frame::cleanupPlatformScriptObjects):
3395 (WebCore::Frame::dragImageForSelection):
3396 (WebCore::Frame::dashboardRegionsChanged):
3397 * platform/gdk/FrameGdk.h: Removed.
3398 * platform/gdk/TemporaryLinkStubs.cpp: Removed Frame stub, added the loadResourceIntoArray stub
3399 * platform/gdk/WidgetGdk.cpp:
3401 2007-08-08 Holger Hans Peter Freyther <zecke@selfish.org>
3405 Remove the event handling code and move it to WebKit/gtk/Api/webkitgtkpage.cpp
3407 * platform/gdk/FrameGdk.cpp:
3408 * platform/gdk/FrameGdk.h:
3410 2007-08-07 Holger Hans Peter Freyther <zecke@selfish.org>
3414 Switch from the generic union GdkEvent to the specific struct GdkEvent*. This is needed
3415 to make WebKitGtkPage handle the events by reimplementing the default handlers in the near
3418 * platform/PlatformKeyboardEvent.h:
3419 * platform/PlatformMouseEvent.h:
3420 * platform/PlatformWheelEvent.h:
3421 * platform/gdk/FrameGdk.cpp:
3422 (WebCore::FrameGdk::handleGdkEvent):
3423 * platform/gdk/KeyEventGdk.cpp:
3424 (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3425 * platform/gdk/MouseEventGdk.cpp:
3426 (WebCore::PlatformMouseEvent::PlatformMouseEvent):
3427 * platform/gdk/WheelEventGdk.cpp:
3428 (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3430 2007-08-07 George Staikos <staikos@kde.org>
3432 Some QStyles don't handle negative maximum well (crash)
3434 * platform/qt/PlatformScrollBarQt.cpp:
3435 (WebCore::PlatformScrollbar::paint):
3437 2007-08-07 Antti Koivisto <antti@apple.com>
3441 Fix <rdar://problem/5102553>
3442 Mail spins trying to display or edit a specific long plain text message in WebCore::TimerBase::...
3444 Calling removeLeftoverAnonymousBoxes() from RenderBlock::addChildToFlow() made adding children
3445 O(n^2) in simple cases (repeated <div><div></div></div> for example).
3447 I couldn't find any limited fix so here is a more complete one. It removes iterating/recursing
3448 removeLeftoverAnonymousBoxes() method altogether. Instead of hunting around wildly, just get
3449 rid of anonymous boxes with block children when they occur.
3451 * rendering/RenderBlock.cpp:
3452 (WebCore::RenderBlock::addChildToFlow):
3453 * rendering/RenderButton.h:
3454 (WebCore::RenderButton::removeLeftoverAnonymousBlock):
3455 * rendering/RenderContainer.cpp:
3456 (WebCore::RenderContainer::removeLeftoverAnonymousBlock):
3457 * rendering/RenderContainer.h:
3458 * rendering/RenderObject.cpp:
3459 (WebCore::RenderObject::handleDynamicFloatPositionChange):
3460 (WebCore::RenderObject::removeLeftoverAnonymousBlock):
3461 * rendering/RenderObject.h:
3462 * rendering/RenderTextControl.h:
3463 (WebCore::RenderTextControl::removeLeftoverAnonymousBlock):
3465 2007-08-06 Sam Weinig <sam@webkit.org>
3469 Fix for <rdar://problem/5354689>
3471 - Use document variable to determine permissions instead
3472 of traversing the frame tree.
3474 * bindings/js/kjs_window.cpp:
3475 (KJS::Window::isSafeScript):
3477 (WebCore::Document::Document):
3478 (WebCore::Document::initSecurityPolicyURL):
3480 (WebCore::Document::securityPolicyURL):
3481 * loader/FrameLoader.cpp:
3482 (WebCore::FrameLoader::setOpener): We must re-initialize the
3483 safeScript URL when setting the opener because the opener was
3484 not known at Document construction.
3486 2007-08-06 David Hyatt <hyatt@apple.com>
3488 Make sure to clear out the parent of the ellipsis box so that it doesn't
3489 trigger the consistency check for line boxes.
3494 * rendering/RootInlineBox.cpp:
3495 (WebCore::RootInlineBox::detachEllipsisBox):
3497 2007-08-06 David Hyatt <hyatt@apple.com>
3499 Back out fix for <rdar://problem/5366582> and replace it with the correct
3500 fix. Make sure to delete the line box tree before splitting an inline flow
3501 into a continuation. The added layout test for the original checkin covers
3506 * rendering/RenderBlock.cpp:
3507 (WebCore::RenderBlock::makeChildrenNonInline):
3510 * rendering/RenderFlow.cpp:
3511 (WebCore::RenderFlow::destroy):
3514 * rendering/RenderInline.cpp:
3515 (WebCore::RenderInline::splitFlow):
3518 2007-08-06 Geoffrey Garen <ggaren@apple.com>
3520 Reviewed by Darin Adler.
3522 Touching a file to force a re-build.
3524 2007-08-06 Darin Adler <darin@apple.com>
3528 * rendering/RenderText.h: (WebCore::RenderText::checkConsistency):
3531 2007-08-06 Darin Adler <darin@apple.com>
3535 - fix <rdar://problem/5366582> crash on it.eurosport.yahoo.com page
3537 Test: fast/dynamic/inline-to-block-crash.html
3539 I added some consistency checks for the line box tree, which helped me figure out
3540 what was going on with this bug pretty quickly.
3542 * rendering/RenderBlock.cpp: (WebCore::RenderBlock::makeChildrenNonInline):
3543 This is the actual fix. If the block needs layout, then don't try to delete the line
3544 box tree because it's going to be rebuilt as part of layout. More importantly, the
3545 child list in the tree is no good, so we will crash if we try to delete here.
3547 * rendering/RenderFlow.cpp: (WebCore::RenderFlow::destroy):
3548 Here's a second fix. We have the same issue in the code that handles anonymous
3549 blocks -- if it's already running as part of layout, we can't walk through the
3550 already partly destroyed line box tree. This crashed in one of the layout tests.
3552 * rendering/InlineBox.h: Made more fields private, since I wanted to do a bit more
3553 work in setters. Made setNextOnLine() and setPrevOnLine() assert that the box has a
3554 parent. Made parent() assert that the parent is good. Also removed the unused
3555 isChildOfParent() function.
3556 * rendering/InlineBox.cpp: (WebCore::InlineBox::~InlineBox): At destruction time, if
3557 we are still attached to a parent, tag that parent as having a "bad" child list.
3559 * rendering/InlineFlowBox.h: Added m_reasonForBadChildList, checkConsistency(),
3560 setHasBadChildList(), and hasBadChildList(). Also changed firstChild() and lastChild() so
3561 they call checkConsistency() and made all the fields private instead of protected.
3562 * rendering/InlineFlowBox.cpp:
3563 (WebCore::InlineFlowBox::addToLine): Added consistency checks before and after adding a
3564 box to the line. Also checked that next and prev start out as 0. Changed manipulation of
3565 next and prev to use accessor functions.
3566 (WebCore::InlineFlowBox::removeChild): Added consistency checks before and after removing
3567 the box from the line.
3568 (WebCore::InlineFlowBox::deleteLine): Use firstChild() instead of getting at m_firstChild
3569 directly so we get a consistency check. Also set the parent to 0 before destroying so that
3570 the assertion in ~InlineBox will work properly.
3571 (WebCore::InlineFlowBox::extractLine): Ditto.
3572 (WebCore::InlineFlowBox::attachLine): Ditto.
3573 (WebCore::InlineFlowBox::adjustPosition): Ditto.
3574 (WebCore::InlineFlowBox::checkConsistency): Added. Checks consistency of the child list by
3575 looking at the parent, next, and prev pointers. Also asserts that we are not yet in the
3576 "bad" child list state, which happens if one of our children is destroyed without removing
3577 it from our list; that's normal, but once it happens we can't look at our child list again.
3579 * rendering/InlineTextBox.h:
3580 * rendering/InlineTextBox.cpp: Remove unnneeded destroy/new/delete functions -- these are
3581 inherited from the InlineBox base class and don't need to be defined again.
3583 * rendering/RenderFlow.h:
3584 * rendering/RenderFlow.cpp:
3585 (WebCore::RenderFlow::~RenderFlow): Assert that there are no children to confirm that we
3586 didn't leak something.
3587 (WebCore::RenderFlow::extractLineBox): Added consistency checks before and after removing
3588 a run of boxes from the list.
3589 (WebCore::RenderFlow::attachLineBox): Added consistency checks before and after adding
3591 (WebCore::RenderFlow::removeLineBox): Added consistency checks before and after removing
3592 a box from the list.
3593 (WebCore::RenderFlow::createInlineBox): Added consistency checks before and after adding
3595 (WebCore::RenderFlow::checkConsistency): Added.
3597 * rendering/RenderText.h:
3598 * rendering/RenderText.cpp:
3599 (WebCore::RenderText::~RenderText): Assert that there are no children to confirm that we
3600 didn't leak something.
3601 (WebCore::RenderText::extractTextBox): Added consistency checks before and after removing
3602 a run of boxes from the list.
3603 (WebCore::RenderText::attachTextBox): Added consistency checks before and after adding
3605 (WebCore::RenderText::removeTextBox): Added consistency checks before and after removing
3606 a box from the list.
3607 (WebCore::RenderText::deleteTextBoxes): Added code to call setHasBadChildList since this
3608 destroys line boxes without informing the parent.
3609 (WebCore::RenderText::checkConsistency): Added.
3611 2007-08-06 Adele Peterson <adele@apple.com>
3615 Fix for <rdar://problem/5382483> REGRESSION: <select> element's text is clipped when a CSS line-height is specified
3617 Don't honor line-height for styled popup buttons. We already don't honor line-height for unstyled popups
3618 and since IE and FF don't honor it at all for popups, we shouldn't either.
3620 * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::adjustMenuListButtonStyle):
3621 * rendering/RenderThemeSafari.cpp: (WebCore::RenderThemeSafari::adjustMenuListButtonStyle):
3623 2007-08-06 Antti <antti@apple.com>
3627 Fix <rdar://problem/5378214>
3628 Mail crashes at RenderLayer::paintLayer() when dragging a selection over To Do text
3630 ObjC interface does not guarantee that Document::updateRendering() gets called after
3631 modification are made to document. This can lead to situation where paint()
3632 is invoked with document still dirty which can then crash in number of interesting ways.
3634 - add hasChangedChild() as needsLayout() condition. layout() will then call recalcStyle()
3635 catching most cases and making sure document is not dirty when entering painting.
3636 - protect recalcStyle() and layout() from being executed during painting. There are some
3637 cases needsLayout() protection does not cover.
3639 No layout test, these states are very hard or impossible to reach using Javascript interface
3640 (which generally guarantees that updateRendering() is done right after execution).
3643 (WebCore::Document::recalcStyle):
3645 (WebCore::Frame::paint):
3646 (WebCore::Frame::setPaintRestriction):
3647 (WebCore::Frame::isPainting):
3648 (WebCore::FramePrivate::FramePrivate):
3650 * page/FramePrivate.h:
3651 * page/FrameView.cpp:
3652 (WebCore::FrameView::layout):
3653 (WebCore::FrameView::needsLayout):
3655 2007-08-05 Maciej Stachowiak <mjs@apple.com>
3657 Reviewed by Darin Adler.
3659 <rdar://problem/5369110> CrashTracer: [USER] reproducible crash opening particular mail messages
3661 * platform/network/mac/ResourceHandleMac.mm:
3662 (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]): Make sure to retain
3663 self for the body of this method. Otherwise, the willSendRequest could trigger events which will
3664 cancel the connection, and we access ivars after this point.
3665 (-[WebCoreSynchronousLoader connection:willSendRequest:redirectResponse:]): retain and release
3668 2007-08-04 Adam Roben <aroben@apple.com>
3670 Another workaround for <rdar://problem/5386894>
3674 This fixed ~150 failing tests.
3676 * platform/network/cf/ResourceResponseCFNet.cpp:
3677 (WebCore::ResourceResponse::doUpdateResourceResponse): Hardcode the
3678 MIME type for .svg files as well.
3680 2007-08-04 Adam Roben <aroben@apple.com>
3682 Workaround for <rdar://problem/5386894> CFURLResponseGetMIMEType returns "text/html" for local .xhtml and .xml files
3686 This fixes ~350 failing tests.
3688 * platform/network/cf/ResourceResponseCFNet.cpp:
3689 (WebCore::ResourceResponse::doUpdateResourceResponse): Use a workaround
3690 identical to the one in ResourceResponseMac.mm, but include .xml files
3693 2007-08-04 David Kilzer <ddkilzer@webkit.org>
3697 - fix for http://bugs.webkit.org/show_bug.cgi?id=14882
3698 <rdar://problem/5386550> REGRESSION (r24866): text/plain documents are always downloaded
3700 The supportedNonImageMimeTypes list is used to determine which MIME types may be viewed
3701 within the web browser (e.g., plug-ins add their own MIME types to the list during
3702 initialization), so we must add "text/plain" and "text/" back to the list. Since
3703 this change would then break DOMImplementation::isTextMIMEType(), that method was reverted
3704 to its original form and MIMETypeRegistry::shouldTreatAsText() was removed.
3706 * dom/DOMImplementation.cpp:
3707 (WebCore::DOMImplementation::isTextMIMEType): Revert to previous version.
3708 * platform/MIMETypeRegistry.cpp:
3709 (WebCore::initialiseSupportedNonImageMimeTypes): Added back "text/plain" and "text/" to the list.
3710 (WebCore::MIMETypeRegistry::shouldTreatAsText): Removed.
3711 * platform/MIMETypeRegistry.h:
3713 2007-08-03 Brady Eidson <beidson@apple.com>
3717 Fix for http://bugs.webkit.org/show_bug.cgi?id=14824 and <rdar://problem/5372989>
3720 1 - The WebCore MIMEType registry was designed assuming the list of types would never change
3721 That is false, as WebKit has API and SPI calls which directly mutate the MIMETypeRegistry
3722 2 - DOMImplementation didn't consult the registry for any MIMEType that started with "text/",
3723 instead maintaining it's own hard coded rules
3725 * dom/DOMImplementation.cpp:
3726 (WebCore::DOMImplementation::isTextMIMEType): For now, call through to the MIMETypeRegistry
3727 until we decided a different fate for this function
3729 * platform/MIMETypeRegistry.cpp:
3730 (WebCore::initialiseSupportedNonImageMimeTypes): "SupportedNonImageMIMETypes" is really a misnomer for
3731 "MIMETypes we should show as HTML" but that line has slowly been blurred since Tiger. In an attempt
3732 to start to unblur it, remove "text/" and "text/plain"
3733 (WebCore::MIMETypeRegistry::shouldTreatAsText): The decision is very close to the old DOMImplementation
3734 method, except we don't automatically hand off "text/" types as true if they are in the set of supported
3736 (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Non-const (can be changed!)
3737 (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Non-const (can be changed!)
3738 (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Non-const (can be changed!)
3739 * platform/MIMETypeRegistry.h:
3741 2007-08-03 Adele Peterson <adele@apple.com>
3745 Fix for <rdar://problem/5345862> CrashTracer: [USER] 4 crashes in Safari at com.apple.WebCore: WebCore::Frame::isContentEditable const + 10
3747 Couldn't reproduce the problem, but a nil check for the frame should fix this.
3749 * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::adjustRenderStyle):
3751 2007-08-03 Anders Carlsson <andersca@apple.com>
3755 <rdar://problem/5383286>
3756 XMLHTTPRequest does not return 401 when user cancels authentication dialog (affects .Mac)
3758 * loader/ResourceLoader.h:
3759 Make receivedCancellation virtual.
3761 * loader/SubresourceLoader.cpp:
3762 (WebCore::SubresourceLoader::receivedCancellation):
3763 Call SubresourceLoaderClient::receivedCancellation.
3765 * xml/XMLHttpRequest.cpp:
3766 (WebCore::XMLHttpRequest::receivedCancellation):
3767 Save the failure response.
3769 2007-08-03 Anders Carlsson <andersca@apple.com>
3773 <rdar://problem/5374393>
3774 Image change on disk not noticed by WebView; -[WebCache setDisabled:] used to cause a reload every time
3776 This is essentially a better fix for the crash in <rdar://problem/5362783>.
3778 * loader/DocLoader.cpp:
3779 (WebCore::DocLoader::requestResource):
3780 If the resource already exists in the m_docResources map, remove it and disassociate it from the doc loader.
3782 2007-08-03 Oliver Hunt <oliver@apple.com>
3786 <rdar://problem/5375190> Mail crashed in WebCore::CachedImage::imageSize() const when viewing a particular message
3788 Fix the uncached load path to confirm that the type of resource being
3789 returned actually matches the type that was requested.
3791 Also make sure we never create a resource in the Cache for invalid urls.
3794 (WebCore::Cache::requestResource):
3795 * loader/DocLoader.cpp:
3796 (WebCore::DocLoader::requestResource):
3798 2007-08-03 Mitz Pettel <mitz@webkit.org>
3802 - fix http://bugs.webkit.org/show_bug.cgi?id=14879
3803 REGRESSION: First item in select (pop-up menu) is displayed even if another item was selected via JavaScript
3805 Test: fast/forms/menulist-deselect-update.html
3807 * html/HTMLOptionElement.cpp:
3808 (WebCore::HTMLOptionElement::setSelected): Reordered to allow setSelectedIndex() to call setChanged().
3810 2007-08-03 Anders Carlsson <andersca@apple.com>
3814 <rdar://problem/5286444>
3815 http://bugs.webkit.org/show_bug.cgi?id=14269
3816 REGRESSION: Gmail links stop working after computer sleep
3818 Add a PowerNotifier object that takes care of resetting and firing the shared timer when coming
3821 * platform/mac/SharedTimerMac.cpp:
3822 (-[PowerNotifier init]):
3823 (-[PowerNotifier didWake:]):
3824 (WebCore::setSharedTimerFireTime):
3826 2007-08-04 Mark Rowe <mrowe@apple.com>
3830 * rendering/RenderTextControl.cpp: Don't use the same name for two arguments.
3832 2007-08-03 Mitz Pettel <mitz@webkit.org>
3836 - fix http://bugs.webkit.org/show_bug.cgi?id=14653
3837 REGRESSION (r23994): No caret is drawn after clicking a search field's placeholder text
3838 <rdar://problem/5383841>
3840 Test: fast/forms/search-click-in-placeholder.html
3842 Defined a subclass of RenderBlock that never hit-tests children for use in
3843 text controls. This avoids returning placeholder text as the hit node.
3844 Since text controls cannot contain inline elements, there is no harm in
3845 doing that unconditionally, and not just in the case that the field is
3846 showing placeholder text.
3848 * rendering/RenderTextControl.cpp:
3849 (WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock):
3850 (WebCore::RenderTextControlInnerBlock::~RenderTextControlInnerBlock):
3851 (WebCore::RenderTextControlInnerBlock::nodeAtPoint):
3852 (WebCore::RenderTextControl::createSubtreeIfNeeded):
3854 2007-08-02 Oliver Hunt <oliver@apple.com>
3858 Fix for <rdar://problem/5369332> Xcode crashes while selecting a hyperlink within a AppleScript dictionary (WebCore::Font::drawGlyphBuffer)
3860 There were many places where we were not correctly retaining/releasing the
3861 NSFont object stored in the C++ PlatformFontData object, this resulted in
3862 the GC incorrectly collecting the NSFont.
3864 This patch fixes the problem by prevent direct modification of the PlatformFontData
3865 font pointer, allowing us to enforce correct CFRetain/Release behaviour.
3867 * platform/FontData.h:
3868 (WebCore::FontData::getNSFont):
3869 * platform/mac/FontCacheMac.mm:
3870 (WebCore::FontCache::getFontDataForCharacters):
3871 (WebCore::FontCache::createFontPlatformData):
3872 * platform/mac/FontDataMac.mm:
3873 (WebCore::initFontData):
3874 (WebCore::FontData::platformInit):
3875 (WebCore::FontData::platformDestroy):
3876 (WebCore::FontData::smallCapsFontData):
3877 (WebCore::FontData::containsCharacters):
3878 (WebCore::FontData::determinePitch):
3879 (WebCore::FontData::platformWidthForGlyph):
3880 (WebCore::FontData::checkShapesArabic):
3881 * platform/mac/FontMac.mm:
3882 (WebCore::initializeATSUStyle):
3883 (WebCore::overrideLayoutOperation):
3884 (WebCore::Font::drawGlyphs):
3885 * platform/mac/FontPlatformData.h:
3886 (WebCore::FontPlatformData::FontPlatformData):
3887 (WebCore::FontPlatformData::~FontPlatformData):
3888 (WebCore::FontPlatformData::hash):
3889 (WebCore::FontPlatformData::operator==):
3890 (WebCore::FontPlatformData::font):
3891 (WebCore::FontPlatformData::setFont):
3893 2007-08-03 Antti Koivisto <antti@apple.com>
3895 Oops, this change wasn't supposed to be commited.
3897 * page/mac/WebCoreFrameBridge.mm:
3898 (-[WebCoreFrameBridge setBaseBackgroundColor:]):
3900 2007-08-02 Antti Koivisto <antti@apple.com>
3904 <rdar://problem/5355951>
3905 plainText() fragments TCMalloc heap badly on large pages
3907 also likely fixes some cases of
3908 <rdar://problem/5335382>
3909 CrashTracer: [REGRESSION] 73 crashes in Safari at com.apple.WebCore: WebCore::DeprecatedStringData::increaseUnicodeSize + 52
3911 If you load http://dscoder.com/test.txt with WebKit build with TCMalloc and system malloc you see that
3912 Safari RPRVT with TCMalloc is 118.8MB
3913 Safari RPRVT with system malloc is 69.7MB
3915 Difference is almost entirely caused by heap fragmentation from a full document plainText() call (for indexing purposes).
3917 The patch helps in two ways:
3918 - construct plainText string in pieces to avoid O(n^2) reallocs
3919 - allocate buffers using system malloc so they can be returned back to OS and don't fragment and grow TCMalloc heap
3921 This shrinks http://dscoder.com/test.txt RPRVT to 79.0MB and makes full document plainText() take 50ms instead of 500ms.
3922 The benefits are not limited to extreme cases, web pages above ~200kB can show substantial improvement in RPRVT.
3924 * editing/TextIterator.cpp:
3925 (WebCore::plainTextToMallocAllocatedBuffer):
3926 (WebCore::plainText):
3927 * editing/TextIterator.h:
3928 * page/mac/WebCoreFrameBridge.mm:
3929 (-[WebCoreFrameBridge selectedString]):
3930 (-[WebCoreFrameBridge stringForRange:]):
3932 2007-08-02 David Hyatt <hyatt@apple.com>
3934 Fix for 5374437, allow comment nodes to be the child of a document.
3935 Refine the check to always make a root element to check documentElement()
3936 rather than firstChild(), since a comment node could be present as the
3939 Reviewed by Tim Hatcher
3941 * html/HTMLDocument.cpp:
3942 (WebCore::HTMLDocument::childAllowed):
3943 * html/HTMLParser.cpp:
3944 (WebCore::HTMLParser::finished):
3946 2007-08-02 Antti Koivisto <antti@apple.com>
3950 <rdar://problem/5228138>
3951 REGRESSION(Leopard): test failures: tests that test Georgian numbering
3953 Fix to Georgian number tables to get CSS2.1 test results right. Font has relevant characters now
3954 which revealed that results were actually wrong.
3956 * rendering/RenderListMarker.cpp:
3957 (WebCore::toGeorgian):
3959 2007-08-02 Ada Chan <adachan@apple.com>
3963 <rdar://problem/5079175> Added parameters headerHeight and footerHeight to
3964 computePageRectsForFrame() so we can account for the header and footer when
3965 calculating page heights for this frame.
3967 * bridge/win/FrameWin.cpp:
3968 (WebCore::computePageRectsForFrame):
3969 * bridge/win/FrameWin.h:
3971 2007-08-02 Alice Liu <alice.liu@apple.com>
3973 Reviewed by Kevin McCullough.
3975 fixed <rdar://problem/5310312> REGRESSION: javascript is mis-escaped at http://labs.zarate.org/passwd causing bookmarklet to break
3978 expose some calls for WebKit to call.
3979 * manual-tests/JavaScript-bookmarklets.html: Added.
3981 2007-08-01 Adam Treat <treat@kde.org>
3983 Reviewed by George Staikos.
3985 Add an interface to manage global history for clients
3988 * platform/qt/TemporaryLinkStubs.cpp:
3990 2007-08-01 Adam Treat <treat@kde.org>
3992 Reviewed by George Staikos.
3994 Do not call update or paint from inside a paint event.
3996 * platform/qt/ScrollViewQt.cpp:
3997 (WebCore::ScrollView::updateContents):
3998 * platform/qt/WidgetQt.cpp:
3999 (WebCore::Widget::invalidateRect):
4001 2007-08-01 Timothy Hatcher <timothy@apple.com>
4005 <rdar://problem/5376156> Mail crash in DeleteButtonController::hide() when dropping selected image on DIV's border
4007 Add the container element back so the selection can not touch the deletion UI nodes. The container
4008 has style to prevent user selection, user drag and user modification.
4010 * editing/DeleteButtonController.cpp:
4011 (WebCore::DeleteButtonController::show): Make the container node, and append the button and outline elements.
4012 (WebCore::DeleteButtonController::hide): Remove the container elements and null out the other nodes.
4013 * editing/DeleteButtonController.h:
4015 2007-08-01 Steve Falkenburg <sfalken@apple.com>
4017 Build mod: Fix sln to match configs in vcproj.
4021 * WebCore.vcproj/WebCore.make:
4023 2007-07-31 David Harrison <harrison@apple.com>
4027 <rdar://problem/5362659> CrashTracer: [USER] 11 crashes in Mail at WebCore::InsertLineBreakCommand::doApply()
4029 The problem was that deleting with the X control leaves the selection inside the fragment that was deleted.
4031 * editing/DeleteButtonController.cpp:
4032 (WebCore::DeleteButtonController::deleteTarget):
4033 Because the deletion UI only appears when the selection is entirely
4034 within the target, we unconditionally update the selection to be
4035 a caret where the target had been.
4037 2007-07-31 Adele Peterson <adele@apple.com>
4041 Fix for <rdar://problem/5339395> REGRESSION:http://sudokucraving.com does not render grid correctly
4043 * rendering/RenderTextControl.h: (WebCore::RenderTextControl::hasControlClip): Clip for search fields.
4044 * rendering/RenderTextControl.cpp:
4045 (WebCore::RenderTextControl::controlClipRect): Added a control clip so the search field's cancel button and magnifier glass
4046 never draw outside the control's bounds.
4047 (WebCore::RenderTextControl::calcPrefWidths): Only include the inner box's padding when calculating the min/max width without using calcContentBoxWidth.
4048 Our old behavior was causing that inner padding to get counted twice. Also, no need to add in the border
4049 for an inner box that can't be controlled from outside this class.
4050 * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::calcPrefWidths): ditto.
4052 2007-07-31 Anders Carlsson <andersca@apple.com>
4056 Speculative fix for <rdar://problem/5359695>
4057 REGRESSION (Tiger Beta): Multiple crashes in WebCore::Widget::getView() const + 6
4059 * page/EventHandler.cpp:
4060 (WebCore::EventHandler::updateDragAndDrop):
4061 Null check the frame view.
4063 2007-07-31 Timothy Hatcher <timothy@apple.com>
4065 Reviewed by Oliver and Beth.
4067 <rdar://problem/5211271> ADOBE Leopard 9A410: At the first Launching InDesign after deactivate, EULA page gets blanked.
4069 Rename needsAcrobatFrameReloadingQuirk to needsAdobeFrameReloadingQuirk, since this now applies to more Adobe applications.
4072 * page/Settings.cpp:
4073 (WebCore::Settings::Settings):
4074 (WebCore::Settings::setNeedsAdobeFrameReloadingQuirk):
4076 (WebCore::Settings::needsAcrobatFrameReloadingQuirk):
4078 2007-07-31 Matt Perry <mpComplete@gmail.com>
4080 Reviewed by Brady and Darin, tweaked by Brady, landed by Brady
4082 Fix for http://bugs.webkit.org/show_bug.cgi?id=14757 and <rdar://problem/5364692>
4083 HTMLTokenizer::processingData implementation is incorrect
4085 * html/HTMLTokenizer.cpp:
4086 (WebCore::HTMLTokenizer::processingData): Made it also return true if the HTMLTokenizer was inside the write() call.
4087 * loader/FrameLoader.cpp:
4088 (WebCore::FrameLoader::FrameLoader):
4089 (WebCore::FrameLoader::checkLoadCompleteTimerFired):
4090 (WebCore::FrameLoader::scheduleCheckLoadComplete):
4091 (WebCore::FrameLoader::stopForUserCancel): Changed a call to checkLoadComplete to be asynchronous, since
4092 stopForUserCancel can be called while parsing.
4093 * loader/FrameLoader.h:
4095 2007-07-31 Anders Carlsson <andersca@apple.com>
4099 <rdar://problem/5371582>
4100 REGRESSION: PLT .5% slower due to r24451 (copying HTMLCollection objects)
4102 Make the hash maps store CollectionInfo pointers to reduce amount of copying when
4103 inserting/rehashing etc.
4106 (WebCore::Document::~Document):
4107 (WebCore::Document::nameCollectionInfo):
4110 2007-07-31 Sam Weinig <sam@webkit.org>
4114 Fix for http://bugs.webkit.org/show_bug.cgi?id=14825
4115 Non-integer hsl() colours are ignored
4117 * css/CSSParser.cpp:
4118 (WebCore::CSSParser::parseHSLParameters): Parse hue as a Number,
4121 2007-07-30 Justin Garcia <justin.garcia@apple.com>
4125 <rdar://problem/5369009> Crash due to infinite recursion in moveParagraphs on delete
4127 After the delete, we moved content into the previous block, and a style
4128 rule turned a style span in the moved content into a block, throwing
4129 moveParagraphs into infinite recursion, as it continually tried and failed
4130 to get the style span into the same paragraph as the content just before it.
4132 Added a method to ReplaceSelectionCommand to keep inserted style spans
4133 from turning into blocks because of style rules. Will add code to prevent