1 2007-08-23 Justin Garcia <justin.garcia@apple.com>
5 <rdar://problem/5432254> GoogleDocs: A hang occurs when applying list style to selected table
7 * editing/DeleteSelectionCommand.cpp:
8 (WebCore::DeleteSelectionCommand::handleGeneralDelete): If the position
9 that marked the start of the range to delete has been removed from the
10 document, and it was inside the node that holds the position that marks
11 the end of the range to delete, don't remove any children of that node,
12 because we don't know how many to remove. For example, if the end is
13 [a, 5] and the start was in some descendant of a and was removed, don't
14 remove any of the children of a. We will now refuse to remove some content
15 incorrectly, but that's less dangerous than removing content incorrectly.
16 Long term we need to update these positions as we remove content from the
17 document, but that seems like a more risky change. Added a testcase.
18 * editing/InsertListCommand.cpp:
19 (WebCore::InsertListCommand::modifyRange): If the end of the selection to
20 modify is just after a table, and if the start of the selection is inside
21 that table, the last paragraph that we'll want modify is the last one inside
22 the table, not the paragraph that contains the table itself. Adjust
23 startOfLastParagraph here to avoid infinite recursion.
25 2007-08-24 Anders Carlsson <andersca@apple.com>
29 <rdar://problem/5430165>
30 REGRESSION: Dynamically loaded images fail to load
32 * html/HTMLImageLoader.cpp:
33 (WebCore::HTMLImageLoader::HTMLImageLoader):
34 Initialize the m_elementIsProtected member.
36 (WebCore::HTMLImageLoader::~HTMLImageLoader):
37 Assert that the element is not protected.
39 (WebCore::HTMLImageLoader::setLoadingImage):
40 If the image is not null, protect the element. Otherwise, unprotect it.
42 (WebCore::HTMLImageLoader::dispatchLoadEvent):
43 Unprotect the element here.
45 (WebCore::HTMLImageLoader::protectElement):
46 (WebCore::HTMLImageLoader::unprotectElement):
47 New methods which protect and unprotect the element.
49 * html/HTMLImageLoader.h:
51 2007-08-24 Kevin McCullough <kmccullough@apple.com>
55 2007-08-24 Beth Dakin <bdakin@apple.com>
57 Reviewed by Hyatt and Adele.
59 Fix for <rdar://problem/5417203> Google Gmail 1.0 widget - unread
62 * rendering/FixedTableLayout.cpp:
63 (WebCore::FixedTableLayout::calcWidthArray): Calc pref widths for
66 2007-08-24 Kevin McCullough <kmccullough@apple.com>
70 <rdar://problem/5437038> 1 credential object leaked for each call to credentialWithUser:password:persistence
71 - Use initWithUser instead of credentialWithUser because credentialWithUser leaks.
73 * platform/network/mac/AuthenticationMac.mm:
75 * platform/network/mac/ResourceHandleMac.mm:
76 (-[WebCoreResourceHandleAsDelegate connection:didReceiveAuthenticationChallenge:]):
77 (-[WebCoreSynchronousLoader connection:didReceiveAuthenticationChallenge:]):
79 2007-08-24 Jon Honeycutt <jhoneycutt@apple.com>
83 <rdar://problem/5433236> Print preview of empty txt file crashes Safari
84 Fix: Adjust computePageRectsForFrame to always return at least one
85 page rect, even if document height is zero.
87 * WebCore.vcproj/WebCore.vcproj:
88 * bridge/win/FrameWin.h: Added Vector& parameter to
89 computePagesRectsForFrame; changed its return type to void.
90 * bridge/win/FrameWin.cpp:
91 (WebCore::computePageRectsForFrame): Reordered the loop that inserts
92 rects into the vector.
94 2007-08-24 Antti Koivisto <antti@apple.com>
98 Fix <rdar://problem/5393758>
99 Crash in WebCore::FontData::platformInit
101 Null check glyph page.
103 If font has somehow failed to initialize it is possible to have null glyph page. Based on
104 crash dumps this seems to occasionally happen when running Mail under guard malloc.
106 No test case, I don't know how to get to this state.
108 * platform/FontData.cpp:
109 (WebCore::FontData::FontData):
110 * platform/mac/FontDataMac.mm:
111 (WebCore::FontData::platformInit):
113 2007-08-24 George Wright <george.wright@collabora.co.uk>
117 http://bugs.webkit.org/show_bug.cgi?id=15071
118 [cairo] SVG skews are incorrect
120 Fix Cairo implementation of AffineTransform::shear so that shearing is
121 done in the correct direction.
123 * platform/graphics/cairo/AffineTransformCairo.cpp:
124 (WebCore::AffineTransform::shear):
126 2007-08-23 Anders Carlsson <andersca@apple.com>
130 If necessary, re-set the window proc after each call to NPP_SetWindow. This is to ensure that
131 our window proc is always run even if a plug-in subclasses the window and replaces the window proc.
133 Also, make sure that the default window proc is of type ASCII so we can eliminate the
134 * plugins/win/PluginViewWin.cpp:
135 (WebCore::registerPluginView):
136 (WebCore::PluginViewWndProc):
137 (WebCore::PluginViewWin::setNPWindowRect):
138 (WebCore::PluginViewWin::stop):
139 (WebCore::PluginViewWin::determineQuirks):
140 (WebCore::PluginViewWin::PluginViewWin):
141 (WebCore::PluginViewWin::init):
142 * plugins/win/PluginViewWin.h:
144 (WebCore::PluginViewWin::pluginWndProc):
146 2007-08-23 Justin Garcia <justin.garcia@apple.com>
150 <rdar://problem/5156801> REGRESSION: Crash at DeleteSelectionCommand::doApply() when deleting table content
152 * editing/DeleteSelectionCommand.cpp:
153 (WebCore::DeleteSelectionCommand::handleGeneralDelete): Use a RefPtr
154 for node. If the node to be removed contains the selection, and if
155 the next node to be removed (nextNode) is inside the deletion UI,
156 removing node will remove nextNode from the document. nextNode is
157 a RefPtr, but node isn't and when nextNode falls out of scope the node
158 that node points to will be destroyed and we'll end up using a stale pointer.
159 Long term we should probably just disable the deletion UI before editing
160 operations because the undo of the removal of node in the situation
161 described above relies on the presence of the deletion UI, but it isn't
162 present because its added and removed in a non-undoable way.
164 2007-08-23 Mitz Pettel <mitz@webkit.org>
168 - fix http://bugs.webkit.org/show_bug.cgi?id=14899
169 !d->m_view->needsLayout() in Frame::paint() (Causes assert)
171 WebKit copies the width and height attributes of an <embed> to its
172 nearest <object> ancestor. This used to be done in updateWidget(), but
173 that could lead to the document being dirty right after layout and
174 before painting. The patch moves the copying of the attributes to when
175 the <embed> is inserted into the document or its attributes change.
177 * html/HTMLEmbedElement.cpp:
178 (WebCore::HTMLEmbedElement::insertedIntoDocument):
179 (WebCore::HTMLEmbedElement::attributeChanged):
180 * html/HTMLEmbedElement.h:
181 * manual-tests/bugzilla-14899.html: Added.
182 * rendering/RenderPartObject.cpp:
183 (WebCore::RenderPartObject::updateWidget):
185 2007-08-22 Anders Carlsson <andersca@apple.com>
187 Reviewed by Darin and Oliver.
189 <rdar://problem/5422410>
190 http://bugs.webkit.org/show_bug.cgi?id=15019
191 REGRESSION (r25124-r25140): New posts and hot topics won't show at mobile01.com
193 Remove the call to checkCallImplicitClose(). Calling it in loadPlugin is bad for two reasons:
195 1. It could cause onload to be dispatched even when the page has subresources that are still
196 loading, such as images.
198 2. Now that loadPlugin is called during layout, it could cause onload to be dispatched during
199 layout, which can execute javascript and do pretty much anything while the render tree is in an
202 * loader/FrameLoader.cpp:
203 (WebCore::FrameLoader::loadPlugin):
205 2007-08-22 Anders Carlsson <andersca@apple.com>
209 <rdar://problem/5430584>
210 http://bugs.webkit.org/show_bug.cgi?id=15053
211 WebKit does not check Windows Registry HKEY_CURRENT_USER for NPAPI plugin locations
213 * plugins/win/PluginDatabaseWin.cpp:
214 (WebCore::addPluginsFromRegistry):
215 (WebCore::PluginDatabaseWin::getPluginsInPaths):
217 2007-08-22 Justin Garcia <justin.garcia@apple.com>
221 <rdar://problem/5418891> CrashTracer: [USER] 1 crash in Mail at -[WebViewEditor webView:shouldInsertText:replacingDOMRange:givenAction:]
223 * editing/BreakBlockquoteCommand.cpp:
224 (WebCore::BreakBlockquoteCommand::doApply): We're reusing the topBlockquote
225 variable. Null it out first. If there is no new topBlockquote and we don't null
226 it out first, we'll assume that there was a new one and crash.
228 2007-08-22 Kevin McCullough <kmccullough@apple.com>
232 - rdar:5423067 Reapplyingthe change but only when the text area is in focus.
234 * html/HTMLTextAreaElement.cpp:
235 (WebCore::HTMLTextAreaElement::setValue):
237 2007-08-21 David Hyatt <hyatt@apple.com>
239 Fix for <rdar://problem/5249757> Painting of JPGs in WebKit is too slow.
241 Use a new Leopard API for fast tiling of images. We only use this API
242 when the whole image is being tiled and when the current CGImageRef to tile
243 has a size that matches the size of the whole image.
245 We can optimize border-image in the future by adding a cache of the 9
250 * platform/graphics/cg/ImageCG.cpp:
251 (WebCore::Image::drawPattern):
253 2007-08-22 Kevin McCullough <kmccullough@apple.com>
255 - Rolling back since I need to update some layouttests this change breaks.
257 * html/HTMLTextAreaElement.cpp:
258 (WebCore::HTMLTextAreaElement::setValue):
260 2007-08-21 Kevin McCullough <kmccullough@apple.com>
262 Reviewed by Geof, Adam, Hyatt, Maciej and Oliver.
264 - 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.
265 - <rdar://problem/5423067> gmail is super annoying when trying to add a new name to the TO, CC or BCC fields
267 * html/HTMLTextAreaElement.cpp:
268 (WebCore::HTMLTextAreaElement::setValue):
270 2007-08-21 Adam Roben <aroben@apple.com>
274 Keep FrameView::layoutIfNeededRecursive Windows- and Gtk-only for now
275 (sadly). This will have to wait until we merge ScrollView and FrameView.
279 * page/FrameView.cpp:
282 2007-08-21 Adam Roben <aroben@apple.com>
284 Fix an ASSERT when using Find in Page
290 * bridge/win/FrameWin.cpp:
291 (WebCore::imageFromSelection): Make sure to update layout before
292 painting so we don't hit an ASSERT in painting code (Frame::selectionImage
293 in FrameMac.mm does this as well).
295 2007-08-21 Adam Roben <aroben@apple.com>
297 Made FrameView::layoutIfNeededRecursive available to all platforms
299 Currently it's only used on Gtk+ and Windows.
303 * page/FrameView.cpp: Removed #ifdef.
304 * page/FrameView.h: Ditto.
306 2007-08-21 Adele Peterson <adele@apple.com>
308 Build fix for release build.
310 * rendering/AutoTableLayout.cpp:
311 (WebCore::AutoTableLayout::calcEffectiveWidth):
312 (WebCore::AutoTableLayout::layout):
314 2007-08-21 Mitz Pettel <mitz@webkit.org>
318 - fix http://bugs.webkit.org/show_bug.cgi?id=15010
319 <rdar://problem/5423956> REGRESSION (r25000-r25065): Table rendering broken by a recent nightly
321 Test: fast/table/max-width-integer-overflow.html
323 Avoid integer overflows when dealing with maximum widths by
324 1) using floating point arithmetic when summing or multiplying column max widths
325 2) capping max widths at INT_MAX / 2
327 * rendering/AutoTableLayout.cpp:
328 (WebCore::AutoTableLayout::calcPrefWidths):
329 (WebCore::AutoTableLayout::calcEffectiveWidth):
330 (WebCore::AutoTableLayout::layout):
332 2007-08-20 John Sullivan <sullivan@apple.com>
334 Reviewed by Adam Roben
336 WebCore part of fix for:
337 <rdar://problem/5417777> WebKit focus ring color no longer matches system focus rings
339 Adele wrote the first version of this patch. No test cases added because I made sure the
340 layout tests are unaffected. Two additional bug fixes were made in passing, but neither
341 of them had any effect on any known real-world case, and both were too difficult to write
342 test cases for to be worthwhile.
345 added symbols for these new functions so WebKit can call them
347 * WebCore.xcodeproj/project.pbxproj:
350 * platform/graphics/mac/ColorMac.h: Added.
351 New file to hold the increasing amount of Mac-specific color stuff.
353 * platform/graphics/Color.h:
354 removed #if PLATFORM(MAC) code, which is now in ColorMac.h
356 * platform/graphics/mac/ColorMac.mm:
357 (WebCore::makeRGBAFromNSColor):
358 new static function to convert an NSColor object to an RGBA32 struct
359 (WebCore::colorFromNSColor):
360 new public function to convert an NSColor object to a WebCore-style Color object
361 (WebCore::focusRingColor):
362 Uses (cached) systemFocusRingColor instead of hardwired values, unless usesTestModeFocusRingColor is true,
363 in which case it uses the old hardwired color
364 (WebCore::usesTestModeFocusRingColor):
365 returns value of global var
366 (WebCore::setUsesTestModeFocusRingColor):
367 sets value of global var
368 (+[WebCoreControlTintObserver controlTintDidChange]):
369 Uses [NSColor keyboardFocusIndicatorColor] to set systemFocusRingColor; don't compile if COLORMATCH_EVERYTHING
370 is set since we don't know what it would take to satisfy this state.
372 * bindings/objc/DOMRGBColor.mm:
373 now includes ColorMac.h to account for moved declarations
374 * bridge/mac/WebCoreAXObject.mm:
377 * page/mac/FrameMac.mm:
378 (WebCore::convertAttributesToUnderlines):
379 now uses new colorFromNSColor. The old code was swapping G & B, but it didn't matter in practice because
380 this function is only used to convert the color of an input manager's marked text underline, which is always black
382 * page/mac/WebCoreFrameBridge.mm:
383 (-[WebCoreFrameBridge setBaseBackgroundColor:]):
384 now uses new colorFromNSColor. The old code was swapping G & B, but it didn't matter in practice because
385 this function is only called with a grayscale color perhaps containing an alpha value
387 * rendering/RenderView.cpp:
388 (WebCore::RenderView::paintBoxDecorations):
389 just updated a comment
391 2007-08-20 Mitz Pettel <mitz@webkit.org>
393 Reviewed by Dave Hyatt.
395 - fix http://bugs.webkit.org/show_bug.cgi?id=15023
396 REGRESSION (r21113-r21143): JavaScript tooltip rendering bug
398 Test: fast/repaint/layer-visibility.html
400 * rendering/RenderLayer.cpp:
401 (WebCore::RenderLayer::setHasVisibleContent): Cache the layer's
402 rects when it changes to visible.
404 2007-08-20 Kevin Decker <kdecker@apple.com>
408 Fixed: <rdar://problem/5325262> REGRESSION (Tiger-Leopard): PictureTalk plug-in doesn't work
410 The problem was that this particular plug-in handles "text/ptf", but WebCore wasn't giving the plug-in a chance to load
411 any type with "text/"
413 * dom/DOMImplementation.cpp:
414 (WebCore::DOMImplementation::createDocument): Allow plug-ins to once again use "text/" MIME types, but only if the MIME
415 type is not "text/plain". Disallowing plug-ins to use text/plain prevents plug-ins from hijacking a fundamental type
416 that the browser is expected to handle, and also serves as an optimization to prevent loading the plug-in database in
419 2007-08-20 Adam Roben <aroben@apple.com>
421 Remove workarounds for <rdar://problem/5386894> now that it's been fixed
425 Tests: fast/loader/local-svg-parsed-as-svg.svg
426 fast/loader/local-xhtml-parsed-as-xhtml.xhtml
428 * platform/network/cf/ResourceResponseCFNet.cpp:
429 (WebCore::ResourceResponse::doUpdateResourceResponse): Removed hackish
432 2007-08-20 Anders Carlsson <andersca@apple.com>
436 <rdar://problem/5412988>
437 Crash when visiting http://www.rockonflash.com/blog/?p=58
439 * plugins/win/PluginViewWin.cpp:
440 (WebCore::PluginViewWin::updateWindow):
441 Just return if the plugin view hasn't been inserted in the hierarchy yet.
443 2007-08-20 Holger Hans Peter Freyther <zecke@selfish.org>
447 Do not define svg as ImageMIMEType if we can use ksvg2.
449 * platform/MIMETypeRegistry.cpp:
450 (WebCore::initialiseSupportedImageMIMETypes):
452 2007-08-19 Adam Roben <aroben@apple.com>
456 * platform/gdk/TemporaryLinkStubs.cpp: Removed const.
458 2007-08-19 Adam Roben <aroben@apple.com>
460 Fix <rdar://5395835> REGRESSION (r24527): Context menu for edit fields is missing "Font & Writing Direction"
462 The problem was that ContextMenuItem::setSubMenu was just copying the
463 HMENU from the ContextMenu passed in on Windows, but that HMENU was
464 later getting destroyed when the ContextMenu went out of scope.
466 I added a new ContextMenu::releasePlatformDescription method that is
467 used in setSubMenu instead. I think an ultimately better design would
468 be for setSubMenu to take ownership of the ContextMenu that's passed in
469 (as should insertItem and appendItem), but I decided to be conservative
470 and just make the changes needed to fix the bug.
476 * platform/ContextMenu.h: Added releasePlatformDescription.
477 * platform/gdk/TemporaryLinkStubs.cpp: Added stub implementation.
478 * platform/mac/ContextMenuMac.mm:
479 (WebCore::ContextMenu::releasePlatformDescription): Implemented, though
480 it's never called on this platform.
481 * platform/qt/ContextMenuQt.cpp:
482 (WebCore::ContextMenu::releasePlatformDescription): Ditto.
483 * platform/win/ContextMenuItemWin.cpp:
484 (WebCore::ContextMenuItem::setSubMenu): Call releasePlatformDescription
485 since we need to take ownership of the HMENU.
486 * platform/win/ContextMenuWin.cpp:
487 (WebCore::ContextMenu::releasePlatformDescription): Implemented.
489 2007-08-18 Maciej Stachowiak <mjs@apple.com>
493 - fixed <rdar://problem/5198272> REGRESSION: PLT 1.5% slower due to r21367 (change to start frames with empty documents)
495 There were three main cuases of extra time due to creating the initial empty document:
497 1) Creating an extra WebHTMLView and swapping it for a new one for each frame created.
498 2) Parsing the minimal markup for the initial document's contents.
499 3) Clearing the Window object an extra time and dispatching the corresponding delegate method.
501 The WebCore part of the fixes addresses 2 and 3.
503 * loader/FrameLoader.cpp:
504 (WebCore::FrameLoader::init): Don't parse "<html><body>" for the initial
505 empty document; it turns out not to be needed.
506 (WebCore::FrameLoader::dispatchWindowObjectAvailable): Don't
507 dispatch the delegate if we haven't created a ScriptInterpreter yet.
508 * bindings/js/kjs_proxy.cpp:
509 (WebCore::KJSProxy::initScriptIfNeeded): Dispatch the window object
510 delegate when we first create the interpreter, since that is now done
512 * loader/FrameLoader.h:
513 (WebCore::FrameLoader::committingFirstRealLoad): Helper for WebKit
514 to know when to reuse a WebHTMLView.
516 2007-08-19 Mitz Pettel <mitz@webkit.org>
518 Reviewed by Adam Roben.
520 - fix http://bugs.webkit.org/show_bug.cgi?id=15008
521 ASSERTION FAILED: !firstLineBox() == !lastLineBox() setting content on image
523 Test: fast/images/text-content-crash-2.html
525 * html/HTMLImageLoader.cpp:
526 (WebCore::HTMLImageLoader::setImage): Added a check that the renderer is an
528 (WebCore::HTMLImageLoader::updateFromElement): Ditto.
529 (WebCore::HTMLImageLoader::notifyFinished): Ditto.
531 2007-08-17 Maciej Stachowiak <mjs@apple.com>
535 - WebCore part of fix to scrollbar suppression hack for Leopard
537 * loader/FrameLoader.cpp:
538 (WebCore::FrameLoader::transitionToCommitted): Suppress scrollbars earlier, so it happens
539 before any potential view swap.
541 2007-08-17 Antti Koivisto <antti@apple.com>
545 Fix <rdar://problem/5403773>
546 CrashTracer: [USER] 88 crashes in Safari at com.apple.WebCore: WebCore::RenderTableSection::paint + 846
548 * rendering/RenderBlock.cpp:
549 (WebCore::RenderBlock::removePositionedObjects):
551 Fix crash in http://www.infobae.com/interior/home.html
552 Positioned objects removed from m_positionedObjects would in some cases not get added back to any
553 positioned objects list. Adding objects happens in block layout but since layout was not invalidated
554 correctly in removePositionedObjects() it would not get invoked. As a result some positioned objects
555 would stay in layout dirty state leading to crashes and other bad things.
557 * rendering/RenderTableSection.cpp:
558 (WebCore::RenderTableSection::paint):
560 Add needLayout() guard to eliminate this class of crashes from release builds.
561 Assert commented out for now since one existing layout test can't handle it.
563 2007-08-17 Kevin Decker <kdecker@apple.com>
565 Code change by Darin, landed and reviewed by me.
567 Fixed: <rdar://problem/5252836> Adobe Help Viewer: Japanese characters in the Help Tree structure are shown as garbage
568 Added fast/encoding/namespace-tolerance.html test.
570 * loader/TextResourceDecoder.cpp:
571 (WebCore::TextResourceDecoder::checkForHeadCharset): Slightly loosen the charset decoder heuristic by tweaking it
572 to ignore namespaces. This restores compatibility to documents which (1) use namespace prefixes on HTML elements
573 (2) specify a non-latin charset and (3) contain non-latin characters.
575 Added fast/encoding/namespace-tolerance.html test.
577 2007-08-17 Anders Carlsson <andersca@apple.com>
579 Reviewed by Dave Hyatt.
581 <rdar://problem/5379040>
582 REGRESSION (Tiger-Leopard): ADOBE: Safari calls NPP_SetWindow with bad values sometimes
584 Instantiate plug-ins during the first layout instead of doing so when creating the renderer.
585 This ensures that the plug-in widget will have a correct initial size.
587 * html/HTMLEmbedElement.cpp:
588 (WebCore::HTMLEmbedElement::getInstance):
589 Force a layout if the plug-in doesn't have an instance.
591 (WebCore::HTMLEmbedElement::attach):
592 Pass true to updateWidget, causing it to only create a widget if it won't be a plug-in.
594 * html/HTMLIFrameElement.cpp:
595 (WebCore::HTMLIFrameElement::attach):
596 Pass false to updateWidget, this will only create subframes anyway.
598 * html/HTMLObjectElement.cpp:
599 (WebCore::HTMLObjectElement::getInstance):
600 Force a layout if the plug-in doesn't have an instance.
602 (WebCore::HTMLObjectElement::attach):
603 Pass true to updateWidget, causing it to only create a widget if it won't be a plug-in.
605 * loader/FrameLoader.cpp:
606 (WebCore::FrameLoader::loadPlugin):
607 Get the size from the renderer and pass it to the client.
609 * loader/FrameLoaderClient.h:
610 * page/mac/WebCoreFrameBridge.h:
611 * platform/graphics/svg/SVGImageEmptyClients.h:
612 (WebCore::SVGEmptyFrameLoaderClient::createPlugin):
615 * rendering/RenderPart.cpp:
616 (WebCore::RenderPart::setWidget):
617 No need to mark the renderer as dirty here.
619 * rendering/RenderPartObject.h:
620 * rendering/RenderPartObject.cpp:
621 (WebCore::RenderPartObject::updateWidget):
622 Add a parameter, onlyCreateNonPlugins. If this is true the widget
623 will only be created if it's not a plug-in.
625 (WebCore::RenderPartObject::layout):
626 Call updateWidget here if m_widget is 0, causing the plug-in to be instantiated.
628 2007-08-17 Oliver Hunt <oliver@apple.com>
632 http://bugs.webkit.org/show_bug.cgi?id=14189
633 <rdar://problem/5319511> REPRODUCIBLE CRASH: Canvas createPattern(canvas, ...) crashes on Windows (14189)
635 Ensure that we actually retain the CG pattern correctly.
637 Credit to Henry Mason <hmason@mac.com> for finding the cause of this.
639 * html/CanvasPattern.cpp:
640 (WebCore::CanvasPattern::~CanvasPattern):
641 (WebCore::CanvasPattern::createPattern):
642 * html/CanvasPattern.h:
643 (WebCore::CanvasPattern::platformImage):
645 2007-08-16 Geoffrey Garen <ggaren@apple.com>
650 (WebCore::Cache::pruneLiveResources):
651 (WebCore::Cache::pruneDeadResources):
653 2007-08-16 Justin Garcia <justin.garcia@apple.com>
655 Reviewed by Harrison.
657 <rdar://problem/5378473>
658 REGRESSION: Undoing a deletion that is part of an open typing command fails to reinsert the caret
660 We recently made Undo of a series of deletes select all of the
661 characters that were deleted, not just the most recently deleted
662 character. But the code that did this set a new starting selection
663 after every delete, even those that were part of an open typing
664 command that started with character insertions or forward deletes,
665 operations that when undone, remove the starting selection being
666 set from the document.
668 After this change we only set a new starting selection if the open typing
669 command was opened by a backward delete. The new behavior matches TextEdit.
670 We don't do something similar or forward deletes because TextEdit opens
671 and closes a new typing command on forward delete (added a FIXME about this).
673 * editing/TypingCommand.cpp:
674 (WebCore::TypingCommand::TypingCommand): Initialize
675 m_openedByBackwardDelete.
676 (WebCore::TypingCommand::forwardDeleteKeyPressed): Added a FIXME about
677 how in TextEdit, forward deletes open and close a new typing command.
678 (WebCore::TypingCommand::doApply): Set m_openedByBackwardDelete
680 (WebCore::TypingCommand::deleteKeyPressed): Only set the starting
681 selection if this delete is the first one in an open typing command
682 or one in a series of deletes that opened the typing command.
683 * editing/TypingCommand.h: Added m_openedByBackwardDelete.
685 2007-08-13 Geoffrey Garen <ggaren@apple.com>
687 Reviewed by Dave Hyatt.
689 Tweaked the cache eviction model to better balance between live and
692 For the sake of avoiding evictions during the PLT, the old model
693 required the sum of dead and live resources to grow to twice the cache
694 capacity before evicting, and would then evict dead or live down to 0
695 if necessary. This was a too-high high water mark, which would nullify
696 much of the value of eviction, and a too-low low water mark, which
697 would nullify much of the value of the LRU-SP strategy.
699 This patch changes the model in 3 ways.
701 1. The new model for dead resources is a flexible window with a fixed
702 minimum and maximum. The dead resource window is big when live resource
703 pressure is small, and vice versa. This has the immediate advantage of
704 cutting the high water mark by up to 50%. It also enables the following
705 tunable optimizations in future patches:
706 a. A dead resource limit of 0 for clients who want that. (Just set
707 the fixed maximum to 0.)
708 b. A much higher low water mark. (Just set the fixed minimum to,
709 say, 25% of the cache's capacity.)
710 c. A much lower high water mark for users who browse simple pages
711 in one tab. (Just set the fixed maximum to, say, 50% of the cache's
714 I plan to make the changes that actually take advantage of these
715 tunable optimizations in another check-in.
717 The new model won't hurt the PLT because it will notice the PLT's low
718 live resource size, and up the dead resource capacity in response. For
719 the same reason, the new model should establish a good balance in
722 2. Live resource eviction is now based on size(), not encodedSize().
723 So, a page with lots of large, encoded images will start evicting
724 resources, if necessary, even before all the images paint. This allows
725 you to more accurately stipulate an exact high water mark.
727 3. When pruning, prune to a small percentage below capacity, to avoid
728 just having to prune again immediately.
730 Layout tests pass. PLT shows no regression.
732 * history/PageCache.cpp:
733 (WebCore::PageCache::releaseAutoreleasedPagesNow): Updated for rename.
735 * loader/Cache.cpp: Implemented the algorithm explained above.
736 * loader/Cache.h: Removed explicit tracking of decoded data size, since
739 * loader/CachedResource.cpp: ditto on tracking of decoded data size
741 2007-08-16 Darin Adler <darin@apple.com>
743 Reviewed by Tim Hatcher.
745 - fix <rdar://problem/5415029> In Mail, a crash occurs at WebCore::Node::isDescendantOf()
746 when attempting to delete a selection in a table
748 The bug was caused by createMarkup trying to operate on a range that
749 has an endpoint in the delete button DOM, because it removes that DOM
750 during its operation! Still working on a regression test -- it's hard
751 to make the kind of bad selection that's needed with the DOM, so I might
752 have to use the eventSender.
754 * editing/DeleteButtonController.h: Made some of the identifiers private.
755 We can make them public if we need to use them. Added a getter function
756 for the container element so we can figure out if a given node is inside
757 the DOM added for the delete button.
759 * editing/markup.cpp:
760 (WebCore::moveEndpointsBeforeNode): Added. General purpose helper function
761 that moves endpoints of a range to before a given node -- we do this before
762 removing the delete button, so the endpoint is where the delete button was,
763 rather than having an endpoint that's not in the document.
764 (WebCore::createMarkup): Always return empty string, not null string.
765 Get the document by calling ownerDocument on the range rather than getting
766 the document of the commonAncestorContainer. That's because we need to
767 get at the delete button before calling commonAncestorContainer. Call
768 moveEndpointsBeforeNode to move the range endpoints out of the delete
769 button interface before calling disable() which will remove it from the
770 DOM if it's in there. Added an early return for the case where commonAncestor
771 is non-0. If this happens, we would crash later because pastEndNode would
772 not be in the tree. This change alone would prevent the crash, but we'd get
773 bad markup, so we need the moveEndpointsBeforeNode fix. Added null checks
774 for the frame to the range version as in the single-node version so this
775 won't crash immediately on documents that are not in a frame. For the
776 single-node version, added a check if a ndoe of 0 and a node inside the
777 delete button user interface, and return the empty string for those cases.
779 2007-08-16 Justin Garcia <justin.garcia@apple.com>
783 <rdar://problem/5378847> After creating and removing a ToDo, the caret disappears as soon as I start to type
785 * editing/InsertTextCommand.cpp:
786 (WebCore::InsertTextCommand::input): A whitespace text node inserted by Mail
787 when a ToDo is removed is completely removed by deleteInsignificantWhitespace,
788 and since it contains the text insertion position, insertion fails.
789 Save the position before the node where text insertion will occur,
790 and if that node is removed, use the saved position for insertion.
792 2007-08-16 Darin Adler <darin@apple.com>
796 - fix <rdar://problem/5413488> REGRESSION: every DOM element is about 40
797 bytes bigger because it has a Timer
799 Moved the timer to the document from the element.
801 * dom/Document.h: Made frame() inline. Added updateFocusApperanceSoon(),
802 cancelFocusAppearanceUpdate(), m_updateFocusAppearanceTimer,
803 clearXMLVersion(), and updateFocusAppearanceTimerFired(). Also made
804 everything that was previously protected be private instead.
806 (WebCore::Document::Document): Initialize m_updateFocusAppearanceTimer.
807 (WebCore::Document::updateFocusAppearanceSoon): Added. Starts timer.
808 (WebCore::Document::cancelFocusAppearanceUpdate): Added. Stops timer.
809 (WebCore::Document::updateFocusAppearanceTimerFired): Added. If the
810 focused node is a focusable element, then calls
811 updateFocusAppearance(false) on it.
813 * dom/Element.h: Removed default value of the boolean parameter to
814 updateFocusAppareance. Removed needsFocusAppearanceUpdate(),
815 setNeedsFocusAppearanceUpdate(), updateFocusAppearanceTimerFired(),
816 stopUpdateFocusAppearanceTimer(), m_updateFocusAppearanceTimer, and
817 m_needsFocusAppearanceUpdate. Added
818 updateFocusAppearanceSoonAfterAttach() and cancelFocusAppearanceUpdate().
820 (WebCore::ElementRareData::ElementRareData): Added initializer for
821 m_needsFocusAppearanceUpdateSoonAfterAttach.
822 (WebCore::Element::Element): Removed initializers for
823 m_updateFocusAppearanceTimer and m_needsFocusAppearanceUpdate.
824 (WebCore::Element::attach): Updated code that starts the focus
825 appearance timer to instead call updateFocusAppearanceSoon() on the
827 (WebCore::Element::detach): Replaced call to
828 stopUpdateFocusAppearanceTimer with call to cancelFocusAppearanceUpdate.
829 (WebCore::Element::focus): Added check for node that's already focused,
830 to match the logic that's in the derived classes. This makes it safe for
831 us to remove the override in the derived classes. Also replaced the code
832 that called setNeedsFocusAppearanceUpdate(true) with code to set the
833 rare data flag m_needsFocusAppearanceUpdateSoonAfterAttach and added a
834 call to cancelFocusAppearanceUpdate() in the case where there's no focus
836 (WebCore::Element::blur): Replaced call to
837 stopUpdateFocusAppearanceTimer with call to cancelFocusAppearanceUpdate.
838 (WebCore::Element::cancelFocusAppearanceUpdate): Added. Sets
839 m_needsFocusAppearanceUpdateSoonAfterAttach to false, and then calls
840 cancelFocusAppearanceUpdate() on the document, but only if the element
841 is the focused node of the document.
843 * html/HTMLDocument.cpp:
844 (WebCore::HTMLDocument::HTMLDocument): Replaced code that sets
845 m_xmlVersion directly with a call to a new inline clearXMLVersion()
847 (WebCore::HTMLDocument::setCookie): Replaced use of m_policyBaseURL with
849 (WebCore::HTMLDocument::createTokenizer): Replaced uses of m_frame with
851 (WebCore::HTMLDocument::determineParseMode): Replaced code that sets
852 pMode and hMode directly with calls to setParseMode and setHTMLMode.
853 Replaced use of m_styleSelector with styleSelector().
855 * html/HTMLInputElement.h: Removed now-unneed override of focus().
856 Removed default value of the boolean parameter to updateFocusAppareance.
857 * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::updateFocusAppearance):
858 Pass the restorePreviousSelection boolean through -- while it's ignored,
859 it no longer has a default value.
861 * html/HTMLTextAreaElement.h: Removed now-unneed override of focus().
862 Removed default value of the boolean parameter to updateFocusAppareance.
863 * html/HTMLTextAreaElement.cpp: Ditto.
865 * WebCore.exp: Removed the Document::frame() symbol, since it's now inline.
867 2007-08-15 Antti Koivisto <antti@apple.com>
871 Fix <rdar://problem/5388936>
872 Crash while setting display:none for a table cell with selection
874 Super class destroy() could (through some selection code in removeChild()) trigger section recalc
875 in middle of RenderTableCell::destroy(), cleaning section dirty bit. This would later crash in
876 layout since cell grid would still have refence to the dead cell.
878 Ensure table sections are dirty when leaving destroy method.
880 I can't figure out tests for row and section changes but they look like
881 they could crash in similar way as cell.
883 * rendering/RenderTableCell.cpp:
884 (WebCore::RenderTableCell::destroy):
885 * rendering/RenderTableRow.cpp:
886 (WebCore::RenderTableRow::destroy):
887 * rendering/RenderTableSection.cpp:
888 (WebCore::RenderTableSection::destroy):
890 2007-08-15 Maciej Stachowiak <mjs@apple.com>
894 <rdar://problem/5389696> leak of 32-byte NSData object (and more?) in WebIconDatabase code path with each refresh of http://www.apple.com
896 * platform/graphics/BitmapImage.h: Use RetainPtr for m_nsImage and m_tiffRep
897 * platform/graphics/mac/ImageMac.mm:
898 (WebCore::BitmapImage::initPlatformData): No need to do anything now
899 (WebCore::BitmapImage::invalidatePlatformData): Simplify
900 (WebCore::BitmapImage::getTIFFRepresentation): Use RetainPtr to avoid leaks
901 (WebCore::BitmapImage::getNSImage): Use RetainPtr to avoid leaks
903 2007-08-15 Darin Adler <darin@apple.com>
907 - fix <rdar://problem/5094895> REGRESSION (r19094): JavaScript timers don't
908 work inside showModalDialog; caret also doesn't blink
910 * platform/Timer.h: Added fireTimersInNestedEventLoop.
911 * platform/Timer.cpp:
912 (WebCore::TimerBase::fireTimers): Added code to exit if the timersReadyToFire
913 is cleared. This indicates that someone fired the timers in the nested event
914 loop, so we should not fire any more timers ourselves.
915 (WebCore::TimerBase::fireTimersInNestedEventLoop): Added. Sets timersReadyToFire
916 to 0 so we won't return early and do nothing if the shared timer first. Then
917 calls updateSharedTimer() so the shared timer will get scheduled as needed based
918 on any pending timers.
920 * page/Chrome.cpp: (WebCore::Chrome::runModal): Call
921 fireTimersInNestedEventLoop before calling runModal on the client.
923 * manual-tests/modal-dialog.html: Added a test that uses a timeout.
924 * manual-tests/show-modal-dialog-test.html: Fixed a typo.
926 2007-08-15 Justin Garcia <justin.garcia@apple.com>
930 http://bugs.webkit.org/show_bug.cgi?id=14971
931 REGRESSION: cannot select reporter's e-mail in bugzilla
933 * page/EventHandler.cpp:
934 (WebCore::EventHandler::canMouseDragExtendSelect): Allow drag-selecting inside
935 a -webkit-user-select:ignore region.
937 2007-08-15 Beth Dakin <bdakin@apple.com>
941 Rolling back in. I made a silly mistake in XMLTokenizer that caused
942 this patch to crash SVG tests. It's fixed now!
944 Refactor of change for <rdar://problem/5404899> REGRESSION: Mail
945 crash in WebCore::FontFallbackList::fontDataAt() after dragging
946 image into text multiple times
948 The original fix that I made last night prevents the pending style
949 sheet count from being incremented until the element is in the
950 document. This fix prevents the style sheet from loading at all
951 until it is in the document.
954 * dom/StyleElement.cpp:
955 (WebCore::StyleElement::insertedIntoDocument): Call process.
956 (WebCore::StyleElement::removedFromDocument): This can be reverted
957 to its original state before my patch last night.
958 (WebCore::StyleElement::process): childrenChanged is now called
959 process. Return early if your not in the document.
960 (WebCore::StyleElement::createSheet): Revert change from last
961 night. The inDocument check is now in caller childrenChanged.
962 * dom/StyleElement.h: insertedIntoDocument() must now accept an
963 element in addition to a document.
965 This is an optimization to prevent calling updateStyleSelector()
967 * dom/XMLTokenizer.cpp:
968 (WebCore::XMLTokenizer::startElementNs):
969 * html/HTMLStyleElement.cpp:
970 (WebCore::HTMLStyleElement::HTMLStyleElement):
971 (WebCore::HTMLStyleElement::finishedParsing):
972 (WebCore::HTMLStyleElement::insertedIntoDocument):
973 (WebCore::HTMLStyleElement::childrenChanged):
974 (WebCore::HTMLStyleElement::sheetLoaded):
975 * html/HTMLStyleElement.h:
976 * ksvg2/svg/SVGStyleElement.cpp:
977 (WebCore::SVGStyleElement::SVGStyleElement):
978 (WebCore::SVGStyleElement::finishedParsing):
979 (WebCore::SVGStyleElement::insertedIntoDocument):
980 (WebCore::SVGStyleElement::childrenChanged):
981 (WebCore::SVGStyleElement::sheetLoaded):
982 * ksvg2/svg/SVGStyleElement.h:
983 (WebCore::SVGStyleElement::setCreatedByParser):
985 This is a name change. Document::stylesheetLoaded()
986 is now Document::removePendingSheet()
988 (WebCore::Document::removePendingSheet):
990 * dom/ProcessingInstruction.cpp:
991 (WebCore::ProcessingInstruction::sheetLoaded):
992 * html/HTMLLinkElement.cpp:
993 (WebCore::HTMLLinkElement::~HTMLLinkElement):
994 (WebCore::HTMLLinkElement::setDisabledState):
995 (WebCore::HTMLLinkElement::process):
996 (WebCore::HTMLLinkElement::sheetLoaded):
998 (WebCore::UserStyleSheetLoader::~UserStyleSheetLoader):
999 (WebCore::UserStyleSheetLoader::setCSSStyleSheet):
1001 This is another name change. closeRenderer() is now
1004 (WebCore::Node::finishedParsing):
1005 * dom/XMLTokenizer.cpp:
1006 (WebCore::XMLTokenizer::endElementNs):
1008 * html/HTMLAppletElement.cpp:
1009 (WebCore::HTMLAppletElement::finishedParsing):
1010 * html/HTMLAppletElement.h:
1011 * html/HTMLGenericFormElement.cpp:
1012 (WebCore::HTMLFormControlElementWithState::finishedParsing):
1013 * html/HTMLGenericFormElement.h:
1014 * html/HTMLObjectElement.cpp:
1015 (WebCore::HTMLObjectElement::finishedParsing):
1016 * html/HTMLObjectElement.h:
1017 * html/HTMLParser.cpp:
1018 (WebCore::HTMLParser::insertNode):
1019 (WebCore::HTMLParser::popOneBlockCommon):
1020 * html/HTMLScriptElement.cpp:
1021 (WebCore::HTMLScriptElement::finishedParsing):
1022 * html/HTMLScriptElement.h:
1023 (WebCore::HTMLStyleElement::setCreatedByParser):
1024 * ksvg2/svg/SVGAnimationElement.cpp:
1025 (WebCore::SVGAnimationElement::finishedParsing):
1026 * ksvg2/svg/SVGAnimationElement.h:
1027 * ksvg2/svg/SVGElement.cpp:
1028 (WebCore::SVGElement::finishedParsing):
1029 * ksvg2/svg/SVGElement.h:
1031 2007-08-15 David Harrison <harrison@apple.com>
1033 Reviewed by Antti Koivisto.
1035 <rdar://problem/5411803> Bumpercar crashes when loading a partial URL (FrameLoader::receivedMainResourceError())
1037 * loader/MainResourceLoader.cpp:
1038 (WebCore::MainResourceLoader::receivedError):
1039 Nil check for the FrameLoader.
1041 2007-08-14 Steve Falkenburg <sfalken@apple.com>
1043 <rdar://problem/5411482> Windows user agent language always returns "en"
1045 Implement defaultLanguage().
1049 * WebCore.vcproj/WebCore.vcproj: Added Language.cpp.
1050 * platform/win/Language.cpp: Added.
1051 (WebCore::localeInfo): Added.
1052 (WebCore::defaultLanguage): Added.
1053 * platform/win/TemporaryLinkStubs.cpp: Remove defaultLanguage stub.
1055 2007-08-14 Sam Weinig <sam@webkit.org>
1057 Reviewed by Geoff and Oliver.
1059 Fix for <rdar://problem/5267870>
1060 Mangleme: Reproducible assertion failure in -[WebCoreFrameBridge installInFrame:]
1062 - Change embed/plugin code path to detach the frame on willRemove instead of detach.
1063 This matches what frame and iframe do.
1065 Test: http/tests/misc/embedCrasher.html
1067 * html/HTMLPlugInElement.cpp:
1068 (WebCore::HTMLPlugInElement::willRemove):
1069 * html/HTMLPlugInElement.h:
1071 2007-08-14 Adele Peterson <adele@apple.com>
1075 Fix for <rdar://problem/5370059> REGRESSION: Cannot type into edit fields on a form (sccsheriff.org)
1077 This change makes -webkit-user-select an inherited css property. For "user-select: none" we were already
1078 acting like it was an inheritable property, where we let user-select:text on the children override its parent's user-select:none.
1079 By making user-select really inherited (instead of inherited for some values), we eliminate the need for crawling up the tree to see
1080 if an ancestor has user-select ignore set.
1082 * page/EventHandler.cpp: (WebCore::EventHandler::canMouseDownStartSelect):
1083 Now that user-select is inherited, you don't need to walk up the render tree looking for ancestors with user-select:ignore set.
1085 * css/CSSStyleSelector.cpp: Eliminate SELECT_AUTO.
1086 (WebCore::CSSStyleSelector::adjustRenderStyle):
1087 (WebCore::CSSStyleSelector::applyProperty):
1088 * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1090 * rendering/RenderStyle.h:
1091 (WebCore::): Eliminate SELECT_AUTO. Make userSelect inherited.
1092 (WebCore::RenderStyle::userSelect):
1093 (WebCore::RenderStyle::setUserSelect):
1094 (WebCore::RenderStyle::initialUserSelect):
1095 * rendering/RenderStyle.cpp:
1096 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1097 (WebCore::StyleRareNonInheritedData::operator==):
1098 (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1099 (WebCore::StyleRareInheritedData::operator==):
1100 (WebCore::RenderStyle::diff):
1102 2007-08-15 Peter Kasting <zerodpx@gmail.org>
1106 http://bugs.webkit.org/show_bug.cgi?id=14967 part 1 - Eliminate most implicit
1107 conversions of wtf::Vector<T> to T* by explicitly calling .data()
1109 * html/HTMLSelectElement.cpp:
1110 (WebCore::HTMLSelectElement::saveState):
1111 * platform/KURL.cpp:
1112 (WebCore::KURL::KURL):
1113 (WebCore::KURL::init):
1114 (WebCore::KURL::decode_string):
1115 (WebCore::KURL::parse):
1116 (WebCore::KURL::encode_string):
1117 * platform/cf/KURLCFNet.cpp:
1118 (WebCore::KURL::KURL):
1119 * platform/mac/KURLMac.mm:
1120 (WebCore::KURL::KURL):
1121 * rendering/RenderFrameSet.cpp:
1122 (WebCore::RenderFrameSet::layOutAxis):
1124 2007-08-14 Ricci Adams <iccir@apple.com>
1126 Reviewed by Darin, Hyatt.
1128 - fix <rdar://problem/5407795> -apple-line-clamp should never display less than one line
1130 * rendering/RenderFlexibleBox.cpp:(WebCore::RenderFlexibleBox::layoutVerticalBox): Use
1131 max to make sure it never computes a minimum of less than one line.
1133 2007-08-14 Brady Eidson <beidson@apple.com>
1135 Reviewed by Darin, John, Maciej, Oliver, and Tim
1137 <rdar://problem/5394708> - Crash on launch with corrupt icon database
1139 The main part of the fix is to not disable SQLite's default level of protection - to leave the sync options at their normal,
1142 But in case lightning strikes at the exact right moment and someone ends up with a corrupt database, add some support code to
1143 detect that condition and recover from it.
1145 This is mainly accomplished by exposing the "PRAGMA integrity_check;" facilities of sqlite through IconDatabase SPI as well as
1146 running that integrity check if a journal file is detected at launch (a strong indication that the last quit was not clean).
1147 There's also a method exposed to allow clients to tell the icon database "I suspect something bad happened, please check integrity"
1149 * loader/icon/IconDatabase.cpp:
1150 (WebCore::IconDatabase::checkIntegrityBeforeOpening): Allow clients to suggest an integrity check
1151 (WebCore::IconDatabase::open): Add a check to see if the journal file for the database exists. If it does, run the integrity
1152 check. Also run the check if a client has suggested it to be necessary.
1153 If the integrity-check fails, we sadly have to destroy the database and recreate from scratch.
1154 Also - quite importantly - do not adjust the default sync preferences for the SQLDatabase. They were an optimization that
1155 might have been valid at one time but no longer affects any benchmarks we care about.
1156 (WebCore::IconDatabase::checkIntegrity): Perform the SQLite integrity_check pragma
1157 * loader/icon/IconDatabase.h:
1159 * loader/icon/IconDatabaseNone.cpp:
1160 (WebCore::IconDatabase::checkIntegrity): Keep IconDatabaseNone users building
1161 (WebCore::IconDatabase::checkIntegrityBeforeOpening): Ditto
1163 * loader/icon/SQLDatabase.cpp:
1164 (WebCore::SQLDatabase::open): Make a copy of the path string so we don't accidentally mutate anyone else's string on ::close()
1166 * platform/FileSystem.h: Added. Begin a long-needed platform file system abstraction
1167 * platform/mac/FileSystemMac.mm: Added.
1168 (WebCore::fileExists): Check if a file exists
1169 (WebCore::deleteFile): Delete a file
1171 * platform/gdk/TemporaryLinkStubs.cpp:
1172 (WebCore::fileExists):
1173 (WebCore::deleteFile):
1174 * platform/qt/TemporaryLinkStubs.cpp:
1175 (WebCore::fileExists):
1176 (WebCore::deleteFile):
1177 * platform/win/TemporaryLinkStubs.cpp:
1178 (WebCore::fileExists):
1179 (WebCore::deleteFile):
1182 * WebCore.xcodeproj/project.pbxproj:
1184 2007-08-14 Jon Honeycutt <jhoneycutt@apple.com>
1188 Build fix for Windows.
1190 * html/HTMLFormElement.cpp:
1192 2007-08-14 George Staikos <staikos@kde.org>
1194 Only connect the menu signal once.
1196 * platform/qt/ContextMenuQt.cpp:
1197 (WebCore::ContextMenu::ContextMenu):
1198 (WebCore::ContextMenu::insertItem):
1200 2007-08-14 Justin Garcia <justin.garcia@apple.com>
1204 <rdar://problem/5408255> REGRESSION: In Mail, clicking the containing element's UI closebox doesn't delete element
1206 * editing/DeleteButtonController.cpp:
1207 (WebCore::DeleteButtonController::show): Use -webkit-user-select:ignore for
1210 2007-08-14 Antti Koivisto <antti@apple.com>
1214 Fix <rdar://problem/5143183>
1215 Air Mail postmark shows up wrong in Firefox due to use of CSS background-position-x/y
1217 Safari was using non-standard background-position-x/y properties when serializing style, both normal
1218 and computed. As a result Safari generated CSS would not render correctly in Firefox.
1220 Use standard background-position property instead.
1222 * css/CSSComputedStyleDeclaration.cpp:
1224 * css/CSSMutableStyleDeclaration.cpp:
1225 (WebCore::CSSMutableStyleDeclaration::cssText):
1227 2007-08-14 Sam Weinig <sam@webkit.org>
1229 Reviewed by Brady and Dr. Harrison.
1231 Fix typo. 'whitespace' property is spelled 'white-space'.
1233 * page/inspector/inspector.css:
1235 2007-08-13 Beth Dakin <bdakin@apple.com>
1239 Fix for <rdar://problem/5404899> REGRESSION: Mail crash in
1240 WebCore::FontFallbackList::fontDataAt() after dragging image into
1243 We were crashing because style information was not up-to-date. This
1244 patch fixes the problem in two ways:
1246 Style information was not up to date at the time of the crash
1247 because the document thought there was still a pending style sheet.
1248 The pending style sheet counter was incremented when a call to
1249 cloneNode from Mail cloned a style node with an imported style
1250 sheet. Because Mail disables the cache, the style sheet did not
1251 load immediately for the cloned node, and we do not check again to
1252 see if it has loaded in time to decrement the pending style sheet
1253 counter before the crash point. The fix here is only to increment
1254 the pending style sheet counter for elements that are already in
1256 * dom/StyleElement.cpp:
1257 (WebCore::StyleElement::insertedIntoDocument): If we have a CSS
1258 style sheet that is currently loading, increment the pending style
1259 sheet counter. This should keep the counter accurate in the case
1260 where a style node is cloned and then immediately inserted into the
1262 (WebCore::StyleElement::removedFromDocument): If we have a CSS
1263 style sheet that is currently loading, decrement the pending style
1264 sheet count. This is required to keep the correct balance, given
1266 (WebCore::StyleElement::createSheet): Only addPendingSheet() and
1267 checkLoaded() if we are in the document.
1269 Here is Darin's original fix. It seems worth keeping this fix too.
1270 Font style information should not cause a crash if there are still
1271 pending style sheets. This is good belt-and-suspenders in case
1272 there is another way to run into this bug with a wacky timing
1274 * css/CSSStyleSelector.cpp:
1275 (WebCore::CSSStyleSelector::styleForElement): Update the font.
1277 2007-08-13 Alexey Proskuryakov <ap@webkit.org>
1281 http://bugs.webkit.org/show_bug.cgi?id=14635
1282 rdar://problem/5340188
1283 Uploading file with non-ASCII character in path fails
1285 File upload cannot be tested in DumpRenderTree.
1287 * html/HTMLFormElement.cpp:
1288 (WebCore::pathGetFilename): A cross-platform helper that extracts a file name from a path.
1289 (WebCore::HTMLFormElement::formData): Use the above helper instead of code that doesn't
1292 2007-08-13 Alexey Proskuryakov <ap@webkit.org>
1296 http://bugs.webkit.org/show_bug.cgi?id=14951
1297 REGRESSION: page interpreted as UTF-8 because of stray <?xml> after <head>
1299 Test: fast/encoding/misplaced-xml-declaration.html
1301 * loader/TextResourceDecoder.cpp:
1302 (WebCore::TextResourceDecoder::checkForHeadCharset): Only honor XML declaration
1303 at the very beginning of the file.
1305 2007-08-13 Oliver Hunt <oliver@apple.com>
1309 Correct accidentally modified code.
1311 * platform/mac/FontDataMac.mm:
1312 (WebCore::FontData::platformInit):
1314 2007-08-13 Adele Peterson <adele@apple.com>
1318 Fix for http://bugs.webkit.org/show_bug.cgi?id=14746
1319 <rdar://problem/5401041> REGRESSION: Form state not saved for forms that submit via HTTPS even if they do not contain a password field
1321 * loader/FrameLoader.cpp: (WebCore::FrameLoader::saveDocumentState): Restore our old behavior that will save form state for secure forms.
1322 This will also match Firefox behavior.
1324 * dom/Document.cpp: Removed secureFormAdded(), secureFormRemoved(), hasSecureForm() which are no longer used.
1326 * html/HTMLFormElement.cpp:
1327 (WebCore::HTMLFormElement::attach):
1328 (WebCore::HTMLFormElement::parseMappedAttribute):
1330 2007-08-13 Oliver Hunt <oliver@apple.com>
1334 <rdar://problem/5386183> REGRESSION (9A504-9A508): Underline of inline hole is too thin
1335 on Japanese DotMac page
1337 Hack the line metrics for the Hiragino font families so that they always allow space for
1338 the marked text underline.
1340 * platform/mac/FontDataMac.mm:
1341 (WebCore::FontData::platformInit):
1343 2007-08-13 David Hyatt <hyatt@apple.com>
1347 <rdar://problem/5400446> messed up content on calendar.yahoo.com and my.yahoo.com
1349 Fix some more bad assumptions about <html> being the first child of the document now that we
1350 properly support HTML5's model (where a comment node preceding <html> will in fact be its sibling).
1352 * html/HTMLParser.cpp:
1353 (WebCore::HTMLParser::handleError):
1354 (WebCore::HTMLParser::createHead):
1356 2007-08-13 Justin Garcia <justin.garcia@apple.com>
1360 <rdar://problem/5333725> -webkit-user-select: none makes selection difficult
1362 Let users create selections if they mouse down in a -webkit-user-select:none
1363 region, just (continue to) disallow selection endpoints in those regions, and
1364 don't paint those regions as selected if they are fully enclosed by a selection.
1365 For example, in xxyyyxx where x is -webkit-user-select:none, a user can mouse down
1366 between the first two xs and drag across yyy to the second two xs to create a
1367 selection xx^yyy^xx.
1369 * editing/SelectionController.cpp:
1370 (WebCore::SelectionController::selectAll): Allow selectAll inside a root
1371 that has -webkit-user-select:none, because it may contain content that
1372 is selectable (VisiblePosition and Selection creation will keep Selection
1373 endpoints out of -webkit-user-select:none regions).
1374 * page/EventHandler.cpp:
1375 (WebCore::EventHandler::selectClosestWordFromMouseEvent): Use canMouseDownStartSelect
1376 instead of the ambiguously named shouldSelect().
1377 (WebCore::EventHandler::handleMousePressEventTripleClick): Ditto.
1378 (WebCore::EventHandler::handleMousePressEventSingleClick): Ditto.
1379 (WebCore::EventHandler::updateSelectionForMouseDrag): Use canMouseDragExtendSelect.
1380 (WebCore::EventHandler::selectCursor): Paint an ibeam in -webkit-user-select:none regions,
1381 because you can click in those regions to create a selection.
1382 (WebCore::EventHandler::canMouseDownStartSelect): Now fires the selectStart event, and
1383 returns true in -webkit-user-select: none regions.
1384 (WebCore::EventHandler::canMouseDragExtendSelect): This is identical to
1385 canMouseDownStartSelect because of 12823, even though it seems strange that we would fire
1386 the selectStart event here.
1387 * page/EventHandler.h:
1388 * rendering/RenderObject.cpp:
1389 (WebCore::RenderObject::draggableNode): Only -webkit-user-select:ignore regions will
1390 prevent selection creation.
1391 * rendering/RenderObject.h:
1393 2007-08-13 Anders Carlsson <andersca@apple.com>
1397 <rdar://problem/5360748>
1398 REGRESSION (r21002-r21003): Flash widget sniffer doesn't work (affects iWeb)
1400 Don't check whether the document is being parsed or not, because the node list
1401 could be accessed after the document has finished parsing.
1404 (WebCore::Node::registerNodeList):
1406 2007-08-13 Lars Knoll <lars@trolltech.com>
1410 no need to update regions that are not visible on the webpage.
1412 * platform/qt/ScrollViewQt.cpp:
1413 (WebCore::ScrollView::updateContents):
1415 2007-08-12 Maciej Stachowiak <mjs@apple.com>
1417 Reviewed by Darin and Sam.
1419 <rdar://problem/5395213> cross-domain access to individual components of location object should be denied.
1421 * bindings/js/kjs_window.cpp:
1422 (KJS::Location::put): Add the appropriate cross-domain access checks.
1424 2007-08-12 Darin Adler <darin@apple.com>
1426 Reviewed by John Sullivan.
1428 - fix <rdar://problem/5403724> REGRESSION: text inputs are not scrolled to make inline input visible (14912)
1430 * editing/Editor.h: Made setIgnoreMarkedTextSelectionChange no longer inline.
1431 It now has a side effect of revealing the selection when you set it to false.
1432 Added private revealSelectionAfterEditingOperation helper.
1433 * editing/Editor.cpp:
1434 (WebCore::Editor::deleteRange): Calls revealSelectionAfterEditingOperation instead
1435 of calling m_frame->revealSelection directly.
1436 (WebCore::Editor::replaceSelectionWithFragment): Ditto.
1437 (WebCore::Editor::insertOrderedList): Ditto.
1438 (WebCore::Editor::insertUnorderedList): Ditto.
1439 (WebCore::Editor::increaseSelectionListLevel): Ditto.
1440 (WebCore::Editor::increaseSelectionListLevelOrdered): Ditto.
1441 (WebCore::Editor::increaseSelectionListLevelUnordered): Ditto.
1442 (WebCore::Editor::decreaseSelectionListLevel): Ditto.
1443 (WebCore::Editor::insertLineBreak): Ditto.
1444 (WebCore::Editor::insertParagraphSeparator): Ditto.
1445 (WebCore::Editor::replaceMarkedText): Ditto.
1446 (WebCore::Editor::revealSelectionAfterEditingOperation): Added. Calls revealSelection,
1447 unless we are in the ignoreMarkedTextSelectionChange state. If we are in that state,
1448 we're in the middle of a composite editing operation and we shouldn't try to scroll
1449 to reveal the selection until the operation is done.
1450 (WebCore::Editor::setIgnoreMarkedTextSelectionChange): Made no longer inline. If
1451 changing the state from true to false, then calls revealSelectionAfterEditingOperation.
1453 * WebCore.exp: Add new entry point for no-longer-inline setter function.
1455 2007-08-12 Geoffrey Garen <ggaren@apple.com>
1457 Reviewed by Maciej Stachowiak, Dave Hyatt.
1459 Changed the dead resource LRU-SP algorithm to measure an object's
1460 total size, not just its encoded size. This will allow us to make
1461 better decisions about what data to evict when the cache is small. For
1462 example, the PLT can now run with a 16MB cache without fully evicting
1465 (Previously, we had assumed that decoded size would be an OK estimate
1466 of encoded size, but that is not true of GIF, whose decoded size can be
1467 orders of magnitude greater than its encoded size.)
1469 Subtly, destroying a resource's decoded data now increases its recency
1470 by moving it to the head of a smaller LRU list. This is slightly odd,
1471 but, since all resources get the same treatment, it shouldn't hurt
1472 the eviction algorithm.
1474 * history/PageCache.cpp:
1475 (WebCore::PageCache::releaseAutoreleasedPagesNow): Make sure that a
1476 dead resource eviction doesn't happen until we've released all of our
1477 dead pages. Otherwise, the cache will make terrible decisions about
1478 what to evict because all of our dead resources will seem live.
1481 (WebCore::Cache::Cache):
1482 (WebCore::Cache::pruneLiveResources):
1483 (WebCore::Cache::pruneDeadResources): Removed call to
1484 removeFromLiveDecodedResourcesList because this happens automatically
1485 now as a part of the process of changing the resource's decoded size.
1486 (WebCore::Cache::lruListFor): *** The key change. *** Compute the
1487 appropriate LRU list based on total size, not encoded size.
1488 (WebCore::Cache::dumpLRULists): Added debug logging function to help
1489 visualize the cache.
1492 (WebCore::Cache::setDeadResourcePruneEnabled):
1493 (WebCore::Cache::deadResourcePruneEnabled):
1495 * loader/CachedImage.cpp: Moved decoded size tracking code from here
1496 up into the base class. Currently, only CachedImage has a use for that
1497 functionality, but other subclasses might need it in the future, and
1498 the base class is already responsible for similar code related to
1499 encoded size tracking.
1500 (WebCore::CachedImage::decodedSizeChanged):
1501 * loader/CachedImage.h:
1503 * loader/CachedResource.cpp:
1504 (WebCore::CachedResource::CachedResource):
1505 (WebCore::CachedResource::setDecodedSize): Move us in the LRU-SP list
1506 just like setEncodedSize does, since decoded size counts now, too.
1507 (WebCore::CachedResource::setEncodedSize): Changed slightly to match
1508 the style of setDecodedSize.
1510 * loader/CachedResource.h:
1511 (WebCore::CachedResource::decodedSize):
1513 2007-08-11 Mitz Pettel <mitz@webkit.org>
1517 - fix http://bugs.webkit.org/show_bug.cgi?id=13670
1518 <rdar://problem/5399619> Table misrender when one of the TDs has width=100%
1520 Tests: fast/table/100-percent-cell-width.html
1521 fast/table/percent-widths-stretch.html
1523 * rendering/AutoTableLayout.cpp:
1524 (WebCore::AutoTableLayout::calcPrefWidths): Changed the value used instead of
1525 0% to avoid division by zero from 1% to less than 0.01%. Removed code that
1526 added 0.5px to non-percent widths when calculating the scaling factor. The
1527 latter change is covered by the percent-widths-stretch test, where the new
1528 results match both WinIE 7 and Firefox 3.
1530 2007-08-11 Darin Adler <darin@apple.com>
1534 - fix <rdar://problem/5266535> REGRESSION: <img> inside <map> no longer allowed in strict mode
1535 (breaks chemicalelements.com)
1537 Test: fast/parser/strict-img-in-map.html
1539 * html/HTMLMapElement.cpp: (WebCore::HTMLMapElement::checkDTD): Removed FIXME saying this
1540 code is strange, since this code matches the HTML 4 specification almost exactly. Made
1541 <img> elements allowed even in strict mode and added small comments to clarify what comes
1542 from the DTD and what is non-standard.
1544 2007-08-11 Holger Hans Peter Freyther <zecke@selfish.org>
1548 Implement passing events to a subframe. The code is copied from
1549 the windows port and passSubframeEventToSubframe was removed as it
1550 is not called and it is not avilable in the windows port as well.
1552 * page/gdk/EventHandlerGdk.cpp:
1553 (WebCore::EventHandler::passMousePressEventToSubframe):
1554 (WebCore::EventHandler::passMouseMoveEventToSubframe):
1555 (WebCore::EventHandler::passMouseReleaseEventToSubframe):
1557 2007-08-11 Holger Hans Peter Freyther <zecke@selfish.org>
1561 GdkEventKey::string is not supposed to be used. The length
1562 of this string is zero for non ascii characters. Use the
1563 gdk_unicode_to_keyval to convert the keyval to a UChar and construct
1564 a String. This change makes it possible to input non ascii
1567 * platform/gdk/KeyEventGdk.cpp:
1568 (WebCore::keyIdentifierForGdkKeyCode):
1569 (WebCore::singleCharacterString):
1570 (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1572 2007-08-11 Andrew Wellington <proton@wiretapped.net>
1574 Reviewed by Mark Rowe.
1576 Fix http://bugs.webkit.org/show_bug.cgi?id=14645
1577 getPropertyValue should be case insensitive
1579 When we get the propertyID for a given string we convert to lowercase.
1581 This also applies to setProperty, removeProperty and others.
1583 * css/CSSStyleDeclaration.cpp:
1584 (WebCore::propertyID):
1586 2007-08-11 Mark Rowe <mrowe@apple.com>
1588 Build fix. Change "#ifdef PLATFORM(GDK)" to "#if PLATFORM(GDK)".
1590 * page/FrameView.cpp:
1593 2007-08-11 Holger Hans Peter Freyther <zecke@selfish.org>
1597 Copy the WebFrame::layoutIfNeededRecursive method of the windows port
1598 to FrameView to be used by the Gtk+ port. Simplify the implementation due
1599 moving it to the FrameView class.
1601 Implement the ScrollView::children() method for the Gtk+ port and make it
1602 available to the FrameView as children() is used within the layoutIfNeededRecursive method.
1604 * page/FrameView.cpp:
1605 (WebCore::FrameView::layoutIfNeededRecursive):
1607 * platform/ScrollView.h:
1608 * platform/gdk/ScrollViewGdk.cpp:
1610 2007-08-11 Holger Hans Peter Freyther <zecke@selfish.org>
1614 To fix text selection make the PlatformMouseEvent set the pressed
1615 button even when moving the mouse.
1617 Add building of the WebKit::DragClient stubs as they are needed to
1618 make text selection work.
1621 * platform/gdk/MouseEventGdk.cpp:
1622 (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1624 2007-08-10 Anders Carlsson <andersca@apple.com>
1626 Reviewed by Darin and Maciej.
1628 <rdar://problem/5360748>
1629 REGRESSION(r21002-r21003) Flash widget sniffer doesn't work
1631 Add a per-document NodeList counter. When parsing, only call notifyNodeListsChildrenChanged
1632 if the document has node lists. Also, make sure to reset the cache when the node list count has
1633 been 0 and a new node list is registered to avoid any stale cache information.
1635 * dom/ContainerNode.cpp:
1636 (WebCore::ContainerNode::addChild):
1638 (WebCore::Document::Document):
1640 (WebCore::Document::addNodeList):
1641 (WebCore::Document::removeNodeList):
1642 (WebCore::Document::hasNodeLists):
1644 (WebCore::Node::registerNodeList):
1645 (WebCore::Node::unregisterNodeList):
1647 2007-08-10 Timothy Hatcher <timothy@apple.com>
1651 <rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit
1653 Disable NPObject use in 64-bit on Mac OS X.
1655 * Configurations/WebCore.xcconfig: Add a framework search path to the sub-framworks of Carbon.
1656 * WebCore.xcodeproj/project.pbxproj: Filter out the Frame::windowScriptNPObject() symbol in 64-bit.
1657 * bindings/objc/DOM.mm:
1658 (-[DOMElement _NPObject]): Return null in 64-bit.
1659 * config.h: Set WTF_USE_NPOBJECT to 0 in 64-bit Mac OS X.
1661 (WebCore::Frame::cleanupScriptObjects): Add more #if USE(NPOBJECT) blocks where needed.
1662 * page/Frame.h: Ditto.
1663 * page/mac/FrameMac.mm:
1664 (WebCore::Frame::createScriptInstanceForWidget): Ditto.
1665 * page/mac/WebCoreFrameBridge.h: Ditto.
1666 * page/mac/WebCoreFrameBridge.mm: Ditto.
1668 2007-08-10 Mitz Pettel <mitz@webkit.org>
1672 - fix <rdar://problem/5397344> http://bugs.webkit.org/show_bug.cgi?id=14911
1673 REGRESSION: Clicking in pasted text doesn't position the insertion point correctly
1675 Test: editing/selection/inline-closest-leaf-child.html
1677 * rendering/RootInlineBox.cpp:
1678 (WebCore::RootInlineBox::closestLeafChildForXPos): Return the last leaf if
1679 it's the closest match, or if no other leaf matches (for example if all
1680 leaves are list markers or non-editable where editable is required).
1682 2007-08-10 Anders Carlsson <andersca@apple.com>
1686 <rdar://problem/5390568>
1687 REGRESSION: –[WebFrame loadHTMLString:baseURL:] leaks the data source.
1689 Revert the fix for <rdar://problem/5133420> which caused us to not cancel
1690 substitute data loads. It's better to remove the assertion in the WebKit layer.
1692 * loader/ResourceLoader.cpp:
1693 (WebCore::ResourceLoader::didCancel):
1695 2007-08-10 Sam Weinig <sam@webkit.org>
1697 Rubber-stamped by Adam Roben.
1699 Fix Windows, Qt and Gtk build.
1702 * WebCore.vcproj/WebCore.vcproj:
1704 2007-08-09 Sam Weinig <sam@webkit.org>
1708 Fix for <rdar://problem/5395618>
1710 Use checkNodeSecurity when setting the 'src' or 'location' attribute of an
1711 iframe or frame element.
1713 * WebCore.xcodeproj/project.pbxproj:
1714 * bindings/js/JSAttrCustom.cpp: Added.
1715 (WebCore::JSAttr::setValue): Call checkNodeSecurity for attributes with a current iframe or frame
1716 ownerElement when setting src to a javascript: URL.
1717 * bindings/js/JSElementCustom.cpp: Added.
1718 (WebCore::allowSettingSrcToJavascriptURL):
1719 (WebCore::JSElement::setAttribute): Call checkNodeSecurity when element is a frame or iframe and
1720 setting he src attribute to a javascript: URL.
1721 (WebCore::JSElement::setAttributeNode): Ditto.
1722 (WebCore::JSElement::setAttributeNS): Ditto.
1723 (WebCore::JSElement::setAttributeNodeNS): Ditto.
1724 * bindings/js/JSHTMLFrameElementCustom.cpp: Added.
1725 (WebCore::allowSettingJavascriptURL):
1726 (WebCore::JSHTMLFrameElement::setSrc): Call checkNodeSecurity when setting to a javascript: URL.
1727 (WebCore::JSHTMLFrameElement::setLocation): Ditto.
1728 * bindings/js/JSHTMLIFrameElementCustom.cpp: Added.
1729 (WebCore::JSHTMLIFrameElement::setSrc): Call checkNodeSecurity when setting to a javascript: URL.
1730 * bindings/scripts/CodeGeneratorJS.pm: Add support for [CustomGetter] and [CustomSetter]
1733 * html/HTMLFrameElement.idl:
1734 * html/HTMLIFrameElement.idl:
1736 2007-08-10 Holger Hans Peter Freyther <zecke@selfish.org>
1740 Make the containingWindow a GtkContainer and make use of the
1741 GtkWidget::window instead of the GtkLayout::bin_window.
1743 * platform/Widget.h:
1744 * platform/gdk/PlatformScreenGdk.cpp:
1745 (WebCore::screenDepth):
1746 * platform/gdk/ScrollViewGdk.cpp:
1747 (WebCore::ScrollView::updateContents):
1748 (WebCore::ScrollView::update):
1749 * platform/gdk/WidgetGdk.cpp:
1750 (WebCore::Widget::setContainingWindow):
1751 (WebCore::Widget::setCursor):
1753 2007-08-10 Simon Hausmann <hausmann@kde.org>
1757 Revert r24699 as it broke timers. The precision of QTime::toTime_t() is just seconds, which is not good enough. Revert back
1758 to the old implementation and use the simple implementation of currentTime() from win/ for the Qt/Windows build (fingers crossed :)
1761 * platform/qt/SystemTimeQt.cpp:
1762 (WebCore::currentTime):
1764 2007-08-10 Simon Hausmann <hausmann@kde.org>
1768 Recognize .htm as valid extension for text/html.
1770 * platform/qt/MIMETypeRegistryQt.cpp:
1773 2007-08-10 Lars Knoll <lars@trolltech.com>
1777 remove an assertion that leads to crashes. The whole design of WidgetQt and ScrollViewQt needs to be reevaluated soon anyways.
1779 * platform/qt/ScrollViewQt.cpp:
1781 2007-08-10 Mark Rowe <mrowe@apple.com>
1785 * ForwardingHeaders/bindings/runtime_object.h: Added.
1787 2007-08-10 Simon Hausmann <hausmann@kde.org>
1791 Make sure -fno-strict-aliasing is also added for mkspecs like linux-g++-64.
1795 2007-08-10 Simon Hausmann <hausmann@kde.org>
1799 Enable JavaScript bindings for HTML Object/Applet elements in the Qt port.
1802 * bindings/js/kjs_dom.cpp:
1803 * html/HTMLAppletElement.h:
1804 * html/HTMLEmbedElement.h:
1805 * page/qt/FrameQt.cpp:
1806 (WebCore::Frame::createScriptInstanceForWidget):
1808 2007-08-10 Mitz Pettel <mitz@webkit.org>
1810 Reviewed by Dave Hyatt.
1812 - fix http://bugs.webkit.org/show_bug.cgi?id=14798
1813 Incorrect bidi reordering of neutrals and digits after RTL embed
1814 and other bugs in the bidi algorithm.
1816 Test: fast/text/international/bidi-neutral-run.html
1818 Fixed several bugs in resolving the embedding level of runs of neutral
1819 characters. Changed the logic to rely on the eor direction only for
1820 the number types, and otherwise consider the last strong type.
1822 * platform/BidiContext.h:
1823 (WebCore::BidiContext::BidiContext): Added an ASSERT.
1824 * platform/BidiResolver.h:
1826 (WebCore::::createBidiRunsForLine):
1827 * platform/graphics/GraphicsContext.cpp:
1828 (WebCore::TextRunIterator::atEnd): Changed to return true instead of
1829 crashing when called on the empty iterator.
1831 2007-08-09 Mark Rowe <mrowe@apple.com>
1835 <rdar://problem/5400709> Versioning in debug and release builds should include minor and tiny version before +
1837 * Configurations/Version.xcconfig:
1838 * WebCore.xcodeproj/project.pbxproj: Add a shell script phase to make to dependency between
1839 Version.xcconfig and Info.plist explicit to Xcode.
1841 2007-08-09 Mitz Pettel <mitz@webkit.org>
1843 Reviewed by Justin Garcia.
1845 - fix http://bugs.webkit.org/show_bug.cgi?id=14347
1846 REGRESSION (r21291): Initiating a drag near the edge of a selection deselects it
1848 Test: editing/selection/contains-boundaries.html
1850 * editing/SelectionController.cpp:
1851 (WebCore::SelectionController::contains): Changed to return true for the
1852 selection boundaries too.
1854 2007-08-09 Mitz Pettel <mitz@webkit.org>
1856 Reviewed by Dave Hyatt.
1858 - fix http://bugs.webkit.org/show_bug.cgi?id=14742
1859 Document::recalcStyle(Force) called for every updateStyleIgnorePendingStylesheets while waiting for stylesheets
1860 <rdar://problem/5376306>
1862 updateStyleSelector() is normally called when something changes that factors
1863 into the style selector. However, updateLayoutIgnorePendingStylesheets() calls it for
1864 a different reason, namely to account for all the preceding changes that were ignored
1865 because of the early return in updateStyleSelector(). After that, the early return
1866 can no longer occur, so changes are accounted for as they happen, and
1867 updateLayoutIgnorePendingStylesheets() does not need to call updateStyleSelector()
1871 (WebCore::Document::updateLayoutIgnorePendingStylesheets): Call updateStyleSelector()
1872 only before the first layout.
1874 2007-08-09 Mitz Pettel <mitz@webkit.org>
1876 Reviewed by Adam Roben.
1878 - fix http://bugs.webkit.org/show_bug.cgi?id=14362
1879 Opening a select list always highlights first element in list
1881 * platform/win/PopupMenuWin.cpp:
1882 (WebCore::PopupWndProc): Track the mouse only inside the popup.
1884 2007-08-09 Mitz Pettel <mitz@webkit.org>
1886 Reviewed by Dave Hyatt.
1888 - fix http://bugs.webkit.org/show_bug.cgi?id=14875
1889 Textarea with nowrap - left/right nav, Up/down nav both hide text
1891 Test: fast/layers/scroll-rect-to-visible.html
1893 * rendering/RenderLayer.cpp:
1894 (WebCore::RenderLayer::scrollRectToVisible): Account for borders and scroll bars.
1896 2007-08-09 Geoffrey Garen <ggaren@apple.com>
1898 Reviewed by Dave Hyatt.
1900 Refactored live decoded resource eviction to be more modular /
1903 This fixes one known place where we forgot to hook into the live
1904 decoded eviction mechanism -- canvas. There might be other, unknown
1905 places. In a canvas test page, which I broke off from the Safari
1906 pageout test, I saw an RPRVT reduction of ~10MB.
1909 - "m_lastLiveAccessTime" => "m_lastDecodedAccessTime" because the data
1910 point we're recording is access to the resource in decoded form.
1912 - "liveResourceAccessed" => "didAccessDecodedData" for the same reason.
1914 - "pruneAllResources" => "pruneDeadResources" because this function
1915 does not prune live resources.
1918 Instead of updating cache metadata at the call site whenver drawing an
1919 image, just have an image notify its observer whenever it draws. The
1920 observer, which is a CachedResource, can then update the metadata.
1922 * loader/Cache.cpp: Renames
1923 * loader/Cache.h: Removed stale declarations, updated comments
1924 * loader/CachedImage.cpp:
1925 (WebCore::CachedImage::didDraw): Implemented didDraw to update cache
1926 metadata whenever our image draws.
1927 * loader/CachedImage.h: Grouped parts of the ImageObserver interface.
1928 * loader/CachedResource.cpp:
1929 (WebCore::CachedResource::CachedResource):
1930 (WebCore::CachedResource::deref):
1931 (WebCore::CachedResource::didAccessDecodedData): Made this function
1932 slightly more modular by allowing the caller to provide a time stamp.
1933 In theory, not all CachedResources will necessarily want to use the
1934 current paint time stamp.
1935 * platform/graphics/cg/ImageCG.cpp:
1936 (WebCore::BitmapImage::draw): Notify our observer that we drew.
1937 (WebCore::Image::drawPattern): ditto
1938 * platform/graphics/cg/PDFDocumentImage.cpp:
1939 (WebCore::PDFDocumentImage::draw): ditto
1940 * platform/graphics/svg/SVGImage.cpp:
1941 (WebCore::SVGImage::draw): ditto
1943 Removed old code at image drawing call sites:
1945 * rendering/RenderBox.cpp:
1946 (WebCore::RenderBox::paintBackgroundExtended):
1947 * rendering/RenderImage.cpp:
1948 (WebCore::RenderImage::paint):
1949 * rendering/RenderListMarker.cpp:
1950 (WebCore::RenderListMarker::paint):
1951 * rendering/RenderObject.cpp:
1952 (WebCore::RenderObject::paintBorderImage):
1954 2007-08-10 Holger Hans Peter Freyther <zecke@selfish.org>
1958 Move the various *ClientGdk.{h,cpp} away from the WebCore directory as
1959 of http://bugs.webkit.org/show_bug.cgi?id=14727.
1962 * platform/gdk/TemporaryLinkStubs.cpp:
1964 2007-08-09 Anders Carlsson <andersca@apple.com>
1968 <rdar://problem/5400029> iframes with an image src rarely load image
1970 Don't try to shrink standalone images in subframes. The resize event is not
1971 sent for subframes which screws up the shrink-to-fit logic.
1973 * loader/ImageDocument.cpp:
1974 (WebCore::ImageDocument::createDocumentStructure):
1975 (WebCore::ImageDocument::imageChanged):
1976 (WebCore::ImageDocument::shouldShrinkToFit):
1977 * loader/ImageDocument.h:
1979 2007-08-10 Holger Hans Peter Freyther <zecke@selfish.org>
1983 Implement FrameLoaderClientGdk::createFrame mostly by copying
1984 the windows implementation. A method similiar to WebFrame::loadURLIntoChild
1985 was not introduced instead we have a simplified version similiar to the
1988 Remove building of WebKit/gtk/webkitgtkframedata.{cpp,h}.
1991 * loader/gdk/FrameLoaderClientGdk.cpp:
1992 (WebCore::FrameLoaderClientGdk::createFrame):
1994 2007-08-10 Holger Hans Peter Freyther <zecke@selfish.org>
1998 Use the ScrollView/Widget design of the Windows port to only use one
1999 native window for the whole page. This will make it possible to implement
2000 FrameLoaderClientGdk::createFrame.
2002 In contrast to the windows port the ScrollBars are GtkWidgets. To paint them
2003 at the right position we need to position them correctly. To not scroll the
2004 ScrollBar's belonging to the ScrollView a ScrollViewScrollbar is introduced with
2005 a different geometryChanged method.
2007 To allow the Gtk+ way of scrolling the ScrollView allows to get GtkAdjustments
2008 set. In this case no ScrollViewScrollbar will be created.
2011 * platform/ScrollView.h:
2012 * platform/Widget.h:
2013 * platform/gdk/PlatformScreenGdk.cpp:
2014 (WebCore::screenDepth):
2015 * platform/gdk/PlatformScrollBar.h:
2016 * platform/gdk/PlatformScrollBarGdk.cpp:
2017 (PlatformScrollbar::PlatformScrollbar):
2018 (PlatformScrollbar::~PlatformScrollbar):
2019 (PlatformScrollbar::setRect):
2020 (PlatformScrollbar::geometryChanged):
2021 * platform/gdk/ScrollViewGdk.cpp:
2022 (WebCore::ScrollView::ScrollViewPrivate::ScrollViewPrivate):
2023 (WebCore::ScrollView::ScrollViewPrivate::~ScrollViewPrivate):
2024 (WebCore::ScrollViewScrollbar::ScrollViewScrollbar):
2025 (WebCore::ScrollViewScrollbar::geometryChanged):
2026 (WebCore::ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar):
2027 (WebCore::ScrollView::ScrollViewPrivate::setHasVerticalScrollbar):
2028 (WebCore::ScrollView::ScrollViewPrivate::scrollBackingStore):
2029 (WebCore::ScrollView::ScrollViewPrivate::adjustmentChanged):
2030 (WebCore::ScrollView::ScrollViewPrivate::valueChanged):
2031 (WebCore::ScrollView::ScrollViewPrivate::windowClipRect):
2032 (WebCore::ScrollView::setGtkAdjustments):
2033 (WebCore::ScrollView::updateContents):
2034 (WebCore::ScrollView::update):
2035 (WebCore::ScrollView::visibleWidth):
2036 (WebCore::ScrollView::resizeContents):
2037 (WebCore::ScrollView::contentsX):
2038 (WebCore::ScrollView::scrollOffset):
2039 (WebCore::ScrollView::maximumScroll):
2040 (WebCore::ScrollView::scrollBy):
2041 (WebCore::ScrollView::suppressScrollbars):
2042 (WebCore::ScrollView::setHScrollbarMode):
2043 (WebCore::ScrollView::setVScrollbarMode):
2044 (WebCore::ScrollView::setScrollbarsMode):
2045 (WebCore::ScrollView::setFrameGeometry):
2046 (WebCore::ScrollView::addChild):
2047 (WebCore::ScrollView::removeChild):
2048 (WebCore::ScrollView::scrollRectIntoViewRecursively):
2049 (WebCore::ScrollView::wheelEvent):
2050 (WebCore::ScrollView::updateScrollbars):
2051 (WebCore::ScrollView::windowToContents):
2052 (WebCore::ScrollView::contentsToWindow):
2053 (WebCore::ScrollView::scrollbarUnderMouse):
2054 (WebCore::ScrollView::convertChildToSelf):
2055 (WebCore::ScrollView::convertSelfToChild):
2056 (WebCore::ScrollView::paint):
2057 (WebCore::ScrollView::geometryChanged):
2058 (WebCore::ScrollView::scroll):
2059 (WebCore::ScrollView::addToDirtyRegion):
2060 (WebCore::ScrollView::scrollBackingStore):
2061 (WebCore::ScrollView::updateBackingStore):
2062 * platform/gdk/WidgetGdk.cpp:
2063 (WebCore::WidgetPrivate::gdkDrawable):
2064 (WebCore::Widget::Widget):
2065 (WebCore::Widget::setContainingWindow):
2066 (WebCore::Widget::containingWindow):
2067 (WebCore::Widget::frameGeometry):
2068 (WebCore::Widget::setFrameGeometry):
2069 (WebCore::Widget::setParent):
2070 (WebCore::Widget::parent):
2071 (WebCore::Widget::setCursor):
2072 (WebCore::Widget::show):
2073 (WebCore::Widget::hide):
2074 (WebCore::Widget::removeFromParent):
2075 (WebCore::Widget::paint):
2076 (WebCore::Widget::invalidate):
2077 (WebCore::Widget::invalidateRect):
2078 (WebCore::Widget::convertToContainingWindow):
2079 (WebCore::Widget::convertFromContainingWindow):
2080 (WebCore::Widget::convertChildToSelf):
2081 (WebCore::Widget::convertSelfToChild):
2082 (WebCore::Widget::suppressInvalidation):
2083 (WebCore::Widget::setSuppressInvalidation):
2085 2007-08-09 Adele Peterson <adele@apple.com>
2087 Fix by Brady, reviewed by me.
2089 Fix for <rdar://problem/5380697> connection:willSendRequest:redirectResponse: is called on every NSURLConnection
2091 * platform/network/mac/ResourceHandleMac.mm: (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]):
2092 Work around a behavior change in CFNetwork where willSendRequest gets called more often by returning early.
2094 2007-08-09 Darin Adler <darin@apple.com>
2098 - fix <rdar://problem/4889753> REGRESSION: Selection doesn't continue with drag selecting
2099 when autoscrolling vertically (in Notes as well as Safari)
2101 The bug doesn't happen inside DumpRenderTree, so I was unable to make an automated
2104 * manual-tests/autoscroll-when-outside-window.html: Added.
2106 * rendering/RenderLayer.cpp: (WebCore::RenderLayer::autoscroll): Removed unneeded null
2107 check for the layer's renderer and the document, neither of which can be null. Call
2108 the new updateSelectionForMouseDrag instead of doing selection updating here.
2110 * page/EventHandler.h:
2111 * page/EventHandler.cpp:
2112 (WebCore::EventHandler::handleMouseDraggedEvent): Refactored most of the logic
2113 about updating the selection into updateSelectionForMouseDrag.
2114 (WebCore::EventHandler::updateSelectionForMouseDrag): Added. The public version of
2115 this function takes no parameters, and is for use from auto-scrolling code. The
2116 private version of this function takes node and point parameters and contains the
2117 shared code, including everything from updateSelectionForMouseDragOverPosition.
2118 Aside from the code motion, variable name changes, and sharing more code, this
2119 differs from the old code in RenderLayer::autoscroll in the following ways:
2121 1) The old code did hit testing only in the layer that was auto-scrolling,
2122 and the new code instead starts the hit testing at the root layer, which is
2123 better because it's the same thing we do for mouse moved events. Further,
2124 the code to do this by calling convertToLayerCoords had a bug because the
2125 x and y variables were uninitialized.
2126 2) The old code passed false for active to HitTestRequest, which was wrong.
2127 The new code passes true. This flag needs to be true for hit testing done
2128 while the mouse is down and false for hit testing done while the mouse is up.
2129 3) The old code did not have the SVG-specific logic to match the mouse moved case.
2130 4) The old code wouldn't do any selection updating if the return value from hitTest
2131 was false, which is incorrect. The new code ignores the return value as it should.
2133 2007-08-08 Beth Dakin <bdakin@apple.com>
2135 Reviewed by Geoff Garen.
2137 Fx for <rdar://problem/5286443>, http://bugs.webkit.org/
2138 show_bug.cgi?id=14268 REGRESSION: Radio buttons don't stay selected
2139 due to unclosed <label> tags
2141 This patch maintains the behavior that allows <label> tags to nest.
2142 This matches WinIE, and appears to match the spec, since the spec
2143 does not explicitly say that they cannot nest. It fixes the bug
2144 instead by calling setDefaultHandled() in two places it should have
2145 been called anyway. This keeps the appropriate button checked as
2148 * html/HTMLInputElement.cpp:
2149 (WebCore::HTMLInputElement::postDispatchEventHandler):
2150 * html/HTMLLabelElement.cpp:
2151 (WebCore::HTMLLabelElement::defaultEventHandler):
2153 2007-08-08 Justin Garcia <justin.garcia@apple.com>
2157 <rdar://problem/5387578> Crash at ReplaceSelectionCommand::doApply() when pasting just after table cell content
2159 ReplaceSelectionCommand::doApply() inserts a line break before insertion
2160 to prevent block nesting. InsertLineBreakCommand::doApply was accidently
2161 destroying a text node when it removed insignificant whitespace and then
2162 setting a nil endingSelection().
2164 * editing/InsertLineBreakCommand.cpp:
2165 (WebCore::InsertLineBreakCommand::doApply): If insignificant whitespace
2166 removal removes textNode from the document, insert a text node containing
2167 the non-breaking space we were attempting to insert and then insert it
2168 at the position that the removed textNode occupied.
2170 2007-08-08 Geoffrey Garen <ggaren@apple.com>
2172 Reviewed by Maciej Stachowiak.
2174 Added a thrash check to live decoded resource eviction.
2176 Here's the strategy: Stamp every image with its paint time. Don't evict
2177 a live decoded resource until another resource paints with a reasonably
2178 (1 second) larger time stamp.
2180 If no other resource paints, or another resource paints, but very soon
2181 after the resource in question, the resource in question is very likely
2182 to paint again soon. In fact, it's probably still on screen. So we
2183 leave it alone. (Previously, we evicted it on a timer, but that would
2184 evict a resource that was still on screen, hurting speed without
2185 helping memory use.)
2187 In theory, this algorithm allows a single large resource or closely
2188 related set of resources to linger in the live decoded cache even
2189 though the cache is over its limit. However, that can only happen as
2190 long as no other resource ever paints again, which guarantees an
2191 absolute cap on cache memory usage from then on. Also, the resources
2192 will only linger as long as they remain live. Upon going dead, they
2193 will flush. Also, these circumstances are so rare that they are almost
2194 impossible to encounter in the wild. So don't sweat it.
2196 Stop evicting if the next resource painted too recently:
2199 (WebCore::Cache::pruneLiveResources):
2200 * loader/CachedResource.cpp:
2201 (WebCore::CachedResource::CachedResource):
2202 (WebCore::CachedResource::liveResourceAccessed):
2203 * loader/CachedResource.h:
2205 Track the paint time stamp in Frame. We do this to give a consistent
2206 stamp to all resources painted in a single paint operation (in case the
2207 operation takes a significant amount of time), and to avoid excessive
2208 calls to system time functions, which hurt the PLT:
2211 (WebCore::Frame::paint):
2213 (WebCore::Frame::currentPaintTimeStamp):
2215 2007-08-08 Sam Weinig <sam@webkit.org>
2217 Reviewed by Adam Roben.
2219 Update project file to reflect the moving of character-sets.txt
2220 and make-charset-table.pl to platform/mac a while ago.
2222 * WebCore.xcodeproj/project.pbxproj:
2224 2007-08-08 Justin Garcia <justin.garcia@apple.com>
2226 Reviewed by Harrison.
2228 <rdar://problem/5390681> WebKit asserts when deleting To Do content selected with a double-click
2231 (WebCore::Position::trailingWhitespacePosition): Use VisiblePosition::characterAfter
2232 to look for a trailing space. The old code would incorrectly return a position before
2233 a non-editable space if it had a collapsed space before it.
2235 2007-08-08 Sam Weinig <sam@webkit.org>
2239 Make protocol and host compares case-insensitive.
2241 * bindings/js/kjs_window.cpp:
2242 (KJS::Window::isSafeScript):
2244 (WebCore::Document::initSecurityPolicyURL):
2245 * platform/DeprecatedString.cpp:
2246 (WebCore::equalIgnoringCase):
2247 * platform/DeprecatedString.h:
2248 (WebCore::equalIgnoringCase):
2250 2007-08-08 Justin Garcia <justin.garcia@apple.com>
2252 Reviewed by Harrison.
2254 <rdar://problem/5390681> WebKit asserts when deleting To Do content selected with a double-click
2257 (WebCore::Position::leadingWhitespacePosition): Added checks to prevent expansion across editable an boundary.
2258 (WebCore::Position::trailingWhitespacePosition): Ditto.
2260 2007-08-08 Adele Peterson <adele@apple.com>
2264 Fix for <rdar://problem/5393798> 100% reproducible crash in WebCore::Scrollbar::setValue
2266 * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEvent):
2267 If the hit testing originally determined the event was in a scrollbar,
2268 refetch the MouseEventWithHitTestResults in case the scrollbar widget was destroyed when the mouse event was handled.
2270 2007-08-08 Sam Weinig <sam@webkit.org>
2272 Reviewed by Geoff Garen.
2274 Fix for <rdar://problem/5354635>
2276 Match Firefox's model for data: URLs by not allowing them script access
2277 to any frames other then itself.
2279 * bindings/js/kjs_window.cpp:
2280 (KJS::Window::isSafeScript):
2282 (WebCore::Document::initSecurityPolicyURL):
2284 2007-08-08 Darin Adler <darin@apple.com>
2286 Reviewed by Kevin Decker.
2288 - fix for <rdar://problem/5390708> CrashTracer: [USER] 27 crashes in Safari at
2289 com.apple.WebCore: WTF::HashMap<etc>::set + 68, beneath pruneUnretainedIconsAtStartup
2291 * loader/icon/IconDatabase.cpp: (WebCore::IconDatabase::pruneUnretainedIconsOnStartup):
2292 Eliminate an unnecessary HashMap from the implementation; we can just use the
2293 m_pageURLToRetainCount map directly. This simplifies the code and allows us to handle
2294 the empty string, which otherwise poses a problem for HashMap.
2296 2007-08-08 Antti Koivisto <antti@apple.com>
2300 Fix for <rdar://problem/5391576>
2301 Malformed table innerHTML causes Safari to crash in HTMLParser::handleError (14894)
2303 Add null checks to protect against
2305 e.innerHTML = "<tr>text</tr>";
2307 type cases. Normal assumptions about document tree structure don't hold when parsing
2308 fragments. Results don't match Firefox in all cases. It seems to have some sort of
2309 anything-goes fragment parsing mode.
2311 * html/HTMLParser.cpp:
2312 (WebCore::HTMLParser::handleError):
2314 2007-08-07 Kevin McCullough <kmccullough@apple.com>
2316 Reviewed by Maciej and Hyatt.
2318 - <rdar://problem/4976879> REGRESSION: Safari doesn't work with Zimbra enhanced login.
2319 - Reverting a previous change, and modifying how documents are created so that we better match other browsers behavior with respect to namespaceURIs.
2321 * WebCore.xcodeproj/project.pbxproj:
2322 * dom/DOMImplementation.cpp:
2323 (WebCore::DOMImplementation::createDocument):
2325 (WebCore::Document::Document):
2326 (WebCore::Document::createElement):
2328 * html/HTMLDocument.cpp:
2329 (WebCore::HTMLDocument::createElement):
2330 * html/HTMLDocument.h:
2332 2007-08-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2334 Reviewed and landed by Brady
2336 Fixes <http://bugs.webkit.org/show_bug.cgi?id=13422>
2338 Bug 13422: REGRESSION: Page reload loses page position
2340 * loader/FrameLoader.cpp:
2341 (WebCore::FrameLoader::updateHistoryForReload):
2343 2007-08-08 Holger Hans Peter Freyther <zecke@selfish.org>
2347 Be paranoid and disconnect from the signal before going away.
2349 * platform/gdk/PlatformScrollBarGdk.cpp:
2350 (PlatformScrollbar::~PlatformScrollbar):
2352 2007-08-08 Holger Hans Peter Freyther <zecke@selfish.org>
2356 Use GraphicsContext::translatePoint in RenderThemeGdk to paint at the
2358 This is needed as the Gtk+ theming code does not know about the translation
2359 of the GraphicsContext.
2361 * platform/gdk/RenderThemeGdk.cpp:
2362 (WebCore::RenderThemeGdk::paintCheckbox):
2363 (WebCore::RenderThemeGdk::paintRadio):
2364 (WebCore::RenderThemeGdk::paintButton):
2366 2007-08-08 Holger Hans Peter Freyther <zecke@selfish.org>
2370 Implement Widget::paint for the Gtk port. This is needed to paint
2371 Widgets in z-order. The original GdkEventExpose is stored within the
2372 GraphicsContext and then used to draw the children. This is similiar
2373 to gtk_container_propagate_expose but we try to honor the GraphicsConntext
2376 * platform/gdk/WidgetGdk.cpp:
2377 (WebCore::Widget::paint):
2378 * platform/graphics/GraphicsContext.h:
2379 * platform/graphics/cairo/GraphicsContextCairo.cpp:
2380 (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
2381 (WebCore::GraphicsContext::setGdkExposeEvent):
2382 (WebCore::GraphicsContext::gdkExposeEvent):
2383 (WebCore::GraphicsContext::gdkDrawable):
2384 (WebCore::GraphicsContext::translatePoint):
2386 2007-08-08 Holger Hans Peter Freyther <zecke@selfish.org>
2388 Reviewed by Oliver Hunt.
2390 Implement PlatformScrollbar by calling ScrollBar::setValue from
2391 gtkValueChange connected to the value-changed signal of the
2393 Update 'value' of the GtkAdjustment in updateThumbPosition and
2394 set upper, page-increment, step-increment and page_size in
2395 updateThumbProportion.
2397 This is from bug http://bugs.webkit.org/show_bug.cgi?id=14795.
2399 * platform/gdk/PlatformScrollBar.h:
2400 * platform/gdk/PlatformScrollBarGdk.cpp:
2401 (PlatformScrollbar::PlatformScrollbar):
2402 (PlatformScrollbar::updateThumbPosition):
2403 (PlatformScrollbar::updateThumbProportion):
2404 (PlatformScrollbar::gtkValueChanged):
2406 2007-08-07 Geoffrey Garen <ggaren@apple.com>
2408 Reviewed by Maciej Stachowiak. Based on earlier review from Dave Hyatt.
2410 First chunk of work for <rdar://problem/5326009> Make non-browser
2411 WebKit clients have no memory cache, or a very tiny one
2415 Removed decodedSizeWillChange mechanism because my last patch to
2416 change the live resources list to a strict LRU model made that code
2419 Renamed "liveResourcesList" and related stuff =>
2420 "liveDecodedResourcesList" because only live resources with decoded
2421 data are kept in the list.
2423 * loader/CachedImage.cpp:
2424 (WebCore::CachedImage::decodedSizeChanged): Only add ourselves to the
2425 list if we're live, our decoded size has grown, and we're not in the
2426 list already. (Otherwise, either we're not live, we're not decoded,
2427 or we're already in the list.)
2429 * loader/CachedResource.cpp:
2430 (WebCore::CachedResource::liveResourceAccessed): Only re-insert
2431 ourselves into the list if we're already there. (In theory, this should
2432 be always, but it's a little more clear to check.)
2434 2007-08-08 Holger Hans Peter Freyther <zecke@selfish.org>
2438 Kill class FrameGdk and move the stubs to page/gdk/FrameGdk.cpp and the
2439 remainings into WebKitGtkFrame.
2440 The DRT functionality of class FrameGdk is currently lost.
2443 * loader/gdk/FrameLoaderClientGdk.cpp:
2444 * loader/gdk/FrameLoaderClientGdk.h:
2445 * page/gdk/FrameGdk.cpp: Renamed from WebCore/platform/gdk/FrameGdk.cpp.
2446 (WebCore::Frame::issueTransposeCommand):
2447 (WebCore::Frame::cleanupPlatformScriptObjects):
2448 (WebCore::Frame::dragImageForSelection):
2449 (WebCore::Frame::dashboardRegionsChanged):
2450 * platform/gdk/FrameGdk.h: Removed.
2451 * platform/gdk/TemporaryLinkStubs.cpp: Removed Frame stub, added the loadResourceIntoArray stub
2452 * platform/gdk/WidgetGdk.cpp:
2454 2007-08-08 Holger Hans Peter Freyther <zecke@selfish.org>
2458 Remove the event handling code and move it to WebKit/gtk/Api/webkitgtkpage.cpp
2460 * platform/gdk/FrameGdk.cpp:
2461 * platform/gdk/FrameGdk.h:
2463 2007-08-07 Holger Hans Peter Freyther <zecke@selfish.org>
2467 Switch from the generic union GdkEvent to the specific struct GdkEvent*. This is needed
2468 to make WebKitGtkPage handle the events by reimplementing the default handlers in the near
2471 * platform/PlatformKeyboardEvent.h:
2472 * platform/PlatformMouseEvent.h:
2473 * platform/PlatformWheelEvent.h:
2474 * platform/gdk/FrameGdk.cpp:
2475 (WebCore::FrameGdk::handleGdkEvent):
2476 * platform/gdk/KeyEventGdk.cpp:
2477 (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2478 * platform/gdk/MouseEventGdk.cpp:
2479 (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2480 * platform/gdk/WheelEventGdk.cpp:
2481 (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2483 2007-08-07 George Staikos <staikos@kde.org>
2485 Some QStyles don't handle negative maximum well (crash)
2487 * platform/qt/PlatformScrollBarQt.cpp:
2488 (WebCore::PlatformScrollbar::paint):
2490 2007-08-07 Antti Koivisto <antti@apple.com>
2494 Fix <rdar://problem/5102553>
2495 Mail spins trying to display or edit a specific long plain text message in WebCore::TimerBase::...
2497 Calling removeLeftoverAnonymousBoxes() from RenderBlock::addChildToFlow() made adding children
2498 O(n^2) in simple cases (repeated <div><div></div></div> for example).
2500 I couldn't find any limited fix so here is a more complete one. It removes iterating/recursing
2501 removeLeftoverAnonymousBoxes() method altogether. Instead of hunting around wildly, just get
2502 rid of anonymous boxes with block children when they occur.
2504 * rendering/RenderBlock.cpp:
2505 (WebCore::RenderBlock::addChildToFlow):
2506 * rendering/RenderButton.h:
2507 (WebCore::RenderButton::removeLeftoverAnonymousBlock):
2508 * rendering/RenderContainer.cpp:
2509 (WebCore::RenderContainer::removeLeftoverAnonymousBlock):
2510 * rendering/RenderContainer.h:
2511 * rendering/RenderObject.cpp:
2512 (WebCore::RenderObject::handleDynamicFloatPositionChange):
2513 (WebCore::RenderObject::removeLeftoverAnonymousBlock):
2514 * rendering/RenderObject.h:
2515 * rendering/RenderTextControl.h:
2516 (WebCore::RenderTextControl::removeLeftoverAnonymousBlock):
2518 2007-08-06 Sam Weinig <sam@webkit.org>
2522 Fix for <rdar://problem/5354689>
2524 - Use document variable to determine permissions instead
2525 of traversing the frame tree.
2527 * bindings/js/kjs_window.cpp:
2528 (KJS::Window::isSafeScript):
2530 (WebCore::Document::Document):
2531 (WebCore::Document::initSecurityPolicyURL):
2533 (WebCore::Document::securityPolicyURL):
2534 * loader/FrameLoader.cpp:
2535 (WebCore::FrameLoader::setOpener): We must re-initialize the
2536 safeScript URL when setting the opener because the opener was
2537 not known at Document construction.
2539 2007-08-06 David Hyatt <hyatt@apple.com>
2541 Make sure to clear out the parent of the ellipsis box so that it doesn't
2542 trigger the consistency check for line boxes.
2547 * rendering/RootInlineBox.cpp:
2548 (WebCore::RootInlineBox::detachEllipsisBox):
2550 2007-08-06 David Hyatt <hyatt@apple.com>
2552 Back out fix for <rdar://problem/5366582> and replace it with the correct
2553 fix. Make sure to delete the line box tree before splitting an inline flow
2554 into a continuation. The added layout test for the original checkin covers
2559 * rendering/RenderBlock.cpp:
2560 (WebCore::RenderBlock::makeChildrenNonInline):
2563 * rendering/RenderFlow.cpp:
2564 (WebCore::RenderFlow::destroy):
2567 * rendering/RenderInline.cpp:
2568 (WebCore::RenderInline::splitFlow):
2571 2007-08-06 Geoffrey Garen <ggaren@apple.com>
2573 Reviewed by Darin Adler.
2575 Touching a file to force a re-build.
2577 2007-08-06 Darin Adler <darin@apple.com>
2581 * rendering/RenderText.h: (WebCore::RenderText::checkConsistency):
2584 2007-08-06 Darin Adler <darin@apple.com>
2588 - fix <rdar://problem/5366582> crash on it.eurosport.yahoo.com page
2590 Test: fast/dynamic/inline-to-block-crash.html
2592 I added some consistency checks for the line box tree, which helped me figure out
2593 what was going on with this bug pretty quickly.
2595 * rendering/RenderBlock.cpp: (WebCore::RenderBlock::makeChildrenNonInline):
2596 This is the actual fix. If the block needs layout, then don't try to delete the line
2597 box tree because it's going to be rebuilt as part of layout. More importantly, the
2598 child list in the tree is no good, so we will crash if we try to delete here.
2600 * rendering/RenderFlow.cpp: (WebCore::RenderFlow::destroy):
2601 Here's a second fix. We have the same issue in the code that handles anonymous
2602 blocks -- if it's already running as part of layout, we can't walk through the
2603 already partly destroyed line box tree. This crashed in one of the layout tests.
2605 * rendering/InlineBox.h: Made more fields private, since I wanted to do a bit more
2606 work in setters. Made setNextOnLine() and setPrevOnLine() assert that the box has a
2607 parent. Made parent() assert that the parent is good. Also removed the unused
2608 isChildOfParent() function.
2609 * rendering/InlineBox.cpp: (WebCore::InlineBox::~InlineBox): At destruction time, if
2610 we are still attached to a parent, tag that parent as having a "bad" child list.
2612 * rendering/InlineFlowBox.h: Added m_reasonForBadChildList, checkConsistency(),
2613 setHasBadChildList(), and hasBadChildList(). Also changed firstChild() and lastChild() so
2614 they call checkConsistency() and made all the fields private instead of protected.
2615 * rendering/InlineFlowBox.cpp:
2616 (WebCore::InlineFlowBox::addToLine): Added consistency checks before and after adding a
2617 box to the line. Also checked that next and prev start out as 0. Changed manipulation of
2618 next and prev to use accessor functions.
2619 (WebCore::InlineFlowBox::removeChild): Added consistency checks before and after removing
2620 the box from the line.
2621 (WebCore::InlineFlowBox::deleteLine): Use firstChild() instead of getting at m_firstChild
2622 directly so we get a consistency check. Also set the parent to 0 before destroying so that
2623 the assertion in ~InlineBox will work properly.
2624 (WebCore::InlineFlowBox::extractLine): Ditto.
2625 (WebCore::InlineFlowBox::attachLine): Ditto.
2626 (WebCore::InlineFlowBox::adjustPosition): Ditto.
2627 (WebCore::InlineFlowBox::checkConsistency): Added. Checks consistency of the child list by
2628 looking at the parent, next, and prev pointers. Also asserts that we are not yet in the
2629 "bad" child list state, which happens if one of our children is destroyed without removing
2630 it from our list; that's normal, but once it happens we can't look at our child list again.
2632 * rendering/InlineTextBox.h:
2633 * rendering/InlineTextBox.cpp: Remove unnneeded destroy/new/delete functions -- these are
2634 inherited from the InlineBox base class and don't need to be defined again.
2636 * rendering/RenderFlow.h:
2637 * rendering/RenderFlow.cpp:
2638 (WebCore::RenderFlow::~RenderFlow): Assert that there are no children to confirm that we
2639 didn't leak something.
2640 (WebCore::RenderFlow::extractLineBox): Added consistency checks before and after removing
2641 a run of boxes from the list.
2642 (WebCore::RenderFlow::attachLineBox): Added consistency checks before and after adding
2644 (WebCore::RenderFlow::removeLineBox): Added consistency checks before and after removing
2645 a box from the list.
2646 (WebCore::RenderFlow::createInlineBox): Added consistency checks before and after adding
2648 (WebCore::RenderFlow::checkConsistency): Added.
2650 * rendering/RenderText.h:
2651 * rendering/RenderText.cpp:
2652 (WebCore::RenderText::~RenderText): Assert that there are no children to confirm that we
2653 didn't leak something.
2654 (WebCore::RenderText::extractTextBox): Added consistency checks before and after removing
2655 a run of boxes from the list.
2656 (WebCore::RenderText::attachTextBox): Added consistency checks before and after adding
2658 (WebCore::RenderText::removeTextBox): Added consistency checks before and after removing
2659 a box from the list.
2660 (WebCore::RenderText::deleteTextBoxes): Added code to call setHasBadChildList since this
2661 destroys line boxes without informing the parent.
2662 (WebCore::RenderText::checkConsistency): Added.
2664 2007-08-06 Adele Peterson <adele@apple.com>
2668 Fix for <rdar://problem/5382483> REGRESSION: <select> element's text is clipped when a CSS line-height is specified
2670 Don't honor line-height for styled popup buttons. We already don't honor line-height for unstyled popups
2671 and since IE and FF don't honor it at all for popups, we shouldn't either.
2673 * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::adjustMenuListButtonStyle):
2674 * rendering/RenderThemeSafari.cpp: (WebCore::RenderThemeSafari::adjustMenuListButtonStyle):
2676 2007-08-06 Antti <antti@apple.com>
2680 Fix <rdar://problem/5378214>
2681 Mail crashes at RenderLayer::paintLayer() when dragging a selection over To Do text
2683 ObjC interface does not guarantee that Document::updateRendering() gets called after
2684 modification are made to document. This can lead to situation where paint()
2685 is invoked with document still dirty which can then crash in number of interesting ways.
2687 - add hasChangedChild() as needsLayout() condition. layout() will then call recalcStyle()
2688 catching most cases and making sure document is not dirty when entering painting.
2689 - protect recalcStyle() and layout() from being executed during painting. There are some
2690 cases needsLayout() protection does not cover.
2692 No layout test, these states are very hard or impossible to reach using Javascript interface
2693 (which generally guarantees that updateRendering() is done right after execution).
2696 (WebCore::Document::recalcStyle):
2698 (WebCore::Frame::paint):
2699 (WebCore::Frame::setPaintRestriction):
2700 (WebCore::Frame::isPainting):
2701 (WebCore::FramePrivate::FramePrivate):
2703 * page/FramePrivate.h:
2704 * page/FrameView.cpp:
2705 (WebCore::FrameView::layout):
2706 (WebCore::FrameView::needsLayout):
2708 2007-08-05 Maciej Stachowiak <mjs@apple.com>
2710 Reviewed by Darin Adler.
2712 <rdar://problem/5369110> CrashTracer: [USER] reproducible crash opening particular mail messages
2714 * platform/network/mac/ResourceHandleMac.mm:
2715 (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]): Make sure to retain
2716 self for the body of this method. Otherwise, the willSendRequest could trigger events which will
2717 cancel the connection, and we access ivars after this point.
2718 (-[WebCoreSynchronousLoader connection:willSendRequest:redirectResponse:]): retain and release
2721 2007-08-04 Adam Roben <aroben@apple.com>
2723 Another workaround for <rdar://problem/5386894>
2727 This fixed ~150 failing tests.
2729 * platform/network/cf/ResourceResponseCFNet.cpp:
2730 (WebCore::ResourceResponse::doUpdateResourceResponse): Hardcode the
2731 MIME type for .svg files as well.
2733 2007-08-04 Adam Roben <aroben@apple.com>
2735 Workaround for <rdar://problem/5386894> CFURLResponseGetMIMEType returns "text/html" for local .xhtml and .xml files
2739 This fixes ~350 failing tests.
2741 * platform/network/cf/ResourceResponseCFNet.cpp:
2742 (WebCore::ResourceResponse::doUpdateResourceResponse): Use a workaround
2743 identical to the one in ResourceResponseMac.mm, but include .xml files
2746 2007-08-04 David Kilzer <ddkilzer@webkit.org>
2750 - fix for http://bugs.webkit.org/show_bug.cgi?id=14882
2751 <rdar://problem/5386550> REGRESSION (r24866): text/plain documents are always downloaded
2753 The supportedNonImageMimeTypes list is used to determine which MIME types may be viewed
2754 within the web browser (e.g., plug-ins add their own MIME types to the list during
2755 initialization), so we must add "text/plain" and "text/" back to the list. Since
2756 this change would then break DOMImplementation::isTextMIMEType(), that method was reverted
2757 to its original form and MIMETypeRegistry::shouldTreatAsText() was removed.
2759 * dom/DOMImplementation.cpp:
2760 (WebCore::DOMImplementation::isTextMIMEType): Revert to previous version.
2761 * platform/MIMETypeRegistry.cpp:
2762 (WebCore::initialiseSupportedNonImageMimeTypes): Added back "text/plain" and "text/" to the list.
2763 (WebCore::MIMETypeRegistry::shouldTreatAsText): Removed.
2764 * platform/MIMETypeRegistry.h:
2766 2007-08-03 Brady Eidson <beidson@apple.com>
2770 Fix for http://bugs.webkit.org/show_bug.cgi?id=14824 and <rdar://problem/5372989>
2773 1 - The WebCore MIMEType registry was designed assuming the list of types would never change
2774 That is false, as WebKit has API and SPI calls which directly mutate the MIMETypeRegistry
2775 2 - DOMImplementation didn't consult the registry for any MIMEType that started with "text/",
2776 instead maintaining it's own hard coded rules
2778 * dom/DOMImplementation.cpp:
2779 (WebCore::DOMImplementation::isTextMIMEType): For now, call through to the MIMETypeRegistry
2780 until we decided a different fate for this function
2782 * platform/MIMETypeRegistry.cpp:
2783 (WebCore::initialiseSupportedNonImageMimeTypes): "SupportedNonImageMIMETypes" is really a misnomer for
2784 "MIMETypes we should show as HTML" but that line has slowly been blurred since Tiger. In an attempt
2785 to start to unblur it, remove "text/" and "text/plain"
2786 (WebCore::MIMETypeRegistry::shouldTreatAsText): The decision is very close to the old DOMImplementation
2787 method, except we don't automatically hand off "text/" types as true if they are in the set of supported
2789 (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Non-const (can be changed!)
2790 (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Non-const (can be changed!)
2791 (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Non-const (can be changed!)
2792 * platform/MIMETypeRegistry.h:
2794 2007-08-03 Adele Peterson <adele@apple.com>
2798 Fix for <rdar://problem/5345862> CrashTracer: [USER] 4 crashes in Safari at com.apple.WebCore: WebCore::Frame::isContentEditable const + 10
2800 Couldn't reproduce the problem, but a nil check for the frame should fix this.
2802 * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::adjustRenderStyle):
2804 2007-08-03 Anders Carlsson <andersca@apple.com>
2808 <rdar://problem/5383286>
2809 XMLHTTPRequest does not return 401 when user cancels authentication dialog (affects .Mac)
2811 * loader/ResourceLoader.h:
2812 Make receivedCancellation virtual.
2814 * loader/SubresourceLoader.cpp:
2815 (WebCore::SubresourceLoader::receivedCancellation):
2816 Call SubresourceLoaderClient::receivedCancellation.
2818 * xml/XMLHttpRequest.cpp:
2819 (WebCore::XMLHttpRequest::receivedCancellation):
2820 Save the failure response.
2822 2007-08-03 Anders Carlsson <andersca@apple.com>
2826 <rdar://problem/5374393>
2827 Image change on disk not noticed by WebView; -[WebCache setDisabled:] used to cause a reload every time
2829 This is essentially a better fix for the crash in <rdar://problem/5362783>.
2831 * loader/DocLoader.cpp:
2832 (WebCore::DocLoader::requestResource):
2833 If the resource already exists in the m_docResources map, remove it and disassociate it from the doc loader.
2835 2007-08-03 Oliver Hunt <oliver@apple.com>
2839 <rdar://problem/5375190> Mail crashed in WebCore::CachedImage::imageSize() const when viewing a particular message
2841 Fix the uncached load path to confirm that the type of resource being
2842 returned actually matches the type that was requested.
2844 Also make sure we never create a resource in the Cache for invalid urls.
2847 (WebCore::Cache::requestResource):
2848 * loader/DocLoader.cpp:
2849 (WebCore::DocLoader::requestResource):
2851 2007-08-03 Mitz Pettel <mitz@webkit.org>
2855 - fix http://bugs.webkit.org/show_bug.cgi?id=14879
2856 REGRESSION: First item in select (pop-up menu) is displayed even if another item was selected via JavaScript
2858 Test: fast/forms/menulist-deselect-update.html
2860 * html/HTMLOptionElement.cpp:
2861 (WebCore::HTMLOptionElement::setSelected): Reordered to allow setSelectedIndex() to call setChanged().
2863 2007-08-03 Anders Carlsson <andersca@apple.com>
2867 <rdar://problem/5286444>
2868 http://bugs.webkit.org/show_bug.cgi?id=14269
2869 REGRESSION: Gmail links stop working after computer sleep
2871 Add a PowerNotifier object that takes care of resetting and firing the shared timer when coming
2874 * platform/mac/SharedTimerMac.cpp:
2875 (-[PowerNotifier init]):
2876 (-[PowerNotifier didWake:]):
2877 (WebCore::setSharedTimerFireTime):
2879 2007-08-04 Mark Rowe <mrowe@apple.com>
2883 * rendering/RenderTextControl.cpp: Don't use the same name for two arguments.
2885 2007-08-03 Mitz Pettel <mitz@webkit.org>
2889 - fix http://bugs.webkit.org/show_bug.cgi?id=14653
2890 REGRESSION (r23994): No caret is drawn after clicking a search field's placeholder text
2891 <rdar://problem/5383841>
2893 Test: fast/forms/search-click-in-placeholder.html
2895 Defined a subclass of RenderBlock that never hit-tests children for use in
2896 text controls. This avoids returning placeholder text as the hit node.
2897 Since text controls cannot contain inline elements, there is no harm in
2898 doing that unconditionally, and not just in the case that the field is
2899 showing placeholder text.
2901 * rendering/RenderTextControl.cpp:
2902 (WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock):
2903 (WebCore::RenderTextControlInnerBlock::~RenderTextControlInnerBlock):
2904 (WebCore::RenderTextControlInnerBlock::nodeAtPoint):
2905 (WebCore::RenderTextControl::createSubtreeIfNeeded):
2907 2007-08-02 Oliver Hunt <oliver@apple.com>
2911 Fix for <rdar://problem/5369332> Xcode crashes while selecting a hyperlink within a AppleScript dictionary (WebCore::Font::drawGlyphBuffer)
2913 There were many places where we were not correctly retaining/releasing the
2914 NSFont object stored in the C++ PlatformFontData object, this resulted in
2915 the GC incorrectly collecting the NSFont.
2917 This patch fixes the problem by prevent direct modification of the PlatformFontData
2918 font pointer, allowing us to enforce correct CFRetain/Release behaviour.
2920 * platform/FontData.h:
2921 (WebCore::FontData::getNSFont):
2922 * platform/mac/FontCacheMac.mm:
2923 (WebCore::FontCache::getFontDataForCharacters):
2924 (WebCore::FontCache::createFontPlatformData):
2925 * platform/mac/FontDataMac.mm:
2926 (WebCore::initFontData):
2927 (WebCore::FontData::platformInit):
2928 (WebCore::FontData::platformDestroy):
2929 (WebCore::FontData::smallCapsFontData):
2930 (WebCore::FontData::containsCharacters):
2931 (WebCore::FontData::determinePitch):
2932 (WebCore::FontData::platformWidthForGlyph):
2933 (WebCore::FontData::checkShapesArabic):
2934 * platform/mac/FontMac.mm:
2935 (WebCore::initializeATSUStyle):
2936 (WebCore::overrideLayoutOperation):
2937 (WebCore::Font::drawGlyphs):
2938 * platform/mac/FontPlatformData.h:
2939 (WebCore::FontPlatformData::FontPlatformData):
2940 (WebCore::FontPlatformData::~FontPlatformData):
2941 (WebCore::FontPlatformData::hash):
2942 (WebCore::FontPlatformData::operator==):
2943 (WebCore::FontPlatformData::font):
2944 (WebCore::FontPlatformData::setFont):
2946 2007-08-03 Antti Koivisto <antti@apple.com>
2948 Oops, this change wasn't supposed to be commited.
2950 * page/mac/WebCoreFrameBridge.mm:
2951 (-[WebCoreFrameBridge setBaseBackgroundColor:]):
2953 2007-08-02 Antti Koivisto <antti@apple.com>
2957 <rdar://problem/5355951>
2958 plainText() fragments TCMalloc heap badly on large pages
2960 also likely fixes some cases of
2961 <rdar://problem/5335382>
2962 CrashTracer: [REGRESSION] 73 crashes in Safari at com.apple.WebCore: WebCore::DeprecatedStringData::increaseUnicodeSize + 52
2964 If you load http://dscoder.com/test.txt with WebKit build with TCMalloc and system malloc you see that
2965 Safari RPRVT with TCMalloc is 118.8MB
2966 Safari RPRVT with system malloc is 69.7MB
2968 Difference is almost entirely caused by heap fragmentation from a full document plainText() call (for indexing purposes).
2970 The patch helps in two ways:
2971 - construct plainText string in pieces to avoid O(n^2) reallocs
2972 - allocate buffers using system malloc so they can be returned back to OS and don't fragment and grow TCMalloc heap
2974 This shrinks http://dscoder.com/test.txt RPRVT to 79.0MB and makes full document plainText() take 50ms instead of 500ms.
2975 The benefits are not limited to extreme cases, web pages above ~200kB can show substantial improvement in RPRVT.
2977 * editing/TextIterator.cpp:
2978 (WebCore::plainTextToMallocAllocatedBuffer):
2979 (WebCore::plainText):
2980 * editing/TextIterator.h:
2981 * page/mac/WebCoreFrameBridge.mm:
2982 (-[WebCoreFrameBridge selectedString]):
2983 (-[WebCoreFrameBridge stringForRange:]):
2985 2007-08-02 David Hyatt <hyatt@apple.com>
2987 Fix for 5374437, allow comment nodes to be the child of a document.
2988 Refine the check to always make a root element to check documentElement()
2989 rather than firstChild(), since a comment node could be present as the
2992 Reviewed by Tim Hatcher
2994 * html/HTMLDocument.cpp:
2995 (WebCore::HTMLDocument::childAllowed):
2996 * html/HTMLParser.cpp:
2997 (WebCore::HTMLParser::finished):
2999 2007-08-02 Antti Koivisto <antti@apple.com>
3003 <rdar://problem/5228138>
3004 REGRESSION(Leopard): test failures: tests that test Georgian numbering
3006 Fix to Georgian number tables to get CSS2.1 test results right. Font has relevant characters now
3007 which revealed that results were actually wrong.
3009 * rendering/RenderListMarker.cpp:
3010 (WebCore::toGeorgian):
3012 2007-08-02 Ada Chan <adachan@apple.com>
3016 <rdar://problem/5079175> Added parameters headerHeight and footerHeight to
3017 computePageRectsForFrame() so we can account for the header and footer when
3018 calculating page heights for this frame.
3020 * bridge/win/FrameWin.cpp:
3021 (WebCore::computePageRectsForFrame):
3022 * bridge/win/FrameWin.h:
3024 2007-08-02 Alice Liu <alice.liu@apple.com>
3026 Reviewed by Kevin McCullough.
3028 fixed <rdar://problem/5310312> REGRESSION: javascript is mis-escaped at http://labs.zarate.org/passwd causing bookmarklet to break
3031 expose some calls for WebKit to call.
3032 * manual-tests/JavaScript-bookmarklets.html: Added.
3034 2007-08-01 Adam Treat <treat@kde.org>
3036 Reviewed by George Staikos.
3038 Add an interface to manage global history for clients
3041 * platform/qt/TemporaryLinkStubs.cpp:
3043 2007-08-01 Adam Treat <treat@kde.org>
3045 Reviewed by George Staikos.
3047 Do not call update or paint from inside a paint event.
3049 * platform/qt/ScrollViewQt.cpp:
3050 (WebCore::ScrollView::updateContents):
3051 * platform/qt/WidgetQt.cpp:
3052 (WebCore::Widget::invalidateRect):
3054 2007-08-01 Timothy Hatcher <timothy@apple.com>
3058 <rdar://problem/5376156> Mail crash in DeleteButtonController::hide() when dropping selected image on DIV's border
3060 Add the container element back so the selection can not touch the deletion UI nodes. The container
3061 has style to prevent user selection, user drag and user modification.
3063 * editing/DeleteButtonController.cpp:
3064 (WebCore::DeleteButtonController::show): Make the container node, and append the button and outline elements.
3065 (WebCore::DeleteButtonController::hide): Remove the container elements and null out the other nodes.
3066 * editing/DeleteButtonController.h:
3068 2007-08-01 Steve Falkenburg <sfalken@apple.com>
3070 Build mod: Fix sln to match configs in vcproj.
3074 * WebCore.vcproj/WebCore.make:
3076 2007-07-31 David Harrison <harrison@apple.com>
3080 <rdar://problem/5362659> CrashTracer: [USER] 11 crashes in Mail at WebCore::InsertLineBreakCommand::doApply()
3082 The problem was that deleting with the X control leaves the selection inside the fragment that was deleted.
3084 * editing/DeleteButtonController.cpp:
3085 (WebCore::DeleteButtonController::deleteTarget):
3086 Because the deletion UI only appears when the selection is entirely
3087 within the target, we unconditionally update the selection to be
3088 a caret where the target had been.
3090 2007-07-31 Adele Peterson <adele@apple.com>
3094 Fix for <rdar://problem/5339395> REGRESSION:http://sudokucraving.com does not render grid correctly
3096 * rendering/RenderTextControl.h: (WebCore::RenderTextControl::hasControlClip): Clip for search fields.
3097 * rendering/RenderTextControl.cpp:
3098 (WebCore::RenderTextControl::controlClipRect): Added a control clip so the search field's cancel button and magnifier glass
3099 never draw outside the control's bounds.
3100 (WebCore::RenderTextControl::calcPrefWidths): Only include the inner box's padding when calculating the min/max width without using calcContentBoxWidth.
3101 Our old behavior was causing that inner padding to get counted twice. Also, no need to add in the border
3102 for an inner box that can't be controlled from outside this class.
3103 * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::calcPrefWidths): ditto.
3105 2007-07-31 Anders Carlsson <andersca@apple.com>
3109 Speculative fix for <rdar://problem/5359695>
3110 REGRESSION (Tiger Beta): Multiple crashes in WebCore::Widget::getView() const + 6
3112 * page/EventHandler.cpp:
3113 (WebCore::EventHandler::updateDragAndDrop):
3114 Null check the frame view.
3116 2007-07-31 Timothy Hatcher <timothy@apple.com>
3118 Reviewed by Oliver and Beth.
3120 <rdar://problem/5211271> ADOBE Leopard 9A410: At the first Launching InDesign after deactivate, EULA page gets blanked.
3122 Rename needsAcrobatFrameReloadingQuirk to needsAdobeFrameReloadingQuirk, since this now applies to more Adobe applications.
3125 * page/Settings.cpp:
3126 (WebCore::Settings::Settings):
3127 (WebCore::Settings::setNeedsAdobeFrameReloadingQuirk):
3129 (WebCore::Settings::needsAcrobatFrameReloadingQuirk):
3131 2007-07-31 Matt Perry <mpComplete@gmail.com>
3133 Reviewed by Brady and Darin, tweaked by Brady, landed by Brady
3135 Fix for http://bugs.webkit.org/show_bug.cgi?id=14757 and <rdar://problem/5364692>
3136 HTMLTokenizer::processingData implementation is incorrect
3138 * html/HTMLTokenizer.cpp:
3139 (WebCore::HTMLTokenizer::processingData): Made it also return true if the HTMLTokenizer was inside the write() call.
3140 * loader/FrameLoader.cpp:
3141 (WebCore::FrameLoader::FrameLoader):
3142 (WebCore::FrameLoader::checkLoadCompleteTimerFired):
3143 (WebCore::FrameLoader::scheduleCheckLoadComplete):
3144 (WebCore::FrameLoader::stopForUserCancel): Changed a call to checkLoadComplete to be asynchronous, since
3145 stopForUserCancel can be called while parsing.
3146 * loader/FrameLoader.h:
3148 2007-07-31 Anders Carlsson <andersca@apple.com>
3152 <rdar://problem/5371582>
3153 REGRESSION: PLT .5% slower due to r24451 (copying HTMLCollection objects)
3155 Make the hash maps store CollectionInfo pointers to reduce amount of copying when
3156 inserting/rehashing etc.
3159 (WebCore::Document::~Document):
3160 (WebCore::Document::nameCollectionInfo):
3163 2007-07-31 Sam Weinig <sam@webkit.org>
3167 Fix for http://bugs.webkit.org/show_bug.cgi?id=14825
3168 Non-integer hsl() colours are ignored
3170 * css/CSSParser.cpp:
3171 (WebCore::CSSParser::parseHSLParameters): Parse hue as a Number,
3174 2007-07-30 Justin Garcia <justin.garcia@apple.com>
3178 <rdar://problem/5369009> Crash due to infinite recursion in moveParagraphs on delete
3180 After the delete, we moved content into the previous block, and a style
3181 rule turned a style span in the moved content into a block, throwing
3182 moveParagraphs into infinite recursion, as it continually tried and failed
3183 to get the style span into the same paragraph as the content just before it.
3185 Added a method to ReplaceSelectionCommand to keep inserted style spans
3186 from turning into blocks because of style rules. Will add code to prevent
3187 other kinds of content from changing appearance because of style rules,
3188 post-Leopard (5371536). Also added a bool to ReplaceSelectionCommand's
3189 constructor to guard against infinite recursion.
3191 * editing/CompositeEditCommand.cpp:
3192 (WebCore::CompositeEditCommand::moveParagraphs):
3193 * editing/JSEditor.cpp:
3194 * editing/ReplaceSelectionCommand.cpp:
3195 (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
3196 (WebCore::ReplaceSelectionCommand::negateStyleRulesThatEffectAppearance):
3197 (WebCore::ReplaceSelectionCommand::doApply):
3198 * editing/ReplaceSelectionCommand.h:
3200 2007-07-30 Anders Carlsson <andersca@apple.com>
3204 <rdar://problem/5371515>
3205 BitmapImage::getTIFFRepresentation() bug results in favicons not working at many sites
3207 Don't bail out if a single frame is invalid.
3209 * platform/graphics/mac/ImageMac.mm:
3210 (WebCore::BitmapImage::getTIFFRepresentation):
3212 2007-07-30 Adele Peterson <adele@apple.com>
3216 Fix for <rdar://problem/5274937> Safari 3 breaks Missing Sync's WebKit code by crashing
3218 * loader/MainResourceLoader.cpp: (WebCore::MainResourceLoader::continueAfterContentPolicy): Nil check for the FrameLoader.
3220 2007-07-30 Anders Carlsson <andersca@apple.com>
3224 <rdar://problem/5370710>
3225 REGRESSION: After switching from Bookmark view, the Find Banner won't appear while displaying a PDF file
3227 Add a hasHTMLView to FrameLoaderClient. This is only useful for clients who can show different views for different
3228 MIME types and URL schemes.
3230 * loader/FrameLoader.cpp:
3231 (WebCore::FrameLoader::transitionToCommitted):
3232 Call delegate methods here if the current view is not a HTML view.
3234 * loader/FrameLoaderClient.h:
3235 (WebCore::FrameLoaderClient::hasHTMLView):
3237 2007-07-30 Sam Weinig <sam@webkit.org>
3241 Fix for <rdar://problem/5363896>
3242 REGRESSION: Setting document.domain does not override port-based cross-frame security checks -- breaks SAP NetWeaver
3244 Updates the results for:
3245 http/tests/security/cross-frame-access-port-explicit-domain.html
3246 http/tests/security/cross-frame-access-protocol-explicit-domain.html
3248 * bindings/js/kjs_window.cpp:
3249 (KJS::createWindow): Use the new setDomainInternal method.
3250 (KJS::Window::isSafeScript): Don't set check the port or protocol
3251 if both documents have explicitly set document.domain in the DOM
3252 and the those domains are equal.
3254 (WebCore::Document::Document):
3255 (WebCore::Document::setDomain): Remove force parameter and change
3256 all calls that relied on it use the new setDomainInternal method
3257 which does the same thing.
3258 (WebCore::Document::setDomainInternal):
3259 * dom/Document.h: Add new m_domainWasSetInDOM variable and accessor.
3260 (WebCore::Document::domainWasSetInDOM):
3261 * loader/FrameLoader.cpp:
3262 (WebCore::FrameLoader::checkCallImplicitClose): Use the new setDomainInternal method.
3264 2007-07-30 Justin Garcia <justin.garcia@apple.com>
3266 Reviewed by Tristan.
3268 <rdar://problem/5098931> Attachments are lost when they are moved into a ToDo after a delete
3270 Added an editor client method for asking whether or not it is
3271 OK to merge content after a delete.
3273 * bridge/EditorClient.h:
3274 * editing/DeleteSelectionCommand.cpp:
3275 (WebCore::DeleteSelectionCommand::mergeParagraphs): Ask if the
3277 * platform/gdk/EditorClientGdk.cpp:
3278 (WebCore::EditorClientGdk::shouldMoveRangeAfterDelete): Added a method stub.
3279 * platform/gdk/EditorClientGdk.h:
3280 * platform/graphics/svg/SVGImageEmptyClients.h:
3281 (WebCore::SVGEmptyEditorClient::shouldMoveRangeAfterDelete): Ditto.
3283 2007-07-30 Alexey Proskuryakov <ap@webkit.org>
3287 <rdar://problem/5352526>
3288 http://bugs.webkit.org/show_bug.cgi?id=14704
3289 REGRESSION: sync XMLHttpRequest.send() raises an exception for failed authentication
3291 Test: http/tests/xmlhttprequest/failed-auth.html
3293 * platform/network/mac/ResourceHandleMac.mm:
3294 (WebCore::ResourceHandle::loadResourceSynchronously): Make the fake response better match the real one
3295 in case of failed authentication. Unfortunately, NSURLConnection doesn't give us the real response.
3297 * xml/XMLHttpRequest.cpp:
3298 (WebCore::XMLHttpRequest::send): If the response has an HTTP code in it, then the error wasn't
3299 a network one, and an exception shouldn't be raised.
3301 2007-07-30 Anders Carlsson <andersca@apple.com>
3305 <rdar://problem/4942372> REGRESSION: Anchor links in Mail don't work anymore
3307 Make it possible for KURL to handle addig fragments to non-hierarchical URLs
3308 such as mailto: and cid:.
3310 * platform/KURL.cpp:
3311 (WebCore::KURL::init):
3312 If the base URL is not hierarchical but the relative URL is a fragment, then
3315 (WebCore::KURL::parse):
3316 If the URL is not hierarchical, set the fragment start and end positions correctly.
3318 2007-07-30 Simon Hausmann <hausmann@kde.org>
3322 On Windows make sure the dll also ends up in $$OUTPUT_DIR/bin, so that QtLauncher can find it.
3326 2007-07-30 Simon Hausmann <hausmann@kde.org>
3330 Removed the __BUILDING_QT ifdef in JSStringRef.h and changed UChar for the Qt build to use wchar_t on Windows.
3332 * platform/TextEncoding.cpp:
3333 (WebCore::TextEncoding::encode):
3335 2007-07-30 Simon Hausmann <hausmann@kde.org>
3339 Don't link against libxml/libxslt unless we really need it.
3343 2007-07-29 Tristan O'Tierney <tristan@apple.com>
3345 Reviewed by Oliver Hunt.
3347 <rdar://problem/5369282> REGRESSION: DOMHTMLInput throwing exception due to missing _isEdited method
3349 * bindings/objc/DOMHTML.mm:
3350 (-[DOMHTMLInputElement _isEdited]):
3351 (-[DOMHTMLTextAreaElement _isEdited]):
3352 * bindings/objc/DOMPrivate.h:
3353 Renamed _isUserEdited to _isEdited.
3355 2007-07-29 Adam Treat <treat@kde.org>
3357 Reviewed by George Staikos.
3359 Correctly set the update rect for the scrollbars when they are invalidated.
3360 Do not paint entire page for each scroll delta. Cache the dirty regions
3361 when webkit calls ScrollView::updateContents as webkit expects the paint
3362 routine to use the dirty regions bounding rect.
3364 These changes greatly reduce the cpu load as we are no longer painting the
3365 entire page for each 1px scroll :P
3367 * platform/qt/ScrollViewQt.cpp:
3368 (WebCore::ScrollView::ScrollViewPrivate::scrollBackingStore):
3369 (WebCore::ScrollView::updateContents):
3370 (WebCore::ScrollView::paint):
3371 * platform/qt/WidgetQt.cpp:
3372 (WebCore::Widget::invalidateRect):
3374 2007-07-29 Adele Peterson <adele@apple.com>
3378 WebCore part of fix for <rdar://problem/5102522> REGRESSION: Can't tab to webview that doesn't have editable content (affects Safari, preview pane in Mail)
3381 * page/FocusController.cpp:
3382 (WebCore::FocusController::setInitialFocus): Added.
3383 (WebCore::FocusController::advanceFocus): Don't give the focus back to the chrome if this is the initial focus.
3384 * page/FocusController.h:
3386 2007-07-29 Adam Treat <treat@kde.org>
3388 Reviewed by Alexey Proskuryakov.
3390 WebCore::Widget::setParent should be virtual.
3391 It is reimplemented in ScrollViewQt for instance.
3393 * platform/Widget.h:
3395 2007-07-29 Alp Toker <alp.toker@collabora.co.uk>
3399 http://bugs.webkit.org/show_bug.cgi?id=14711 (revisited)
3400 RenderThemeGdk's buttons are state-agnostic (pressed, hovered)
3402 Generalize shadow state into a function.
3403 use a GtkHBox to work around a theme bug (thanks to Nigel Tao).
3405 * platform/gdk/RenderThemeGdk.cpp:
3406 (WebCore::RenderThemeGdk::determineShadow):
3407 (WebCore::RenderThemeGdk::paintCheckbox):
3408 (WebCore::RenderThemeGdk::paintRadio):
3409 (WebCore::RenderThemeGdk::paintButton):
3410 (WebCore::RenderThemeGdk::gtkWindowContainer):
3411 * platform/gdk/RenderThemeGdk.h:
3413 2007-07-27 Adele Peterson <adele@apple.com>
3417 Temporary fix for Windows to prevent crashing on all frame pages. Darin
3418 is working on a more permanent fix.
3420 * loader/FrameLoader.cpp:
3422 2007-07-27 Adam Treat <treat@kde.org>
3424 Reviewed by David Hyatt.
3426 Fix crash when using QtWebKit canvas support.
3429 * html/HTMLCanvasElement.cpp:
3430 (WebCore::HTMLCanvasElement::reset):
3432 2007-07-27 Darin Adler <darin@apple.com>
3434 * rendering/RenderLayer.cpp: Rolled out accidentally-checked-in code.
3436 2007-07-27 Darin Adler <darin@apple.com>
3438 Reviewed by John Sullivan.
3440 - fix <rdar://problem/5261393> In Mail the plain text alternatives to messages with attachments show weird little OBJ thingies
3442 The "weird little thingies" are U+FFFC characters. It's good to render them as zero-width, the way we do
3443 with control characters -- helps Mail and doesn't hurt web browsing.
3445 Test: fast/text/zero-width-characters.html
3447 * platform/CharacterNames.h: Add names for leftToRightMark, rightToLeftMark, and objectReplacementCharacter.
3448 * platform/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::initializePage): Give objectReplacementCharacter
3449 zero width in the same way we do it for the various other characters.
3451 2007-07-27 Lars Knoll <lars@trolltech.com>
3455 Enable XSLT support for the gtk port.
3459 2007-07-27 Zack Rusin <zack@kde.org>
3461 Reviewed by Zack and Lars.
3463 Premature end after finishing parsing is a fatal error.
3465 * dom/XMLTokenizer.cpp:
3466 (WebCore::XMLTokenizer::end):
3468 2007-07-27 Lars Knoll <lars@trolltech.com>
3470 Reviewed by Zack and Lars.
3472 Simplify conversions that go from a QStringRef to a WebCore::String to not use a temporary QString.
3474 * dom/XMLTokenizer.cpp:
3477 2007-07-27 Zack Rusin <zack@kde.org>
3479 Reviewed by Zack and Lars.
3481 Fix entity handling in the main document content (attributes still broken)
3483 * dom/XMLTokenizer.cpp:
3486 2007-07-27 Lars Knoll <lars@trolltech.com>
3488 Reviewed by Zack and Lars.
3490 Correctly convert a null QString into a null WebCore::String. Add a String(const QStringRef&) constructor so that we can avoid converting QStringRef via QString to WebCore::String.
3492 * dom/XMLTokenizer.cpp:
3494 * platform/PlatformString.h:
3495 * platform/qt/StringQt.cpp:
3496 (WebCore::String::String):
3498 2007-07-27 Zack Rusin <zack@kde.org>
3500 Reviewed by Zack and Lars.
3502 Parse version and encoding of the xml document.
3504 * dom/XMLTokenizer.cpp:
3505 (WebCore::XMLTokenizer::write):
3507 2007-07-27 Zack Rusin <zack@kde.org>
3509 Reviewed by Zack and Lars.
3511 Correctly or semi-correctly parse the public and system id.