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