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