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