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