74e34af06e2e483c71747a65f1bce41002dc6de0
[WebKit-https.git] / WebCore / ChangeLog
1 2007-08-05  Maciej Stachowiak  <mjs@apple.com>
2
3         Reviewed by Darin Adler.
4         
5         <rdar://problem/5369110> CrashTracer: [USER] reproducible crash opening particular mail messages
6
7         * platform/network/mac/ResourceHandleMac.mm:
8         (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]): Make sure to retain
9         self for the body of this method. Otherwise, the willSendRequest could trigger events which will
10         cancel the connection, and we access ivars after this point.
11         (-[WebCoreSynchronousLoader connection:willSendRequest:redirectResponse:]): retain and release
12         in the right order.
13
14 2007-08-04  Adam Roben  <aroben@apple.com>
15
16         Another workaround for <rdar://problem/5386894>
17
18         Reviewed by Sam.
19
20         This fixed ~150 failing tests.
21
22         * platform/network/cf/ResourceResponseCFNet.cpp:
23         (WebCore::ResourceResponse::doUpdateResourceResponse): Hardcode the
24         MIME type for .svg files as well.
25
26 2007-08-04  Adam Roben  <aroben@apple.com>
27
28         Workaround for <rdar://problem/5386894> CFURLResponseGetMIMEType returns "text/html" for local .xhtml and .xml files
29
30         Reviewed by Sam.
31
32         This fixes ~350 failing tests.
33
34         * platform/network/cf/ResourceResponseCFNet.cpp:
35         (WebCore::ResourceResponse::doUpdateResourceResponse): Use a workaround
36         identical to the one in ResourceResponseMac.mm, but include .xml files
37         as well.
38
39 2007-08-04  David Kilzer  <ddkilzer@webkit.org>
40
41         Reviewed by Oliver.
42
43         - fix for http://bugs.webkit.org/show_bug.cgi?id=14882
44           <rdar://problem/5386550> REGRESSION (r24866): text/plain documents are always downloaded
45
46         The supportedNonImageMimeTypes list is used to determine which MIME types may be viewed
47         within the web browser (e.g., plug-ins add their own MIME types to the list during
48         initialization), so we must add "text/plain" and "text/" back to the list.  Since
49         this change would then break DOMImplementation::isTextMIMEType(), that method was reverted
50         to its original form and MIMETypeRegistry::shouldTreatAsText() was removed.
51
52         * dom/DOMImplementation.cpp:
53         (WebCore::DOMImplementation::isTextMIMEType): Revert to previous version.
54         * platform/MIMETypeRegistry.cpp:
55         (WebCore::initialiseSupportedNonImageMimeTypes): Added back "text/plain" and "text/" to the list.
56         (WebCore::MIMETypeRegistry::shouldTreatAsText): Removed.
57         * platform/MIMETypeRegistry.h:
58
59 2007-08-03  Brady Eidson  <beidson@apple.com>
60
61         Reviewed by Oliver
62
63         Fix for http://bugs.webkit.org/show_bug.cgi?id=14824 and <rdar://problem/5372989>
64
65         Two issues - 
66         1 - The WebCore MIMEType registry was designed assuming the list of types would never change
67             That is false, as WebKit has API and SPI calls which directly mutate the MIMETypeRegistry
68         2 - DOMImplementation didn't consult the registry for any MIMEType that started with "text/", 
69             instead maintaining it's own hard coded rules
70
71         * dom/DOMImplementation.cpp:
72         (WebCore::DOMImplementation::isTextMIMEType): For now, call through to the MIMETypeRegistry
73           until we decided a different fate for this function
74
75         * platform/MIMETypeRegistry.cpp:
76         (WebCore::initialiseSupportedNonImageMimeTypes):  "SupportedNonImageMIMETypes" is really a misnomer for 
77           "MIMETypes we should show as HTML" but that line has slowly been blurred since Tiger.  In an attempt
78           to start to unblur it, remove "text/" and "text/plain"
79         (WebCore::MIMETypeRegistry::shouldTreatAsText):  The decision is very close to the old DOMImplementation 
80           method, except we don't automatically hand off "text/" types as true if they are in the set of supported
81           MIMETypes
82         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Non-const (can be changed!)
83         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Non-const (can be changed!)
84         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Non-const (can be changed!)
85         * platform/MIMETypeRegistry.h:
86
87 2007-08-03  Adele Peterson  <adele@apple.com>
88
89         Reviewed by Adam.
90
91         Fix for <rdar://problem/5345862> CrashTracer: [USER] 4 crashes in Safari at com.apple.WebCore: WebCore::Frame::isContentEditable const + 10
92
93         Couldn't reproduce the problem, but a nil check for the frame should fix this.
94
95         * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::adjustRenderStyle):
96
97 2007-08-03  Anders Carlsson  <andersca@apple.com>
98
99         Reviewed by Oliver.
100
101         <rdar://problem/5383286>
102         XMLHTTPRequest does not return 401 when user cancels authentication dialog (affects .Mac)
103         
104         * loader/ResourceLoader.h:
105         Make receivedCancellation virtual.
106         
107         * loader/SubresourceLoader.cpp:
108         (WebCore::SubresourceLoader::receivedCancellation):
109         Call SubresourceLoaderClient::receivedCancellation.
110         
111         * xml/XMLHttpRequest.cpp:
112         (WebCore::XMLHttpRequest::receivedCancellation):
113         Save the failure response.
114
115 2007-08-03  Anders Carlsson  <andersca@apple.com>
116
117         Reviewed by Geoff.
118
119         <rdar://problem/5374393> 
120         Image change on disk not noticed by WebView; -[WebCache setDisabled:] used to cause a reload every time
121         
122         This is essentially a better fix for the crash in <rdar://problem/5362783>.
123         
124         * loader/DocLoader.cpp:
125         (WebCore::DocLoader::requestResource):
126         If the resource already exists in the m_docResources map, remove it and disassociate it from the doc loader.
127
128 2007-08-03  Oliver Hunt  <oliver@apple.com>
129
130         Reviewed by Geoff.
131
132         <rdar://problem/5375190> Mail crashed in WebCore::CachedImage::imageSize() const when viewing a particular message
133
134         Fix the uncached load path to confirm that the type of resource being 
135         returned actually matches the type that was requested.
136
137         Also make sure we never create a resource in the Cache for invalid urls.
138
139         * loader/Cache.cpp:
140         (WebCore::Cache::requestResource):
141         * loader/DocLoader.cpp:
142         (WebCore::DocLoader::requestResource):
143
144 2007-08-03  Mitz Pettel  <mitz@webkit.org>
145
146         Reviewed by Adele.
147
148         - fix http://bugs.webkit.org/show_bug.cgi?id=14879
149           REGRESSION: First item in select (pop-up menu) is displayed even if another item was selected via JavaScript
150
151         Test: fast/forms/menulist-deselect-update.html
152
153         * html/HTMLOptionElement.cpp:
154         (WebCore::HTMLOptionElement::setSelected): Reordered to allow setSelectedIndex() to call setChanged().
155
156 2007-08-03  Anders Carlsson  <andersca@apple.com>
157
158         Reviewed by Darin.
159
160         <rdar://problem/5286444>
161         http://bugs.webkit.org/show_bug.cgi?id=14269
162         REGRESSION: Gmail links stop working after computer sleep
163         
164         Add a PowerNotifier object that takes care of resetting and firing the shared timer when coming
165         back from sleep.
166         
167         * platform/mac/SharedTimerMac.cpp:
168         (-[PowerNotifier init]):
169         (-[PowerNotifier didWake:]):
170         (WebCore::setSharedTimerFireTime):
171
172 2007-08-04  Mark Rowe  <mrowe@apple.com>
173
174         Windows build fix.
175
176         * rendering/RenderTextControl.cpp: Don't use the same name for two arguments.
177
178 2007-08-03  Mitz Pettel  <mitz@webkit.org>
179
180         Reviewed by Darin.
181
182         - fix http://bugs.webkit.org/show_bug.cgi?id=14653
183           REGRESSION (r23994): No caret is drawn after clicking a search field's placeholder text
184           <rdar://problem/5383841>
185
186         Test: fast/forms/search-click-in-placeholder.html
187
188         Defined a subclass of RenderBlock that never hit-tests children for use in
189         text controls. This avoids returning placeholder text as the hit node.
190         Since text controls cannot contain inline elements, there is no harm in
191         doing that unconditionally, and not just in the case that the field is
192         showing placeholder text.
193
194         * rendering/RenderTextControl.cpp:
195         (WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock):
196         (WebCore::RenderTextControlInnerBlock::~RenderTextControlInnerBlock):
197         (WebCore::RenderTextControlInnerBlock::nodeAtPoint):
198         (WebCore::RenderTextControl::createSubtreeIfNeeded):
199
200 2007-08-02  Oliver Hunt  <oliver@apple.com>
201
202         Reviewed by Geoff
203
204         Fix for <rdar://problem/5369332> Xcode crashes while selecting a hyperlink within a AppleScript dictionary (WebCore::Font::drawGlyphBuffer)
205
206         There were many places where we were not correctly retaining/releasing the
207         NSFont object stored in the C++ PlatformFontData object, this resulted in
208         the GC incorrectly collecting the NSFont.
209
210         This patch fixes the problem by prevent direct modification of the PlatformFontData
211         font pointer, allowing us to enforce correct CFRetain/Release behaviour.
212
213         * platform/FontData.h:
214         (WebCore::FontData::getNSFont):
215         * platform/mac/FontCacheMac.mm:
216         (WebCore::FontCache::getFontDataForCharacters):
217         (WebCore::FontCache::createFontPlatformData):
218         * platform/mac/FontDataMac.mm:
219         (WebCore::initFontData):
220         (WebCore::FontData::platformInit):
221         (WebCore::FontData::platformDestroy):
222         (WebCore::FontData::smallCapsFontData):
223         (WebCore::FontData::containsCharacters):
224         (WebCore::FontData::determinePitch):
225         (WebCore::FontData::platformWidthForGlyph):
226         (WebCore::FontData::checkShapesArabic):
227         * platform/mac/FontMac.mm:
228         (WebCore::initializeATSUStyle):
229         (WebCore::overrideLayoutOperation):
230         (WebCore::Font::drawGlyphs):
231         * platform/mac/FontPlatformData.h:
232         (WebCore::FontPlatformData::FontPlatformData):
233         (WebCore::FontPlatformData::~FontPlatformData):
234         (WebCore::FontPlatformData::hash):
235         (WebCore::FontPlatformData::operator==):
236         (WebCore::FontPlatformData::font):
237         (WebCore::FontPlatformData::setFont):
238
239 2007-08-03  Antti Koivisto  <antti@apple.com>
240
241         Oops, this change wasn't supposed to be commited.
242
243         * page/mac/WebCoreFrameBridge.mm:
244         (-[WebCoreFrameBridge setBaseBackgroundColor:]):
245
246 2007-08-02  Antti Koivisto  <antti@apple.com>
247
248         Reviewed by Darin.
249
250         <rdar://problem/5355951>
251         plainText() fragments TCMalloc heap badly on large pages
252         
253         also likely fixes some cases of
254         <rdar://problem/5335382>
255         CrashTracer: [REGRESSION] 73 crashes in Safari at com.apple.WebCore: WebCore::DeprecatedStringData::increaseUnicodeSize + 52
256         
257         If you load http://dscoder.com/test.txt with WebKit build with TCMalloc and system malloc you see that
258         Safari RPRVT with TCMalloc is 118.8MB
259         Safari RPRVT with system malloc is 69.7MB
260         
261         Difference is almost entirely caused by heap fragmentation from a full document plainText() call (for indexing purposes).
262         
263         The patch helps in two ways:
264         - construct plainText string in pieces to avoid O(n^2) reallocs
265         - allocate buffers using system malloc so they can be returned back to OS and don't fragment and grow TCMalloc heap
266     
267         This shrinks http://dscoder.com/test.txt RPRVT to 79.0MB and makes full document plainText() take 50ms instead of 500ms.
268         The benefits are not limited to extreme cases, web pages above ~200kB can show substantial improvement in RPRVT.
269
270         * editing/TextIterator.cpp:
271         (WebCore::plainTextToMallocAllocatedBuffer):
272         (WebCore::plainText):
273         * editing/TextIterator.h:
274         * page/mac/WebCoreFrameBridge.mm:
275         (-[WebCoreFrameBridge selectedString]):
276         (-[WebCoreFrameBridge stringForRange:]):
277
278 2007-08-02  David Hyatt  <hyatt@apple.com>
279
280         Fix for 5374437, allow comment nodes to be the child of a document.
281         Refine the check to always make a root element to check documentElement()
282         rather than firstChild(), since a comment node could be present as the
283         firstChild() now.
284
285         Reviewed by Tim Hatcher
286
287         * html/HTMLDocument.cpp:
288         (WebCore::HTMLDocument::childAllowed):
289         * html/HTMLParser.cpp:
290         (WebCore::HTMLParser::finished):
291
292 2007-08-02  Antti Koivisto  <antti@apple.com>
293
294         Reviewed by Darin.
295         
296         <rdar://problem/5228138>
297         REGRESSION(Leopard): test failures: tests that test Georgian numbering
298
299         Fix to Georgian number tables to get CSS2.1 test results right. Font has relevant characters now 
300         which revealed that results were actually wrong. 
301
302         * rendering/RenderListMarker.cpp:
303         (WebCore::toGeorgian):
304
305 2007-08-02  Ada Chan  <adachan@apple.com>
306
307         Reviewed by Steve.
308
309         <rdar://problem/5079175> Added parameters headerHeight and footerHeight to 
310         computePageRectsForFrame() so we can account for the header and footer when
311         calculating page heights for this frame.
312
313         * bridge/win/FrameWin.cpp:
314         (WebCore::computePageRectsForFrame):
315         * bridge/win/FrameWin.h:
316
317 2007-08-02  Alice Liu  <alice.liu@apple.com>
318
319         Reviewed by Kevin McCullough.
320
321         fixed <rdar://problem/5310312> REGRESSION: javascript is mis-escaped at http://labs.zarate.org/passwd causing bookmarklet to break
322         
323         * WebCore.exp:
324         expose some calls for WebKit to call. 
325         * manual-tests/JavaScript-bookmarklets.html: Added.
326
327 2007-08-01  Adam Treat  <treat@kde.org>
328
329         Reviewed by George Staikos.
330
331         Add an interface to manage global history for clients
332
333         * WebCore.pro:
334         * platform/qt/TemporaryLinkStubs.cpp:
335
336 2007-08-01  Adam Treat  <treat@kde.org>
337
338         Reviewed by George Staikos.
339
340         Do not call update or paint from inside a paint event.
341
342         * platform/qt/ScrollViewQt.cpp:
343         (WebCore::ScrollView::updateContents):
344         * platform/qt/WidgetQt.cpp:
345         (WebCore::Widget::invalidateRect):
346
347 2007-08-01  Timothy Hatcher  <timothy@apple.com>
348
349         Reviewed by Justin.
350
351         <rdar://problem/5376156> Mail crash in DeleteButtonController::hide() when dropping selected image on DIV's border
352
353         Add the container element back so the selection can not touch the deletion UI nodes. The container
354         has style to prevent user selection, user drag and user modification.
355
356         * editing/DeleteButtonController.cpp:
357         (WebCore::DeleteButtonController::show): Make the container node, and append the button and outline elements.
358         (WebCore::DeleteButtonController::hide): Remove the container elements and null out the other nodes.
359         * editing/DeleteButtonController.h:
360
361 2007-08-01  Steve Falkenburg  <sfalken@apple.com>
362
363         Build mod: Fix sln to match configs in vcproj.
364         
365         Reviewed by Adam.
366
367         * WebCore.vcproj/WebCore.make:
368
369 2007-07-31  David Harrison  <harrison@apple.com>
370
371         Reviewed by Justin.
372
373         <rdar://problem/5362659> CrashTracer: [USER] 11 crashes in Mail at WebCore::InsertLineBreakCommand::doApply()
374
375         The problem was that deleting with the X control leaves the selection inside the fragment that was deleted.
376
377         * editing/DeleteButtonController.cpp:
378         (WebCore::DeleteButtonController::deleteTarget):
379         Because the deletion UI only appears when the selection is entirely
380         within the target, we unconditionally update the selection to be
381         a caret where the target had been.
382
383 2007-07-31  Adele Peterson  <adele@apple.com>
384
385         Reviewed by Hyatt.
386
387          Fix for <rdar://problem/5339395> REGRESSION:http://sudokucraving.com does not render grid correctly
388
389         * rendering/RenderTextControl.h: (WebCore::RenderTextControl::hasControlClip): Clip for search fields.
390         * rendering/RenderTextControl.cpp:
391         (WebCore::RenderTextControl::controlClipRect): Added a control clip so the search field's cancel button and magnifier glass
392          never draw outside the control's bounds.
393         (WebCore::RenderTextControl::calcPrefWidths): Only include the inner box's padding when calculating the min/max width without using calcContentBoxWidth.
394          Our old behavior was causing that inner padding to get counted twice.  Also, no need to add in the border
395          for an inner box that can't be controlled from outside this class.
396         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::calcPrefWidths): ditto.
397
398 2007-07-31  Anders Carlsson  <andersca@apple.com>
399
400         Reviewed by Geoff.
401
402         Speculative fix for <rdar://problem/5359695> 
403         REGRESSION (Tiger Beta): Multiple crashes in WebCore::Widget::getView() const + 6
404                 
405         * page/EventHandler.cpp:
406         (WebCore::EventHandler::updateDragAndDrop):
407         Null check the frame view.
408
409 2007-07-31  Timothy Hatcher  <timothy@apple.com>
410
411         Reviewed by Oliver and Beth.
412
413         <rdar://problem/5211271> ADOBE Leopard 9A410: At the first Launching InDesign after deactivate, EULA page gets blanked.
414
415         Rename needsAcrobatFrameReloadingQuirk to needsAdobeFrameReloadingQuirk, since this now applies to more Adobe applications.
416
417         * WebCore.exp:
418         * page/Settings.cpp:
419         (WebCore::Settings::Settings):
420         (WebCore::Settings::setNeedsAdobeFrameReloadingQuirk):
421         * page/Settings.h:
422         (WebCore::Settings::needsAcrobatFrameReloadingQuirk):
423
424 2007-07-31  Matt Perry  <mpComplete@gmail.com>
425
426         Reviewed by Brady and Darin, tweaked by Brady, landed by Brady
427
428         Fix for http://bugs.webkit.org/show_bug.cgi?id=14757 and <rdar://problem/5364692>
429         HTMLTokenizer::processingData implementation is incorrect
430
431         * html/HTMLTokenizer.cpp:
432         (WebCore::HTMLTokenizer::processingData): Made it also return true if the HTMLTokenizer was inside the write() call.
433         * loader/FrameLoader.cpp:
434         (WebCore::FrameLoader::FrameLoader):
435         (WebCore::FrameLoader::checkLoadCompleteTimerFired):
436         (WebCore::FrameLoader::scheduleCheckLoadComplete):
437         (WebCore::FrameLoader::stopForUserCancel): Changed a call to checkLoadComplete to be asynchronous, since
438         stopForUserCancel can be called while parsing.
439         * loader/FrameLoader.h:
440
441 2007-07-31  Anders Carlsson  <andersca@apple.com>
442
443         Reviewed by Geoff.
444
445         <rdar://problem/5371582>
446         REGRESSION: PLT .5% slower due to r24451 (copying HTMLCollection objects)
447         
448         Make the hash maps store CollectionInfo pointers to reduce amount of copying when
449         inserting/rehashing etc.
450         
451         * dom/Document.cpp:
452         (WebCore::Document::~Document):
453         (WebCore::Document::nameCollectionInfo):
454         * dom/Document.h:
455
456 2007-07-31  Sam Weinig  <sam@webkit.org>
457
458         Reviewed by Mitz.
459
460         Fix for http://bugs.webkit.org/show_bug.cgi?id=14825
461         Non-integer hsl() colours are ignored
462
463         * css/CSSParser.cpp:
464         (WebCore::CSSParser::parseHSLParameters): Parse hue as a Number,
465         not an Integer. 
466
467 2007-07-30  Justin Garcia  <justin.garcia@apple.com>
468
469         Reviewed by Darin.
470
471         <rdar://problem/5369009> Crash due to infinite recursion in moveParagraphs on delete
472         
473         After the delete, we moved content into the previous block, and a style
474         rule turned a style span in the moved content into a block, throwing
475         moveParagraphs into infinite recursion, as it continually tried and failed
476         to get the style span into the same paragraph as the content just before it.
477         
478         Added a method to ReplaceSelectionCommand to keep inserted style spans 
479         from turning into blocks because of style rules.  Will add code to prevent
480         other kinds of content from changing appearance because of style rules,
481         post-Leopard (5371536). Also added a bool to ReplaceSelectionCommand's 
482         constructor to guard against infinite recursion.
483
484         * editing/CompositeEditCommand.cpp:
485         (WebCore::CompositeEditCommand::moveParagraphs):
486         * editing/JSEditor.cpp:
487         * editing/ReplaceSelectionCommand.cpp:
488         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
489         (WebCore::ReplaceSelectionCommand::negateStyleRulesThatEffectAppearance):
490         (WebCore::ReplaceSelectionCommand::doApply):
491         * editing/ReplaceSelectionCommand.h:
492
493 2007-07-30  Anders Carlsson  <andersca@apple.com>
494
495         Reviewed by Brady.
496
497         <rdar://problem/5371515>
498         BitmapImage::getTIFFRepresentation() bug results in favicons not working at many sites
499
500         Don't bail out if a single frame is invalid.
501         
502         * platform/graphics/mac/ImageMac.mm:
503         (WebCore::BitmapImage::getTIFFRepresentation):
504
505 2007-07-30  Adele Peterson  <adele@apple.com>
506
507         Reviewed by Darin.
508
509         Fix for <rdar://problem/5274937> Safari 3 breaks Missing Sync's WebKit code by crashing
510
511         * loader/MainResourceLoader.cpp: (WebCore::MainResourceLoader::continueAfterContentPolicy): Nil check for the FrameLoader.
512
513 2007-07-30  Anders Carlsson  <andersca@apple.com>
514
515         Reviewed by Darin.
516
517         <rdar://problem/5370710> 
518         REGRESSION: After switching from Bookmark view, the Find Banner won't appear while displaying a PDF file
519
520         Add a hasHTMLView to FrameLoaderClient. This is only useful for clients who can show different views for different
521         MIME types and URL schemes.
522         
523         * loader/FrameLoader.cpp:
524         (WebCore::FrameLoader::transitionToCommitted):
525         Call delegate methods here if the current view is not a HTML view.
526         
527         * loader/FrameLoaderClient.h:
528         (WebCore::FrameLoaderClient::hasHTMLView):
529
530 2007-07-30  Sam Weinig  <sam@webkit.org>
531
532         Reviewed by Maciej.
533
534         Fix for <rdar://problem/5363896>
535         REGRESSION: Setting document.domain does not override port-based cross-frame security checks -- breaks SAP NetWeaver
536
537         Updates the results for:
538             http/tests/security/cross-frame-access-port-explicit-domain.html
539             http/tests/security/cross-frame-access-protocol-explicit-domain.html
540
541         * bindings/js/kjs_window.cpp:
542         (KJS::createWindow): Use the new setDomainInternal method.
543         (KJS::Window::isSafeScript): Don't set check the port or protocol 
544         if both documents have explicitly set document.domain in the DOM
545         and the those domains are equal.
546         * dom/Document.cpp:
547         (WebCore::Document::Document):
548         (WebCore::Document::setDomain): Remove force parameter and change 
549         all calls that relied on it use the new setDomainInternal method
550         which does the same thing.
551         (WebCore::Document::setDomainInternal): 
552         * dom/Document.h: Add new m_domainWasSetInDOM variable and accessor.
553         (WebCore::Document::domainWasSetInDOM):
554         * loader/FrameLoader.cpp:
555         (WebCore::FrameLoader::checkCallImplicitClose): Use the new setDomainInternal method. 
556
557 2007-07-30  Justin Garcia  <justin.garcia@apple.com>
558
559         Reviewed by Tristan.
560         
561         <rdar://problem/5098931> Attachments are lost when they are moved into a ToDo after a delete
562         
563         Added an editor client method for asking whether or not it is
564         OK to merge content after a delete.
565
566         * bridge/EditorClient.h:
567         * editing/DeleteSelectionCommand.cpp:
568         (WebCore::DeleteSelectionCommand::mergeParagraphs): Ask if the 
569         merge is allowed.
570         * platform/gdk/EditorClientGdk.cpp: 
571         (WebCore::EditorClientGdk::shouldMoveRangeAfterDelete): Added a method stub.
572         * platform/gdk/EditorClientGdk.h:
573         * platform/graphics/svg/SVGImageEmptyClients.h: 
574         (WebCore::SVGEmptyEditorClient::shouldMoveRangeAfterDelete): Ditto.
575
576 2007-07-30  Alexey Proskuryakov  <ap@webkit.org>
577
578         Reviewed by Anders.
579
580         <rdar://problem/5352526>
581         http://bugs.webkit.org/show_bug.cgi?id=14704
582         REGRESSION: sync XMLHttpRequest.send() raises an exception for failed authentication
583
584         Test: http/tests/xmlhttprequest/failed-auth.html
585
586         * platform/network/mac/ResourceHandleMac.mm:
587         (WebCore::ResourceHandle::loadResourceSynchronously): Make the fake response better match the real one
588         in case of failed authentication. Unfortunately, NSURLConnection doesn't give us the real response.
589
590         * xml/XMLHttpRequest.cpp:
591         (WebCore::XMLHttpRequest::send): If the response has an HTTP code in it, then the error wasn't
592         a network one, and an exception shouldn't be raised.
593
594 2007-07-30  Anders Carlsson  <andersca@apple.com>
595
596         Reviewed by Darin.
597
598         <rdar://problem/4942372> REGRESSION: Anchor links in Mail don't work anymore
599         
600         Make it possible for KURL to handle addig fragments to non-hierarchical URLs
601         such as mailto: and cid:.
602     
603         * platform/KURL.cpp:
604         (WebCore::KURL::init):
605         If the base URL is not hierarchical but the relative URL is a fragment, then 
606         allow parsing it.
607         
608         (WebCore::KURL::parse):
609         If the URL is not hierarchical, set the fragment start and end positions correctly.
610
611 2007-07-30  Simon Hausmann  <hausmann@kde.org>
612
613         Reviewed by Lars.
614
615         On Windows make sure the dll also ends up in $$OUTPUT_DIR/bin, so that QtLauncher can find it.
616
617         * WebCore.pro:
618
619 2007-07-30  Simon Hausmann  <hausmann@kde.org>
620
621         Reviewed by Lars.
622
623         Removed the __BUILDING_QT ifdef in JSStringRef.h and changed UChar for the Qt build to use wchar_t on Windows.
624
625         * platform/TextEncoding.cpp:
626         (WebCore::TextEncoding::encode):
627
628 2007-07-30  Simon Hausmann  <hausmann@kde.org>
629
630         Reviewed by Lars.
631
632         Don't link against libxml/libxslt unless we really need it.
633
634         * WebCore.pro:
635
636 2007-07-29  Tristan O'Tierney  <tristan@apple.com>
637
638         Reviewed by Oliver Hunt.
639
640         <rdar://problem/5369282> REGRESSION: DOMHTMLInput throwing exception due to missing _isEdited method
641
642         * bindings/objc/DOMHTML.mm:
643         (-[DOMHTMLInputElement _isEdited]):
644         (-[DOMHTMLTextAreaElement _isEdited]):
645         * bindings/objc/DOMPrivate.h:
646         Renamed _isUserEdited to _isEdited.
647
648 2007-07-29  Adam Treat  <treat@kde.org>
649
650         Reviewed by George Staikos.
651
652         Correctly set the update rect for the scrollbars when they are invalidated.
653         Do not paint entire page for each scroll delta.  Cache the dirty regions
654         when webkit calls ScrollView::updateContents as webkit expects the paint
655         routine to use the dirty regions bounding rect.
656
657         These changes greatly reduce the cpu load as we are no longer painting the
658         entire page for each 1px scroll :P
659
660         * platform/qt/ScrollViewQt.cpp:
661         (WebCore::ScrollView::ScrollViewPrivate::scrollBackingStore):
662         (WebCore::ScrollView::updateContents):
663         (WebCore::ScrollView::paint):
664         * platform/qt/WidgetQt.cpp:
665         (WebCore::Widget::invalidateRect):
666
667 2007-07-29  Adele Peterson  <adele@apple.com>
668
669         Reviewed by John.
670
671         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)
672
673         * WebCore.exp:
674         * page/FocusController.cpp:
675         (WebCore::FocusController::setInitialFocus): Added.
676         (WebCore::FocusController::advanceFocus): Don't give the focus back to the chrome if this is the initial focus.
677         * page/FocusController.h:
678
679 2007-07-29  Adam Treat  <treat@kde.org>
680
681         Reviewed by Alexey Proskuryakov.
682
683         WebCore::Widget::setParent should be virtual.
684         It is reimplemented in ScrollViewQt for instance.
685
686         * platform/Widget.h:
687
688 2007-07-29  Alp Toker  <alp.toker@collabora.co.uk>
689
690         Reviewed by bdash.
691
692         http://bugs.webkit.org/show_bug.cgi?id=14711 (revisited)
693         RenderThemeGdk's buttons are state-agnostic (pressed, hovered)
694
695         Generalize shadow state into a function.
696         use a GtkHBox to work around a theme bug (thanks to Nigel Tao).
697
698         * platform/gdk/RenderThemeGdk.cpp:
699         (WebCore::RenderThemeGdk::determineShadow):
700         (WebCore::RenderThemeGdk::paintCheckbox):
701         (WebCore::RenderThemeGdk::paintRadio):
702         (WebCore::RenderThemeGdk::paintButton):
703         (WebCore::RenderThemeGdk::gtkWindowContainer):
704         * platform/gdk/RenderThemeGdk.h:
705
706 2007-07-27  Adele Peterson  <adele@apple.com>
707
708         Reviewed by Darin. 
709
710         Temporary fix for Windows to prevent crashing on all frame pages.  Darin
711         is working on a more permanent fix.
712
713         * loader/FrameLoader.cpp:
714
715 2007-07-27  Adam Treat  <treat@kde.org>
716
717         Reviewed by David Hyatt.
718
719         Fix crash when using QtWebKit canvas support.
720
721         * ChangeLog:
722         * html/HTMLCanvasElement.cpp:
723         (WebCore::HTMLCanvasElement::reset):
724
725 2007-07-27  Darin Adler  <darin@apple.com>
726
727         * rendering/RenderLayer.cpp: Rolled out accidentally-checked-in code.
728
729 2007-07-27  Darin Adler  <darin@apple.com>
730
731         Reviewed by John Sullivan.
732
733         - fix <rdar://problem/5261393> In Mail the plain text alternatives to messages with attachments show weird little OBJ thingies
734
735         The "weird little thingies" are U+FFFC characters. It's good to render them as zero-width, the way we do
736         with control characters -- helps Mail and doesn't hurt web browsing.
737
738         Test: fast/text/zero-width-characters.html
739
740         * platform/CharacterNames.h: Add names for leftToRightMark, rightToLeftMark, and objectReplacementCharacter.
741         * platform/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::initializePage): Give objectReplacementCharacter
742         zero width in the same way we do it for the various other characters.
743
744 2007-07-27  Lars Knoll <lars@trolltech.com>
745
746         Reviewed by Zack
747
748         Enable XSLT support for the gtk port.
749
750         * WebCore.pro:
751
752 2007-07-27  Zack Rusin  <zack@kde.org>
753
754         Reviewed by Zack and Lars.
755
756         Premature end after finishing parsing is a fatal error.
757
758         * dom/XMLTokenizer.cpp:
759         (WebCore::XMLTokenizer::end):
760
761 2007-07-27  Lars Knoll  <lars@trolltech.com>
762
763         Reviewed by Zack and Lars.
764
765         Simplify conversions that go from a QStringRef to a WebCore::String to not use a temporary QString.
766
767         * dom/XMLTokenizer.cpp:
768         (WebCore::):
769
770 2007-07-27  Zack Rusin  <zack@kde.org>
771
772         Reviewed by Zack and Lars.
773
774         Fix entity handling in the main document content (attributes still broken)
775
776         * dom/XMLTokenizer.cpp:
777         (WebCore::):
778
779 2007-07-27  Lars Knoll  <lars@trolltech.com>
780
781         Reviewed by Zack and Lars.
782
783         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.
784
785         * dom/XMLTokenizer.cpp:
786         (WebCore::):
787         * platform/PlatformString.h:
788         * platform/qt/StringQt.cpp:
789         (WebCore::String::String):
790
791 2007-07-27  Zack Rusin  <zack@kde.org>
792
793         Reviewed by Zack and Lars.
794
795         Parse version and encoding of the xml document.
796
797         * dom/XMLTokenizer.cpp:
798         (WebCore::XMLTokenizer::write):
799
800 2007-07-27  Zack Rusin  <zack@kde.org>
801
802         Reviewed by Zack and Lars.
803
804         Correctly or semi-correctly parse the public and system id.
805
806         Patch from Lars.
807
808         * dom/XMLTokenizer.cpp:
809         (WebCore::):
810
811 2007-07-27  Zack Rusin  <zack@kde.org>
812
813         Reviewed by Zack and Lars.
814
815         Fix uri parsing for attributes.
816
817         * dom/XMLTokenizer.cpp:
818         (WebCore::):
819
820 2007-07-27  Zack Rusin  <zack@kde.org>
821
822         Reviewed by Zack and Lars.
823
824         Fixing qualified name parsing - from Lars.
825
826         * dom/XMLTokenizer.cpp:
827         (WebCore::XMLTokenizer::insertErrorMessageBlock):
828         (WebCore::):
829
830 2007-07-27  Zack Rusin  <zack@kde.org>
831
832         Reviewed by Zack and Lars.
833
834         Parse dtd's
835
836         * dom/XMLTokenizer.cpp:
837         (WebCore::XMLTokenizer::resumeParsing):
838         (WebCore::):
839         * dom/XMLTokenizer.h:
840
841 2007-07-27  Zack Rusin  <zack@kde.org>
842
843         Reviewed by Zack and Lars.
844
845         Implement error handling.
846
847         Add our copyrights
848
849         * dom/XMLTokenizer.cpp:
850         (WebCore::XMLTokenizer::handleError):
851         (WebCore::XMLTokenizer::end):
852         (WebCore::):
853         * dom/XMLTokenizer.h:
854
855 2007-07-27  Zack Rusin  <zack@kde.org>
856
857         Reviewed by Zack and Lars.
858
859         Making the stylesheets work (plus everything else basically)
860
861         * dom/XMLTokenizer.cpp:
862         (WebCore::XMLTokenizer::write):
863         (WebCore::XMLTokenizer::insertErrorMessageBlock):
864         (WebCore::):
865         * dom/XMLTokenizer.h:
866
867 2007-07-27  Zack Rusin  <zack@kde.org>
868
869         Reviewed by Zack and Lars.
870
871         Remove the libxml dependency when not compiling with XSLT.
872
873         Just ifdefing, displaying xml doesn't work.
874
875         * WebCore.pro:
876         * dom/XMLTokenizer.cpp:
877         (WebCore::XMLTokenizer::XMLTokenizer):
878         (WebCore::XMLTokenizer::write):
879         (WebCore::XMLTokenizer::startElementNs):
880         (WebCore::XMLTokenizer::enterText):
881         (WebCore::XMLTokenizer::exitText):
882         (WebCore::XMLTokenizer::initializeParserContext):
883         (WebCore::XMLTokenizer::end):
884         (WebCore::XMLTokenizer::lineNumber):
885         (WebCore::XMLTokenizer::columnNumber):
886         (WebCore::XMLTokenizer::stopParsing):
887         (WebCore::XMLTokenizer::resumeParsing):
888         (WebCore::):
889         * dom/XMLTokenizer.h:
890
891 2007-07-27  Simon Hausmann  <hausmann@kde.org>
892
893         Reviewed by Zack.
894
895         Work around bug in the moc when used as preprocessor for generating the bindings. -DFOO=1 is needed instead of -DFOO
896         to make the <hash>if FOO conditional match.
897
898         * WebCore.pro:
899
900 2007-07-27  Patrick Hanna  <phanna@email.unc.edu>
901
902         Reviewed by Darin Adler.
903
904         Change PluginBase::refresh to be static and update PluginsFunc::callAsFunction accordingly. Now we no longer
905         allocate an instance of a JSObject subclass on the stack which could lead to a crash during garbage collection.
906
907         * bindings/js/kjs_navigator.cpp:
908         (KJS::PluginsFunc::callAsFunction):
909
910 2007-07-27  Simon Hausmann  <hausmann@kde.org>
911
912         Done with and reviewed by Lars and Zack.
913
914         Fix snprintf hack for the Qt/Windows build with mingw-gcc. MingW has snprintf, so we don't need this helper function.
915
916         * page/FrameTree.cpp:
917         * platform/DeprecatedString.cpp:
918         (WebCore::DeprecatedString::format):
919         * platform/String.cpp:
920         (WebCore::String::format):
921
922 2007-07-27  Simon Hausmann  <hausmann@kde.org>
923
924         Done with and reviewed by Lars and Zack.
925
926         Make the DocTypeStrings.cpp generation work with MingW. Cleaned it up to be a regular extra compiler at the same time.
927
928         * WebCore.pro:
929
930 2007-07-27  Simon Hausmann  <hausmann@kde.org>
931
932         Done with and reviewed by Lars and Zack.
933
934         MingW build fixes: Do the "OBJECTS_TRAILING_SLASH" trick not only for win32-msvc but for all win32 mkspecs. Added LIB/INCLUDE hack from Qt to make us pick up 3rdparty libraries such as libxml from these environment variables.
935
936         * WebCore.pro:
937
938 2007-07-27  Simon Hausmann  <hausmann@kde.org>
939
940         Done with and reviewed by Lars and Zack.
941
942         Use $(MOVE) instead of mv to eliminated the shell dependency and replaced the long shell line to call bison and modify the css grammar file with a few lines of portable perl code.
943
944         * WebCore.pro:
945         * css/makegrammar.pl: Added.
946
947 2007-07-27  Simon Hausmann  <hausmann@kde.org>
948
949         Done with and reviewed by Lars and Zack.
950
951         On make install on Windows copy the dll into the bin dir.
952
953         * WebCore.pro:
954
955 2007-07-27  Simon Hausmann  <hausmann@kde.org>
956
957         Done with and reviewed by Lars and Zack.
958
959         Link in libxml and libxslt on Windows.
960
961         * WebCore.pro:
962
963 2007-07-27  Simon Hausmann  <hausmann@kde.org>
964
965         Done with and reviewed by Lars and Zack.
966
967         Temporarily disable the ICO support for the Qt build on Windows.
968
969         * WebCore.pro:
970         * platform/graphics/qt/ImageDecoderQt.cpp:
971
972 2007-07-27  Simon Hausmann  <hausmann@kde.org>
973
974         Done with and reviewed by Lars and Zack.
975
976         Fix evaluation with ActiveState Perl 5.6. Somehow it tried to treat nameEntries as array.
977
978         * bindings/scripts/CodeGeneratorJS.pm:
979
980 2007-07-27  Simon Hausmann  <hausmann@kde.org>
981
982         Done with and reviewed by Lars and Zack.
983
984         Fix compilation with MSVC in the Qt build (missing header files).
985
986         * loader/icon/IconDatabaseNone.cpp:
987         * platform/graphics/svg/SVGImage.cpp:
988
989 2007-07-27  Simon Hausmann  <hausmann@kde.org>
990
991         Done with and reviewed by Lars and Zack.
992
993         Disable the favicon database on Windows for now, to eliminate the sqlite dependency.
994
995         * WebCore.pro:
996
997 2007-07-27  Simon Hausmann  <hausmann@kde.org>
998
999         Done with and reviewed by Lars and Zack.
1000
1001         Added custom preprocessor support to make_names.pl and use the moc for it in the Qt build.
1002
1003         * WebCore.pro:
1004         * ksvg2/scripts/make_names.pl:
1005
1006 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1007
1008         Done with and reviewed by Lars and Zack.
1009
1010         Disable the batch mode for nmake to work around the clash of Node.c and Node.cpp both mapping to Node.obj
1011
1012         * WebCore.pro:
1013
1014 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1015
1016         Done with and reviewed by Lars and Zack.
1017
1018         Fix compilation under Windows (removed sys/time.h dependency, use Qt instead).
1019
1020         * platform/qt/SystemTimeQt.cpp:
1021
1022 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1023
1024         Done with and reviewed by Lars and Zack.
1025
1026         Fix compilation on Windows.
1027
1028         * platform/graphics/qt/PathQt.cpp:
1029
1030 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1031
1032         Done with and reviewed by Lars and Zack.
1033
1034         Fix generation of ColorData.c on Windows.
1035
1036         * WebCore.pro:
1037
1038 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1039
1040         Done with and reviewed by Lars and Zack.
1041
1042         Fix compilation under Qt/Windows.
1043
1044         * loader/icon/IconDatabase.cpp:
1045         (WebCore::IconDatabase::open):
1046
1047 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1048
1049         Done with and reviewed by Lars and Zack.
1050
1051         Changed extendedAttributes to be a variable instead of a hash directly. Required to work with ActiveState perl.
1052
1053         * bindings/scripts/IDLStructure.pm:
1054
1055 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1056
1057         Done with and reviewed by Lars and Zack.
1058
1059         Fix header guard generation for CSSGrammar.h under Windows
1060
1061         * WebCore.pro:
1062
1063 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1064
1065         Done with and reviewed by Lars and Zack.
1066
1067         Fix build with moc as preprocessor. Don't rely the preprocessor preserving whitespace at the beginning of lines.
1068
1069         * bindings/scripts/IDLParser.pm:
1070
1071 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1072
1073         Done with and reviewed by Lars and Zack.
1074
1075         Make make-css-file-arrays.pl work on Windows by not calling /usr/bin/gcc as preprocessor for the Qt build.
1076
1077         * WebCore.pro:
1078         * css/make-css-file-arrays.pl:
1079
1080 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1081
1082         Done with and reviewed by Lars and Zack.
1083
1084         More gperf commandline fixes for Windows.
1085
1086         * WebCore.pro:
1087
1088 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1089
1090         Done with and reviewed by Lars and Zack.
1091
1092         More quoting fixes for perl under Windows.
1093
1094         * WebCore.pro:
1095
1096 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1097
1098         Done with and reviewed by Lars and Zack.
1099
1100         Fix command quoting under Windows
1101
1102         * WebCore.pro:
1103
1104 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1105
1106         Done with and reviewed by Lars and Zack.
1107
1108         Fix cssmakeprops and cssmakevalue scripts to work on Windows without cygwin perl. Avoid inplace substitutions and direct invocation of /bin/sh. Also call gperf with arguments that GnuWin32's gperf understands.
1109
1110         * ksvg2/scripts/cssmakeprops:
1111         * ksvg2/scripts/cssmakevalues:
1112
1113 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1114
1115         Done with and reviewed by Lars and Zack.
1116
1117         Beautiful hacks to make more of the extra compiler magic work under Windows outside of cygwin.
1118
1119         * WebCore.pro:
1120
1121 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1122
1123         Done with and reviewed by Lars and Zack.
1124
1125         Correctly propagate the custom preprocessor option through the idl parser and the codegenerator.
1126
1127         * bindings/scripts/CodeGenerator.pm:
1128         * bindings/scripts/generate-bindings.pl:
1129
1130 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1131
1132         Done with and reviewed by Lars and Zack.
1133
1134         When constructing the absolute path when searching for IDL files in the list of search paths don't prepend a slash if $SOURCEROOT as environment variable is not set. In the Qt build we pass absolute search paths already and we don't set SOURCEROOT. Under Unix that gives a double slash for the directory which works fine, under Windows we get /c:\webkit\foo which of course does not work.
1135
1136         * bindings/scripts/CodeGenerator.pm:
1137
1138 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1139
1140         Done with and reviewed by Lars and Zack.
1141
1142         Relax the regular expression that tries to find constant declarations in the IDL source to not require leading whitespace. This makes it work with preprocessors that happen to eliminate leading whitespace.
1143
1144         * bindings/scripts/IDLParser.pm:
1145
1146 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1147
1148         Done with and reviewed by Lars and Zack.
1149
1150         Try to use the moc as preprocessor for the IDL bindings generator
1151
1152         * WebCore.pro:
1153
1154 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1155
1156         Done with and reviewed by Lars and Zack.
1157
1158         Make it possible to specify the preprocessor the bindings generator uses instead of hardcoding /usr/bin/gcc (which is of course no option on Windows). Also try to use a more portable and Windows friendly way of opening the reading pipe to the preprocessor.
1159
1160         * bindings/scripts/IDLParser.pm:
1161         * bindings/scripts/generate-bindings.pl:
1162
1163 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1164
1165         Done with and reviewed by Lars and Zack.
1166
1167         Don't use stdout redirection for make_names.pl as it doesn't work under Windows perl (outside cygwin).
1168
1169         * ksvg2/scripts/make_names.pl:
1170
1171 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1172
1173         Done with and reviewed by Lars and Zack.
1174
1175         Fix DocTypeStrings.cpp generation to work on Windows with cmd.exe
1176
1177         * WebCore.pro:
1178
1179 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1180
1181         Reviewed by Lars.
1182
1183         Work around aliasing bugs in WebCore by compiling with -fno-strict-aliasing for gcc builds for now.
1184
1185         * WebCore.pro:
1186
1187 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1188
1189         Reviewed by Lars.
1190
1191         Use -Wreturn-type only when compiling with g++
1192
1193         * WebCore.pro:
1194
1195 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1196
1197         Reviewed by Zack.
1198
1199         Don't use pkg-config on Windows for the Qt build
1200
1201         * WebCore.pro:
1202
1203 2007-07-27  Simon Hausmann  <hausmann@kde.org>
1204
1205         Reviewed by Zack.
1206
1207         Fix compilation with MSVC.
1208
1209         * platform/graphics/qt/ImageDecoderQt.cpp:
1210
1211 2007-07-26  Tristan O'Tierney  <tristan@apple.com>
1212
1213         Reviewed by Anders Carlsson.
1214
1215         <rdar://problem/5350019> REGRESSION: Pages on milliyet.com are added to Back list when visited, causing Back button to just reload
1216
1217         * loader/FrameLoader.cpp:
1218         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
1219         If the policy action is FrameLoadTypeRedirectLockHistory, don't add the frame load url to the history.
1220
1221 2007-07-26  Anders Carlsson  <andersca@apple.com>
1222
1223         Reviewed by Geoff.
1224
1225         Add a FIXME about caching pages with plug-ins that have outstanding NPObjects.
1226         
1227         * loader/FrameLoader.cpp:
1228         (WebCore::FrameLoader::canCachePage):
1229
1230 2007-07-26  David Hyatt  <hyatt@apple.com>
1231
1232         FIx for <rdar://problem/5289721> CrashTracer: [REGRESSION] 2658 crashes in Safari at com.apple.WebCore: WebCore::RenderInline::height const + 16
1233
1234         Adding a null check for now and an assert.  We don't know how/why this
1235         bug happens, but hopefully the assert will help people to reproduce.
1236
1237         Reviewed by kevin
1238
1239         * rendering/RenderInline.cpp:
1240         (WebCore::RenderInline::height):
1241
1242 2007-07-26  Anders Carlsson  <andersca@apple.com>
1243
1244         Reviewed by Oliver.
1245
1246         <rdar://problem/5362783>
1247         In Mail, a crash occurs at WTF::fastMalloc() when attempting to create a new HTML message from http://nytimes.com/
1248         
1249         If the cache is disabled and there is already a resource with the given URL, return it instead of creating a new one.
1250         
1251         * loader/DocLoader.cpp:
1252         (WebCore::DocLoader::requestResource):
1253
1254 2007-07-26  Adele Peterson  <adele@apple.com>
1255
1256         Reviewed by Geoff. 
1257
1258         Build fix.
1259
1260         * platform/network/cf/ResourceRequest.h:
1261
1262 2007-07-26  Anders Carlsson  <andersca@apple.com>
1263
1264         Reviewed by John Sullivan.
1265
1266         <rdar://problem/5349389> 
1267         Some frame load delegate methods not called when loading a page from the BF cache
1268         
1269         These calls were moved to FrameLoader::begin, which is never called for pages loaded
1270         from the BF cache. This happened in revision 24490.
1271          
1272         * loader/FrameLoader.cpp:
1273         (WebCore::FrameLoader::transitionToCommitted):
1274         Call delegate methods if the load is from the BF cache.
1275
1276 2007-07-26  Kevin McCullough  <kmccullough@apple.com>
1277
1278         Reviewed by Darin, Geoff and Sam.
1279
1280         - <rdar://problem/5150461> Resizing the window larger than the screen causes no resize.
1281         - We now better match the behavior of other browsers.
1282
1283         * bindings/js/kjs_window.cpp:
1284         (KJS::constrainToVisible):
1285         (KJS::WindowFunc::callAsFunction):
1286
1287 2007-07-26  Tristan O'Tierney  <tristan@apple.com>
1288
1289         Reviewed by Adele Peterson.
1290         
1291         <rdar://problem/5359921> WebCore should maintain a dirty flag for confirmation on unsaved changes
1292
1293         * bindings/objc/DOMHTML.mm:
1294         (-[DOMHTMLInputElement _isUserEdited]):
1295         (-[DOMHTMLTextAreaElement _isUserEdited]):
1296         Renamed _isEdited to _isUserEdited since the functionality is now different
1297         
1298         * bindings/objc/DOMPrivate.h:
1299         Renamed _isEdited to _isUserEdited.
1300         
1301         * rendering/RenderTextControl.cpp:
1302         (WebCore::RenderTextControl::RenderTextControl):
1303         Defaulted m_userEdited to false
1304         
1305         (WebCore::RenderTextControl::updateFromElement):
1306         Set m_userEdited to false, since the change wasn't triggered first by an edit
1307         
1308         (WebCore::RenderTextControl::subtreeHasChanged):
1309         Set m_userEdited to true, since it has been touched by the user
1310         
1311         * rendering/RenderTextControl.h:
1312         (WebCore::RenderTextControl::isUserEdited):
1313         (WebCore::RenderTextControl::setUserEdited):
1314         Added two new methods to set/return the userEdited boolean value.
1315         
1316 2007-07-26  Geoffrey Garen  <ggaren@apple.com>
1317
1318         Reviewed by Beth Dakin.
1319
1320         Fixed NULL-dereference crash seen on buildbot.
1321         
1322         No bug filed because this is a part of <rdar://problem/5241167>.
1323
1324         * history/PageCache.h:
1325         (WebCore::PageCache::get): NULL-check HistoryItems passed to get()
1326         and remove(), to match the old semantics of HashMap. For clarity,
1327         ASSERT that add() is not called with NULL arguments.
1328
1329 2007-07-26  Anders Carlsson  <andersca@apple.com>
1330
1331         Reviewed by Oliver Hunt.
1332
1333         <rdar://problem/5361106> Crash in user style sheet when loading webpage
1334
1335         Null check m_frame.
1336         
1337         * dom/Document.cpp:
1338         (WebCore::Document::stylesheetLoaded):
1339
1340 2007-07-26  Geoffrey Garen  <ggaren@apple.com>
1341
1342         Used `svn merge -r24646:24645' to revert project changes I accidentally
1343         checked in.
1344
1345         * WebCore.xcodeproj/project.pbxproj:
1346
1347 2007-07-26  Geoffrey Garen  <ggaren@apple.com>
1348
1349         Reviewed by Darin Adler.
1350
1351         Fixed <rdar://problem/5241167> REGRESSION: PLT 1% slower due to r21793 
1352         (global page cache cap)
1353         
1354         I just measured a .1%-.2% regression in PLT average, but a .4% win in 
1355         PLT fastest run, so I think this regression is licked.
1356
1357         Surprisingly, the combination of wtf data structures I originally used 
1358         for PageCache turned out to be too slow, so I reworked PageCache to use
1359         a hand-crafted linked list for LRU tracking (instead of ListHashSet), 
1360         to store its CachedPages in the HistoryItems to which they corresponded 
1361         (instead of using a HashMap), and to ref/deref HistoryItems manually
1362         (instead of using RefPtr, which would ref once for every reference in 
1363         the linked list).
1364
1365         * history/HistoryItem.h: Added data members for PageCache data. Made
1366         PageCache a friend so it could access them. Ideally (from an 
1367         encapsulation perspective), we would store this data an independent 
1368         structure, but that's just too slow.
1369
1370         * history/PageCache.cpp: Added a hand-crafted linked list for LRU 
1371         tracking.
1372         (WebCore::PageCache::PageCache):
1373         (WebCore::PageCache::add): Adopt the HistoryItem's ref when it's added.
1374         (WebCore::PageCache::remove): deref() the Historyitem when it's 
1375         removed.
1376         (WebCore::PageCache::prune):
1377         (WebCore::PageCache::addToLRUList):
1378         (WebCore::PageCache::removeFromLRUList):
1379
1380         * history/PageCache.h:
1381         (WebCore::PageCache::get): Inlined just in case.
1382
1383 2007-07-26  Adam Treat  <treat@kde.org>
1384
1385         Reviewed by George Staikos.
1386
1387         Launch the context menu in the right place.
1388
1389         * platform/qt/ContextMenuQt.cpp:
1390         (WebCore::ContextMenu::setPlatformDescription):
1391
1392 2007-07-25  Maciej Stachowiak  <mjs@apple.com>
1393
1394         Reviewed by Mark.
1395
1396         - follow-up to previous change to avoid assertion failures in debug
1397         
1398         * xml/XMLHttpRequest.cpp:
1399         (WebCore::XMLHttpRequest::getResponseText): hold JSLock when needed
1400         (WebCore::XMLHttpRequest::open): ditto
1401         (WebCore::XMLHttpRequest::didFinishLoading): ditto
1402         (WebCore::XMLHttpRequest::didReceiveData): ditto
1403         * xml/XMLHttpRequest.h:
1404
1405 2007-07-25  Anders Carlsson  <andersca@apple.com>
1406
1407         Reviewed by Darin.
1408
1409         <rdar://problem/5327912> 
1410         iDisk: Web iDisk & main iDisk appear blank
1411         
1412         Prepend any remaining text that scripts might have written.
1413         
1414         * html/HTMLTokenizer.cpp:
1415         (WebCore::HTMLTokenizer::scriptExecution):
1416
1417 2007-07-25  Kevin McCullough  <kmccullough@apple.com>
1418
1419         Reviewed by Tim, Darin, Oliver.
1420
1421         - <rdar://problem/5329440> REGRESSION: Clicking links with the feed:// protocol in Safari 3 does nothing
1422         - Check for file:// urls when clicking links, not block all schemes that are treated as local.
1423
1424         * loader/FrameLoader.cpp:
1425         (WebCore::FrameLoader::load):
1426
1427 2007-07-25  Maciej Stachowiak  <mjs@apple.com>
1428
1429         Reviewed by Darin.
1430
1431         - fixed <rdar://problem/5300291> Optimize GC to reclaim big, temporary objects (like XMLHttpRequest.responseXML) quickly
1432         
1433         With this plus related JavaScriptCore changes, a number of XMLHttpRequest situations that
1434         result in huge data sets are addressed, including a single huge responseXML on an XMR done
1435         repeatedly, or accessing responseText repeatedly during loading of a single large XHR.
1436         
1437         In addition to the GC changes in JavaScriptCore, I changed responseText to be stored as a
1438         KJS::UString instead of a WebCore::String so that the JavaScript responseText value can
1439         share the buffer (indeed multiple intermediate responseTexts can share its buffer).
1440
1441         
1442         First of all, here's some manual test cases that will each blow out the process VM without this fix,
1443         but will settle into decent steady state with.
1444         
1445         * manual-tests/memory: Added.
1446         * manual-tests/memory/MessageUidsAlreadyDownloaded2: Added.
1447         * manual-tests/memory/string-growth.html: Added.
1448         * manual-tests/memory/xhr-multiple-requests-responseText.html: Added.
1449         * manual-tests/memory/xhr-multiple-requests-responseXML.html: Added.
1450         * manual-tests/memory/xhr-multiple-requests.html: Added.
1451         * manual-tests/memory/xhr-repeated-string-access.xml: Added.
1452
1453         And here's the actual code changes:
1454         
1455         * WebCore.xcodeproj/project.pbxproj:
1456         * bindings/js/JSDocumentCustom.cpp:
1457         (WebCore::toJS): Record extra cost if the document is frameless (counting the nodes
1458         doesn't make a measurable performance difference here in any case I could find)
1459         * bindings/js/JSXMLHttpRequest.cpp:
1460         (KJS::JSXMLHttpRequest::getValueProperty): Adjust for the fact that ressponseText
1461         is now stored as a UString.
1462         * bindings/js/kjs_binding.cpp:
1463         (KJS::jsOwnedStringOrNull): New helper.
1464         * bindings/js/kjs_binding.h:
1465         * xml/XMLHttpRequest.cpp:
1466         (WebCore::XMLHttpRequest::getResponseText): It's a UString!
1467         (WebCore::XMLHttpRequest::getResponseXML): handle the fact that m_responseText
1468         is a UString.
1469         (WebCore::XMLHttpRequest::XMLHttpRequest): ditto.
1470         (WebCore::XMLHttpRequest::abort): call dropProtection
1471         (WebCore::XMLHttpRequest::didFinishLoading): call dropProtection
1472         (WebCore::XMLHttpRequest::dropProtection): after removing our GC protection,
1473         report extra cost of this XHR's responseText buffer.
1474         * xml/XMLHttpRequest.h:
1475
1476 2007-07-25  Timothy Hatcher  <timothy@apple.com>
1477
1478         Reviewed by Brady.
1479
1480         <rdar://problem/4796657> table deletion outline does not always follow the table size as editing occurs inside
1481
1482         Change the outline element to position itself automaticlly using the top, left, bottom and right CSS properties.
1483         This made the container element redundant, so it has been removed. Now the outline element and the delete button
1484         both get appended to the target element and positioned based on that container element. This removes the need
1485         to update the width and height when the target contents changed.
1486
1487         * editing/DeleteButtonController.cpp:
1488         (WebCore::DeleteButtonController::show): Change the style properties and remove the container element.
1489         (WebCore::DeleteButtonController::hide): Remove the button and outline from the target element.
1490         * editing/DeleteButtonController.h: Removed updateOutlineStyle, respondToChangedContents and m_containerElement.
1491         * editing/Editor.cpp:
1492         (WebCore::Editor::respondToChangedContents): Remove the call to DeleteButtonController respondToChangedContents.
1493
1494 2007-07-25  Anders Carlsson  <andersca@apple.com>
1495
1496         Reviewed by Darin.
1497
1498         <rdar://problem/5344471>
1499         CrashTracer: [USER] 1 crash in Mail at WebCore::PluginTokenizer::writeRawData(char const*, int)
1500         
1501         Make sure to layout so we'll have a renderer. Also null-check the renderer for extra safety.
1502         
1503         * loader/PluginDocument.cpp:
1504         (WebCore::PluginTokenizer::writeRawData):
1505
1506 2007-07-25  Marvin Decker  <marv.decker@gmail.com>
1507
1508         Reviewed by Maciej, Darin.
1509
1510         - http://bugs.webkit.org/show_bug.cgi?id=14030
1511
1512         Add ResourceHandle::setClient to resolve some messiness with handle
1513         releasing. Clear the client when ResourceLoader is going to release
1514         the handle to prevent crashes in the case where somebody still holds a
1515         reference (this doesn't seem to currently happen in practice). Add
1516         NULL-checking for ResourceHandle implementations using the client.
1517
1518         * loader/ResourceLoader.cpp:
1519         (WebCore::ResourceLoader::releaseResources):
1520         * platform/network/ResourceHandle.cpp:
1521         (WebCore::ResourceHandle::fireBlockedFailure):
1522         (WebCore::ResourceHandle::setClient):
1523         * platform/network/ResourceHandle.h:
1524         * platform/network/cf/ResourceHandleCFNet.cpp:
1525         (WebCore::willSendRequest):
1526         (WebCore::didReceiveResponse):
1527         (WebCore::didReceiveData):
1528         (WebCore::didFinishLoading):
1529         (WebCore::didFail):
1530         (WebCore::willCacheResponse):
1531         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1532         (WebCore::ResourceHandle::receivedCancellation):
1533         * platform/network/mac/ResourceHandleMac.mm:
1534         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1535         (WebCore::ResourceHandle::didCancelAuthenticationChallenge):
1536         (WebCore::ResourceHandle::receivedCancellation):
1537         (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]):
1538         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
1539         (-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]):
1540         (-[WebCoreResourceHandleAsDelegate connection:willStopBufferingData:]):
1541         (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
1542         (-[WebCoreResourceHandleAsDelegate connection:didFailWithError:]):
1543         (-[WebCoreResourceHandleAsDelegate connection:willCacheResponse:]):
1544
1545 2007-07-25  Maxime Britto  <mbritto@pleyo.com>
1546
1547         Reviewed by Darin.
1548
1549         - fix http://bugs.webkit.org/show_bug.cgi?id=11756
1550           <rdar://problem/5286420>
1551
1552         Fix a typo error to really compare the present domain to the domain of the parent of the targeted frame.
1553
1554         * loader/FrameLoader.cpp: (WebCore::FrameLoader::canTarget):
1555
1556 2007-07-25  Mitz Pettel  <mitz@webkit.org>
1557
1558         Reviewed by Darin.
1559
1560         - fix http://bugs.webkit.org/show_bug.cgi?id=14758
1561           REGRESSION: Repeated text after line break on facebook.com
1562
1563         Test: fast/text/reset-emptyRun.html
1564
1565         * platform/BidiResolver.h:
1566         (WebCore::::deleteRuns): Re-add a line that was removed for no reason at all
1567         during refactoring in r24485.
1568         * rendering/bidi.cpp:
1569         (WebCore::BidiState::deleteRuns): Ditto.
1570
1571 2007-07-24  Oliver Hunt  <oliver@apple.com>
1572
1573         Reviewed by Adam and Justin.
1574
1575         <rdar://problem/5141779> WebView editableDOMRangeForPoint: & moveDragCaretToPoint: returns last position in DOMText range
1576
1577         Remove bridge implementation for editableDOMRangeForPoint: and moveDragCaretToPoint:. 
1578         Now use cross-platform code Editor::rangeForPoint and DragController::placeDragCaret instead.
1579         This required lifting local code from DragController.cpp into the shared methods
1580         Frame::visiblePositionForPoint and Frame::documentAtPoint.
1581
1582         * WebCore.exp:
1583         * editing/Editor.cpp:
1584         (WebCore::Editor::rangeForPoint):
1585         * editing/Editor.h:
1586         * page/DragController.cpp:
1587         (WebCore::DragController::dragEnded):
1588         (WebCore::DragController::performDrag):
1589         (WebCore::DragController::dragEnteredOrUpdated):
1590         (WebCore::DragController::tryDocumentDrag):
1591         (WebCore::DragController::operationForLoad):
1592         (WebCore::setSelectionToDragCaret):
1593         (WebCore::DragController::concludeDrag):
1594         (WebCore::DragController::placeDragCaret):
1595         * page/DragController.h:
1596         * page/Frame.cpp:
1597         (WebCore::Frame::visiblePositionForPoint):
1598         (WebCore::Frame::documentAtPoint):
1599         * page/Frame.h:
1600         * page/mac/WebCoreFrameBridge.h:
1601         * page/mac/WebCoreFrameBridge.mm:
1602
1603 2007-07-24  Sam Weinig  <sam@webkit.org>
1604
1605         Rubber-stamped by Adam Roben.
1606
1607         Remove unused .strip files.
1608
1609         * WebCore.xcodeproj/project.pbxproj:
1610
1611 2007-07-24  Adele Peterson  <adele@apple.com>
1612
1613         Reviewed by Hyatt.
1614
1615         Fix for <rdar://problem/5308492> Computed width for elements with box-sizing: border-box is not equal to the width set in the CSS
1616
1617         Test: fast/css/getComputedStyle-border-box.html
1618
1619         * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1620           For the width and height properties, when you get the value from the renderer, use the renderer's box sizing value to determine the size.
1621
1622 2007-07-24  Anders Carlsson  <andersca@apple.com>
1623
1624         Reviewed by Kevin Decker.
1625
1626         <rdar://problem/5355781>
1627         REGRESSION: reproducible crash in CoreFoundation!CFRunLoopFinished on Flash pages
1628         
1629         Null check the loader.
1630         
1631         * plugins/win/PluginStreamWin.cpp:
1632         (WebCore::PluginStreamWin::start):
1633
1634 2007-07-24  Adele Peterson  <adele@apple.com>
1635
1636         Reviewed by Hyatt and Adam.
1637
1638         Fix for <rdar://problem/5130590> REGRESSION: style="width:1px" on <select> element no longer hides the element
1639
1640         Removed hack that forced large padding on popup buttons.  Now we put that padding in the inner block, so that
1641         the specified width will be honored.
1642
1643         * rendering/RenderMenuList.cpp:
1644         (WebCore::RenderMenuList::adjustInnerStyle): Set the padding on the inner block based on the metrics provided by the theme.
1645         (WebCore::RenderMenuList::controlClipRect): Clip to the intersection of the inner content box and the outer content box.
1646          This will leave room for the arrows which sit in the inner box padding, and if the inner box ever spills out of the outer box, 
1647          that will get clipped too.
1648         (WebCore::RenderMenuList::calcPrefWidths):  Add in the inner box's padding and border to the pref widths.
1649
1650         * rendering/RenderThemeMac.mm:
1651         (WebCore::RenderThemeMac::paintMenuList): Only inflate the rect for the shadow if the rect is big enough to fit the whole control.
1652          Also, on Leopard, the NSCell will draw outside of a small rect, so add a clip for that case.
1653         (WebCore::RenderThemeMac::paintMenuListButton): Restrict font scale to make sure the arrows will actually fit in the bounds vertically.
1654          Don't draw the arrows if they won't fit horizontally.  Reset padding.  Since WinIE doesn't honor padding for popups, its not critical to
1655          support padding at this time.
1656         (WebCore::RenderThemeMac::adjustMenuListStyle): Don't set the padding here.  Instead, we're going to set the padding on the inner block of the select.
1657         (WebCore::RenderThemeMac::adjustMenuListButtonStyle): ditto.
1658         (WebCore::RenderThemeMac::popupInternalPaddingLeft): Added.  Provides internal padding values for RenderMenuList.
1659         (WebCore::RenderThemeMac::popupInternalPaddingRight): ditto.
1660         (WebCore::RenderThemeMac::popupInternalPaddingTop): ditto.
1661         (WebCore::RenderThemeMac::popupInternalPaddingBottom): ditto.
1662         * rendering/RenderThemeMac.h:
1663
1664         * rendering/RenderThemeSafari.cpp:  The same changes that were made to RenderThemeMac were made here, with variations for the arrow differences.
1665           This code should be refactored and shared, but now did not seem like the right time to do that refactoring.
1666         (WebCore::RenderThemeSafari::paintMenuList):
1667         (WebCore::RenderThemeSafari::paintMenuListButton):
1668         (WebCore::RenderThemeSafari::adjustMenuListStyle):
1669         (WebCore::RenderThemeSafari::popupInternalPaddingLeft):
1670         (WebCore::RenderThemeSafari::popupInternalPaddingRight):
1671         (WebCore::RenderThemeSafari::popupInternalPaddingTop):
1672         (WebCore::RenderThemeSafari::popupInternalPaddingBottom):
1673         (WebCore::RenderThemeSafari::adjustMenuListButtonStyle):
1674         * rendering/RenderThemeSafari.h:
1675
1676         * rendering/RenderTheme.h: Added to provide internal padding values for RenderMenuList.
1677         (WebCore::RenderTheme::popupInternalPaddingLeft):
1678         (WebCore::RenderTheme::popupInternalPaddingRight):
1679         (WebCore::RenderTheme::popupInternalPaddingTop):
1680         (WebCore::RenderTheme::popupInternalPaddingBottom):
1681
1682 2007-07-24  Lars Knoll  <lars@trolltech.com>
1683
1684         Reviewed by Adam Roben & David Kilzer.
1685
1686         replace the makeprop and makevalues shell scripts by equivalent perl versions. This is required to remove the last shell dependency when building QtWebKit on Windows.
1687
1688         * DerivedSources.make:
1689         * WebCore.pro:
1690         * WebCore.xcodeproj/project.pbxproj:
1691         * css/makeprop: Added.
1692         * css/makeprop.pl: Removed.
1693         * css/makevalues: Added.
1694         * css/makevalues.pl: Removed.
1695
1696 2007-07-24  Beth Dakin  <bdakin@apple.com>
1697
1698         Reviewed by Darin.
1699
1700         Fix for http://bugs.webkit.org/show_bug.cgi?id=14714 REGRESSION: 
1701         ASSERTION FAILED: i < size() in Vector.h:401 on negative -webkit-
1702         column-width
1703         - and -
1704         http://bugs.webkit.org/show_bug.cgi?id=14718 REGRESSION: ASSERTION 
1705         FAILED: i < size() in Vector.h:401 on zero -webkit-column-count
1706
1707         * rendering/RenderBlock.cpp:
1708         (WebCore::RenderBlock::calcColumnWidth): Make 1 the minimum value 
1709         for column-width and column-count. Since the spec does not address 
1710         what to do with negative values for these properties, we are 
1711         patching the rendering code instead of the parser.
1712
1713 2007-07-24  Anders Carlsson  <andersca@apple.com>
1714
1715         Reviewed by Steve.
1716         
1717         <rdar://problem/5355403>
1718         REGRESSION: 303A2 does not display pdf files with AdobeReader 8.1
1719         
1720         Close the file before handing off the file name to the plug-in.
1721         
1722         * plugins/win/PluginStreamWin.cpp:
1723         (WebCore::PluginStreamWin::destroyStream):
1724
1725 2007-07-24  Alp Toker  <alp.toker@collabora.co.uk>
1726
1727         Reviewed by Adam.
1728
1729         http://bugs.webkit.org/show_bug.cgi?id=14711
1730         RenderThemeGdk's buttons are state-agnostic (pressed, hovered)
1731
1732         Remove unnecessary label from widget instances.
1733         Render check and radio widgets correctly.
1734         Determine the widget state and render it appropriately.
1735
1736         * platform/gdk/RenderThemeGdk.cpp:
1737         (WebCore::RenderThemeGdk::determineState):
1738         (WebCore::RenderThemeGdk::paintCheckbox):
1739         (WebCore::RenderThemeGdk::paintRadio):
1740         (WebCore::RenderThemeGdk::paintButton):
1741         (WebCore::RenderThemeGdk::gtkButton):
1742         (WebCore::RenderThemeGdk::gtkCheckbox):
1743         (WebCore::RenderThemeGdk::gtkRadioButton):
1744         * platform/gdk/RenderThemeGdk.h:
1745
1746 2007-07-24  Mark Rowe  <mrowe@apple.com>
1747
1748         Reviewed by Antti.
1749
1750         <rdar://problem/5356666> NSMenuItem's seen leaking on buildbot
1751
1752         * platform/mac/ContextMenuItemMac.mm:
1753         (WebCore::ContextMenuItem::releasePlatformDescription): Transfer ownership from the RetainPtr's CF-based retain
1754         count to the Foundation retain count so that callers of releasePlatformDescription can use -[NSObject release]
1755         to dispose of it in a manner that won't leak under Obj-C GC.
1756         * platform/mac/ContextMenuMac.mm:
1757         (WebCore::ContextMenu::appendItem): Release platformItem as we were transferred its ownership by releasePlatformDescription.
1758         (WebCore::ContextMenu::insertItem): ditto.
1759
1760 2007-07-24  Mitz Pettel  <mitz@webkit.org>
1761
1762         Reviewed by Darin.
1763
1764         - fix http://bugs.webkit.org/show_bug.cgi?id=14684
1765           Hebrew text in Safari chrome is reversed (LTR instead of RTL)
1766
1767         Test: fast/text/drawBidiText.html
1768
1769         * WebCore.pro:
1770         * WebCore.vcproj/WebCore.vcproj:
1771         * WebCore.xcodeproj/project.pbxproj:
1772         * WebCoreSources.bkl:
1773         * manual-tests/chrome-bidi-text.html: Added.
1774         * manual-tests/resources/chrome-bidi-text-window.html: Added.
1775         * platform/BidiReorderCharacters.cpp: Removed.
1776         * platform/BidiReorderCharacters.h: Removed.
1777         * platform/BidiResolver.h:
1778         (WebCore::BidiCharacterRun::start): Added accessor method.
1779         (WebCore::BidiCharacterRun::stop): Ditto.
1780         (WebCore::BidiCharacterRun::level): Ditto.
1781         (WebCore::BidiCharacterRun::next): Ditto.
1782         (WebCore::::appendRun): Added default implementation.
1783         * platform/TextStyle.h:
1784         (WebCore::TextStyle::setDirectionalOverride): Added accessor method.
1785         * platform/graphics/GraphicsContext.cpp:
1786         (WebCore::TextRunIterator::TextRunIterator): Added. A BidiResolver-
1787         compliant iterator over the characters in a TextRun.
1788         (WebCore::TextRunIterator::offset):
1789         (WebCore::TextRunIterator::increment):
1790         (WebCore::TextRunIterator::atEnd):
1791         (WebCore::TextRunIterator::current):
1792         (WebCore::TextRunIterator::direction):
1793         (WebCore::TextRunIterator::operator==):
1794         (WebCore::TextRunIterator::operator!=):
1795         (WebCore::GraphicsContext::drawBidiText): Added. Applies the Unicode
1796         Bidi Algorithm to the text and draws the resulting unidirectional runs
1797         in the right order and with the right directionality.
1798         * platform/graphics/GraphicsContext.h:
1799         * platform/win/PopupMenuWin.cpp:
1800         (WebCore::PopupMenu::paint): Replaced the use of a character buffer
1801         and BidiReorderCharacters with calling to drawBidiText(). Removed special
1802         handling of '-webkit-rtl-ordering:visual' because that CSS property is an
1803         implementation detail of WebCore's visual Hebrew support, and the UA stylesheet
1804         sets it to 'logical' for this form control. Authors can specify the ordering
1805         using the 'direction' and 'unicode-bidi' properties.
1806         * platform/win/WebCoreTextRenderer.cpp:
1807         (WebCore::isOneLeftToRightRun): Added. Checks if the text consists of
1808         a single left-to-right run, in which case it requires no bidi processing.
1809         (WebCore::doDrawTextAtPoint): Changed to call drawBidiText if the text
1810         is not entirely left-to-right.
1811         * rendering/RenderFileUploadControl.cpp:
1812         (WebCore::RenderFileUploadControl::paintObject): Replaced the use of a
1813         character buffer in BidiReorderCharacters with calling to drawBidiText().
1814         Removed special handling of '-webkit-rtl-ordering:visual' for the same reason
1815         stated above.
1816         * rendering/RenderListBox.cpp:
1817         (WebCore::RenderListBox::paintItemForeground): Ditto. Also changed the
1818         run-rounding modes used when drawing to match those used when measuring.
1819
1820 2007-07-23  Oliver Hunt  <oliver@apple.com>
1821
1822         Reviewed by Steve.
1823
1824         Windows build fix, remove superfluous !
1825
1826         * page/EventHandler.cpp:
1827         (WebCore::EventHandler::keyEvent):
1828
1829 2007-07-23  Adam Roben  <aroben@apple.com>
1830
1831         Add an assignment operator for BString that takes a BSTR
1832
1833         Reviewed by Geoff and Oliver.
1834
1835         * platform/win/BString.cpp:
1836         (WebCore::BString::operator=):
1837         * platform/win/BString.h:
1838
1839 2007-07-23  Justin Garcia  <justin.garcia@apple.com>
1840
1841         Reviewed by Geoff.
1842         
1843         <rdar://problem/5354455> Word selection when right-clicking can be confusing (14728)
1844
1845         * page/EventHandler.cpp:
1846         (WebCore::EventHandler::sendContextMenuEvent): In non-editable content,
1847         only do word selection over text.  In editable content, we will continue
1848         to select images, line breaks and other elements on right-clicks, to match 
1849         TextEdit.  For now, in editable content, we'll live with the cases where 
1850         positionForPoint creates selections that aren't underneath the mouse.  These
1851         aren't regressions because we've always done word selection on right clicks
1852         in editable content.
1853
1854 2007-07-23  Anders Carlsson  <andersca@apple.com>
1855
1856         Reviewed by Oliver.
1857
1858         <rdar://problem/5335354>
1859         REGRESSION(r21359-r21368): Can't edit inside RTEF editable region
1860         
1861         If Document::open is called and there's a pending load that has not yet started,
1862         that load should be cancelled.
1863         
1864         * dom/Document.cpp:
1865         (WebCore::Document::open):
1866
1867 2007-07-23  Timothy Hatcher  <timothy@apple.com>
1868
1869         Reviewed by Hyatt.
1870
1871         <rdar://problem/5242145> REGRESSION: Clicking on symbol in documentation often doesn't scroll to symbol
1872
1873         A renderer for the anchor wasn't always available at the time parsing finished. So we need
1874         to bail out of gotoAnchor if stylesheets are pending and remember to call gotoAnchor later
1875         once all of the pending stylesheets load.
1876
1877         * dom/Document.cpp:
1878         (WebCore::Document::Document): Initialize m_gotoAnchorNeededAfterStylesheetsLoad to false.
1879         (WebCore::Document::stylesheetLoaded): If we have no more pending stylesheets, call gotoAnchor if needed.
1880         * dom/Document.h:
1881         (WebCore::Document::gotoAnchorNeededAfterStylesheetsLoad): New method.
1882         (WebCore::Document::setGotoAnchorNeededAfterStylesheetsLoad): Ditto.
1883         * loader/FrameLoader.cpp:
1884         (WebCore::FrameLoader::gotoAnchor): Bail early if the document still has pending stylesheets.
1885         * loader/FrameLoader.h: Make gotoAnchor() public.
1886
1887 2007-07-23  John Sullivan  <sullivan@apple.com>
1888
1889         Reviewed by Darin
1890         
1891         - fixed <rdar://problem/5327887> Printing Mail note (or Safari page) with misspelled word prints red underline
1892
1893         * rendering/InlineTextBox.cpp:
1894         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
1895         When printing, bail out without doing any work. Also moved a couple of lines down below another early
1896         bailout since they were pointless above it.
1897
1898 2007-07-23  Oliver Hunt  <oliver@apple.com>
1899
1900         Reviewed by Darin.
1901         
1902         <rdar://problem/5353577> WebKit key event behaviour needs to better match other browsers keyevent behaviour
1903         <rdar://problem/5352152> REGRESSION (24399-24479): Pressing Enter in a search field at apple.com no longer starts a search with Korean IM
1904         <rdar://problem/5352649> WebKit should send keyDown event on autorepeat keyDowns
1905         http://bugs.webkit.org/show_bug.cgi?id=14690
1906
1907         Perform Input Method call first so that our behaviour is determined by whether or not 
1908         the input method has actually handle the event, rather than by making guesses based 
1909         on the existences of marked text.  This fixes issues with IMs that have side effects
1910         even on events they do not handle.
1911
1912         Refactored the code in order to improve clarity given the hoisting required by performing
1913         the IM call earlier.
1914
1915         * page/EventHandler.cpp:
1916         (WebCore::EventHandler::keyEvent):
1917
1918 2007-07-23  Anders Carlsson  <andersca@apple.com>
1919
1920         Reviewed by Darin.
1921
1922         <rdar://problem/5045711> 
1923         http://bugs.webkit.org/show_bug.cgi?id=12938
1924         Google calendar settings page crashes
1925         
1926         Move handling of checked radio buttons to a new class, HTMLFormElement::CheckedRadioButtons. 
1927         Each <form> element has an instance of this class. For radio buttons without a containing 
1928         form, the document has an instance of HTMLFormElement::CheckedRadioButtons where the
1929         state of those radio buttons will be stored.
1930         be stored.
1931         
1932         This also fixes another bug where removing a checked radio button that does not have a
1933         containing form would not remove the radio button from the checked radio buttons map,
1934         which could lead to a crash due to a dangling pointer.
1935         
1936         * dom/Document.cpp:
1937         (WebCore::Document::~Document):
1938         * dom/Document.h:
1939         (WebCore::Document::checkedRadioButtons):
1940         * html/HTMLFormElement.cpp:
1941         (WebCore::HTMLFormElement::registerFormElement):
1942         (WebCore::HTMLFormElement::removeFormElement):
1943         (WebCore::HTMLFormElement::CheckedRadioButtons::didCheckButton):
1944         (WebCore::HTMLFormElement::CheckedRadioButtons::checkedButtonForGroup):
1945         (WebCore::HTMLFormElement::CheckedRadioButtons::removeButtonIfChecked):
1946         * html/HTMLFormElement.h:
1947         (WebCore::HTMLFormElement::checkedRadioButtons):
1948         * html/HTMLGenericFormElement.cpp:
1949         (WebCore::HTMLGenericFormElement::insertedIntoTree):
1950         * html/HTMLInputElement.cpp:
1951         (WebCore::HTMLInputElement::~HTMLInputElement):
1952         (WebCore::checkedRadioButtons):
1953         (WebCore::HTMLInputElement::isKeyboardFocusable):
1954         (WebCore::HTMLInputElement::setInputType):
1955         (WebCore::HTMLInputElement::parseMappedAttribute):
1956         (WebCore::HTMLInputElement::setChecked):
1957         (WebCore::HTMLInputElement::preDispatchEventHandler):
1958         (WebCore::HTMLInputElement::willMoveToNewOwnerDocument):
1959         * manual-tests/remove-form-node-with-radio-buttons-crash.html: Added.
1960
1961 2007-07-23  David Hyatt  <hyatt@apple.com>
1962
1963         Fix for 5350587, hang in iExploder text 8101.  The code that painted outlines for continuations was buggy
1964         in that it assumed the chain was always inline-block-inline, but this is only true for the innermost chained
1965         continuation.  To make this more robust, we always just use the inline's containing block's containing block,
1966         which should be guaranteed to enclose all renderers in the continuation chain.  In addition, there is now a
1967         null check (to guarantee no more hangs) and an assert (to check if we hit this situation again where the block
1968         used to paint does not properly enclose the continuation chain).
1969
1970         Reviewed by beth
1971
1972         fast/inline/outline-continuation.html
1973
1974         * rendering/RenderBlock.cpp:
1975         (WebCore::RenderBlock::paintContinuationOutlines):
1976         * rendering/InlineFlowBox.cpp:
1977         (WebCore::RenderInline::paint):
1978
1979 2007-07-22  Holger Hans Peter Freyther  <zecke@selfish.org>
1980
1981         Reviewed by Adam.
1982
1983         WARNING: NO TEST CASES ADDED OR CHANGED
1984
1985         Add the WebKit/Gtk API to the buildsystem, ask qmake to create a
1986         pkg-config file and install headers and libraries.
1987
1988         Start to emit signals from FrameLoaderClientGdk, hide the kit Frame
1989         inside the the FrameLoaderClientGdk.
1990
1991         Move ChromeClientGdk to WebKit/gtk/WebCoreSupport
1992
1993         * WebCore.pro:
1994         * loader/gdk/FrameLoaderClientGdk.cpp:
1995         * loader/gdk/FrameLoaderClientGdk.h:
1996         * platform/gdk/ChromeClientGdk.h: Removed.
1997         * platform/gdk/FrameGdk.cpp: Remove code not belonging here
1998         * platform/gdk/FrameGdk.h:
1999         * platform/gdk/ScrollViewGdk.cpp: The gdkDrawable won't exist at that time and it is fine
2000         * platform/gdk/TemporaryLinkStubs.cpp: Removed ChromeClientGdk stubs
2001
2002 2007-07-22  Maciej Stachowiak  <mjs@apple.com>
2003
2004         Reviewed by Adam.
2005
2006         <rdar://problem/5353174> REGRESSION: 1% JavaScript performance regression fro Window refactoring (14717)
2007         http://bugs.webkit.org/show_bug.cgi?id=14717
2008         
2009         * bindings/js/kjs_window.cpp:
2010         * bindings/js/kjs_window.h:
2011         (KJS::Window::impl): inlined
2012         * page/DOMWindow.cpp:
2013         * page/DOMWindow.h:
2014         (WebCore::DOMWindow::frame): inlined
2015
2016 2007-07-22  Darin Adler  <darin@apple.com>
2017
2018         * platform/ContextMenu.cpp: Added missing include.
2019
2020 2007-07-22  Sam Weinig  <sam@webkit.org>
2021
2022         Reviewed by Darin.
2023
2024         Fix for http://bugs.webkit.org/show_bug.cgi?id=14682
2025         REGRESSION(24285-24399): alerts do not appear at W3C RTL test page
2026
2027         Test: fast/dom/Window/window-function-name-getter-precedence.html
2028
2029         * bindings/js/JSDOMWindowCustom.cpp:
2030         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Make sure to return functions
2031         before the custom name getter.
2032
2033 2007-07-22  Darin Adler  <darin@apple.com>
2034
2035         Reviewed by Adam.
2036
2037         - fix <rdar://problem/5353263> ContextMenuItem and ContextMenu objects leaking (seen on buildbot)
2038
2039         * platform/ContextMenu.cpp:
2040         (WebCore::separatorItem): Return an auto_ptr instead of a raw pointer, since this function
2041         creates an object that's the caller's responsibility to delete.
2042         (WebCore::createAndAppendFontSubMenu): Create the context menu on the stack, not the heap,
2043         since setSubMenu does not take ownership, and hence the objects were leaking.
2044         (WebCore::createAndAppendSpellingAndGrammarSubMenu): Ditto.
2045         (WebCore::createAndAppendSpellingSubMenu): Ditto.
2046         (WebCore::createAndAppendSpeechSubMenu): Ditto.
2047         (WebCore::createAndAppendWritingDirectionSubMenu): Ditto.
2048
2049 2007-07-22  Darin Adler  <darin@apple.com>
2050
2051         Reviewed by Kevin Decker.
2052
2053         - fix <rdar://problem/5126394> REGRESSION: Crash after clicking back button in test application (13250)
2054           http://bugs.webkit.org/show_bug.cgi?id=13250
2055
2056         * bindings/objc/WebScriptObject.mm:
2057         (_didExecute): Removed unnecessary check for isValid() since the _rootObject method already
2058         takes care of that check.
2059         (-[WebScriptObject _imp]): Made this return 0 if there is not a valid rootObject.
2060         (-[WebScriptObject _isSafeScript]): Made this always return false if there is not a valid
2061         rootObject, eliminating the need to check _rootObject for nil if the code is checking _isSafeScript.
2062         (-[WebScriptObject callWebScriptMethod:withArguments:]): Removed check of _rootObject, since it's
2063         immediately followed by a check of _isSafeScript. Removed awkward conversion of name from NSString *
2064         to KJS::Identifier and did it using WebCore::String instead -- makes it clear that there's no
2065         arbitrary JavaScript execution after _isSafeScript and before _imp, so we don't need to null-check
2066         the _imp pointer. Added a second check of _isSafeScript after calling get to get the function
2067         object, since arbitrary changes could occur in there, including navigation to a new frame.
2068         This also takes care of null checking the second call to _imp.
2069         (-[WebScriptObject evaluateWebScript:]): Removed check of _rootObject, since it's
2070         immediately followed by a check of _isSafeScript. Removed awkward conversion of script from NSString *
2071         to KJS::Identifier and did it using WebCore::String instead -- makes it clear that there's no
2072         arbitrary JavaScript execution after _isSafeScript and before _imp, so we don't need to null-check
2073         the _imp pointer.
2074         (-[WebScriptObject setValue:forKey:]): Removed check of _rootObject, since it's
2075         immediately followed by a check of _isSafeScript. Removed awkward conversion of key from NSString *
2076         to KJS::Identifier and did it using WebCore::String instead -- makes it clear that there's no
2077         arbitrary JavaScript execution after _isSafeScript and before _imp, so we don't need to null-check
2078         the _imp pointer.
2079         (-[WebScriptObject valueForKey:]): Ditto.
2080         (-[WebScriptObject removeWebScriptKey:]): Ditto.
2081         (-[WebScriptObject stringRepresentation]): Removed check of _rootObject, since it's
2082         immediately followed by a check of _isSafeScript. Removed unnecessary local variable
2083         and const_cast from the call to the _imp method.
2084         (-[WebScriptObject webScriptValueAtIndex:]): Removed check of _rootObject, since it's
2085         immediately followed by a check of _isSafeScript.
2086         (-[WebScriptObject setWebScriptValueAtIndex:value:]): Ditto.
2087         (-[WebScriptObject JSObject]): Ditto.
2088
2089 2007-07-22  Darin Adler  <darin@apple.com>
2090
2091         Reviewed by Anders Carlsson and John Sullivan.
2092
2093         - speculative fix for <rdar://problem/5337500> CrashTracer: [USER] 4 crashes in Mail
2094           at WebCore::HTMLImageElement::isURLAttribute(WebCore::Attribute*) const
2095
2096         * editing/markup.cpp: Added AttributeChange class.
2097         (WebCore::completeURLs): Changed function so that all the URL completion is done in
2098         a separate pass after finding all the URL attributes. This is safer, since actually
2099         applying an attribute change could have any arbitrary effect on the document; it's
2100         tricky to iterate a document while it's being modified and we don't have the checks
2101         here that would be needed to make that work in pathological cases.
2102
2103 2007-07-18  Darin Adler  <darin@apple.com>
2104
2105         Reviewed by Adam.
2106
2107         - fix <rdar://problem/5350604> REGRESSION: Crash in inspector controller code after
2108           clicking back button in test application (14337)
2109
2110         * page/InspectorController.cpp: (WebCore::InspectorController::addScriptResource):
2111         Replace an assertion that was firing with some code that at least doesn't immediately crash.
2112
2113 2007-07-22  Darin Adler  <darin@apple.com>
2114
2115         Reviewed by Anders.
2116
2117         - improve the fix for <rdar://problem/5298816> Crash redirecting message,
2118           in -[SharedBufferData initWithSharedBuffer:]; fixes a crash seen on the buildbot
2119
2120         * loader/DocLoader.cpp: (WebCore::DocLoader::~DocLoader): Call setDocLoader(0) on all
2121         the resources so they don't try to use a stale DocLoader pointer later.
2122
2123 2007-07-21  Mitz Pettel  <mitz@webkit.org>
2124
2125         Reviewed by Sam Weinig.
2126
2127         - fixed typos and markup in the following manual tests
2128
2129         * manual-tests/accidental-strict-mode.html:
2130         * manual-tests/caretScrolling.html:
2131         * manual-tests/close-on-closedWindow.html:
2132
2133 2007-07-21  Sam Weinig  <sam@webkit.org>
2134
2135         Reviewed by Mitz.
2136
2137         Patch for <rdar://problem/5352013>
2138         The computed style for background-position is wrong for the initial value
2139
2140         - Set the initial value for background-position-x and background-position-y (and
2141           therefore background-position) to 0% instead of 0px.
2142
2143         * rendering/RenderStyle.cpp:
2144         (WebCore::BackgroundLayer::BackgroundLayer):
2145         * rendering/RenderStyle.h:
2146         (WebCore::RenderStyle::initialBackgroundXPosition):
2147         (WebCore::RenderStyle::initialBackgroundYPosition):
2148
2149 2007-07-20  Brady Eidson  <beidson@apple.com>
2150
2151         Reviewed by Adele and Andersca
2152
2153         <rdar://problem/5336105> - WebBackForwardList created from scratch is unusable (always leads to crash)
2154
2155         * WebCore.exp: Export the BackForwardList c'tor so WebKit can create one explicitly
2156
2157 2007-07-20  Sam Weinig  <sam@webkit.org>
2158
2159         Reviewed by Beth Dakin.
2160
2161         Fix for <rdar://problem/5351901>
2162         Computed value of border-position should return a CSSValueList, not a CSSPrimitiveValue
2163
2164         - Return a space separated CSSValueList for background-position
2165           instead of a CSSPrimitiveValue (string type).
2166         - Remove the "else if (renderer)" case as it never returns a different
2167           value than just calling length.value().
2168         - Make background-position-x and background-position-y behave like
2169           background-position.  Fix case of initial value return 'auto' instead
2170           of 0.
2171
2172         Test: fast/css/getComputedStyle-background-position.html
2173
2174         * css/CSSComputedStyleDeclaration.cpp:
2175         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
2176
2177 2007-07-20  Geoffrey Garen  <ggaren@apple.com>
2178
2179         Build fix for non-Mac platforms.
2180         
2181         * bindings/js/GCController.cpp:
2182
2183 2007-07-20  Anders Carlsson  <andersca@apple.com>
2184
2185         Reviewed by Darin.
2186
2187         If the style sheet requested is a user style sheet, don't store it in the DocLoader's resource map;
2188         user style sheets can outlive their doc loaders.
2189
2190         * loader/DocLoader.cpp:
2191         (WebCore::DocLoader::requestCSSStyleSheet):
2192
2193 2007-07-20  Justin Garcia  <justin.garcia@apple.com>
2194
2195         Reviewed by Darin.
2196
2197         <rdar://problem/5109817> Ctrl-click on word in non-editable text doesn't select it
2198         
2199         * bridge/EditorClient.h: Removed a client method for enabling/disabling
2200         word selection on right clicks.
2201         * editing/Editor.cpp: Ditto.
2202         * editing/Editor.h:
2203         * page/EventHandler.cpp:
2204         (WebCore::EventHandler::sendContextMenuEvent): Select the
2205         word underneath the mouse regardless of whether its editable.
2206
2207 2007-07-20  Ada Chan  <adachan@apple.com>
2208
2209         Reviewed by Darin and Adam.
2210
2211         <rdar://problem/5338385> Fixed infinite loop in ScrollView::scrollRectIntoViewRecursively().
2212         Also removed an unused local variable.
2213
2214         * platform/win/ScrollViewWin.cpp:
2215         (WebCore::ScrollView::scrollRectIntoViewRecursively):
2216
2217 2007-07-21  Antti  <antti@apple.com>
2218
2219         Reviewed by Darin.
2220         
2221         Fix <rdar://problem/5305788>
2222         REGRESSION: Safari sometimes loads IE-specific stylesheet on www.apaema.org
2223         
2224         Pick the preferred style sheet set based on document order even if the sheet is still loading. Previously 
2225         the set was chosen based on which stylesheet happened to arrive first. Just fix the problem at hand 
2226         and resist urge to start refactoring this function.
2227
2228         * dom/Document.cpp:
2229         (WebCore::Document::recalcStyleSelector):
2230
2231 2007-07-20  Sam Weinig  <sam@webkit.org>
2232
2233         Reviewed by Darin.
2234
2235         Fix for <rdar://problem/5351252>
2236         Computed value for -webkit-background-size and border-spacing
2237         should be space separated CSSValueLists.
2238
2239         * css/CSSComputedStyleDeclaration.cpp:
2240         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
2241
2242 2007-07-20  Geoffrey Garen  <ggaren@apple.com>
2243
2244         Suggested by Darin Adler.
2245         
2246         Slight tweak to my last commit: changed gcController() to return a 
2247         reference instead of a pointer.
2248
2249 2007-07-20  Geoffrey Garen  <ggaren@apple.com>
2250
2251         Reviewed by Darin Adler.
2252         
2253         Fixed http://bugs.webkit.org/show_bug.cgi?id=12900 Page tear-down 
2254         forces garbage collection once per frame
2255
2256         Also fixed <rdar://problem/5286989> GC on window close does not always 
2257         bring the JS object count down to 0
2258         
2259         Implemented a 0-delay GC timer in WebCore. Instead of forcing GC
2260         immediately, code that thinks it has created a lot of garbage starts
2261         the timer. This has two advantages: 
2262
2263         1) Multiple GCs can coalesce. In my pathological test case, this 
2264         improves performance by an order of magnitude. 
2265         
2266         2) Conservative marking is less likely to keep alive important dead
2267         objects, like the window object, because the stack is small and free of
2268         JS processing when the timer fires.
2269
2270         Added GCController.h/.cpp, sometimes blindly:
2271         * WebCore.pro:
2272         * WebCore.vcproj/WebCore.vcproj:
2273         * WebCore.xcodeproj/project.pbxproj:
2274         * WebCoreSources.bkl:
2275
2276         Added singleton that implements GC on a 0-delay timer:
2277         * bindings/js/GCController.h: Added.
2278         * bindings/js/GCController.cpp: Added.
2279         
2280         Changed Collector::collect() calls below to call to the singleton:
2281         * bindings/js/kjs_proxy.cpp:
2282         (WebCore::KJSProxy::~KJSProxy):
2283         * bindings/js/kjs_window.cpp:
2284         (KJS::Window::clear):
2285         * history/CachedPage.cpp:
2286         (WebCore::CachedPage::clear):
2287         
2288         * page/Frame.cpp:
2289         (WebCore::Frame::~Frame): Removed previous slightly hackish attempt to
2290         avoid conservative marking of the window object.
2291
2292 2007-07-20  Anders Carlsson  <andersca@apple.com>
2293     
2294         Reviewed by Darin.
2295
2296         <rdar://problem/5298816> Crash redirecting message, in -[SharedBufferData initWithSharedBuffer:]
2297         
2298         Have cached resources keep track of what DocLoader they belong to. This is so that they can remove themselves
2299         from the DocLoader's resource map when they're destroyed when the cache is disabled.
2300         
2301         * html/HTMLImageLoader.cpp:
2302         (WebCore::HTMLImageLoader::updateFromElement):
2303         * loader/Cache.cpp:
2304         (WebCore::Cache::requestResource):
2305         * loader/CachedResource.cpp:
2306         (WebCore::CachedResource::CachedResource):
2307         (WebCore::CachedResource::~CachedResource):
2308         * loader/CachedResource.h:
2309         (WebCore::CachedResource::setDocLoader):
2310
2311 2007-07-20  Brady Eidson  <beidson@apple.com>
2312
2313         Reviewed by Darin
2314
2315         <rdar://problem/5153021> and http://bugs.webkit.org/show_bug.cgi?id=13364
2316
2317         The issue here was that if a document in a subframe was loaded from a URL, but then a script did 
2318         document.open or document.write during parsing, we would overwrite the document's url and baseurl 
2319         with the parent frame's url.  WRONG!
2320
2321         * dom/Document.cpp:
2322         (WebCore::Document::open): Only set the url and baseURL in document.open if they are still empty or about:blank
2323
2324 2007-07-20  Maciej Stachowiak  <mjs@apple.com>
2325
2326         Reviewed by Oliver.
2327
2328         <rdar://problem/5326303> REGRESSION: blur event fires upon navigating away from a page with focused element
2329
2330
2331         
2332         The proximate cause was the recent change to keep focus on the
2333         WebHTMLView when switching views. But the reason this happend was
2334         that didCommitLoadForFrame got called at a time when the new view
2335         was in place, but the old document was still there. This was a
2336         longstanding problem with the delegate, and fixing it cleans it
2337         up.
2338
2339         * loader/FrameLoader.cpp:
2340         (WebCore::FrameLoader::begin): Don't send dispatchWindowObjectAvailable if
2341         caller asked not to (this is to allow order of delegates to be the same).
2342         (WebCore::FrameLoader::transitionToCommitted): Don't emit didCommitLoadForFrame here.
2343         (WebCore::FrameLoader::receivedFirstData): Instead do it here, after calling begin(),
2344         so the new document is set up.
2345         * loader/FrameLoader.h: Add new optional parameter to begin().
2346
2347 2007-07-20  Sam Weinig  <sam@webkit.org>
2348
2349         Reviewed by Beth Dakin.
2350
2351         Update for fix for http://bugs.webkit.org/show_bug.cgi?id=14646
2352         <rdar://problem/5340449>
2353
2354         - Return a CSSValueList instead of CSSValue (with a Pair type) for
2355           computed values of border radii.
2356         - Add ability to CSSValueList to print out a space separated list
2357           instead of a comma.
2358         - Add border radii to list of computed styles that we create and can
2359           iterate over.
2360
2361         * css/CSSComputedStyleDeclaration.cpp:
2362         (WebCore::):
2363         (WebCore::getBorderRadiusCornerValue):
2364         * css/CSSValueList.cpp:
2365         (WebCore::CSSValueList::CSSValueList):
2366         (WebCore::CSSValueList::cssText):
2367         * css/CSSValueList.h:
2368
2369 2007-07-20  Mitz Pettel  <mitz@webkit.org>
2370
2371         Reviewed by Darin.
2372
2373         - http://bugs.webkit.org/show_bug.cgi?id=14626
2374           Make bidiReorderCharacters independent of RenderBlock
2375
2376         No layout test possible because there is no change in functionality.
2377
2378         This patch generalizes RenderBlock's implementation of the Unicode Bidi Algorithm
2379         in the form of the BidiResolver class template. An instance of a BidiResolver class
2380         can generate a sequence of runs with corresponding level and override attributes,
2381         given a range specified by start and end iterators. The iterators can optionally
2382         call back to the BidiResolver instance to push or pop explicit embedding levels.
2383
2384         The patch replaces BidiState with a specialization of BidiResolver that uses
2385         BidiIterators and generates BidiRuns. It also eliminates some of the file statics
2386         in bidi.cpp, instead relying on BidiResolver data members.
2387
2388         The patch makes the BidiContext part of BidiStatus, thus making BidiStatus the
2389         entire state that needs to be saved and restored in order to restart the bidi
2390         algorithm at a given point. Previously, you had to keep and pass around two
2391         separate structures, namely the BidiContext and the BidiStatus.
2392
2393         bidiReorderCharacters is implemented without relying on render objects, using
2394         a BidiResolver specialization that uses simple character buffer iterators and
2395         simple run structures.
2396
2397         * WebCore.pro:
2398         * WebCore.vcproj/WebCore.vcproj:
2399         * WebCore.xcodeproj/project.pbxproj:
2400         * WebCoreSources.bkl:
2401         * platform/BidiContext.cpp: Added.
2402         (WebCore::operator==):
2403         * platform/BidiContext.h: Added.
2404         (WebCore::BidiContext::BidiContext):
2405         (WebCore::BidiContext::ref):
2406         (WebCore::BidiContext::deref):
2407         (WebCore::BidiContext::parent):
2408         (WebCore::BidiContext::level):
2409         (WebCore::BidiContext::dir):
2410         (WebCore::BidiContext::override):
2411         * platform/BidiReorderCharacters.cpp: Added.
2412         (WebCore::CharacterBufferIterator::CharacterBufferIterator):
2413         (WebCore::CharacterBufferIterator::offset):
2414         (WebCore::CharacterBufferIterator::increment):
2415         (WebCore::CharacterBufferIterator::atEnd):
2416         (WebCore::CharacterBufferIterator::current):
2417         (WebCore::CharacterBufferIterator::direction):
2418         (WebCore::CharacterBufferIterator::operator==):
2419         (WebCore::CharacterBufferIterator::operator!=):
2420         (WebCore::::appendRun):
2421         (WebCore::bidiReorderCharacters):
2422         * platform/BidiReorderCharacters.h: Added.
2423         * platform/BidiResolver.h: Added.
2424         (WebCore::BidiStatus::BidiStatus):
2425         (WebCore::operator==):
2426         (WebCore::operator!=):
2427         (WebCore::BidiCharacterRun::BidiCharacterRun):
2428         (WebCore::BidiCharacterRun::reversed):
2429         (WebCore::BidiCharacterRun::dirOverride):
2430         (WebCore::BidiCharacterRun::next):
2431         (WebCore::BidiResolver::):
2432         (WebCore::BidiResolver::context):
2433         (WebCore::BidiResolver::setContext):
2434         (WebCore::BidiResolver::setLastDir):
2435         (WebCore::BidiResolver::setLastStrongDir):
2436         (WebCore::BidiResolver::setEorDir):
2437         (WebCore::BidiResolver::dir):
2438         (WebCore::BidiResolver::setDir):
2439         (WebCore::BidiResolver::status):
2440         (WebCore::BidiResolver::setStatus):
2441         (WebCore::BidiResolver::adjustEmbedding):
2442         (WebCore::BidiResolver::setAdjustEmbedding):
2443         (WebCore::BidiResolver::firstRun):
2444         (WebCore::BidiResolver::lastRun):
2445         (WebCore::BidiResolver::runCount):
2446         (WebCore::::embed):
2447         (WebCore::::deleteRuns):
2448         (WebCore::::reverseRuns):
2449         (WebCore::::createBidiRunsForLine):
2450         * platform/win/PopupMenuWin.cpp:
2451         (WebCore::PopupMenu::paint):
2452         * rendering/RenderBlock.h:
2453         * rendering/RenderFileUploadControl.cpp:
2454         (WebCore::RenderFileUploadControl::paintObject):
2455         * rendering/RenderListBox.cpp:
2456         (WebCore::RenderListBox::paintItemForeground):
2457         * rendering/RootInlineBox.cpp:
2458         (WebCore::RootInlineBox::childRemoved):
2459         (WebCore::RootInlineBox::lineBreakBidiStatus):
2460         (WebCore::RootInlineBox::setLineBreakInfo):
2461         * rendering/RootInlineBox.h:
2462         (WebCore::RootInlineBox::RootInlineBox):
2463         * rendering/bidi.cpp:
2464         (WebCore::BidiIterator::BidiIterator):
2465         (WebCore::BidiState::deleteRuns):
2466         (WebCore::operator==):
2467         (WebCore::operator!=):
2468         (WebCore::bidiNext):
2469         (WebCore::bidiFirst):
2470         (WebCore::BidiState::addRun):
2471         (WebCore::appendRunsForObject):
2472         (WebCore::BidiState::appendRun):
2473         (WebCore::RenderBlock::constructLine):
2474         (WebCore::RenderBlock::computeHorizontalPositionsForLine):
2475         (WebCore::RenderBlock::computeVerticalPositionsForLine):
2476         (WebCore::RenderBlock::bidiReorderLine):
2477         (WebCore::buildCompactRuns):
2478         (WebCore::RenderBlock::layoutInlineChildren):
2479         (WebCore::RenderBlock::determineStartPosition):
2480         (WebCore::RenderBlock::determineEndPosition):
2481         (WebCore::RenderBlock::matchedEndLine):
2482         (WebCore::RenderBlock::skipWhitespace):
2483         * rendering/bidi.h:
2484         (WebCore::BidiRun::BidiRun):
2485         (WebCore::BidiRun::next):
2486
2487 2007-07-20  Darin Adler  <darin@apple.com>
2488
2489         Reviewed by John Sullivan.
2490
2491         - fix for <rdar://problem/5331723> <rdar://problem/5331723> Safari gives error
2492           103 for URLs that Adobe Lightroom's Preview feature produces, with ":1" in the hostname
2493
2494         Test: fast/loader/file-URL-with-port-number.html
2495
2496         * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::portAllowed):
2497         Don't do any port blocking for file URLs.
2498
2499 2007-07-20  Mitz Pettel  <mitz@webkit.org>
2500
2501         Reviewed by Darin.
2502
2503         - fix http://bugs.webkit.org/show_bug.cgi?id=14689
2504           REGRESSION (3.0.2-TOT): <select> menu items have incorrect background color
2505
2506         * manual-tests/item-background.html: Added.
2507         * platform/PopupMenuClient.h:
2508         * platform/graphics/Color.cpp:
2509         (WebCore::blendComponent): Renamed the static method blend() to this.
2510         (WebCore::Color::blend): Added. Compositing (in "normal" or "source over"
2511         blend mode) B.blend(C) over A is equivalent to compositing C over the
2512         result of compositing B over A.
2513         (WebCore::Color::blendWithWhite): Changed for the above rename.
2514         * platform/graphics/Color.h:
2515         * platform/win/PopupMenuWin.cpp:
2516         (WebCore::PopupMenu::paint): Changed to use itemBackgroundColor().
2517         * rendering/RenderMenuList.cpp:
2518         (WebCore::RenderMenuList::itemBackgroundColor): Added. Returns the color
2519         that would result from overlaying the item's background color over the
2520         menu's background color over solid white. Note that clientStyle() cannot
2521         be used for the menu's background color, since background color is not
2522         inherited by the inner block (the regression resulted from changing
2523         clientStyle() to return the inner block's style), and that the color
2524         returned from this method is guaranteed to be opaque.
2525         * rendering/RenderMenuList.h:
2526         * rendering/RenderTextControl.cpp:
2527         (WebCore::RenderTextControl::itemBackgroundColor): Added.
2528         * rendering/RenderTextControl.h:
2529
2530 2007-07-20  Rob Buis  <buis@kde.org>
2531
2532         Reviewed by Darin.
2533
2534         http://bugs.webkit.org/show_bug.cgi?id=14642
2535         REGRESSION(r24064-24096): Reflection type effect in canvas tag broke
2536
2537         Do not stop the fill/stroke operation when encountering an empty path.
2538
2539         * html/CanvasRenderingContext2D.cpp:
2540         (WebCore::CanvasRenderingContext2D::fill):
2541         (WebCore::CanvasRenderingContext2D::stroke):
2542
2543 2007-07-20  Lars Knoll  <lars@trolltech.com>
2544
2545         Reviewed by Simon.
2546
2547         Remove some files that are not used anymore.
2548
2549         * platform/qt/FontCacheQt.cpp: Removed.
2550         * platform/qt/FontDataQt.cpp: Removed.
2551         * platform/qt/FontPlatformData.h: Removed.
2552         * platform/qt/FontPlatformDataQt.cpp: Removed.
2553         * platform/qt/GlyphPageTreeNodeQt.cpp: Removed.
2554
2555 2007-07-20  Lars Knoll  <lars@trolltech.com>
2556
2557         Reviewed by Simon.
2558
2559         use the correct font for spaces.
2560
2561         * platform/qt/FontQt.cpp:
2562         (WebCore::generateComponents):
2563
2564 2007-07-20  Lars Knoll  <lars@trolltech.com>
2565
2566         Reviewed by Simon.
2567
2568         spaces where not correctly taken into account for both offsetForPosition and selectionRectForText. Because of that selections sort of worked in LTR text, but completely failed in RTL.
2569
2570         * platform/qt/FontQt.cpp:
2571         (WebCore::TextRunComponent::isSpace):
2572         (WebCore::TextRunComponent::TextRunComponent):
2573         (WebCore::generateComponents):
2574         (WebCore::Font::drawText):
2575         (WebCore::Font::offsetForPosition):
2576         (WebCore::Font::selectionRectForText):
2577
2578 2007-07-20  Lars Knoll  <lars@trolltech.com>
2579
2580         Reviewed by Simon.
2581
2582         fix up some smaller issues in selection handling. It's still not perfect and selections in mixed rtl/ltr text are still broken, but it's getting there.
2583
2584         * platform/qt/FontQt.cpp:
2585         (WebCore::Font::offsetForPosition):
2586         (WebCore::cursorToX):
2587         (WebCore::Font::selectionRectForText):
2588
2589 2007-07-20  Lars Knoll  <lars@trolltech.com>
2590
2591         Reviewed by Simon.
2592
2593         make offsetForPosition and selectionRectForText work correctly with small caps.
2594
2595         * platform/qt/FontQt.cpp:
2596         (WebCore::Font::offsetForPosition):
2597         (WebCore::cursorToX):
2598         (WebCore::Font::selectionRectForText):
2599
2600 2007-07-20  Lars Knoll  <lars@trolltech.com>
2601
2602         Reviewed by Simon.
2603
2604         clip the drawn text correctly when needed.
2605
2606         * platform/qt/FontQt.cpp:
2607         (WebCore::Font::drawText):
2608
2609 2007-07-20  Lars Knoll  <lars@trolltech.com>
2610
2611         Reviewed by Simon.
2612
2613         Fix offsetForPosition and selectionRectForText methods.
2614
2615         * platform/qt/FontQt.cpp:
2616         (WebCore::Font::offsetForPosition):
2617         (WebCore::cursorToX):
2618         (WebCore::Font::selectionRectForText):
2619
2620 2007-07-20  Lars Knoll  <lars@trolltech.com>
2621
2622         Reviewed by Simon.
2623
2624         fix BiDi text rendering.
2625
2626         * platform/qt/FontQt.cpp:
2627         (WebCore::TextRunComponent::TextRunComponent):
2628         (WebCore::generateComponents):
2629         (WebCore::Font::drawText):
2630
2631 2007-07-20  Mark Rowe  <mrowe@apple.com>
2632
2633         Reviewed by Maciej.
2634
2635         Move FTPDirectoryTokenizer::m_templateDocumentData to be a function-scoped static
2636         to avoid creating a global initializer.  This fixes the build for x86_64.
2637
2638         * loader/FTPDirectoryDocument.cpp:
2639         (WebCore::FTPDirectoryTokenizer::loadDocumentTemplate):
2640
2641 2007-07-19  Geoffrey Garen  <ggaren@apple.com>
2642
2643         Reviewed by Maciej Stachowiak.
2644         
2645         Fixed <rdar://problem/5347849> Cache eviction of live decoded data is 
2646         thrash-y
2647         
2648         The solution here is to evict live decoded data based on a strict LRU
2649         model. This should work well as a "scrolling window."
2650
2651         With this patch, I see a substantial reduction in CPU while scrolling
2652         through a page with large images on a low memory system. Layout tests
2653         pass.
2654
2655         * loader/Cache.h: Changed from a size-based vector of LRU lists to a
2656         single LRU list in order to implement strict LRU.
2657         
2658         * loader/CachedResource.h: Removed tracking of access count, since that
2659         was the old cache eviction model.
2660
2661 2007-07-19  Oliver Hunt  <oliver@apple.com>
2662
2663         Reviewed by Maciej.
2664
2665         <rdar://problem/5076807> REGRESSION: Can't undo conversion of inline text (by hitting ESC)
2666         <rdar://problem/5346167> DOM key events triggered during IME composition differ in webkit/mac vs all windows browsers
2667
2668         We now basically match the behaviour of IE/Windows. This means that during composition keydown and autorepeat
2669         keys generate keydown events with a keyCode of 229, which correlates to the windows VK_PROCESSKEY message.
2670         keyup events are generated with the keyCode of the actual key that was pressed.
2671
2672         The only difference is on the first keydown of a composition, in which IE will use keyCode == 229, and we will
2673         send an event with the keyCode for the actual key that was pressed.
2674
2675         * page/EventHandler.cpp:
2676         (WebCore::EventHandler::keyEvent):
2677         * platform/PlatformKeyboardEvent.h:
2678         (WebCore::PlatformKeyboardEvent::setWindowsKeyCode):
2679
2680 2007-07-19  Brady Eidson  <beidson@apple.com>
2681
2682         Reviewed by Sam
2683
2684         <rdar://problem/5134929> REGRESSION: Colon detected as delimiting an empty port is stripped
2685
2686         The fix for this was in KURL::parse() which had a slightly changed rule that would strip the colon if there
2687         was no port.
2688
2689         An additional canonicalization fix was made in window.location.host to match the expected behavior of leaving
2690         the colon in place - before this fix, if the colon was there but no port was there, we'd see the port as 0.
2691
2692         * bindings/js/kjs_window.cpp:
2693         (KJS::Location::put): Call setHostAndPort instead of setHost and setPort seperately
2694
2695         * manual-tests/location-host-canonicalization.html: Added.
2696
2697         * platform/KURL.cpp:
2698         (WebCore::KURL::setHostAndPort): Set the host and port as one string component then reparse the URL
2699         (WebCore::KURL::parse): Change one line to consider the empty colon as part of the host name
2700         * platform/KURL.h:
2701
2702 2007-07-19  Anders Carlsson  <andersca@apple.com>
2703
2704         Reviewed by Adam.
2705
2706         <rdar://problem/5288617>
2707         Crash playing a very large QuickTime movie in Safari
2708         
2709         <rdar://problem/5271174>
2710         http://bugs.webkit.org/show_bug.cgi?id=14148
2711         LEAK: Serious memory consumption and leak when loading QT movies.
2712         
2713         Don't keep plugin stream data in memory since some plugin resources (like QT movies)
2714         can be really big. If a plug-in wants data in a file, create a file and write data to it 
2715         as it's coming from the wire, instead of using a big buffer.
2716         
2717         * loader/ResourceLoader.cpp:
2718         (WebCore::ResourceLoader::ResourceLoader):
2719         (WebCore::ResourceLoader::addData):
2720         (WebCore::ResourceLoader::willStopBufferingData):
2721         * loader/ResourceLoader.h:
2722         (WebCore::ResourceLoader::setShouldBufferData):
2723         * plugins/win/PluginStreamWin.cpp:
2724         (WebCore::PluginStreamWin::PluginStreamWin):
2725         (WebCore::PluginStreamWin::start):
2726         (WebCore::PluginStreamWin::startStream):
2727         (WebCore::PluginStreamWin::destroyStream):
2728         (WebCore::PluginStreamWin::didReceiveData):
2729         (WebCore::PluginStreamWin::didFinishLoading):
2730         * plugins/win/PluginStreamWin.h:
2731
2732 2007-07-19  Geoffrey Garen  <ggaren@apple.com>
2733
2734         Reviewed by Darin Adler.
2735         
2736         Fixed <rdar://problem/5348384> Restore old return value behavior of 
2737         stringByEvaluatingJavaScriptFromString
2738         
2739         Return an empty string unless you have a string, boolean, or number
2740         result.
2741
2742         * WebCore.xcodeproj/project.pbxproj:
2743         * page/mac/WebCoreFrameBridge.mm:
2744         (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
2745
2746 2007-07-19  Darin Adler  <darin@apple.com>
2747
2748         Reviewed by Alexey.
2749
2750         - fix http://bugs.webkit.org/show_bug.cgi?id=14666
2751           remove unused xxx-encodings.txt for all platforms other than Mac
2752
2753         * platform/gdk/gdk-encodings.txt: Removed.
2754         * platform/win/win-encodings.txt: Removed.
2755         * platform/wx/wx-encodings.txt: Removed.
2756
2757         * platform/character-sets.txt: Moved into mac subdirectory since it's only used for Mac; at some
2758         point I hope to remove it completely.
2759         * platform/make-charset-table.pl: Ditto.
2760         * platform/mac/character-sets.txt: Copied from platform/character-sets.txt.
2761         * platform/mac/make-charset-table.pl: Copied from platform/make-charset-table.pl.
2762
2763         * DerivedSources.make: Moved CharsetData.cpp into the MACOS section.
2764         Changed the build rule to use Mac-specific paths for everything and got rid of
2765         make variables.
2766
2767         * WebCore.vcproj/build-generated-files.sh: Removed code to set ENCODINGS_FILE and ENCODINGS_PREFIX.
2768         * WebCore.xcodeproj/project.pbxproj: Ditto.
2769         * make-generated-sources.sh: Ditto.
2770
2771         * Projects/gdk/webcore-gdk.bkl: Removed code to pass gdk-encodings.txt to make-generated-sources.sh.
2772         * Projects/wx/webcore-wx.bkl: Ditto, but for wx-encodings.txt.
2773
2774 2007-07-19  Antti  <antti@apple.com>
2775
2776         Reviewed by Darin.
2777
2778         Fix <rdar://problem/5257371>
2779         Dashcode Client crash when clicking on placemarks in Maps widget in WebCore::DeprecatedPtrListImpl::addIterator
2780         
2781         FlexibleBoxes should never have inline children. Don't move children out from last remaining anonymous block.
2782
2783         * rendering/RenderBlock.cpp:
2784         (WebCore::RenderBlock::removeChild): real fix
2785         * rendering/RenderFlexibleBox.cpp:
2786         (WebCore::RenderFlexibleBox::layoutVerticalBox): just to be sure, this is checked elsewhere too
2787
2788 2007-07-19  Anders Carlsson  <andersca@apple.com>
2789
2790         Reviewed by Darin.
2791
2792         <rdar://problem/5322268>
2793         Safari Crash at http://www.exlibrisgroup.com/sfx_openurl.htm
2794         
2795         Add a real copy constructor and assignment operator for CollectionInfo
2796         so that the vectors in the cache maps will be copied correctly.
2797         
2798         * html/HTMLCollection.cpp:
2799         (WebCore::HTMLCollection::CollectionInfo::CollectionInfo):
2800         (WebCore::HTMLCollection::CollectionInfo::swap):
2801         * html/HTMLCollection.h:
2802         (WebCore::HTMLCollection::CollectionInfo::operator=):
2803         (WebCore::HTMLCollection::CollectionInfo::copyCacheMap):
2804
2805 2007-07-19  David Hyatt  <hyatt@apple.com>
2806
2807         Fix for 5237574, Colloquy main view does not size correctly.  Make
2808         sure to reset the baseilne when calculating a row's height/baseline, so
2809         that old values don't stick around.
2810
2811         Reviewed by Tim Hatcher
2812
2813         * rendering/RenderTableSection.cpp:
2814         (WebCore::RenderTableSection::calcRowHeight):
2815
2816 2007-07-19  Antti  <antti@apple.com>
2817
2818         Reviewed by John.
2819         
2820         Fix <rdar://problem/5346697>
2821         REGRESSION(r23773): Visibile children on invisible layer are not painted (fast/layers/layer-visibility.html fails)
2822         
2823         Test m_hasVisibleContent instead of renderer()->style()->visibility(). 
2824         This takes children into account too.
2825
2826         Regression spotted by Mitz.
2827
2828         * rendering/RenderLayer.cpp:
2829         (WebCore::RenderLayer::paintLayer):
2830
2831 2007-07-18  Oliver Hunt  <oliver@apple.com>
2832
2833         Rubber stamped by maciej
2834
2835         Rollout patch from r24437.
2836
2837         * page/EventHandler.cpp:
2838         (WebCore::EventHandler::keyEvent):
2839
2840 2007-07-18  Oliver Hunt  <oliver@apple.com>
2841
2842         Reviewed by Kevin M.
2843
2844         Fix for <rdar://problem/5346167> DOM key events triggered during
2845                 IME composition differ in webkit/mac vs all windows browsers
2846
2847         We no longer send DOM key events during IME composition.  This behaviour 
2848         matches the behaviour of WebKit/Win.
2849
2850         * page/EventHandler.cpp:
2851         (WebCore::EventHandler::keyEvent):
2852
2853 2007-07-18  Sam Weinig  <sam@webkit.org>
2854
2855         Reviewed by Oliver.
2856
2857         Fix for http://bugs.webkit.org/show_bug.cgi?id=14646
2858         WebKit border radius properties are unavailable via JavaScript
2859
2860         Test: fast/dom/getComputedStyle-borderRadius.html
2861
2862         * css/CSSComputedStyleDeclaration.cpp:
2863         (WebCore::getBorderRadiusCornerValue): Helper function that returns a single value if
2864         width and the height of the corner radius are equal, and otherwise a pair.
2865         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
2866
2867 2007-07-18  Anders Carlsson  <andersca@apple.com>
2868
2869         Reviewed by Darin.
2870
2871         <rdar://problem/5262136> Double form repost alert going forward on britishairways.com
2872         
2873         When checking if the request has changed and a new policy callback needs to be sent, 
2874         ignore the request headers. NSURLConnection in Leopard will always call willSendRequest,
2875         with a request that was different from the one passed to -[NSURLConnection connectionWithRequest:]
2876         (a few Accept headers are added).
2877
2878         * loader/FrameLoader.cpp:
2879         (WebCore::FrameLoader::checkNavigationPolicy):
2880         * platform/network/ResourceRequestBase.cpp:
2881         (WebCore::equalIgnoringHeaderFields):
2882         (WebCore::operator==):
2883         * platform/network/ResourceRequestBase.h:
2884
2885 2007-07-18  Anders Carlsson  <andersca@apple.com>
2886
2887         Reviewed by Darin.
2888
2889         <rdar://problem/5340098>
2890         http://bugs.webkit.org/show_bug.cgi?id=13366
2891         REGRESSION (r10935): AOL beta music player doesn't play
2892
2893         The AOL beta music player has a typo, causing it to create an <embed"> element inside of
2894         an <object> element
2895         Because of this, it will not be treated as an embed tag, so its name will not be added
2896         to the document's named item map. Furthermore, since the <object> contains a child that
2897         is not a <param>, the object's name won't be added either.
2898         
2899         The (somewhat ugly) fix is to add <object> to the named map only if it has <param> or
2900         unknown elements as children.
2901         
2902         * html/HTMLObjectElement.cpp:
2903         (WebCore::HTMLObjectElement::updateDocNamedItem):
2904
2905 2007-07-18  Timothy Hatcher  <timothy@apple.com>
2906
2907         Reviewed by Adam.
2908
2909         <rdar://problem/5343767> Should have a way to disable the Web Inspector
2910
2911         This change facilitates the ability to turn the Web Inspector on and off.
2912
2913         Makes the InspectorClient be required to create a new Page. This also means that
2914         InspectorController will never be NULL. Adds a new function on Page to test
2915         if the inspector is enabled.
2916
2917         * WebCore.exp: New symbol for the Page constructor.
2918         * WebCore.pro: Add InspectorClientGdk.cpp.
2919         * WebCoreSources.bkl: ditto.
2920         * html/HTMLDocument.cpp:
2921         (WebCore::HTMLDocument::createTokenizer):
2922         * loader/FrameLoader.cpp:
2923         (WebCore::FrameLoader::detachFromParent): Don't null check the InspectorCOntroller.
2924         (WebCore::FrameLoader::dispatchDidCommitLoad): Ditto.
2925         (WebCore::FrameLoader::dispatchAssignIdentifierToInitialRequest): Ditto.
2926         (WebCore::FrameLoader::dispatchWillSendRequest): Ditto.
2927         (WebCore::FrameLoader::dispatchDidReceiveResponse): Ditto.
2928         (WebCore::FrameLoader::dispatchDidReceiveContentLength): Ditto.
2929         (WebCore::FrameLoader::dispatchDidFinishLoading): Ditto.
2930         (WebCore::FrameLoader::dispatchDidLoadResourceFromMemoryCache): Ditto.
2931         * page/ContextMenuController.cpp:
2932         (WebCore::ContextMenuController::handleContextMenuEvent): Ask the InspectorController if it is enabled.
2933         (WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
2934         * page/InspectorController.cpp:
2935         (WebCore::InspectorController::enabled): Ask the Page's settings if developer extras are enabled.
2936         (WebCore::InspectorController::inspect): Check if the InspectorController is enabled.
2937         (WebCore::InspectorController::focusNode): Ditto.
2938         (WebCore::InspectorController::highlight): Ditto.
2939         (WebCore::InspectorController::hideHighlight): Ditto.
2940         (WebCore::InspectorController::addMessageToConsole): Ditto.
2941         (WebCore::InspectorController::attachWindow): Ditto.
2942         (WebCore::InspectorController::detachWindow): Ditto.
2943         (WebCore::InspectorController::windowScriptObjectAvailable): Ditto.
2944         (WebCore::InspectorController::didCommitLoad): Ditto.
2945         (WebCore::InspectorController::frameDetachedFromParent): Ditto.
2946         (WebCore::InspectorController::didLoadResourceFromMemoryCache): Ditto.
2947         (WebCore::InspectorController::identifierForInitialRequest): Ditto.
2948         (WebCore::InspectorController::willSendRequest): Ditto.
2949         (WebCore::InspectorController::didReceiveResponse): Ditto.
2950         (WebCore::InspectorController::didReceiveContentLength): Ditto.
2951         (WebCore::InspectorController::didFinishLoading): Ditto.
2952         (WebCore::InspectorController::didFailLoading): Ditto.
2953         * page/InspectorController.h:
2954         * page/Page.cpp:
2955         (WebCore::Page::Page): Require an InspectorClient.
2956         (WebCore::Page::~Page): Always call pageDestroyed on the InspectorController.
2957         (WebCore::Page::inspectorEnabled): Check the WebCore settings if the developer extras are enabled.
2958         * page/Page.h:
2959         * page/gdk/InspectorClientGdk.cpp: Added.
2960         (WebCore::InspectorClientGdk::inspectorDestroyed): Empty stub calling notImplemented.
2961         (WebCore::InspectorClientGdk::createPage): Ditto.
2962         (WebCore::InspectorClientGdk::showWindow): Ditto.
2963         (WebCore::InspectorClientGdk::closeWindow): Ditto.
2964         (WebCore::InspectorClientGdk::attachWindow): Ditto.
2965         (WebCore::InspectorClientGdk::detachWindow): Ditto.
2966         (WebCore::InspectorClientGdk::highlight): Ditto.
2967         (WebCore::InspectorClientGdk::hideHighlight): Ditto.
2968         (WebCore::InspectorClientGdk::inspectedURLChanged): Ditto.
2969         * page/gdk/InspectorClientGdk.h: Added.
2970         * platform/graphics/svg/SVGImage.cpp:
2971         (WebCore::SVGImage::dataChanged): Pass in a dummy InspectorClient.
2972         * platform/graphics/svg/SVGImageEmptyClients.h:
2973         (WebCore::SVGEmptyInspectorClient::~SVGEmptyInspectorClient): Empty dummy implementation.
2974         (WebCore::SVGEmptyInspectorClient::inspectorDestroyed): Ditto.
2975         (WebCore::SVGEmptyInspectorClient::createPage): Ditto.
2976         (WebCore::SVGEmptyInspectorClient::showWindow): Ditto.
2977         (WebCore::SVGEmptyInspectorClient::closeWindow): Ditto.
2978         (WebCore::SVGEmptyInspectorClient::attachWindow): Ditto.
2979         (WebCore::SVGEmptyInspectorClient::detachWindow): Ditto.
2980         (WebCore::SVGEmptyInspectorClient::highlight): Ditto.
2981         (WebCore::SVGEmptyInspectorClient::hideHighlight): Ditto.
2982         (WebCore::SVGEmptyInspectorClient::inspectedURLChanged): Ditto.
2983
2984 2007-07-18  Anders Carlsson  <andersca@apple.com>
2985
2986         Make some headers private instead of project.
2987         
2988         * WebCore.xcodeproj/project.pbxproj:
2989
2990 2007-07-18  John Sullivan  <sullivan@apple.com>
2991
2992         Reviewed by Maciej and Kevin Decker
2993
2994         - fixed <rdar://problem/5315926> REGRESSION: ~.4% PLT regression from r23949 (canonicalization change)
2995
2996         * loader/mac/LoaderNSURLExtras.m:
2997         (canonicalURL):
2998         Rolled out the fix for 5249730 that caused this regression. 5249730 is addressed a different way now.
2999
3000 2007-07-18  Sam Weinig  <sam@webkit.org>
3001
3002         Build fix.
3003
3004         * WebCore.xcodeproj/project.pbxproj:
3005         * loader/gdk/FrameLoaderClientGdk.cpp:
3006         (WebCore::FrameLoaderClientGdk::objectContentType):
3007         * platform/graphics/win/ImageWin.cpp:
3008         * platform/network/cf/ResourceResponseCFNet.cpp:
3009         * platform/win/ClipboardWin.cpp:
3010         (WebCore::createGlobalImageFileDescriptor):
3011
3012 2007-07-18  Sam Weinig  <sam@webkit.org>
3013
3014         Rubber-stamped by Adam Roben.
3015
3016         Rename MimeTypeRegistry to MIMETypeRegistry and xmlhttprequest to XMLHttpRequest
3017
3018         * WebCore.exp:
3019         * WebCore.pro:
3020         * WebCore.vcproj/WebCore.vcproj:
3021         * bindings/js/JSXMLHttpRequest.cpp:
3022         * bindings/js/kjs_binding.cpp:
3023         * bindings/js/kjs_dom.cpp:
3024         * dom/Document.cpp:
3025         * html/HTMLFormElement.cpp:
3026         (WebCore::HTMLFormElement::formData):
3027         * html/HTMLObjectElement.cpp:
3028         (WebCore::HTMLObjectElement::containsJavaApplet):
3029         * loader/FrameLoader.cpp:
3030         (WebCore::FrameLoader::requestObject):
3031         * loader/mac/LoaderNSURLExtras.m:
3032         (suggestedFilenameWithMIMEType):
3033         * platform/MIMETypeRegistry.cpp: Copied from platform/MimeTypeRegistry.cpp.
3034         (WebCore::initialiseSupportedImageMIMETypes):
3035         (WebCore::initialiseMIMETypeRegistry):
3036         (WebCore::MIMETypeRegistry::getMIMETypeForPath):
3037         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
3038         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType):
3039         (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
3040         (WebCore::MIMETypeRegistry::isJavaAppletMIMEType):
3041         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
3042         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
3043         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes):
3044         * platform/MIMETypeRegistry.h: Copied from platform/MimeTypeRegistry.h.
3045         * platform/MimeTypeRegistry.cpp: Removed.
3046         * platform/MimeTypeRegistry.h: Removed.
3047         * platform/gdk/MIMETypeRegistryGdk.cpp: Copied from platform/gdk/MimeTypeRegistryGdk.cpp.
3048         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
3049         * platform/gdk/MimeTypeRegistryGdk.cpp: Removed.
3050         * platform/graphics/BitmapImage.cpp:
3051         * platform/graphics/Image.cpp:
3052         (WebCore::Image::supportsType):
3053         * platform/mac/DragDataMac.mm:
3054         * platform/mac/MIMETypeRegistryMac.mm: Copied from platform/mac/MimeTypeRegistryMac.mm.
3055         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
3056         (WebCore::MIMETypeRegistry::getExtensionsForMIMEType):
3057         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
3058         * platform/mac/MimeTypeRegistryMac.mm: Removed.
3059         * platform/mac/PasteboardMac.mm:
3060         (WebCore::Pasteboard::writeImage):
3061         * platform/qt/MIMETypeRegistryQt.cpp: Copied from platform/qt/MimeTypeRegistryQt.cpp.
3062         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
3063         * platform/qt/MimeTypeRegistryQt.cpp: Removed.
3064         * platform/win/MIMETypeRegistryWin.cpp: Copied from platform/win/MimeTypeRegistryWin.cpp.
3065         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
3066         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
3067         * platform/win/MimeTypeRegistryWin.cpp: Removed.
3068         * rendering/RenderPartObject.cpp:
3069         (WebCore::RenderPartObject::updateWidget):
3070         * xml/xmlhttprequest.cpp: Removed.
3071         * xml/xmlhttprequest.h: Removed.
3072         * xml/XMLHttpRequest.cpp: Copied from xml/xmlhttprequest.cpp.
3073         * xml/XMLHttpRequest.h: Copied from xml/xmlhttprequest.h.
3074
3075 2007-07-18  Sam Weinig  <sam@webkit.org>
3076
3077         Rubber-stamped by Adam Roben.
3078
3079         Rename csshelper.h, csshelper.cpp, cssparser.h, cssparser.cpp,
3080         cssstyleselector.h, and cssstyleselector.cpp to be CamelCase.
3081
3082         * WebCore.pro:
3083         * WebCore.vcproj/WebCore.vcproj:
3084         * bindings/objc/DOM.mm:
3085         * bindings/objc/DOMHTML.mm:
3086         * css/CSSGrammar.y:
3087         * css/CSSMediaRule.cpp:
3088         * css/CSSMutableStyleDeclaration.cpp:
3089         * css/CSSPrimitiveValue.cpp:
3090         * css/CSSStyleSheet.cpp:
3091         * css/MediaList.cpp:
3092         * css/MediaQueryExp.cpp:
3093         * css/csshelper.cpp: Removed.
3094         * css/csshelper.h: Removed.
3095         * css/CSSHelper.cpp: Copied from css/csshelper.cpp.
3096         * css/CSSHelper.h: Copied from css/csshelper.h.
3097         * css/cssparser.cpp: Removed.
3098         * css/cssparser.h: Removed.
3099         * css/CSSParser.cpp: Copied from css/cssparser.cpp.
3100         * css/CSSParser.h: Copied from css/cssparser.h.
3101         * css/cssstyleselector.cpp: Removed.
3102         * css/cssstyleselector.h: Removed.
3103         * css/CSSStyleSelector.cpp: Copied from css/cssstyleselector.cpp.
3104         * css/CSSStyleSelector.h: Copied from css/cssstyleselector.h.
3105         * dom/Document.cpp:
3106         * dom/Element.cpp:
3107         * dom/StyledElement.cpp:
3108         * editing/ApplyStyleCommand.cpp:
3109         * editing/markup.cpp:
3110         * html/CanvasGradient.cpp:
3111         * html/CanvasRenderingContext2D.cpp:
3112         * html/CanvasStyle.cpp:
3113         * html/HTMLAnchorElement.cpp:
3114         * html/HTMLBaseElement.cpp:
3115         * html/HTMLBodyElement.cpp:
3116         * html/HTMLDocument.cpp:
3117         * html/HTMLEmbedElement.cpp:
3118         * html/HTMLFormElement.cpp:
3119         * html/HTMLFrameElementBase.cpp:
3120         * html/HTMLImageElement.cpp:
3121         * html/HTMLImageLoader.cpp:
3122         * html/HTMLLinkElement.cpp:
3123         * html/HTMLObjectElement.cpp:
3124         * html/HTMLOptGroupElement.cpp:
3125         * html/HTMLOptionElement.cpp:
3126         * html/HTMLSelectElement.cpp:
3127         * html/HTMLTableElement.cpp:
3128         * html/HTMLTablePartElement.cpp:
3129         * html/HTMLTokenizer.cpp:
3130         * ksvg2/css/SVGCSSParser.cpp:
3131         * ksvg2/css/SVGCSSStyleSelector.cpp:
3132         * ksvg2/svg/SVGAElement.cpp:
3133         * ksvg2/svg/SVGClipPathElement.cpp:
3134         * ksvg2/svg/SVGGradientElement.cpp:
3135         * ksvg2/svg/SVGLength.cpp:
3136         * ksvg2/svg/SVGMaskElement.cpp:
3137         * ksvg2/svg/SVGStyledElement.cpp:
3138         * ksvg2/svg/SVGUseElement.cpp:
3139         * page/DOMWindow.cpp:
3140         * page/mac/FrameMac.mm:
3141         * page/mac/WebCoreFrameBridge.mm:
3142         * rendering/HitTestResult.cpp:
3143         * rendering/RenderObject.cpp:
3144         * rendering/RenderStyle.cpp:
3145         * rendering/RenderThemeMac.mm:
3146
3147 2007-07-18  Brady Eidson  <beidson@apple.com>
3148
3149         Rubberstamped by Adam
3150
3151         * platform/win/SharedBufferWin.cpp:
3152         (WebCore::SharedBuffer::createWithContentsOfFile): Correct license on this newly checked in file from yesterday
3153
3154 2007-07-18  Maciej Stachowiak  <mjs@apple.com>
3155
3156         Reviewed by Oliver.
3157
3158         - fixed <rdar://problem/5340603> REGRESSION: javascript being written to the screen in Safari
3159
3160         Test Case: fast/tokenizer/badscript.html
3161         
3162         * html/HTMLTokenizer.cpp:
3163         (WebCore::HTMLTokenizer::parseTag): Don't apply our self-closing
3164         <script> quirk in cases where the / appears in a mangled attribtue
3165         value.
3166
3167 2007-07-17  Peter Kasting  <zerodpx@gmail.com>
3168
3169         Reviewed by Hyatt.
3170
3171         http://bugs.webkit.org/show_bug.cgi?id=13618
3172         Don't set link targets to "_blank" on middle-click; rely on the policy
3173         delegate to do the right thing.
3174
3175         * html/HTMLAnchorElement.cpp:
3176         (WebCore::HTMLAnchorElement::defaultEventHandler):
3177
3178 2007-07-17  Oliver Hunt  <oliver@apple.com>
3179
3180         Reviewed by Maciej.
3181
3182         Fix for <rdar://problem/4799967> Safari and other WebKit 
3183         apps sometimes crash in WebCore::FontData::platformInit
3184
3185         Always retain/release our font handle, instead of only retaining
3186         in the presence of GC.
3187
3188         * platform/mac/FontPlatformData.h:
3189         (WebCore::FontPlatformData::FontPlatformData):
3190         (WebCore::FontPlatformData::~FontPlatformData):
3191
3192 2007-07-17  Sam Weinig  <sam@webkit.org>
3193
3194         Reviewed by Geoff Garen.
3195
3196         Fix for <rdar://problem/5333957>
3197                 http://bugs.webkit.org/show_bug.cgi?id=14610
3198
3199         Original patch by Feng Qian.
3200
3201         - Clear the selection object when disconnecting a frame.
3202
3203         Test: http/tests/security/cross-frame-access-selection.html
3204
3205         * loader/FrameLoader.cpp:
3206         (WebCore::FrameLoader::clear):
3207         * page/DOMWindow.cpp:
3208         (WebCore::DOMWindow::disconnectFrame):
3209         (WebCore::DOMWindow::clear):
3210         * page/DOMWindow.h:
3211         * page/Frame.cpp:
3212         (WebCore::Frame::clearScriptProxy):
3213         (WebCore::Frame::clearDOMWindow):
3214         * page/Frame.h:
3215
3216 2007-07-17  Oliver Hunt  <oliver@apple.com>
3217
3218         Reviewed by Sam.
3219
3220         Fix for <rdar://problem/5154518> REGRESSION: Hitting return does
3221         nothing in ruby terminal at http://tryruby.hobix.com/
3222
3223         Calling event.preventDefault() during a keydown event should not 
3224         prevent the keypress event from firing.
3225
3226         * WebCore.xcodeproj/project.pbxproj:
3227         * page/EventHandler.cpp:
3228         (WebCore::EventHandler::keyEvent):
3229         (WebCore::EventHandler::defaultKeyboardEventHandler):
3230
3231 2007-07-17  Anders Carlsson  <andersca@apple.com>
3232
3233         Reviewed by Geoff.
3234
3235         <rdar://problem/4993463> 
3236         http://bugs.webkit.org/show_bug.cgi?id=12732
3237         REGRESSION: Comments fields on ircimages not showing up in nightly
3238
3239         Postpone setting the frame name to just right before we request the frame. Otherwise, 
3240         two calls to FrameTree::uniqueChildName will return the same frame name and in that case only
3241         one Frame object will actually be created and multiple iframe elements will refer to it.
3242         
3243         * html/HTMLFrameElementBase.cpp:
3244         (WebCore::HTMLFrameElementBase::openURL):
3245         (WebCore::HTMLFrameElementBase::setNameAndOpenURL):
3246         (WebCore::HTMLFrameElementBase::setNameAndOpenURLCallback):
3247         (WebCore::HTMLFrameElementBase::insertedIntoDocument):
3248         (WebCore::HTMLFrameElementBase::attach):
3249         * html/HTMLFrameElementBase.h:
3250
3251 2007-07-17  Brady Eidson  <beidson@apple.com>
3252
3253         Reviewed by Steve
3254
3255         Required for <rdar://problem/4516185> - FTP Directory Listings
3256
3257         * WebCore.vcproj/WebCore.vcproj: Added SharedBufferWin
3258         
3259         * platform/SharedBuffer.cpp: Windows doesn't get the default empty resource anymore
3260         * platform/win/SharedBufferWin.cpp: Added.
3261         (WebCore::SharedBuffer::createWithContentsOfFile):
3262
3263 2007-07-17  Brady Eidson  <beidson@apple.com>
3264
3265         Reviewed by Tim Hatcher
3266
3267         Tweak the class names we give to the icon table cell to make it easier to style
3268
3269         * loader/FTPDirectoryDocument.cpp:
3270           (WebCore::FTPDirectoryTokenizer::appendEntry): The the table cell a "IconCell" class name and
3271           either a "FileType" or "DirectoryType" class name depending on the type
3272
3273 2007-07-17  Holger Hans Peter Freyther  <zecke@selfish.org>
3274
3275         Reviewed by NOBODY.
3276
3277         Build fix after r24366 add an additional ResourceRequest parameter to
3278         the download method.
3279
3280         * loader/gdk/FrameLoaderClientGdk.cpp:
3281         (WebCore::FrameLoaderClientGdk::download):
3282         * loader/gdk/FrameLoaderClientGdk.h:
3283
3284 2007-07-17  Adam Roben  <aroben@apple.com>
3285
3286         Fix Bug 14324: Cannot remove/customize the "Inspect Element" contextual menu item
3287         http://bugs.webkit.org/show_bug.cgi?id=14324
3288
3289         Reviewed by Tim.
3290
3291         No regression test possible.
3292
3293         * page/ContextMenuController.cpp:
3294         (WebCore::ContextMenuController::handleContextMenuEvent): Add the
3295         Inspect Element item to the menu before passing it to the
3296         ContextMenuClient so that the UI delegate has a chance to
3297         modify/remove the item.
3298
3299 2007-07-17  Adam Roben  <aroben@apple.com>
3300
3301         Remove ContextMenuClient::shouldIncludeInspectElementItem
3302
3303         Reviewed by Tim.
3304
3305         No regression test possible.
3306
3307         * page/ContextMenuClient.h:
3308         * page/ContextMenuController.cpp:
3309         (WebCore::ContextMenuController::handleContextMenuEvent): Use Settings
3310         to determine whether to include the Inspect Element item.
3311         * page/gdk/ContextMenuClientGdk.cpp:
3312         * page/gdk/ContextMenuClientGdk.h:
3313         * platform/graphics/svg/SVGImageEmptyClients.h:
3314
3315 2007-07-17  Adam Roben  <aroben@apple.com>
3316
3317         Initialize ContextMenuController::m_page
3318
3319         Somehow this variable had never been initialized before.
3320
3321         Reviewed by Tim.
3322
3323         * page/ContextMenuController.cpp:
3324         (WebCore::ContextMenuController::ContextMenuController):
3325         * page/ContextMenuController.h:
3326         * page/Page.cpp:
3327         (WebCore::Page::Page):
3328
3329 2007-07-17  Adam Roben  <aroben@apple.com>
3330
3331         Add Settings::developerExtrasEnabled
3332
3333         Reviewed by Tim.
3334
3335         * WebCore.exp:
3336         * page/Settings.cpp:
3337         * page/Settings.h:
3338
3339 2007-07-17  Justin Garcia  <justin.garcia@apple.com>
3340
3341         Reviewed by Antti.
3342
3343         <rdar://problem/5206311> 
3344         Whitespace can't be removed when editing text pasted into from web page
3345         
3346         The whitespace comes from table rows that aren't being removed after they are
3347         emptied out during a deletion.
3348
3349         * editing/DeleteSelectionCommand.cpp:
3350         (WebCore::isTableCell):
3351         (WebCore::isTableRow):
3352         (WebCore::isTableCellEmpty):
3353         (WebCore::isTableRowEmpty):
3354         (WebCore::DeleteSelectionCommand::initializePositionData): Remember the table
3355         rows that contained the start and end of the selection.
3356         (WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows):
3357         Remove table rows that come before the end of the selection
3358         that was removed (except for the row that contained the start of the selection
3359         and any before that).
3360         Remove table rows that are come after the start of the selection
3361         that was removed (except for the row that contained the end of the selection
3362         and any after that).
3363         (WebCore::DeleteSelectionCommand::doApply): Call the new function.
3364         * editing/DeleteSelectionCommand.h:
3365
3366 2007-07-17  Geoffrey Garen  <ggaren@apple.com>
3367
3368         Reviewed by Kevin Decker.
3369
3370         Removed ASSERT that was breaking the pageout test. It's trivial to
3371         reproduce this ASSERT when navigating between pages that change their
3372         names, but nothing bad seems to happen.
3373
3374         * page/Page.cpp:
3375         (WebCore::Page::goToItem):
3376
3377 2007-07-17  Geoffrey Garen  <ggaren@apple.com>
3378
3379         Build fix.
3380         
3381         * plugins/win/PluginViewWin.cpp: Pass false for lockHistory like we
3382         do elsewhere.
3383
3384 2007-07-17  Holger Hans Peter Freyther  <zecke@selfish.org>
3385
3386         Reviewed by Maciej.
3387
3388         Implement the callback responsible for handling HTTP headers. This
3389         callback gets called for every header.
3390         We will add these headers to our ResourceResponse and on the 'end-of-header'
3391         indicator we will update the ResourceResponse and dispatch it.
3392
3393         This patch adds various set methods to ResourceResponse. This improves
3394         the readability of the headerCallback and avoids storing a CURL handle inside
3395         the ResourceResponse which would be needed to implement ResourceResponse::doUpdateResourceResponse
3396
3397         Add a destructor for ResourceHandleManager which would free the resources and remove
3398         a unused variable.
3399
3400         * platform/network/ResourceHandleInternal.h:
3401         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3402         * platform/network/ResourceResponse.cpp:
3403         (WebCore::ResourceResponse::setUrl):
3404         (WebCore::ResourceResponse::setMimeType):
3405         (WebCore::ResourceResponse::setExpectedContentLength):
3406         (WebCore::ResourceResponse::setTextEncodingName):
3407         (WebCore::ResourceResponse::setSuggestedFilename):
3408         * platform/network/ResourceResponse.h:
3409         * platform/network/curl/ResourceHandleCurl.cpp:
3410         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
3411         * platform/network/curl/ResourceHandleManager.cpp:
3412         (WebCore::ResourceHandleManager::~ResourceHandleManager):
3413         (WebCore::ResourceHandleManager::sharedInstance):
3414         (WebCore::headerCallback):
3415         * platform/network/curl/ResourceHandleManager.h:
3416
3417 2007-07-17  Sam Weinig  <sam@webkit.org>
3418
3419         Reviewed by Adam Roben.
3420
3421         Convert JS undefined to the empty string when calling alert, confirm, and prompt. 
3422
3423         Test: fast/dom/Window/alert-undefined.html
3424
3425         * page/DOMWindow.idl:
3426
3427 2007-07-17  Geoffrey Garen  <ggaren@apple.com>
3428
3429         Reviewed by Kevin McCulough.
3430
3431         Fixed failing layout test.
3432         
3433         Renamed "FrameLoadTypeInternal" to "FrameLoadTypeRedirectWithLockedHistory".
3434         This is almost certainly not a correct name for the original intent
3435         of this load type, but it's a correct name for its current behavior.
3436         
3437         (WebCore::FrameLoader::updateHistoryForRedirectWithLockedHistory):
3438         When history is supposed to be locked, and no current history item
3439         exists, only add a new history item if you're the top-level frame.
3440         
3441         This rule, combined with the rule that setting iframe.src should not
3442         create a history item, is pretty hackish. On the other hand, it
3443         matches WinIE and doesn't cause any test regressions. So I'm OK with
3444         it as a short-term solution until the solution described in 
3445         <rdar://problem/5339292> can be implemented.
3446
3447 2007-07-17  Tristan O'Tierney  <tristan@apple.com>
3448
3449         Reviewed by Maciej Stachowiak.
3450
3451         <rdar://problem/5294691> Source of file is misrepresented if downloaded by typing in URL in Safari address bar
3452
3453         * loader/FrameLoaderClient.h:
3454         * loader/MainResourceLoader.cpp:        
3455         (WebCore::MainResourceLoader::continueAfterContentPolicy):
3456         Added an extra request parameter, initialRequest, to the download() method
3457         by passing up the resource handle's request.
3458         
3459         * platform/graphics/svg/SVGImageEmptyClients.h:
3460         (WebCore::SVGEmptyFrameLoaderClient::download):
3461         Added an extra parameter to the empty SVG download method.
3462         
3463 2007-07-17  Antti  <antti@apple.com>
3464
3465         Reviewed by home-bradee.
3466
3467         <rdar://problem/5336372>
3468         Icon database uses too much memory
3469         
3470         XRaying Safari startup memory consumption revealed that icon database is eating quite
3471         a bit of RAM if Icon.db is large (which it probably is if it has been in use for a while, 
3472         mine used for getting figures below was 2.6MB). 
3473         
3474         Note that the wins are less impressive with smaller Icon.db.
3475         
3476         This patch addresses three separate issues
3477         
3478         - SQLite fails to free the memory used by temporary tables. Icon database uses a temporary table
3479           on startup for pruning unused page urls. This wastes around 1MB. Addressed by rewriting
3480           pruning so it does not need a temporary table. The new method is also quite a bit faster speeding
3481           up Safari launch time by around 100ms
3482         - SQLite has it's own memory cache limited by default to 3MB. Icon database does not really need that much.
3483           Dropped the cache size to 300kB saving ~1MB on startup. 
3484           Smaller cache slows down startup by ~30ms (more than compensated by faster pruning above)
3485         - Don't populate m_pageURLToIconURLMap with all urls from database on startup, instead let it get populated
3486           when urls are accessed (user opens history menu for example). This shouldn't have any real performance impact 
3487           as the accesses are icon loads that need to hit the database anyway. This saves ~700kB.
3488           
3489         All in all with this Icon.db these changes reduce allocated memory by around 2.7MB on startup. Release build
3490         Safari RPRVT (empty start page) goes from 12.4MB to 10.4MB (TCMalloc pooling probably explaining why the win 
3491         looks bit smaller here).
3492
3493         * loader/icon/IconDatabase.cpp:
3494         (WebCore::IconDatabase::IconDatabase):
3495         (WebCore::IconDatabase::open):
3496         (WebCore::IconDatabase::deleteAllPreparedStatements):
3497         (WebCore::IconDatabase::retainIconForPageURL):
3498         (WebCore::IconDatabase::releaseIconForPageURL):
3499         (WebCore::IconDatabase::establishIconIDForIconURL):
3500         (WebCore::IconDatabase::pruneUnretainedIconsOnStartup):
3501         * loader/icon/IconDatabase.h:
3502
3503 2007-07-17  Darin Adler  <darin@apple.com>
3504
3505         Reviewed by Mitz.
3506
3507         - fix http://bugs.webkit.org/show_bug.cgi?id=14569
3508           Repro crash due to saved state not being cleared when select and textarea elements
3509           are adopted by another document
3510
3511         Test: fast/forms/saved-state-adoptNode-crash.html
3512
3513         * dom/Document.h:
3514         (WebCore::Document::registerFormElementWithState): Updated parameter type to be
3515         HTMLFormControlElementWithState.
3516         (WebCore::Document::unregisterFormElementWithState): Ditto.
3517         Also removed isFormElementRegistered function and changed the type of the
3518         m_formElementsWithState ListHashSet.
3519         * dom/Document.cpp: (WebCore::Document::formElementsState): Updated to use new type,
3520         for set contents and to use new saveState() function and only save state for elements
3521         that return true.
3522
3523         * html/HTMLGenericFormElement.h: Added HTMLFormControlElementWithState class,
3524         derived from HTMLGenericFormElement, and moved down all the behavior related to
3525         saving form control element state. Also removed the unnecessary default parameter
3526         to the HTMLGenericFormElement constructor.
3527         * html/HTMLGenericFormElement.cpp:
3528         (WebCore::HTMLFormControlElementWithState::HTMLFormControlElementWithState): Added.
3529         Calls registerFormElementWithState.
3530         (WebCore::HTMLFormControlElementWithState::~HTMLFormControlElementWithState): Added.
3531         Calls unregisterFormElementWithState.
3532         (WebCore::HTMLFormControlElementWithState::willMoveToNewOwnerDocument): Added.
3533         Calls unregisterFormElementWithState.
3534         (WebCore::HTMLFormControlElementWithState::didMoveToNewOwnerDocument): Added.
3535         Calls registerFormElementWithState.
3536         (WebCore::HTMLFormControlElementWithState::closeRenderer): Moved to this class from
3537         the base class.
3538
3539         * html/HTMLInputElement.h: Updated the base class name and overrode saveState instead
3540         of stateValue.
3541         * html/HTMLInputElement.cpp: Updated the base class name.
3542         (WebCore::HTMLInputElement::init): Removed the call to registerFormElementWithState.
3543         (WebCore::HTMLInputElement::~HTMLInputElement): Removed the call to
3544         unregisterFormElementWithState. Also changed the code to only call the
3545         unregisterForDidRestoreFromCacheCallback function for type PASSWORD (consistency
3546         and efficiency).
3547         (WebCore::HTMLInputElement::setInputType): Removed calls to registerFormElementWithState
3548         and unregisterFormElementWithState; we now let the element stay registered and simply
3549         don't save or restore state for password fields.
3550         (WebCore::HTMLInputElement::saveState): Updated function name and signature to replace
3551         the old stateValue function. Returns false for password fields.
3552         (WebCore::HTMLInputElement::willMoveToNewOwnerDocument): Removed the call to
3553         unregisterFormElementWithState.
3554         (WebCore::HTMLInputElement::didMoveToNewOwnerDocument): Removed the call to
3555         registerFormElementWithState.
3556
3557         * html/HTMLSelectElement.h: Updated the base class name and overrode saveState instead
3558         of stateValue.
3559         * html/HTMLSelectElement.cpp: Updated the base class name.
3560         (WebCore::HTMLSelectElement::HTMLSelectElement): Removed the call to
3561         registerFormElementWithState.
3562         (WebCore::HTMLSelectElement::~HTMLSelectElement): Removed the call to
3563         unregisterFormElementWithState.
3564         (WebCore::HTMLSelectElement::saveState): Updated function name and signature to
3565         replace the old stateValue function.
3566         (WebCore::HTMLSelectElement::setLength): Updated to use document() instead of
3567         ownerDocument(); the latter is just a slower virtual-function way of doing the
3568         same thing in all cases except for Document and XPathNamespace.
3569
3570         * html/HTMLTextAreaElement.h: Update the base class name, overrode saveState instead
3571         of stateValue, and removed the now-unnecessary explicit destructor.
3572         * html/HTMLTextAreaElement.cpp: Updated the base class name.
3573         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Removed the call to
3574         registerFormElementWithState.
3575         (WebCore::HTMLTextAreaElement::saveState): Updated function name and signature to replace
3576         the old stateValue function.