2007-12-22 Alp Toker <alp@atoker.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2007-12-22  Alp Toker  <alp@atoker.com>
2
3         GTK+ build fix
4
5         GTK_TARGET_OTHER_APP is not available in older GTK+ versions. Pass
6         empty target flags for now.
7
8         Check GTK+, not GLib versions, since they are different.
9
10         * platform/gtk/PasteboardGtk.cpp:
11         (WebCore::Pasteboard::documentFragment):
12
13 2007-12-22  Luca Bruno  <lethalman88@gmail.com>
14
15         Reviewed by Alp Toker.
16
17         http://bugs.webkit.org/show_bug.cgi?id=16311
18         [Gtk] Copy rich text to clipboard as text/plain and text/html.
19
20         Hook into the WebView to get the correct clipboard object on the
21         appropriate display. This is necessary because GTK+ does not have
22         global clipboards.
23
24         * WebCore.pro:
25         * platform/Pasteboard.h:
26         (WebCore::Pasteboard::setHelper): added for GTK
27         (WebCore::Pasteboard::m_helper): private added for GTK
28         * platform/gtk/PasteboardGtk.cpp:
29         (WebCore::PasteboardSelectionData): added to support GTK selection data callback
30         (WebCore::clipboard_get_contents_cb): added
31         (WebCore::clipboard_clear_contents_cb): added
32         (WebCore::Pasteboard::~Pasteboard):
33         (WebCore::Pasteboard::setHelper):
34         (WebCore::Pasteboard::writeSelection): copy rich text
35         (WebCore::Pasteboard::documentFragment): 
36         (WebCore::Pasteboard::plainText): 
37         * platform/gtk/PasteboardHelper.h: Added.
38
39 2007-12-22  Nikolas Zimmermann  <zimmermann@kde.org>
40
41         Reviewed by Oliver.
42
43         Fixes: http://bugs.webkit.org/show_bug.cgi?id=15966 (Crash in SVGRootInlineBox::walkTextChunks() on mouse hover)
44
45         Add new isSVGRootInlineBox() function to InlineBox to be able to differentiate between RootInlineBox/SVGRootInlineBox.
46         SVG assumed it's root inline box (for <text> elements) is always of type SVGRootInlineBox, which is not the case
47         for HTML text in <foreignObject>. Text selection doesn't work so far as line box offsets are wrong - which is visible
48         in Web Inspector.
49
50         * rendering/InlineBox.h:
51         (WebCore::InlineBox::isSVGRootInlineBox):
52         * rendering/SVGInlineTextBox.cpp:
53         (WebCore::SVGInlineTextBox::svgRootInlineBox):
54         (WebCore::SVGInlineTextBox::closestCharacterToPosition):
55         (WebCore::SVGInlineTextBox::selectionRect):
56         * rendering/SVGRenderTreeAsText.cpp:
57         (WebCore::writeSVGInlineTextBox):
58         * rendering/SVGRootInlineBox.h:
59         (WebCore::SVGRootInlineBox::isSVGRootInlineBox):
60
61 2007-12-22  Alp Toker  <alp@atoker.com>
62
63         LOW_BANDWIDTH_DISPLAY build fix
64
65         Track recent KURL DeprecatedString changes.
66
67         * loader/FrameLoader.cpp:
68         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
69
70 2007-12-22  Dan Bernstein  <mitz@apple.com>
71
72         - Windows build fix
73
74         * WebCore.vcproj/WebCore.vcproj:
75
76 2007-12-22  Xan Lopez  <xan@gnome.org>
77
78         Reviewed by Alp Toker.
79
80         Add missing return 0 to fix a compile warning.
81
82         * page/gtk/FrameGtk.cpp:
83         (WebCore::Frame::createScriptInstanceForWidget):
84
85 2007-12-21  Antti Koivisto  <antti@apple.com>
86
87         Reviewed by Darin, Adam and Steve.
88
89         Add media playback support for Windows.
90         
91         The implementation uses low level QuickTime API. DLL is
92         needed to work around CF use in both WebKit and QuickTime.
93         
94         This makes Windows build depend on the QuickTime SDK 
95         
96         http://developer.apple.com/quicktime/download/
97         
98         but not QuickTime itself.
99         
100         QTMovieWinTimer contains some copy code from SharedTimerWin. It
101         is used in the QuickTime access DLL which can't use WebCore
102         SharedTimer due to dependency problems.
103
104         * WebCore.vcproj/QTMovieWin.vcproj: Added.
105         * WebCore.vcproj/WebCore.vcproj:
106         * WebCore.vcproj/build-generated-files.sh:
107         * html/HTMLMediaElement.cpp:
108         (WebCore::HTMLMediaElement::setSrc):
109         * platform/graphics/MediaPlayer.cpp:
110         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp: Added.
111         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
112         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
113         (WebCore::MediaPlayerPrivate::load):
114         (WebCore::MediaPlayerPrivate::play):
115         (WebCore::MediaPlayerPrivate::pause):
116         (WebCore::MediaPlayerPrivate::duration):
117         (WebCore::MediaPlayerPrivate::currentTime):
118         (WebCore::MediaPlayerPrivate::seek):
119         (WebCore::MediaPlayerPrivate::doSeek):
120         (WebCore::MediaPlayerPrivate::cancelSeek):
121         (WebCore::MediaPlayerPrivate::seekTimerFired):
122         (WebCore::MediaPlayerPrivate::setEndTime):
123         (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
124         (WebCore::MediaPlayerPrivate::endPointTimerFired):
125         (WebCore::MediaPlayerPrivate::paused):
126         (WebCore::MediaPlayerPrivate::seeking):
127         (WebCore::MediaPlayerPrivate::naturalSize):
128         (WebCore::MediaPlayerPrivate::hasVideo):
129         (WebCore::MediaPlayerPrivate::setVolume):
130         (WebCore::MediaPlayerPrivate::setMuted):
131         (WebCore::MediaPlayerPrivate::setRate):
132         (WebCore::MediaPlayerPrivate::dataRate):
133         (WebCore::MediaPlayerPrivate::maxTimeBuffered):
134         (WebCore::MediaPlayerPrivate::maxTimeSeekable):
135         (WebCore::MediaPlayerPrivate::maxTimeLoaded):
136         (WebCore::MediaPlayerPrivate::bytesLoaded):
137         (WebCore::MediaPlayerPrivate::totalBytesKnown):
138         (WebCore::MediaPlayerPrivate::totalBytes):
139         (WebCore::MediaPlayerPrivate::cancelLoad):
140         (WebCore::MediaPlayerPrivate::updateStates):
141         (WebCore::MediaPlayerPrivate::didEnd):
142         (WebCore::MediaPlayerPrivate::setRect):
143         (WebCore::MediaPlayerPrivate::setVisible):
144         (WebCore::MediaPlayerPrivate::paint):
145         (WebCore::MediaPlayerPrivate::getSupportedTypes):
146         (WebCore::MediaPlayerPrivate::movieEnded):
147         (WebCore::MediaPlayerPrivate::movieLoadStateChanged):
148         (WebCore::MediaPlayerPrivate::movieTimeChanged):
149         (WebCore::MediaPlayerPrivate::movieNewImageAvailable):
150         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h: Added.
151         (WebCore::MediaPlayerPrivate::networkState):
152         (WebCore::MediaPlayerPrivate::readyState):
153         * platform/graphics/win/QTMovieWin.cpp: Added.
154         (updateTaskTimer):
155         (QTMovieWinPrivate::QTMovieWinPrivate):
156         (QTMovieWinPrivate::~QTMovieWinPrivate):
157         (taskTimerFired):
158         (QTMovieWinPrivate::startTask):
159         (QTMovieWinPrivate::endTask):
160         (QTMovieWinPrivate::task):
161         (QTMovieWinPrivate::registerDrawingCallback):
162         (QTMovieWinPrivate::drawingComplete):
163         (QTMovieWinPrivate::createGWorld):
164         (QTMovieWinPrivate::setSize):
165         (QTMovieWinPrivate::deleteGWorld):
166         (QTMovieWin::QTMovieWin):
167         (QTMovieWin::~QTMovieWin):
168         (QTMovieWin::play):
169         (QTMovieWin::pause):
170         (QTMovieWin::rate):
171         (QTMovieWin::setRate):
172         (QTMovieWin::duration):
173         (QTMovieWin::currentTime):
174         (QTMovieWin::setCurrentTime):
175         (QTMovieWin::setVolume):
176         (QTMovieWin::setMuted):
177         (QTMovieWin::dataSize):
178         (QTMovieWin::maxTimeLoaded):
179         (QTMovieWin::loadState):
180         (QTMovieWin::getNaturalSize):
181         (QTMovieWin::setSize):
182         (QTMovieWin::setVisible):
183         (QTMovieWin::paint):
184         (QTMovieWin::load):
185         (movieDrawingCompleteProc):
186         (initializeSupportedTypes):
187         (QTMovieWin::countSupportedTypes):
188         (QTMovieWin::getSupportedType):
189         (QTMovieWin::initializeQuickTime):
190         (DllMain):
191         * platform/graphics/win/QTMovieWin.h: Added.
192         * platform/graphics/win/QTMovieWinTimer.cpp: Added.
193         (TimerWindowWndProc):
194         (initializeOffScreenTimerWindow):
195         (setSharedTimerFiredFunction):
196         (timerFired):
197         (setSharedTimerFireDelay):
198         (stopSharedTimer):
199         (setSharedTimerInstanceHandle):
200         (systemTime):
201         * platform/graphics/win/QTMovieWinTimer.h: Added.
202         * rendering/RenderMedia.cpp:
203         (WebCore::MediaControlPlayButtonElement::update):
204
205 2007-12-21  Brent Fulgham  <bfulgham@gmail.com>
206
207         Reviewed by Alp Toker.
208
209         http://bugs.webkit.org/show_bug.cgi?id=16558
210         Cairo WebCore Rendering Fails on arc drawing
211
212         Fix for bug reported (and patched) by Apollo team in which
213         arcs were draw in reverse (resulting in inverted images).
214         Review of the source found that the 'clockwise' term was
215         actually meant to mean 'anticlockwise' so the IDL and
216         supporting classes have been changed to match this. 
217
218         * html/CanvasRenderingContext2D.cpp:
219         (WebCore::CanvasRenderingContext2D::arc):
220         * html/CanvasRenderingContext2D.idl:
221         * platform/graphics/cairo/PathCairo.cpp:
222         (WebCore::Path::addArc):
223         (WebCore::Path::addEllipse):
224         * platform/graphics/Path.h:
225
226 2007-12-21  Alexey Proskuryakov  <ap@webkit.org>
227
228         Reviewed by Oliver.
229
230         <rdar://problem/5629995> Incorrect display of Danish characters on web site.
231
232         Test: http/tests/xmlhttprequest/response-encoding.html
233
234         * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::didReceiveData):
235         Default to UTF-8 for HTML, too. It's unfortunate that we have to use different
236         rules for main content and XHR responses, but this matches both IE and Firefox.
237
238 2007-12-20  Jon Honeycutt  <jhoneycutt@apple.com>
239
240         Reviewed by Kevin Decker.
241
242         <rdar://problem/5655797> REGRESSION(304-306A10) Safari does not find
243         shockwave plugin on freshly installed OS
244
245         Look for Director plugin in its native directory.
246
247         * plugins/win/PluginDatabaseWin.cpp:
248         (WebCore::PluginDatabaseWin::getPluginsInPaths): The Director plugin
249         doesn't start with "np," so special case its filename.
250         (WebCore::addMacromediaPluginPaths): Add Flash and "Shockwave 10"
251         directories to the plugin paths.
252         (WebCore::PluginDatabaseWin::defaultPluginPaths):
253
254 2007-12-20  Peter Kasting  <zerodpx@gmail.com>
255
256         Reviewed by Alp Toker.
257
258         http://bugs.webkit.org/show_bug.cgi?id=16508
259         Fix regression in GIFImageDecoder.cpp: "Haeberli hack" led to wrongly
260         decoded transparent areas.
261
262         * platform/image-decoders/gif/GIFImageDecoder.cpp:
263         (WebCore::GIFImageDecoder::haveDecodedRow):
264         * platform/image-decoders/gif/GIFImageDecoder.h:
265         * platform/image-decoders/gif/GIFImageReader.cpp:
266         (GIFImageReader::output_row):
267
268 2007-12-20  Justin Garcia  <justin.garcia@apple.com>
269
270         Reviewed by Oliver Hunt.
271
272         <rdar://problem/5543472> GoogleDocs: Safari hangs when creating a list from a particular selection
273         
274         Still need to fix similar issues with the other operations that iterate 
275         over selected paragraphs, like FormatBlock, Indent and Outdent (<rdar://problem/5658933>).
276
277         * editing/IndentOutdentCommand.cpp:
278         (WebCore::IndentOutdentCommand::indentRegion): Added a FIXME.
279         * editing/IndentOutdentCommand.h: Removed an unused function.
280         * editing/InsertListCommand.cpp:
281         (WebCore::InsertListCommand::modifyRange): 
282         Renamed visibleStart to startOfSelection and visibleEnd to endOfSelection.
283         Call the new selectionForParagraphIteration, which a) prevents operations like this
284         one from being performed on a table that isn't fully selected (where the selection
285         starts just before the table and ends inside it), and b) helps prevent paragraph
286         iteration from going past the end of the selection.
287         Call the new startOfNextParagraph, instead of using endOfParagraph(v).next(),
288         since when v is in the last paragraph of the last cell of a table, that expression 
289         will return the position after the table, not the start of the next paragraph.
290         * editing/htmlediting.cpp:
291         (WebCore::enclosingListChild): Don't go above a table cell, so that list operations
292         take effect inside the table cell where they are performed.
293         (WebCore::selectionForParagraphIteration): Added, see above.
294         (WebCore::indexForVisiblePosition): Moved from IndentOutdentCommand.cpp.
295         * editing/htmlediting.h:
296         * editing/visible_units.cpp:
297         (WebCore::startOfNextParagraph): Added, see above.
298         * editing/visible_units.h:
299         * editing/TextIterator.h:
300         (WebCore::TextIterator::exitNode): Added a FIXME.
301
302 2007-12-20  Alp Toker  <alp@atoker.com>
303
304         Rubber-stamped by Maciej.
305
306         http://bugs.webkit.org/show_bug.cgi?id=16542
307         [GTK] Text is missing with old Pango version
308
309         Back out commits r28880, r28876, r28865, r28864 which added Pango font
310         selection support. These changes caused a regression where no text was
311         displayed with older Pango versions.
312
313         * platform/graphics/gtk/FontCacheGtk.cpp:
314         (WebCore::FontCache::fontExists):
315         * platform/graphics/gtk/FontDataGtk.cpp:
316         (WebCore::FontData::platformDestroy):
317         (WebCore::FontData::containsCharacters):
318         * platform/graphics/gtk/FontPlatformData.h:
319         (WebCore::FontPlatformData::FontPlatformData):
320         (WebCore::FontPlatformData::hash):
321         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
322         (WebCore::FontPlatformData::FontPlatformData):
323         (WebCore::FontPlatformData::init):
324         (WebCore::FontPlatformData::~FontPlatformData):
325         (WebCore::FontPlatformData::isFixedPitch):
326         (WebCore::FontPlatformData::operator==):
327         * platform/graphics/gtk/GlyphPageTreeNodeGtk.cpp:
328         (WebCore::GlyphPage::fill):
329
330 2007-12-20  Timothy Hatcher  <timothy@apple.com>
331
332         Reviewed by Sam Weinig.
333
334         <rdar://problem/5604897> Double-clicking on JavaScript console error
335         won't show the line where it occurred
336
337         Make the URLs clickable in the console, since double clicking is used for
338         word text selection. Makes the word "line" localizable. Messages that don't
339         have a URL will no longer print "undefined". Messages that have a line number
340         less than or equal to 0 will no longer be printed.
341
342         * English.lproj/InspectorLocalizedStrings.js: Add "%s (line %d)".
343         * page/inspector/ConsolePanel.js: Tweak how the DOM nodes are created
344           and change the click handler to look for a link with the
345           "console-message-url" class name.
346         * page/inspector/SourcePanel.js: Call setupSourceFrameIfNeeded() if a
347           line row is needed. 
348         * page/inspector/inspector.css: Update the look of the URL in the console.
349
350 2007-12-20  Adam Barth  <hk9565@gmail.com>
351
352         Reviewed and landed by Sam Weinig.
353
354         http://bugs.webkit.org/show_bug.cgi?id=15313
355         <rdar://problem/5514516>
356
357         The same-origin check was incorrect in two cases (both fixed in this
358         patch):
359
360         A) If both the source and the target have set their document.domain
361            to the same value, the protocol must also match in order for
362            access to be allowed.  Without this requirement, the browser is
363            vulnerable to the following attack:
364
365            1) Suppose there is an HTTPS site (www.example.com) that sets
366               document.domain = "example.com".
367            2) A network attacker redirects the browser to http://www.example.com/
368               a) injects script to set document.domain = "example.com", and
369               b) opens a window to https://www.example.com/
370            3) Now the network attacker can inject script into the HTTPS page,
371               stealing cookies and issuing banking transactions.
372
373         B) If only one of the source and target has set document.domain, then
374            access should be denied.  With this behavior, the browser is
375            vulnerable to the following attack:
376
377            1) Suppose http://foo.example.com/ opens an iframe to
378               http://foo.example.com/frame.html that
379               a) sets document.domain = "example.com", and
380               b) opens an iframe to http://bar.example.com/
381               This is a common usage of document.domain for cross-domain
382               communication, see for example:
383                 http://www.collinjackson.com/research/papers/fp801-jackson.pdf
384            2) The inner-most iframe, which is from bar.example.com, sets
385               document.domain = "example.com".
386            3) Now the inner-most iframe can inject script into the middle
387               iframe (say via document.write).  This bar.example.com script
388               now has access to the outer-most frame (from foo.example.com).
389
390         Both these changes cause WebKit to match the behavior of Firefox 2 and
391         IE6 in these cases.  This patch includes regression tests for both
392         issues.
393
394         Internet Explorer 7 and Opera 9 are more strict in that they require
395         the port numbers to match when both pages have document.domain set.
396         Opera 9 allows access when only one page has set document.domain, but
397         this is a security vulnerability.
398
399         Tests: http/tests/security/cross-frame-access-child-explicit-domain.html
400                http/tests/security/cross-frame-access-parent-explicit-domain.html
401
402         * bindings/js/kjs_window.cpp:
403         (KJS::createWindow):
404         (KJS::Window::allowsAccessFrom):
405         * dom/Document.cpp:
406         (WebCore::Document::domain):
407         (WebCore::Document::setDomain):
408         (WebCore::Document::initSecurityOrigin):
409         * dom/Document.h:
410         (WebCore::Document::securityOrigin):
411         * loader/FrameLoader.cpp:
412         (WebCore::FrameLoader::begin):
413         (WebCore::FrameLoader::checkCallImplicitClose):
414         (WebCore::FrameLoader::shouldAllowNavigation):
415         * platform/SecurityOrigin.cpp:
416         (WebCore::SecurityOrigin::setForURL):
417         (WebCore::SecurityOrigin::createForFrame):
418         (WebCore::SecurityOrigin::canAccess):
419         * platform/SecurityOrigin.h:
420         (WebCore::SecurityOrigin::domain):
421         * storage/Database.cpp:
422         (WebCore::Database::openDatabase):
423         (WebCore::Database::Database):
424         (WebCore::Database::securityOriginData):
425         * storage/Database.h:
426         (WebCore::Database::databaseDebugName):
427         * storage/DatabaseTracker.cpp:
428         (WebCore::DatabaseTracker::canEstablishDatabase):
429         * storage/SQLTransaction.cpp:
430         (WebCore::SQLTransaction::postflightAndCommit):
431         (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
432
433 2007-12-20  Rodney Dawes  <dobey@wayofthemonkey.com>
434
435         Reviewed by Darin Adler.
436
437         Define XP_UNIX when building with plugins on X11.
438         Use new npruntime_internal.h instead of npruntime.h.
439         http://bugs.webkit.org/show_bug.cgi?id=15669
440
441         * ForwardingHeaders/bindings/npruntime_internal.h
442         * WebCore.pro:
443         * html/HTMLPlugInElement.h:
444
445 2007-12-19  johnnyding.webkit  <johnnyding.webkit@gmail.com>
446
447         Reviewed by Alexey. Landed by Stephanie.
448
449         - fix http://bugs.webkit.org/show_bug.cgi?id=16179 | <rdar://problem/5619399>
450           Any attribute name start with a unicode which like #xx00(x could be any hex number[0-9a-f]) will cause HTMLTokenizer parse error
451           Actually any unicode characters which great than 255 in attribute name will cause Webkit parse the attribute name wrong. So after comparing 
452           the same scenario in IE 6/7, FireFox 2/3, Opera, we should treat those characters as part of attribute name.
453
454
455         * html/HTMLTokenizer.cpp:
456         (WebCore::HTMLTokenizer::parseEntity): Handle Unicode Entity Name by using ASCII version of findEntity.
457         (WebCore::HTMLTokenizer::parseTag): Let type of ptr match type of cBuffer.
458         * html/HTMLTokenizer.h: Change type of cBuffer from char to UChar.
459
460 2007-12-20  Eric Seidel  <eric@webkit.org>
461
462         Reviewed by Nikolas Zimmermann.
463
464         WebKit claims to support SVG feature strings it shouldn't
465         http://bugs.webkit.org/show_bug.cgi?id=15480
466
467         * dom/DOMImplementation.cpp:
468         (WebCore::isSVG10Feature):
469         (WebCore::isSVG11Feature):
470
471 2007-12-20  John Sullivan  <sullivan@apple.com>
472
473         Reviewed by Oliver and Geoff
474         
475         - fix <rdar://problem/5536858> Yellow highlight for find results is sometimes shorter 
476           than white "hole" behind it
477
478         * rendering/RenderText.cpp:
479         (WebCore::RenderText::addLineBoxRects):
480         respect useSelectionHeight in all cases; we were only respecting it in one of the two cases
481
482 2007-12-20  Dan Bernstein  <mitz@apple.com>
483
484         Reviewed by Darin Adler.
485
486         - fix <rdar://problem/5656368> REGRESSION(3.0.4-ToT): Acid2 test fails to render anything
487
488         * platform/win/ScrollViewWin.cpp:
489         (WebCore::ScrollView::maximumScroll): Changed back to return the maximum
490         scroll offsets even if scrolling is not allowed, because navigation and
491         scrollTo should still work.
492         (WebCore::ScrollView::wheelEvent): Added early return if scrolling is
493         not allowed.
494
495 2007-12-17  Tony Chang  <idealisms@gmail.com>
496
497         Reviewed by Darin.
498
499         - Fix for http://bugs.webkit.org/show_bug.cgi?id=16479
500           text selection does not always begin at mouse down point
501           Reset the m_dragSrc object on mouse down on all platforms.
502
503         Test: fast/text/reset-drag-on-mouse-down.html
504
505         * page/EventHandler.cpp:
506         (WebCore::EventHandler::handleMousePressEvent):
507         * page/mac/EventHandlerMac.mm:
508         (WebCore::EventHandler::mouseDown):
509
510 2007-12-19  Geoffrey Garen  <ggaren@apple.com>
511
512         Reviewed by Oliver Hunt.
513
514         Build support:
515         * ForwardingHeaders/kjs/SymbolTable.h: Added.
516         * ForwardingHeaders/wtf/VectorTraits.h: Added.
517
518         * bindings/js/JSDOMWindowCustom.cpp:
519         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Replaced use of
520         getDirectLocation with getOwnPropertySlot. getDirectLocation is no
521         longer valid, since global declarations are not stored in the property
522         map.
523
524         (WebCore::JSDOMWindow::customPut): Replaced use of JSObject::put with
525         JSGlobalObject::put. JSObject::put is no longer valid, since global
526         declarations are not stored in the property map.
527
528         * bindings/js/kjs_window.cpp: Replaced JSObject:: calls with Base::
529         calls, since JSObject is not our base class. This was always a bug, but
530         the bug is even more apparent after some of my changes.
531
532         (KJS::Window::clear): Removed call to clearProperties because
533         JSGlobalObject::reset takes care of that now.
534
535         * history/CachedPage.cpp:
536         * history/CachedPage.h: Added support for saving a symbol table and
537         localStorage to the page cache, and restoring it.
538
539 2007-12-19  Dan Bernstein  <mitz@apple.com>
540
541         Reviewed by Darin Adler and Dave Hyatt.
542
543         - Substitute the user's preferred standard font for an unknown primary
544           font before falling back on the platform's last resort font
545
546         Cannot be tested in DumpRenderTree because it sets the standard font to
547         Times, which is also the hard-coded last resort font on Mac.
548
549         * css/CSSFontSelector.cpp:
550         (WebCore::CSSFontSelector::getFontData): Changed the early bail out
551         condition to allow getting generic font families from settings even if
552         there are not @font-face rules. Fixed a typo that mapped fantasy to
553         cursive. Added a mapping from -webkit-standard to the standard family.
554         * css/CSSStyleSelector.cpp:
555         (WebCore::CSSStyleSelector::CSSStyleSelector): Changed to always create
556         a font selector.
557         (WebCore::CSSRuleSet::addRulesFromSheet):
558         (WebCore::CSSStyleSelector::applyProperty): Changed to always use the
559         font selector.
560         * css/CSSStyleSelector.h:
561         (WebCore::CSSStyleSelector::fontSelector):
562         * platform/graphics/FontCache.cpp:
563         (WebCore::FontCache::getFontData): Try the user's preferred standard
564         font before the platform's last resort font.
565
566 2007-12-19  Sven Herzberg  <sven@imendio.com>
567
568         Reviewed by Alp Toker.
569
570         Scaled font destruction takes place in FontData::platformDestroy(). No
571         need to do it in FontPlatformData::~FontPlatformData().
572
573         Destroying platform data in platformDestroy() is a convention we
574         borrow from the Mac and Win ports.
575
576         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
577
578 2007-12-19  Alice Liu  <alice.liu@apple.com>
579
580         build fix (Windows)
581
582         Changed uint to unsigned int.  uint caused Windows build breakage
583
584         * page/Page.cpp:
585         (WebCore::Page::markAllMatchesForText):
586         * page/Page.h:
587
588 2007-12-19  Christian Dywan  <christian@twotoasts.de> 
589
590         Reviewed by Alp Toker.
591
592         http://bugs.webkit.org/show_bug.cgi?id=16222
593         [GTK] Implement inline search and highlighting of matching strings.
594
595         Implement search and highlighting logic directly in WebCore.
596
597         * page/Page.cpp:
598         (WebCore::incrementFrame):
599         (WebCore::Page::findString):
600         (WebCore::Page::markAllMatchesForText):
601         (WebCore::Page::unmarkAllTextMatches):
602         * page/Page.h:
603
604 2007-12-19  Geoffrey Garen  <ggaren@apple.com>
605
606         Reviewed by Sam Weinig, Dan Bernstein.
607
608         Tiger build fix: restored some graphics code still needed on Tiger.
609
610         * platform/graphics/GraphicsTypes.h:
611         * platform/graphics/cg/GraphicsContextCG.cpp:
612         * platform/graphics/mac/GraphicsContextMac.mm:
613         (WebCore::GraphicsContext::setCompositeOperation):
614
615 2007-12-19  Alp Toker  <alp@atoker.com>
616
617         Build fix for Pango < 1.18.0 breakage introduced in r28864. Use Fc and
618         the Pango backend API in these cases.
619
620         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
621         (WebCore::FontPlatformData::FontPlatformData):
622         (WebCore::FontPlatformData::~FontPlatformData):
623
624 2007-12-19  Alice Liu  <alice.liu@apple.com>
625
626         Reviewed by Darin.
627
628         Fixed <rdar://problem/5592485> Safari crashed trying to get a motorcycle insurance quote
629         on Geico.com WebCore::Document::inPageCache()
630
631         Calling Node::willRemove on the focusedNode would immediately tell the document to remove
632         the focused node, and trigger JS events.  This means that the document is mutated while
633         the engine is trying to tell all child nodes that it's about to removed.  To avoid
634         crashing, we need to hold off on mutating the document until node traversal is finished.
635
636         * dom/ContainerNode.cpp:
637         (WebCore::ContainerNode::removeChild):
638         (WebCore::ContainerNode::removeChildren):
639         * dom/Node.cpp:
640         * dom/Node.h:
641         (WebCore::Node::willRemove):
642         * loader/FrameLoader.cpp:
643         (WebCore::FrameLoader::clear):
644
645 2007-12-19  Andre Boule  <aboule@apple.com>
646
647         Reviewed by Dan Bernstein.
648
649         Test: fast/canvas/canvas-composite.html
650
651         Fix for:
652         <rdar://problem/5640059> GraphicsContext::setCompositeOperation should use CGContextSetBlendMode
653
654         This fix makes setCompositeOperation consistent across all platforms that use CG.
655
656         The following compositing modes don't pass however that is covered by another bug:
657         source-in
658         source-out
659         destination-in
660         destination-atop
661         copy
662         <rdar://problem/5651783> Some canvas tag compositing modes don't render correctly
663
664         * platform/graphics/GraphicsTypes.h:
665         * platform/graphics/cg/GraphicsContextCG.cpp:
666         (WebCore::GraphicsContext::setCompositeOperation):
667         * platform/graphics/mac/GraphicsContextMac.mm:
668         * platform/win/GraphicsContextWin.cpp:
669
670 2007-12-19  Dan Bernstein  <mitz@apple.com>
671
672         Reviewed by Dave Hyatt.
673
674         - fix <rdar://problem/5650045> REGRESSION: major layout problems in svn r28754 WebKit on Vox.com page
675
676         Test: fast/dynamic/subtree-boundary-percent-height.html
677
678         * rendering/RenderObject.cpp:
679         (WebCore::objectIsRelayoutBoundary): Do not allow overflows with
680         percent heights because sometimes they compute to 'auto'.
681
682 2007-12-19  Sam Weinig  <sam@webkit.org>
683
684         Reviewed by Maciej.
685
686         http://bugs.webkit.org/show_bug.cgi?id=16511
687         Speed up ClassNodeList and NamedNodeList by using the caching mechanism employed by ChildNodeList.
688         - This give a ~2.15x speedup on the native test @ http://ejohn.org/apps/classname/
689
690         * dom/ChildNodeList.cpp: Use the caching NodeList constructor to turn on caching.
691         (WebCore::ChildNodeList::ChildNodeList):
692         * dom/ClassNodeList.cpp:
693         (WebCore::ClassNodeList::ClassNodeList):
694         * dom/ClassNodeList.h:
695
696         Move getElementsByName and getElementsByClassName to Node so they
697         can use easily employ the caching already used by ChildNodeLists.  In the case of 
698         getElementsByClassName, this reduces code duplication in Element as well
699         * dom/Document.cpp:
700         * dom/Document.h:
701
702         Move getElementsByClassName to Node.
703         * dom/Element.cpp:
704         * dom/Element.h:
705
706         * dom/NameNodeList.cpp: Use the caching NodeList constructor to turn on caching.
707         (WebCore::NameNodeList::NameNodeList):
708         (WebCore::NameNodeList::item):
709         * dom/NameNodeList.h:
710
711         Add maps of caches for ClassNodeLists and NameNodeList to NodeListsNodeData.
712         * dom/Node.cpp:
713         (WebCore::TagNodeList::TagNodeList):
714         (WebCore::Node::Node):
715         (WebCore::Node::~Node):
716         (WebCore::Node::childNodes):
717         (WebCore::Node::registerNodeList):
718         (WebCore::Node::getElementsByName):
719         (WebCore::Node::getElementsByClassName):
720         * dom/Node.h: Make m_nodeLists an OwnPtr.  Moved getElementsByName and getElementsByClassName here
721
722         Allow subclasses to choose whether they want to receive the notifications using a new bit.
723         * dom/NodeList.cpp:
724         (WebCore::NodeList::NodeList):
725         * dom/NodeList.h:
726         (WebCore::NodeList::needsNotifications):
727
728 2007-12-19  Dave Hyatt  <hyatt@apple.com>
729
730         Add support for GDI text rendering to WebKit.
731       
732         Reviewed by mitz
733         
734         * css/CSSStyleSelector.cpp:
735         (WebCore::CSSStyleSelector::applyProperty):
736         * dom/Document.cpp:
737         (WebCore::Document::recalcStyle):
738         * page/Settings.cpp:
739         (WebCore::Settings::setFontRenderingMode):
740         (WebCore::Settings::fontRenderingMode):
741         * page/Settings.h:
742         * platform/graphics/Font.h:
743         (WebCore::Font::renderingMode):
744         * platform/graphics/FontCache.cpp:
745         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
746         (WebCore::FontPlatformDataCacheKey::operator==):
747         (WebCore::computeHash):
748         (WebCore::FontCache::getCachedFontPlatformData):
749         * platform/graphics/FontDescription.h:
750         (WebCore::):
751         (WebCore::FontDescription::FontDescription):
752         (WebCore::FontDescription::renderingMode):
753         (WebCore::FontDescription::setRenderingMode):
754         (WebCore::FontDescription::operator==):
755         * platform/graphics/GraphicsContext.h:
756         * platform/graphics/win/FontCacheWin.cpp:
757         (WebCore::FontCache::fontExists):
758         (WebCore::FontCache::createFontPlatformData):
759         * platform/graphics/win/FontDataWin.cpp:
760         (WebCore::FontData::platformInit):
761         (WebCore::FontData::smallCapsFontData):
762         (WebCore::FontData::containsCharacters):
763         (WebCore::FontData::determinePitch):
764         (WebCore::FontData::platformWidthForGlyph):
765         * platform/graphics/win/FontPlatformData.h:
766         (WebCore::FontPlatformData::FontPlatformData):
767         (WebCore::FontPlatformData::useGDI):
768         (WebCore::FontPlatformData::operator==):
769         * platform/graphics/win/FontPlatformDataWin.cpp:
770         (WebCore::FontPlatformData::FontPlatformData):
771         * platform/graphics/win/FontWin.cpp:
772         (WebCore::Font::drawGlyphs):
773         * platform/graphics/win/IconWin.cpp:
774         (WebCore::Icon::paint):
775         * platform/win/GraphicsContextWin.cpp:
776         (WebCore::GraphicsContext::getWindowsContext):
777         (WebCore::GraphicsContext::releaseWindowsContext):
778         * platform/win/UniscribeController.cpp:
779         (WebCore::UniscribeController::shapeAndPlaceItem):
780         * platform/win/UniscribeController.h:
781         * plugins/win/PluginViewWin.cpp:
782         (WebCore::PluginViewWin::paint):
783
784 2007-12-19  Sven Herzberg  <sven@imendio.com>
785
786         Reviewed by Alp Toker.
787
788         Replace the fontconfig/freetype based font management with a pango
789         based one. Fixes:
790         http://bugs.webkit.org/show_bug.cgi?id=15229
791
792         * platform/gtk/FontDataGtk.cpp (FontData::platformDestroy()): updated
793         the platform specific destroy code
794         (FontData::containsCharacters()): implemented font coverage with pango
795         * platform/gtk/FontPlatformData.h: replaced fontconfig specific
796         members with pango-specific ones
797         * platform/gtk/FontPlatformDataGtk.cpp: added static members for the
798         FontPlatformData class
799         (FontPlatformData::FontPlatformData()): implemented the font-matching
800         with a PangoFontDescription instead of an FcPattern; initialize the
801         scaled font by using the API for PangoCairoFont
802         (FontPlatformData::init()): initialize the PangoFontMap and set up a
803         hash table to translate the font family name into a font family
804         (FontPlatformData::isFixedPitch()): implemented by querying the
805         PangoFontFamily
806         (FontPlatformData::operator==): compare the FontPlatformData by
807         comparing the font pointers or the described fonts
808         * platform/gtk/GlyphPageTreeNodeGtk.cpp (pango_font_get_glyph()):
809         added a function to query a glyph from a PangoFont
810         (GlyphPage::fill()): implemented the fill function with Pango instead
811         of fontconfig/freetype
812
813 2007-12-19  Alp Toker  <alp@atoker.com>
814
815         Reviewed by Holger Freyther.
816
817         Improve graphics operator approximations
818         
819         These changes match Cairo's own CG approximations.
820
821         * platform/graphics/cairo/GraphicsContextCairo.cpp:
822         (WebCore::toCairoOperator):
823
824 2007-12-19  Alp Toker  <alp@atoker.com>
825
826         Reviewed by Holger Freyther.
827
828         Check the bounding box before doing a full hit test
829
830         * platform/graphics/cairo/PathCairo.cpp:
831         (WebCore::Path::contains):
832
833 2007-12-18  Sam Weinig  <sam@webkit.org>
834
835         Reviewed by Geoff.
836
837         Fix for <rdar://problem/5646478>
838         REGRESSION: fast/events/event-view-toString fails on Leopard
839
840         This fixes an issue where we were incorrectly setting the lastInPrototypeChain
841         for the JSDOMWindow (the global object) before a call to setPrototype overwrote
842         it. This fixes it by passing the prototype up the constructor chain so that it
843         is set before any calls can be made.
844
845         * bindings/js/kjs_window.cpp:
846         (KJS::Window::Window):
847         * bindings/js/kjs_window.h:
848         * bindings/scripts/CodeGeneratorJS.pm:
849
850 2007-12-18  Beth Dakin  <bdakin@apple.com>
851
852         Reviewed by Oliver.
853
854         Fix for <rdar://problem/5616982> SVGs with width and height 100% 
855         fail to render when used as <img> or CSS image (16167)
856
857         This final part of the work fixes the <img> tag.
858
859         This is the real fix. 
860         * rendering/RenderImage.cpp:
861         (WebCore::RenderImage::calcReplacedWidth): Set the container size 
862         on the image. Setting the container size only actually sticks if 
863         the values are non-zero, so if the container size really was set, 
864         use the imageSize that is calculated using the container size. If 
865         it did not stick but the image does have relative width (meaning 
866         that the container size is 0), set the width to 0 by hand. We want 
867         to avoid setting the width before we have a container size or we 
868         will end up incorrectly using the default size of 300x150.
869         (WebCore::RenderImage::calcReplacedHeight): Same as above, but for 
870         height.
871
872         A few more pieces of information have to be exposed through cached 
873         image to make this happen.
874         * loader/CachedImage.cpp:
875         (WebCore::CachedImage::usesImageContainerSize): As mentioned above, 
876         when setContainerSize() is called, the container size is only 
877         actually set if the values are non-zero. This call tells you if it 
878         was set.
879         (WebCore::CachedImage::imageHasRelativeWidth):
880         (WebCore::CachedImage::imageHasRelativeHeight):
881         * loader/CachedImage.h:
882         * platform/graphics/Image.h:
883         (WebCore::Image::usesContainerSize):
884         * svg/graphics/SVGImage.cpp:
885         (WebCore::SVGImage::usesContainerSize):
886         * svg/graphics/SVGImage.h:
887
888 2007-12-18  Mark Rowe  <mrowe@apple.com>
889
890         Rubber-stamped by Maciej Stachowiak.
891
892         Remove outdated and non-functioning project files for the Apollo port.
893
894         * WebCore.apolloproj: Removed.
895
896 2007-12-18  Steve Falkenburg  <sfalken@apple.com>
897
898         <rdar://problem/5649911> REGRESSION (304-306A9): Typing 'p' in popup menu for type-to-select brings up Safari Help
899         
900         Need to translate the char back into a key code for posting our WM_KEYDOWN.
901         
902         Reviewed by Ada.
903
904         * platform/win/PopupMenuWin.cpp:
905         (WebCore::PopupWndProc):
906
907 2007-12-18  Steve Falkenburg  <sfalken@apple.com>
908
909         <rdar://problem/5651534> REGRESSION(r28764-r28765): GDI leak drawing text when no appropriate font is available
910         
911         Our captured metafile from Uniscribe may contain multiple calls to CreateFontIndirect.
912         Only create a font with the last one.
913         
914         Reviewed by Mitz, Darin.
915
916         * platform/graphics/win/FontCacheWin.cpp:
917         (WebCore::metaFileEnumProc):
918         (WebCore::FontCache::getFontDataForCharacters):
919
920 2007-12-17  Brent Fulgham  <bfulgham@gmail.com>
921
922         Reviewed by Darin.
923
924         http://bugs.webkit.org/show_bug.cgi?id=16464
925         Modify WebCore to use win32 thread primitives
926
927         Updates to support native windows threading primitives
928         rather than pthreads emulation library.
929
930         * WebCore.vcproj/WebCore.vcproj:
931         * config.h:
932         * platform/Threading.h:
933         * platform/win/MutexWin.cpp: Added.
934         (WebCore::Mutex::Mutex):
935         (WebCore::Mutex::~Mutex):
936         (WebCore::Mutex::lock):
937         (WebCore::Mutex::tryLock):
938         (WebCore::Mutex::unlock):
939         * platform/win/ThreadConditionWin.cpp: Added.
940         (WebCore::ThreadCondition::ThreadCondition):
941         (WebCore::ThreadCondition::~ThreadCondition):
942         (WebCore::ThreadCondition::wait):
943         (WebCore::ThreadCondition::signal):
944         (WebCore::ThreadCondition::broadcast):
945         * platform/win/ThreadingWin.cpp:
946         (WebCore::threadMapMutex):
947         (WebCore::threadMap):
948         (WebCore::storeThreadHandleByIdentifier):
949         (WebCore::identifierByThreadHandle):
950         (WebCore::threadHandleForIdentifier):
951         (WebCore::clearThreadHandleForIdentifier):
952         (WebCore::createThread):
953         (WebCore::waitForThreadCompletion):
954         (WebCore::detachThread):
955         (WebCore::currentThread):
956
957 2007-12-18  Rodney Dawes  <dobey@wayofthemonkey.com>
958
959         Reviewed by Darin Adler.
960
961         Handle EINTR when set by select() and try the select() again
962         http://bugs.webkit.org/show_bug.cgi?id=16071
963
964         * platform/network/curl/ResourceHandleManager.cpp:
965         (ResourceHandleManager::downloadTimerCallback):
966
967 2007-12-18  Dan Bernstein  <mitz@apple.com>
968
969         Reviewed by Dave Hyatt.
970
971         - avoid the simplified Chinese font linking code for characters that are
972           not in any Windows code page
973
974         * platform/graphics/win/FontCacheWin.cpp:
975         (WebCore::FontCache::getFontDataForCharacters):
976
977 2007-12-18  Brady Eidson <beidson@apple.com>
978
979         Reviewed by Adele
980
981         <rdar://problem/5525770> REGRESSION: HTTP Auth protected favicon request results in a password sheet
982
983         Some http-auth protected sites have the main resource(s) unprotected, but many subresources are
984         protected by authentication.  Occasionally one can view the main page of a site but the favicon
985         is behind the iron curtain - in these cases, we should *not* prompt for a username and password
986         solely for the favicon.
987
988         * loader/ResourceLoader.h: Make didReceiveAuthenticationChallenge virtual
989
990         * loader/SubresourceLoader.cpp:
991         (WebCore::SubresourceLoader::didReceiveAuthenticationChallenge): Now that this method
992           is virtual from ResourceLoader, SubresourceLoader can override.  First call to the 
993           SubresourceLoaderClient.  If they cancel the resource load, return early. Otherwise, let
994           ResourceLoader work its magic (resulting in the auth sheet coming down)
995         * loader/SubresourceLoader.h:
996
997         * loader/SubresourceLoaderClient.h:
998         (WebCore::SubresourceLoaderClient::didReceiveAuthenticationChallenge):
999
1000         * loader/icon/IconLoader.cpp:
1001         (WebCore::IconLoader::didReceiveAuthenticationChallenge): Cancel the resource load, since we should
1002           never prompt the user for credentials just for a favicon.
1003         * loader/icon/IconLoader.h:
1004
1005 2007-12-18  John Sullivan  <sullivan@apple.com>
1006
1007         Reviewed by Brady
1008         
1009         - fixed <rdar://problem/5652380> Initial prompt shows "" for databases with no user-visible name
1010
1011         * storage/DatabaseTracker.cpp:
1012         (WebCore::DatabaseTracker::canEstablishDatabase):
1013         pass "name" instead of "displayName" if there's no displayName
1014
1015 2007-12-17  Dan Bernstein  <mitz@apple.com>
1016
1017         Reviewed by Maciej Stachowiak.
1018
1019         - restore ButtonFace and ThreeDFace to their previous values for non-Mac
1020           platforms. The Mac port also uses the same values for now instead
1021           of NSColor-based ones.
1022
1023         * rendering/RenderTheme.cpp:
1024         (WebCore::RenderTheme::systemColor):
1025
1026 2007-12-17  Rodney Dawes  <dobey@wayofthemonkey.com>
1027
1028         Reviewed by Maciej Stachowiak.
1029
1030         Define WTF_USE_NPOBJECT and WTF_USE_JAVASCRIPTCORE_BINDINGS for GTK+
1031         Add required Frame::createScriptInstanceForWidget to FrameGtk
1032
1033         * config.h:
1034         * page/gtk/FrameGtk.cpp (Frame::createScriptInstanceForWidget):
1035
1036 2007-12-17  Alice Liu  <alice.liu@apple.com>
1037
1038         Reviewed by Adam.
1039
1040         Fixed <rdar://5566435> window with no scrollbars can be scrolled
1041
1042         * platform/win/ScrollViewWin.cpp:
1043         (WebCore::ScrollView::maximumScroll):
1044         corrected maximumScroll() to account for scrolling not allowed.
1045         (WebCore::ScrollView::wheelEvent):
1046
1047 2007-12-14  Juan A. Suarez Romero  <jasuarez@igalia.com>
1048
1049         Reviewed by Alp Toker.
1050
1051         http://bugs.webkit.org/show_bug.cgi?id=16042
1052         [GTK] Eliminate webkit_init()
1053
1054         Move webkit initialization to WebView class init.
1055
1056         * WebCore.pro:
1057
1058 2007-12-17  Jon Honeycutt  <jhoneycutt@apple.com>
1059
1060         Reviewed by Darin.
1061
1062         <rdar://problem/5651291> REGRESSION: Flash content doesn't display
1063         (www.adobe.com)
1064
1065         We were passing NPEvent** instead of NPEvent* to NPP_HandleEvent.
1066
1067         * plugins/win/PluginViewWin.cpp:
1068         (WebCore::PluginViewWin::dispatchNPEvent): Changed to take NPEvent&, not
1069         NPEvent*
1070         (WebCore::PluginViewWin::paint): Pass NPEvent, not NPEvent*
1071         (WebCore::PluginViewWin::handleKeyboardEvent): same
1072         (WebCore::PluginViewWin::handleMouseEvent): same
1073         * plugins/win/PluginViewWin.h:
1074
1075 2007-12-17  Alexey Proskuryakov  <ap@webkit.org>
1076
1077         Reviewed by Darin.
1078
1079         Live to the promise of never making AppKit special character codes visible via DOM.
1080
1081         Test: fast/events/arrow-keys-on-body.html
1082
1083         * page/EventHandler.cpp:
1084         (WebCore::EventHandler::keyEvent): Check for empty keypress characters after disambiguation,
1085         to let quirks-aware code strip special charactrers.
1086         * platform/mac/KeyEventMac.mm:
1087         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): If not in keyboard event quirks
1088         mode, remove the text if it's a special character.
1089
1090 2007-12-17  Mark Rowe  <mrowe@apple.com>
1091
1092         Reviewed by Darin Adler.
1093
1094         Fix incorrect array size and incorrect array index in convertNSColorToColor.
1095
1096         * rendering/RenderThemeMac.mm:
1097         (WebCore::convertNSColorToColor):
1098
1099 2007-12-17  Darin Adler  <darin@apple.com>
1100
1101         Reviewed by Mark Rowe.
1102
1103         - fix http://bugs.webkit.org/show_bug.cgi?id=16468
1104           REGRESSION(r28781): Crash running storage/transaction_callback_exception_crash.html
1105
1106         * storage/DatabaseThread.cpp:
1107         (WebCore::DatabaseThread::dispatchNextTaskIdentifier): Use a RefPtr for the database
1108         because there's no guarantee it won't lose its last reference otherwise.
1109
1110 2007-12-17  Dan Bernstein  <mitz@apple.com>
1111
1112         Reviewed by Maciej Stachowiak.
1113
1114         - fix <rdar://problem/5333260> Some Chinese characters in Text Encoding menu are bold, others are not
1115           and <rdar://problem/5280188> Chinese text looks worse on Safari for Windows cf. Safari for Mac
1116
1117         * platform/graphics/win/FontCacheWin.cpp:
1118         (WebCore::FontCache::getFontDataForCharacters): To ensure that font
1119         linking gives consistent results for characters that are exclusive to
1120         the simplified Chinese code page and characters that belong to that
1121         code page and other code pages, always ask to map to simplified Chinese
1122         alone first.
1123
1124 2007-12-17  Christian Dywan  <christian@twotoasts.de>
1125
1126         Reviewed by Alp Toker.
1127
1128         http://bugs.webkit.org/show_bug.cgi?id=16378
1129         Implement Icon for Gtk
1130
1131         Icon provides a GdkPixbuf containing a themed icon.
1132         The icon theme is probed for an icon name according to the
1133         Icon Naming Specification or conventional Gnome icon names respectively.
1134
1135         See http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
1136
1137         * platform/graphics/Icon.h:
1138         * platform/graphics/gtk/IconGtk.cpp:
1139         (WebCore::Icon::~Icon):
1140         (WebCore::lookupIconName):
1141         (WebCore::Icon::newIconForFile):
1142         (WebCore::Icon::paint):
1143
1144 2007-12-16  Sam Weinig  <sam@webkit.org>
1145
1146         Reviewed by Mitz.
1147
1148         Fix for http://bugs.webkit.org/show_bug.cgi?id=16466
1149         Move the JS Location object to its own file
1150
1151         - Move Location into its own file and rename it JSLocation.
1152
1153         * DerivedSources.make:
1154         * WebCore.pro:
1155         * WebCore.vcproj/WebCore.vcproj:
1156         * WebCore.xcodeproj/project.pbxproj:
1157         * WebCoreSources.bkl:
1158         * bindings/js/JSDocumentCustom.cpp:
1159         * bindings/js/JSLocation.cpp: Copied from WebCore/bindings/js/kjs_window.cpp.
1160         (WebCore::):
1161         (WebCore::JSLocation::JSLocation):
1162         (WebCore::JSLocation::getValueProperty):
1163         (WebCore::JSLocation::getOwnPropertySlot):
1164         (WebCore::JSLocation::put):
1165         (WebCore::JSLocationProtoFuncReplace::callAsFunction):
1166         (WebCore::JSLocationProtoFuncReload::callAsFunction):
1167         (WebCore::JSLocationProtoFuncAssign::callAsFunction):
1168         (WebCore::JSLocationProtoFuncToString::callAsFunction):
1169         * bindings/js/JSLocation.h: Copied from WebCore/bindings/js/kjs_window.h.
1170         (WebCore::JSLocation::):
1171         (WebCore::JSLocation::frame):
1172         (WebCore::JSLocation::classInfo):
1173         * bindings/js/kjs_window.cpp:
1174         (KJS::Window::location):
1175         * bindings/js/kjs_window.h:
1176         * history/CachedPage.cpp:
1177
1178 2007-12-16  Dan Bernstein  <mitz@apple.com>
1179
1180         Reviewed by Sam Weinig.
1181
1182         - make 'cursor: copy' and 'cursor: none' work.
1183
1184         Already covered by manual-tests/cursor.html
1185
1186         * rendering/RenderStyle.h: Increase the _cursor_style field to 6 bits,
1187         needed for the 33rd and 34th cursor values.
1188
1189 2007-12-16  Mark Rowe  <mrowe@apple.com>
1190
1191         Reviewed by Maciej Stachowiak.
1192
1193         Refactor Mac plugin stream code to use the shared NetscapePlugInStreamLoader implementation.
1194
1195         * WebCore.base.exp:
1196         * WebCore.xcodeproj/project.pbxproj:
1197         * loader/NetscapePlugInStreamLoader.h:
1198         * loader/mac/NetscapePlugInStreamLoaderMac.mm: Removed.
1199         * loader/mac/WebPlugInStreamLoaderDelegate.h: Moved to WebKit.
1200
1201 2007-12-16  Sam Weinig  <sam@webkit.org>
1202
1203         Reviewed by Maciej.
1204
1205         Yet more of http://bugs.webkit.org/show_bug.cgi?id=16385
1206         Cleanup kjs_window
1207
1208         - Move ScheduledAction into its own file and put it in the WebCore namespace.
1209
1210         * WebCore.pro:
1211         * WebCore.vcproj/WebCore.vcproj:
1212         * WebCore.xcodeproj/project.pbxproj:
1213         * WebCoreSources.bkl:
1214         * bindings/js/PausedTimeouts.cpp:
1215         * bindings/js/PausedTimeouts.h:
1216         * bindings/js/ScheduledAction.cpp: Copied from bindings/js/kjs_window.cpp.
1217         (WebCore::ScheduledAction::ScheduledAction):
1218         (WebCore::ScheduledAction::execute):
1219         * bindings/js/ScheduledAction.h: Copied from bindings/js/kjs_window.h.
1220         (WebCore::ScheduledAction::ScheduledAction):
1221         * bindings/js/kjs_window.cpp:
1222         (KJS::DOMWindowTimer::DOMWindowTimer):
1223         (KJS::DOMWindowTimer::action):
1224         (KJS::DOMWindowTimer::takeAction):
1225         (KJS::Window::installTimeout):
1226         (KJS::Window::timerFired):
1227         * bindings/js/kjs_window.h:
1228
1229 2007-12-16  Alp Toker  <alp@atoker.com>
1230
1231         Reviewed by Maciej.
1232
1233         http://bugs.webkit.org/show_bug.cgi?id=16356
1234         [GTK] Integrate GStreamer video with the graphics backend
1235
1236         Integrate the GStreamer media backend with the Cairo graphics backend.
1237         There are still some issues: Data is copied more often than necessary,
1238         and repaint() is not called, causing transformed video not to update
1239         sometimes.
1240
1241         * WebCore.pro:
1242         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
1243         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
1244         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
1245         (WebCore::MediaPlayerPrivate::currentTime):
1246         (WebCore::MediaPlayerPrivate::setEndTime):
1247         (WebCore::MediaPlayerPrivate::seeking):
1248         (WebCore::MediaPlayerPrivate::naturalSize):
1249         (WebCore::MediaPlayerPrivate::setMuted):
1250         (WebCore::MediaPlayerPrivate::setRect):
1251         (WebCore::MediaPlayerPrivate::setVisible):
1252         (WebCore::MediaPlayerPrivate::repaint):
1253         (WebCore::MediaPlayerPrivate::paint):
1254         (WebCore::MediaPlayerPrivate::createGSTPlayBin):
1255         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
1256         * platform/graphics/gtk/VideoSinkGStreamer.cpp: Added.
1257         (webkit_video_sink_base_init):
1258         (webkit_video_sink_init):
1259         (webkit_video_sink_idle_func):
1260         (webkit_video_sink_render):
1261         (webkit_video_sink_set_caps):
1262         (webkit_video_sink_dispose):
1263         (webkit_video_sink_finalize):
1264         (webkit_video_sink_set_property):
1265         (webkit_video_sink_get_property):
1266         (webkit_video_sink_stop):
1267         (webkit_video_sink_class_init):
1268         (webkit_video_sink_new):
1269         (webkit_video_sink_set_surface):
1270         (plugin_init):
1271         * platform/graphics/gtk/VideoSinkGStreamer.h: Added.
1272
1273 2007-12-16  Mark Rowe  <mrowe@apple.com>
1274
1275         Mac build fix.
1276
1277         * WebCore.xcodeproj/project.pbxproj: Remove NetscapePlugInStreamLoader.cpp from the WebCore target.
1278         Mac currently has its own implementation in NetscapePlugInStreamLoaderMac.mm which conflicts with the
1279         new shared implementation.
1280
1281 2007-12-16  Rodney Dawes  <dobey@wayofthemonkey.com>
1282
1283         Reviewed by Maciej Stachowiak.
1284
1285         http://bugs.webkit.org/show_bug.cgi?id=16389
1286         Bug 16389: Common Implementation of NetscapePlugInStreamLoader
1287
1288         * WebCore.vcproj/WebCore.vcproj: Remove NetscapePlugInStreamLoaderWin.cpp.
1289         * loader/NetscapePlugInStreamLoader.cpp: Copy method implementations from NetscapePlugInStreamLoaderWin.cpp.
1290         * loader/win/NetscapePlugInStreamLoaderWin.cpp: Removed.
1291
1292 2007-12-16  Grace Kloba  <klobag@gmail.com>
1293
1294         Reviewed by Darin Adler.
1295
1296         Fix http://bugs.webkit.org/show_bug.cgi?id=16433.
1297         Bug 16433: LOW_BANDWIDTH_DISPLAY build is broken
1298
1299         * dom/Document.cpp:
1300         (WebCore::Document::Document):
1301         * loader/FrameLoader.cpp:
1302         (WebCore::FrameLoader::addLowBandwidthDisplayRequest):
1303         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
1304
1305 2007-12-16  Darin Adler  <darin@apple.com>
1306
1307         Reviewed by Maciej.
1308
1309         - fix <rdar://problem/5636065> First form of SQLTransaction.executeSql() fails with TYPE_ERROR dom exception
1310
1311         Test: storage/execute-sql-args.html
1312
1313         * bindings/js/JSSQLTransactionCustom.cpp:
1314         (WebCore::JSSQLTransaction::executeSql): Added exception handling code so that once an
1315         exception happens, we won't try to do any more argument processing. Changed processing
1316         of the second argument so that we allow an undefined value or null, and simply omit the
1317         array. Changed processing of the second argument so that we don't require an actual
1318         JavaScript array. Instead, as with the JavaScript array operations themselves, we use
1319         the length property and corresponding numeric properties of the object, allowing other
1320         objects to act as arrays. Changed processing of the third and fourth arguments to
1321         allow the undefined value as well as null; we check the value of the argument rather
1322         than looking at the size of the passed-in arguments list.
1323
1324 2007-12-16  Sam Weinig  <sam@webkit.org>
1325
1326         Reviewed by Darin.
1327
1328         More of http://bugs.webkit.org/show_bug.cgi?id=16385
1329         Cleanup kjs_window
1330
1331         - Move PausedTimeouts into its own file and put it in the WebCore namespace.
1332
1333         * WebCore.pro:
1334         * WebCore.vcproj/WebCore.vcproj:
1335         * WebCore.xcodeproj/project.pbxproj:
1336         * WebCoreSources.bkl:
1337         * bindings/js/PausedTimeouts.cpp: Copied from bindings/js/kjs_window.cpp.
1338         * bindings/js/PausedTimeouts.h: Copied from bindings/js/kjs_window.h.
1339         * bindings/js/kjs_window.cpp:
1340         (KJS::Window::pauseTimeouts):
1341         * bindings/js/kjs_window.h:
1342         * history/CachedPage.cpp:
1343         * history/CachedPage.h:
1344         * page/Chrome.cpp:
1345
1346 2007-12-16  Beth Dakin  <bdakin@apple.com>
1347
1348         Reviewed by Geoff.
1349
1350         Make relative-size SVGs work in border-image.
1351
1352         * rendering/RenderBox.cpp:
1353         (WebCore::RenderBox::calculateBackgroundSize):
1354         * rendering/RenderObject.cpp:
1355         (WebCore::RenderObject::paintBorderImage):
1356
1357 2007-12-16  Darin Adler  <darin@apple.com>
1358
1359         - fix Tiger build (my fault it was broken)
1360
1361         * rendering/RenderThemeMac.mm: Define NSUInteger if on Tiger.
1362
1363 2007-12-16  Andrew Wellington  <proton@wiretapped.net>
1364
1365         Reviewed by Darin.
1366         
1367         http://bugs.webkit.org/show_bug.cgi?id=6129
1368         Incomplete implementation of CSS 2.1 system colors
1369
1370         Test: fast/css/css2-system-color.html
1371         
1372         Based on original patch by Rob Buis.
1373         
1374         System colors are retrieved from NSColor as appropriate. If the color is a pattern color
1375         (and therefore NSColor won't let us retrieve a color from it) we draw a 1x1 image of the
1376         color and sample that to get a solid color.
1377
1378         * css/CSSStyleSelector.cpp:
1379         (WebCore::):
1380         (WebCore::colorForCSSValue):
1381         * rendering/RenderTheme.cpp:
1382         (WebCore::RenderTheme::systemColor):
1383         * rendering/RenderTheme.h:
1384         * rendering/RenderThemeMac.h:
1385         * rendering/RenderThemeMac.mm:
1386         (WebCore::getSystemColor):
1387         (WebCore::RenderThemeMac::platformColorsDidChange):
1388         (WebCore::RenderThemeMac::systemColor):
1389
1390 2007-12-16  Dan Bernstein  <mitz@apple.com>
1391
1392         Reviewed by Darin Adler.
1393
1394         - fix http://bugs.webkit.org/show_bug.cgi?id=16426
1395           Divs with overflow:auto: scrollbars not correctly updated when contents change
1396
1397         Test: fast/overflow/scrollbar-position-update.html
1398
1399         * platform/mac/PlatformScrollBarMac.mm:
1400         (WebCore::PlatformScrollbar::updateThumbProportion): Update the
1401         NSScroller's value for the new proportions.
1402         * rendering/RenderLayer.cpp:
1403         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Removed unnecessary
1404         repaint(). Scrollbars repaint themselves as needed.
1405
1406 2007-12-16  Alexey Proskuryakov  <ap@webkit.org>
1407
1408         Reviewed by Darin.
1409
1410         http://bugs.webkit.org/show_bug.cgi?id=14140
1411         <rdar://problem/5270958> REGRESSION: Complex system KeyBindings don't work properly
1412
1413         * dom/KeyboardEvent.h:
1414         (WebCore::KeypressCommand::KeypressCommand):
1415         (WebCore::KeyboardEvent::keypressCommands):
1416         Change stored command class to preserve complete information about commands.
1417
1418         * editing/EditorCommand.cpp: (WebCore::CommandEntry::): Mark InsertText as a text insertion
1419         command, which it is. Previously, we couldn't do it because WebKit didn't really treat insertText:
1420         as a command.
1421
1422         * page/EventHandler.cpp: (WebCore::EventHandler::keyEvent): Copy commands saved while interpreting
1423         a keydown event into keypress, to avoid losing state when running interpretKeyEvents: again.
1424
1425 2007-12-16  Alexey Proskuryakov  <ap@webkit.org>
1426
1427         Reviewed by Darin.
1428
1429         http://bugs.webkit.org/show_bug.cgi?id=16462
1430         REGRESSION: access keys broken on Windows
1431
1432         * page/EventHandler.cpp:
1433         (WebCore::EventHandler::handleAccessKey):
1434         (WebCore::EventHandler::keyEvent):
1435         * page/EventHandler.h:
1436         Make handleAccessKey a class method; rely on WebKit to call it on Windows and wxWidgets.
1437
1438 2007-12-16  Xan Lopez  <xan@gnome.org>
1439
1440         Reviewed by Alexey Proskuryakov.
1441
1442         http://bugs.webkit.org/show_bug.cgi?id=16454
1443         [GTK] Text input doesn't work consistently on PPC
1444
1445         * platform/gtk/KeyEventGtk.cpp:
1446         (WebCore::singleCharacterString):
1447
1448         UChar is 2 bytes (UTF-16), so transform accordingly from
1449         gunichar (UCS-4). Fixes keyboard input on big endian systems.
1450
1451 2007-12-15  Darin Adler  <darin@apple.com>
1452
1453         Reviewed by Mark Rowe.
1454
1455         - better build fix for the problem affecting GTK and some other platforms
1456           "this time for sure"
1457
1458         * WebCore.xcodeproj/project.pbxproj:
1459         * bindings/js/JSEventTargetBase.cpp: Move the include of the .lut.h file here.
1460         * bindings/js/JSEventTargetBase.h: Instead of including the .lut.h file in the header,
1461         which won't work, declare the tables that are in the .lut.h file in the header.
1462
1463 2007-12-12  Kevin Watters  <kevin@dotsyntax.com>
1464
1465         Reviewed by Darin Adler.
1466
1467         Fixed the Wx port's FontPlatformData for use in HashTable.
1468         - FontPlatformData(Deleted) made unequal to FontPlatformData()
1469
1470         * platform/graphics/wx/FontPlatformData
1471
1472 2007-12-15  Dan Bernstein  <mitz@apple.com>
1473
1474         Reviewed by Darin Adler.
1475
1476         - fix <rdar://problem/5636090> Text in Georgia, Armenian, Inuktitut, Cree, or Cherokee (KA, HY, IU, CR, CHR) draws as all missing glyphs
1477
1478         * platform/graphics/win/FontCacheWin.cpp:
1479         (WebCore::metaFileEnumProc): Added. Called during metafile record
1480         enumeration and extracts the font from the create font record.
1481         (WebCore::FontCache::getFontDataForCharacters): If font linking fails,
1482         let Uniscribe draw the characters and see what font it chooses.
1483
1484 2007-12-15  Darin Adler  <darin@apple.com>
1485
1486         * WebCore.pro: Roll my last change out. Was wrong and didn't fix the build.
1487
1488 2007-12-15  Darin Adler  <darin@apple.com>
1489
1490         Another try at a GTK build fix.
1491
1492         * WebCore.pro: Add JSEventTargetBase.cpp to LUT_TABLE_FILES instead of LUT_FILES.
1493
1494 2007-12-15  Sam Weinig  <sam@webkit.org>
1495
1496         Force windows to regenerate COM DOM bindings.
1497
1498         * WebCore.vcproj/build-generated-files.sh: Add license. 
1499         * bindings/scripts/CodeGeneratorCOM.pm: Use shared WK_ucfirst.
1500
1501 2007-12-15  Sam Weinig  <sam@webkit.org>
1502
1503         Fix Windows and wx builds.
1504
1505         * WebCore.vcproj/WebCore.vcproj:
1506         * WebCoreSources.bkl:
1507
1508 2007-12-15  Mark Rowe  <mrowe@apple.com>
1509
1510         Gtk build fix.  Add JSEventTargetBase.cpp to SOURCES.
1511
1512         * WebCore.pro:
1513
1514 2007-12-15  Sam Weinig  <sam@webkit.org>
1515
1516         Fix wx build.
1517
1518         * WebCoreSources.bkl:
1519
1520 2007-12-15  Nikolas Zimmermann  <zimmermann@kde.org>
1521
1522         Not reviewed. Build fix for Qt/Gtk.
1523
1524         * WebCore.pro: Include JSEventTargetBase.lut.h in generation
1525
1526 2007-12-15  Nikolas Zimmermann  <zimmermann@kde.org>
1527
1528         Reviewed by Eric.
1529
1530         Fixes: http://bugs.webkit.org/show_bug.cgi?id=16445 (Refactor EventTargetNode & JSEventTargetNode for an upcoming SVG patch)
1531
1532         Split up JSEventTargetNode in JSEventTargetNode & JSEventTargetBase - where most functionality has been moved down
1533         in the base class. Applied the same refactorization to EventTargetNode.
1534
1535         This makes it possible for the upcoming patch implementing the EventTarget interface for SVGElementInstance
1536         to share as much code as possible with the EventTargetNode classes.
1537
1538         * DerivedSources.make:
1539         * WebCore.xcodeproj/project.pbxproj:
1540         * bindings/js/JSEventTargetBase.cpp: Added.
1541         (WebCore::retrieveEventTargetAndCorrespondingNode):
1542         (WebCore::eventNameForPropertyToken):
1543         * bindings/js/JSEventTargetBase.h: Added.
1544         (WebCore::JSEventTargetProperties::):
1545         (WebCore::JSEventTargetPrototypeFunctionBase::JSEventTargetPrototypeFunctionBase):
1546         (WebCore::JSEventTargetPrototypeFunction::JSEventTargetPrototypeFunction):
1547         (WebCore::):
1548         (WebCore::::create):
1549         (WebCore::JSEventTargetBase::JSEventTargetBase):
1550         (WebCore::JSEventTargetBase::getValueProperty):
1551         (WebCore::JSEventTargetBase::putValueProperty):
1552         (WebCore::JSEventTargetBase::getOwnPropertySlot):
1553         (WebCore::JSEventTargetBase::put):
1554         (WebCore::JSEventTargetPrototype::JSEventTargetPrototype):
1555         (WebCore::JSEventTargetPrototype::self):
1556         (WebCore::JSEventTargetPrototype::getOwnPropertySlot):
1557         (WebCore::JSEventTargetPrototype::classInfo):
1558         * bindings/js/JSEventTargetNode.cpp:
1559         (WebCore::JSEventTargetNode::getOwnPropertySlot):
1560         (WebCore::JSEventTargetNode::getValueProperty):
1561         (WebCore::JSEventTargetNode::put):
1562         (WebCore::JSEventTargetNode::putValueProperty):
1563         (WebCore::JSEventTargetNode::setListener):
1564         (WebCore::toEventTargetNode):
1565         * bindings/js/JSEventTargetNode.h:
1566         (WebCore::JSEventTargetPrototypeInformation::prototypeClassName):
1567         (WebCore::JSEventTargetPrototypeInformation::prototypeIdentifier):
1568         * dom/EventTarget.cpp:
1569         (WebCore::EventTarget::addEventListener):
1570         (WebCore::EventTarget::removeEventListener):
1571         (WebCore::EventTarget::dispatchGenericEvent):
1572         (WebCore::EventTarget::removeAllEventListeners):
1573         (WebCore::EventTarget::insertedIntoDocument):
1574         (WebCore::EventTarget::removedFromDocument):
1575         (WebCore::EventTarget::handleLocalEvents):
1576         (WebCore::EventTarget::applySVGEventTargetRules):
1577         (WebCore::forbidEventDispatch):
1578         (WebCore::allowEventDispatch):
1579         (WebCore::eventDispatchForbidden):
1580         * dom/EventTarget.h:
1581         (WebCore::EventTarget::preDispatchEventHandler):
1582         (WebCore::EventTarget::postDispatchEventHandler):
1583         (WebCore::forbidEventDispatch):
1584         (WebCore::allowEventDispatch):
1585         * dom/EventTargetNode.cpp:
1586         (WebCore::EventTargetNode::~EventTargetNode):
1587         (WebCore::EventTargetNode::insertedIntoDocument):
1588         (WebCore::EventTargetNode::removedFromDocument):
1589         (WebCore::EventTargetNode::addEventListener):
1590         (WebCore::EventTargetNode::removeEventListener):
1591         (WebCore::EventTargetNode::removeAllEventListeners):
1592         (WebCore::EventTargetNode::handleLocalEvents):
1593         (WebCore::EventTargetNode::dispatchEvent):
1594         (WebCore::EventTargetNode::dispatchWindowEvent):
1595         * dom/EventTargetNode.h:
1596         (WebCore::EventTargetNode::localEventListeners):
1597         * svg/SVGElement.cpp:
1598         (WebCore::SVGElement::sendSVGLoadEventIfPossible):
1599         (WebCore::SVGElement::dispatchEvent):
1600
1601 2007-12-15  Eric Seidel  <eric@webkit.org>
1602
1603         Reviewed by Oliver.
1604         
1605         Width of SVG elements not applied to container elements
1606         http://bugs.webkit.org/show_bug.cgi?id=16305
1607         Added calcPrefWidths for RenderSVGRoot (copied from RenderReplaced)
1608         This is caused by poor factoring in the render tree.  RenderContainer probably should be a template.
1609
1610         svg/css/css-box-min-width.html
1611
1612         * rendering/RenderSVGRoot.cpp:
1613         (WebCore::RenderSVGRoot::calcPrefWidths): Added.
1614         * rendering/RenderSVGRoot.h:
1615         * css/SVGCSSStyleSelector::applySVGProperty: fixed ASSERT in debug builds
1616
1617 2007-12-15  David Kilzer  <ddkilzer@apple.com>
1618
1619         Fix comment after isSafeScript() was renamed to allowsAccessFrom().
1620
1621         * bindings/js/kjs_window.cpp:
1622         (KJS::createWindow):
1623
1624 2007-12-15  Alp Toker  <alp@atoker.com>
1625
1626         Reviewed by Mark Rowe.
1627
1628         http://bugs.webkit.org/show_bug.cgi?id=16449
1629         cairo_arc() functions hang or crash when passed inf as radius or start/end angle
1630
1631         Add checks. This matches a similar workaround for a CG bug in the CG
1632         graphics backend: <rdar://problem/5189233>
1633
1634         Fixes:
1635           fast/canvas/arc-crash.html
1636           fast/canvas/canvas-with-incorrect-args.html
1637
1638         * platform/graphics/cairo/PathCairo.cpp:
1639         (WebCore::Path::addArc):
1640
1641 2007-12-15  Alexey Proskuryakov  <ap@webkit.org>
1642
1643         Reviewed by Darin.
1644
1645         http://bugs.webkit.org/show_bug.cgi?id=16078
1646         Google Maps zooming via the scroll wheel (almost) always zooms IN only.
1647
1648         * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent):
1649         Ensure that delta is never rounded down to zero - we are getting values less than 1 from 
1650         many mice on OS X, and Google Maps code assumes scrolling up if event.wheelDelta is zero.
1651
1652 2007-12-14  Dan Bernstein  <mitz@apple.com>
1653
1654         - Windows build fix
1655
1656         * WebCore.vcproj/WebCore.vcproj:
1657
1658 2007-12-14  Alp Toker  <alp@atoker.com>
1659
1660         GTK+/Qt build fix. Track added files in r28722.
1661
1662         * WebCore.pro:
1663
1664 2007-12-14  Sam Weinig  <sam@webkit.org>
1665
1666         Reviewed by Geoff.
1667
1668         Speed up getElementByClassName.
1669         - This makes getElementByClassName 33% faster on the stress test
1670           linked to at http://bugs.webkit.org/show_bug.cgi?id=15760.
1671
1672         * platform/text/StringImpl.cpp:
1673         (WebCore::StringImpl::foldCase): Optimize the case when all the characters are ASCII.
1674
1675 2007-12-14  Alp Toker  <alp@atoker.com>
1676
1677         Reviewed by Maciej.
1678
1679         http://bugs.webkit.org/show_bug.cgi?id=16432
1680         [GTK] Update license headers
1681
1682         Consent has been given by the authors of these files to change license
1683         to the LGPL as outlined in the bug report.
1684
1685         * platform/gtk/ClipboardGtk.cpp:
1686         * platform/gtk/ContextMenuGtk.cpp:
1687         * platform/gtk/ContextMenuItemGtk.cpp:
1688         * platform/gtk/CookieJarGtk.cpp:
1689         * platform/gtk/CursorGtk.cpp:
1690         * platform/gtk/DragDataGtk.cpp:
1691         * platform/gtk/DragImageGtk.cpp:
1692         * platform/gtk/PasteboardGtk.cpp:
1693         * platform/gtk/PlatformScreenGtk.cpp:
1694         * platform/gtk/PlatformScrollBarGtk.cpp:
1695         * platform/gtk/SearchPopupMenuGtk.cpp:
1696         * platform/gtk/WidgetGtk.cpp:
1697
1698 2007-12-14  Darin Adler  <darin@apple.com>
1699
1700         Reviewed by Adele.
1701
1702         - fix http://bugs.webkit.org/show_bug.cgi?id=16442
1703           navigation policy delegate gets called twice for each load
1704
1705         * loader/MainResourceLoader.cpp:
1706         (WebCore::MainResourceLoader::willSendRequest): Removed call to checkNavigationPolicy.
1707         That's handled by FrameLoader.
1708
1709         * loader/MainResourceLoader.h: Removed callContinueAfterNavigationPolicy
1710         and continueAfterNavigationPolicy.
1711
1712 2007-12-14  Anders Carlsson  <andersca@apple.com>
1713
1714         Reviewed by Brady.
1715
1716         Make document.open count as committing a document load, so that -[WebFrame dataSource:] won't
1717         return nil in that case.
1718         
1719         * loader/FrameLoader.cpp:
1720         (WebCore::FrameLoader::didExplicitOpen):
1721
1722 2007-12-14  David Smith  <catfish.man@gmail.com>
1723
1724         Reviewed by Mitz.
1725
1726         - fix http://bugs.webkit.org/show_bug.cgi?id=14955
1727           Implement getElementsByClassName.
1728
1729         This patch also renames AtomicStringList to ClassNames to better reflect its actual use,
1730         and takes advantage of admitting that it's class-specific to encapsulate class attribute 
1731         parsing so it can be shared.  It also changes the class to use a Vector, rather than a linked
1732         list to store the class names.
1733
1734         Tests: fast/dom/getElementsByClassName/001.html
1735                fast/dom/getElementsByClassName/002.html
1736                fast/dom/getElementsByClassName/003.html
1737                fast/dom/getElementsByClassName/004.html
1738                fast/dom/getElementsByClassName/005.html
1739                fast/dom/getElementsByClassName/006.html
1740                fast/dom/getElementsByClassName/007.html
1741                fast/dom/getElementsByClassName/008.html
1742                fast/dom/getElementsByClassName/009.html
1743                fast/dom/getElementsByClassName/010.xml
1744                fast/dom/getElementsByClassName/011.xml
1745                fast/dom/getElementsByClassName/012.html
1746                fast/dom/getElementsByClassName/013.html
1747                fast/dom/getElementsByClassName/014.html
1748                fast/dom/getElementsByClassName/array/001.html
1749                fast/dom/getElementsByClassName/array/002.html
1750                fast/dom/getElementsByClassName/array/003.html
1751                fast/dom/getElementsByClassName/array/004.html
1752                fast/dom/getElementsByClassName/dumpNodeList.html
1753
1754         * WebCore.xcodeproj/project.pbxproj:
1755         * css/CSSStyleSelector.cpp:
1756         (WebCore::CSSStyleSelector::matchRules):
1757         (WebCore::CSSStyleSelector::checkOneSelector):
1758         * dom/AtomicStringList.h: Removed.
1759         * dom/ClassNames.cpp: Added.
1760         (WebCore::ClassNames::contains):
1761         (WebCore::ClassNames::parseClassAttribute):
1762         * dom/ClassNames.h: Copied from WebCore/dom/AtomicStringList.h.
1763         (WebCore::ClassNames::ClassNames):
1764         (WebCore::ClassNames::size):
1765         (WebCore::ClassNames::clear):
1766         (WebCore::ClassNames::operator[]):
1767         (WebCore::isClassWhitespace):
1768         * dom/ClassNodeList.cpp: Added.
1769         (WebCore::ClassNodeList::ClassNodeList):
1770         (WebCore::ClassNodeList::length):
1771         (WebCore::ClassNodeList::item):
1772         (WebCore::ClassNodeList::nodeMatches):
1773         * dom/ClassNodeList.h: Added.
1774         * dom/Document.cpp:
1775         (WebCore::Document::getElementsByName):
1776         (WebCore::Document::getElementsByClassName):
1777         * dom/Document.h:
1778         * dom/Document.idl:
1779         * dom/Element.cpp:
1780         (WebCore::Element::getClassNames):
1781         (WebCore::Element::getElementsByClassName):
1782         * dom/Element.h:
1783         * dom/Element.idl:
1784         * dom/NameNodeList.cpp:
1785         (WebCore::NameNodeList::NameNodeList):
1786         (WebCore::NameNodeList::item):
1787         (WebCore::NameNodeList::nodeMatches):
1788         * dom/NameNodeList.h:
1789         * dom/NamedMappedAttrMap.cpp:
1790         (WebCore::NamedMappedAttrMap::clearAttributes):
1791         (WebCore::NamedMappedAttrMap::parseClassAttribute):
1792         * dom/NamedMappedAttrMap.h:
1793         (WebCore::NamedMappedAttrMap::getClassNames):
1794         * dom/StyledElement.cpp:
1795         (WebCore::StyledElement::getClassNames):
1796         * dom/StyledElement.h:
1797
1798 2007-12-14  Darin Adler  <darin@apple.com>
1799
1800         Reviewed by Sam.
1801
1802         - fix http://bugs.webkit.org/show_bug.cgi?id=16351
1803           FontFallbackList.h doesn't include wtf/PassRefPtr.h
1804           
1805         * platform/graphics/FontFallbackList.h: Added include of <wtf/Forward.h>
1806         * platform/graphics/GlyphPageTreeNode.h: Removed an unneeded include.
1807
1808 2007-12-14  Darin Adler  <darin@apple.com>
1809
1810         Reviewed by Alexey.
1811
1812         - http://bugs.webkit.org/show_bug.cgi?id=16420
1813           change regression tests to use document.execCommand instead of textInputController.doCommand
1814
1815         Add a few more operations to document.execCommand.
1816
1817         Finished up the transition to the new Editor::Command, including removing
1818         the Editor::execCommand function.
1819
1820         * WebCore.base.exp: Added Editor::Command::isSupported.
1821         * editing/Editor.h: Removed execCommand.
1822         * editing/EditorCommand.cpp:
1823         (WebCore::expandSelectionToGranularity): Added.
1824         (WebCore::verticalScrollDistance): Added; replaces canScroll.
1825         (WebCore::executeDeleteBackward): Added. Moved code here from WebHTMLView.
1826         (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter): Ditto.
1827         (WebCore::executeDeleteForward): Ditto.
1828         (WebCore::executeDeleteToBeginningOfLine): Ditto.
1829         (WebCore::executeDeleteToBeginningOfParagraph): Ditto.
1830         (WebCore::executeDeleteToEndOfLine): Ditto.
1831         (WebCore::executeDeleteToEndOfParagraph): Ditto.
1832         (WebCore::executeMovePageDown): Renamed this command to be consistent with all the other
1833         Move commands. They all modify the caret. Reimplemented to match the Mac OS X version by
1834         removing the explicit scrolling, and letting it be done automatically by code that makes
1835         the caret visible. In some cases the old code would scroll twice which was harmless but
1836         unnecessary.
1837         (WebCore::executeMovePageDownAndModifySelection): Added. Moved code here from WebHTMLView.
1838         (WebCore::executeMovePageUp): See MovePageDown above.
1839         (WebCore::executeMovePageUpAndModifySelection): Added. Moved code here from WebHTMLView.
1840         (WebCore::executeSelectLine): Ditto.
1841         (WebCore::executeSelectParagraph): Ditto.
1842         (WebCore::executeSelectSentence): Ditto.
1843         (WebCore::executeSelectWord): Ditto.
1844         (WebCore::executeSwapWithMark): Some small tweaks.
1845
1846         * page/ContextMenuController.cpp:
1847         (WebCore::ContextMenuController::contextMenuItemSelected): Changed to use Editor::command()
1848         instead of Editor::execCommand(). This code could be changed to use Editor::Command quite a
1849         bit more, but I didn't do that this time.
1850
1851         - Removed some obsolete unused code.
1852
1853         * page/mac/EventHandlerMac.mm:
1854         (WebCore::EventHandler::passMouseDownEventToWidget): Removed the special case code for
1855         NSTextView. This was left over from when we used NSTextField and NSTextView for form
1856         elements and is no longer used at all.
1857
1858         * page/mac/WebCoreFrameBridge.h: Removed 20 unused methods that were still on one side
1859         of the bridge or another. We really need to find a time to tear down the rest of the
1860         bridge, but that's not this patch.
1861
1862         * page/mac/WebCoreFrameBridge.mm:
1863         (-[WebCoreFrameBridge addData:]): Changed to get at the _shouldCreateRenderers field directly
1864         instead of using a method.
1865         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
1866         Took out obsolete comment about matching enums (we use a single enum now and have for some
1867         time).
1868         (-[WebCoreFrameBridge selectionGranularity]): Ditto.
1869
1870 2007-12-14  Justin Garcia  <justin.garcia@apple.com>
1871
1872         Reviewed by Darin Adler.
1873
1874         <rdar://problem/5575101> GoogleDocs: Hang in SplitElementCommand::doApply when outdenting a list item in a particular list
1875
1876         * editing/CompositeEditCommand.cpp:
1877         (WebCore::CompositeEditCommand::splitTreeToNode): Moved here.
1878         * editing/CompositeEditCommand.h:
1879         * editing/IndentOutdentCommand.cpp: Moved splitTreeToNode.
1880         * editing/IndentOutdentCommand.h: Ditto, and removed unimplemented splitTreeTo.
1881         * editing/InsertListCommand.cpp:
1882         (WebCore::InsertListCommand::doApply): Split ancestors of listChildNode between
1883         it and listNode, if they exists, so that moving listChildNode doesn't put it out
1884         of order.  Added a test case to cover each change.
1885         * editing/SplitElementCommand.cpp:
1886         (WebCore::SplitElementCommand::doApply): Added an ASSERT to catch code that
1887         tries to split a container at a bogus child, and an early return to avoid a
1888         hang in that case.
1889
1890 2007-12-14  Anders Carlsson  <andersca@apple.com>
1891
1892         Reviewed by Darin and Geoff.
1893
1894         <rdar://problem/5619295> 
1895         REGRESSION: 303-304: Embedded YouTube video fails to render- JS errors (16150) (Flash 9)
1896
1897         _NPN_CreateScriptObject doesn't take an origin root object anymore.
1898         
1899         * html/HTMLPlugInElement.cpp:
1900         (WebCore::HTMLPlugInElement::createNPObject):
1901         * page/Frame.cpp:
1902         (WebCore::Frame::windowScriptNPObject):
1903
1904 2007-12-14  Dan Bernstein  <mitz@apple.com>
1905
1906         Reviewed by Darin Adler.
1907
1908         - fix <rdar://problem/5643663> text-shadow and box-shadow offsets 1px smaller than specified
1909           which is the root cause of:
1910           http://bugs.webkit.org/show_bug.cgi?id=12943
1911           box-shadow: small values don't affect shadow position
1912           http://bugs.webkit.org/show_bug.cgi?id=14736
1913           Safari implementation of text-shadow off by 1px
1914
1915         * platform/graphics/cg/GraphicsContextCG.cpp:
1916         (WebCore::GraphicsContext::setShadow): Slightly increase the magnitude
1917         of the offsets passed to CGContextSetShadow* to ensure that the end
1918         result after truncation is the desired integer offsets.
1919
1920 2007-12-13  Alp Toker  <alp@atoker.com>
1921
1922         curl backend build fix for breakage introduced in r28709.
1923
1924         * platform/network/ResourceHandleInternal.h:
1925         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
1926
1927 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
1928
1929         Reviewed by Oliver Hunt.
1930
1931         <rdar://problem/5607069> In Mail, a crash occurs at WebCore::AppendNodeCommand() after dragging image into a <FORM> element
1932
1933         * editing/InsertLineBreakCommand.cpp:
1934         (WebCore::InsertLineBreakCommand::shouldUseBreakElement): Equip this function to
1935         handle editing positions, like [input, 0];
1936         * editing/InsertParagraphSeparatorCommand.cpp:
1937         (WebCore::InsertParagraphSeparatorCommand::doApply): Pass enclosingBlock a node peeled
1938         off of a non-editing position, to fix a bug where the enclosing block of [input, 0] was
1939         the input element itself.
1940         Insert a <br> when a <form> element is the enclosing block instead of splitting/cloning or
1941         nesting a <div>.
1942
1943 2007-12-13  Alp Toker  <alp@atoker.com>
1944
1945         Reviewed by Oliver Hunt.
1946
1947         http://bugs.webkit.org/show_bug.cgi?id=16365
1948         [cURL] Acid2 test segmentation fault
1949
1950         This patch makes the Acid2 test pass.
1951
1952         Defer the cleanup of cancelled jobs and halt further transfer as early
1953         as possible.
1954
1955         Bug found by and initial patch provided by Luca Bruno.
1956
1957         * platform/network/curl/ResourceHandleManager.cpp:
1958         (WebCore::writeCallback):
1959         (WebCore::headerCallback):
1960         (WebCore::ResourceHandleManager::downloadTimerCallback):
1961         (WebCore::ResourceHandleManager::cancel):
1962
1963 2007-12-13  Sam Weinig  <sam@webkit.org>
1964
1965         Reviewed by Mark Rowe.
1966
1967         Fix typos and rename InspectorController::moveByUnrestricted to InspectorController::moveWindowBy.
1968
1969         * page/InspectorController.cpp:
1970         (WebCore::moveByUnrestricted):
1971         (WebCore::InspectorController::windowScriptObjectAvailable):
1972         (WebCore::InspectorController::moveWindowBy):
1973         * page/InspectorController.h:
1974         * page/inspector/inspector.js:
1975
1976 2007-12-13  Dan Bernstein  <mitz@apple.com>
1977
1978         Reviewed by Dave Hyatt.
1979
1980         - fix <rdar://problem/5642426> explicit cubic-bezier curves all treated as "default" for transition-timing-function
1981
1982         Test: fast/css/transition-timing-function.html
1983
1984         * css/CSSStyleSelector.cpp: Changed the HANDLE_MULTILAYER_VALUE macro to
1985         not reject non-primitive non-list values, and instead made sure that the
1986         mapping functions rejected them if necessary. This allows non-primitive
1987         timing functions to be mapped.
1988         (WebCore::CSSStyleSelector::mapBackgroundAttachment):
1989         (WebCore::CSSStyleSelector::mapBackgroundClip):
1990         (WebCore::CSSStyleSelector::mapBackgroundComposite):
1991         (WebCore::CSSStyleSelector::mapBackgroundOrigin):
1992         (WebCore::CSSStyleSelector::mapBackgroundImage):
1993         (WebCore::CSSStyleSelector::mapBackgroundRepeat):
1994         (WebCore::CSSStyleSelector::mapBackgroundXPosition):
1995         (WebCore::CSSStyleSelector::mapBackgroundYPosition):
1996         (WebCore::CSSStyleSelector::mapTransitionDuration):
1997         (WebCore::CSSStyleSelector::mapTransitionRepeatCount):
1998         (WebCore::CSSStyleSelector::mapTransitionTimingFunction):
1999         (WebCore::CSSStyleSelector::mapTransitionProperty):
2000         * css/CSSTimingFunctionValue.cpp:
2001         (WebCore::CSSTimingFunctionValue::cssText): Implemented for use in the
2002         regression test.
2003         * css/CSSTimingFunctionValue.h:
2004         (WebCore::CSSTimingFunctionValue::isTransitionTimingFunctionValue):
2005         Added. Returns true.
2006         * css/CSSValue.h:
2007         (WebCore::CSSValue::isTransitionTimingFunctionValue): Added. Returns
2008         false.
2009
2010 2007-12-13  Steve Falkenburg  <sfalken@apple.com>
2011
2012         Move source file generation into its own vcproj to fix build dependencies.
2013
2014         Reviewed by Adam.
2015
2016         * WebCore.vcproj/WebCore.make:
2017         * WebCore.vcproj/WebCore.sln:
2018         * WebCore.vcproj/WebCore.submit.sln:
2019         * WebCore.vcproj/WebCore.vcproj:
2020         * WebCore.vcproj/WebCoreGenerated.vcproj: Added.
2021
2022 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
2023
2024         Reviewed by Oliver Hunt.
2025         
2026         <rdar://problem/4145786> Undoing a color change of text in a compose window always changes it back to black
2027         
2028         Some of the operations performed in removeHTMLFontStyle were non-undoable.
2029         
2030         I'm having trouble writing a layout test for this because I can't get DRT to
2031         perform editing operations in separate Undo steps without adding unacceptably long
2032         wait times between operations.  I filed:
2033         
2034         <rdar://problem/5646779> Can't get DRT to perform editing operations in separate Undo steps
2035
2036         * editing/ApplyStyleCommand.cpp:
2037         (WebCore::ApplyStyleCommand::removeHTMLFontStyle):
2038
2039 2007-12-13  Sam Weinig  <sam@webkit.org>
2040
2041         Reviewed by Anders.
2042
2043         Fix for http://bugs.webkit.org/show_bug.cgi?id=16352
2044         Toolbar dragged inspector cannot be moved beyond screen edges
2045
2046         * page/InspectorController.cpp:
2047         (WebCore::moveByUnrestricted):
2048         (WebCore::InspectorController::windowScriptObjectAvailable):
2049         (WebCore::InspectorController::moveByUnrestricted):
2050         * page/InspectorController.h:
2051         * page/inspector/inspector.js:
2052
2053 2007-12-13  Adam Roben  <aroben@apple.com>
2054
2055         Fix <rdar://5517707> Crash on wptv.wp.pl when "make bigger" button is clicked
2056
2057         Windows Media Player has a modal message loop that will deliver
2058         messages to us at inappropriate times and we will crash if we handle
2059         them when they are delivered. In PluginViewWin, we add a quirk for
2060         Media Player to set a flag whenever we give the plugin a chance to
2061         execute code, and in SharedTimerWin we check if the plugin is
2062         executing code and repost messages if so.
2063
2064         Reviewed by Anders.
2065
2066         * platform/win/SharedTimerWin.cpp:
2067         (WebCore::TimerWindowWndProc): Repost messages if we're calling a
2068         plugin.
2069         * plugins/win/PluginViewWin.cpp: Surround all calls to the plugin with
2070         setCallingPlugin(true/false).
2071         (WebCore::PluginViewWin::updateWindow):
2072         (WebCore::PluginViewWin::dispatchNPEvent):
2073         (WebCore::PluginViewWin::setNPWindowRect):
2074         (WebCore::PluginViewWin::start):
2075         (WebCore::PluginViewWin::stop):
2076         (WebCore::PluginViewWin::performRequest):
2077         (WebCore::PluginViewWin::bindingInstance):
2078         (WebCore::PluginViewWin::determineQuirks):
2079         (WebCore::PluginViewWin::setCallingPlugin): Added.
2080         (WebCore::PluginViewWin::isCallingPlugin): Added.
2081         * plugins/win/PluginViewWin.h: Added a new quirk.
2082
2083 2007-12-13  Alp Toker  <alp@atoker.com>
2084
2085         Add a missing DEPENDPATH. Fixes non-clean builds following networking
2086         header changes.
2087
2088         * WebCore.pro:
2089
2090 2007-12-13  Dan Bernstein  <mitz@apple.com>
2091
2092         Reviewed by Anders Carlsson.
2093
2094         - fix regression in fast/text/international/bidi-override on Tiger
2095
2096         * platform/graphics/GlyphPageTreeNode.cpp:
2097         (WebCore::GlyphPageTreeNode::initializePage): Add bidi overrides here
2098         too. I forgot to add them when I added them to treatAsZeroWidthSpace in
2099         an earlier patch.
2100
2101 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
2102
2103         Reviewed by Darin Adler.
2104
2105         <rdar://problem/5601583> GMail Editor: Copied link doesn't paste as a link, just colored text
2106         
2107         The code that checks the selected Range to see if it's inside an anchor
2108         checks ancestors of the Range's commonAncestor() but not the
2109         commonAncestor() itself, and so we'd fail to add markup for the enclosing
2110         anchor to the pasteboard.
2111         
2112         Some enclosing element getters check the node passed to the getter and some
2113         don't.  There were a few places where we incorrectly assumed that enclosing 
2114         element getters check the node passed to the getter, but this is the only 
2115         case that I'm able to write a test case for at the moment.
2116         
2117         In this patch I've:
2118         Changed enclosingNodeWithType and enclosingNodeWithTag to take in positions,
2119         like the newer enclosing element getters.  This is important because we must
2120         soon add code to the getters so that they understand that some editing positions
2121         inside nodes don't actually refer to positions inside those nodes but positions
2122         before and after them.  Like [table, 0].
2123         Changed enclosingNodeWithType and enclosingNodeWithTag to check nodes starting with
2124         n where [n, o] is the position passed to the getter, instead of starting the the parent
2125         of n.  This makes all but a few of the enclosing element getters behave consistently.
2126         Changed enclosingNodeWithType and enclosingNodeWithTag to not return non-editable 
2127         nodes if the input position was editable.  This fixes a bug that that the above change
2128         exposed.
2129         Changed enclosingTableCell to simply call enclosingNodeWithType.  We should do
2130         this for the rest of the getters, or simply remove them in favor of enclosingNodeWithType
2131         unless doing so would affect readability, like it would in the case of enclosingTableCell.
2132         Ditto for enclosingBlock.
2133
2134         * editing/AppendNodeCommand.cpp:
2135         (WebCore::AppendNodeCommand::doApply):
2136         * editing/DeleteButtonController.cpp:
2137         (WebCore::enclosingDeletableElement):
2138         * editing/DeleteSelectionCommand.cpp:
2139         (WebCore::DeleteSelectionCommand::initializePositionData):
2140         (WebCore::DeleteSelectionCommand::saveFullySelectedAnchor):
2141         * editing/Editor.cpp:
2142         (WebCore::Editor::selectionUnorderedListState):
2143         (WebCore::Editor::selectionOrderedListState):
2144         * editing/IndentOutdentCommand.cpp:
2145         (WebCore::IndentOutdentCommand::prepareBlockquoteLevelForInsertion):
2146         (WebCore::IndentOutdentCommand::outdentParagraph):
2147         * editing/InsertNodeBeforeCommand.cpp:
2148         (WebCore::InsertNodeBeforeCommand::doApply):
2149         * editing/InsertParagraphSeparatorCommand.cpp:
2150         (WebCore::InsertParagraphSeparatorCommand::doApply):
2151         * editing/ReplaceSelectionCommand.cpp:
2152         (WebCore::ReplaceSelectionCommand::shouldMerge):
2153         (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
2154         (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent):
2155         * editing/TextIterator.cpp:
2156         * editing/htmlediting.cpp:
2157         (WebCore::enclosingBlock):
2158         (WebCore::enclosingNodeWithTag):
2159         (WebCore::enclosingNodeOfType):
2160         (WebCore::enclosingTableCell):
2161         (WebCore::isTableCell):
2162         * editing/htmlediting.h:
2163         * editing/markup.cpp:
2164         (WebCore::appendStartMarkup):
2165         (WebCore::createMarkup):
2166
2167 2007-12-13  Alexey Proskuryakov  <ap@webkit.org>
2168
2169         Reviewed by Darin.
2170
2171         Turn on keyboard event processing quirks for feed views and old applications on Mac OS X.
2172
2173         * WebCore.base.exp:
2174         * dom/KeyboardEvent.cpp:
2175         (WebCore::KeyboardEvent::charCode):
2176         * page/EventHandler.cpp:
2177         (WebCore::EventHandler::needsKeyboardEventDisambiguationQuirks):
2178         (WebCore::EventHandler::keyEvent):
2179         * page/EventHandler.h:
2180         * page/Settings.cpp:
2181         (WebCore::Settings::Settings):
2182         (WebCore::Settings::setNeedsKeyboardEventDisambiguationQuirks):
2183         * page/Settings.h:
2184         (WebCore::Settings::needsKeyboardEventDisambiguationQuirks):
2185         * page/mac/EventHandlerMac.mm:
2186         (WebCore::EventHandler::needsKeyboardEventDisambiguationQuirks):
2187         * platform/PlatformKeyboardEvent.h:
2188         * platform/mac/KeyEventMac.mm:
2189         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2190         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
2191
2192 2007-12-13  Dan Bernstein  <mitz@apple.com>
2193
2194         - build fix
2195
2196         * platform/network/cf/ResourceErrorCF.cpp:
2197
2198 2007-12-13  Antti Koivisto  <antti@apple.com>
2199
2200         Reviewed by Tim Hatcher.
2201
2202         Fix <rdar://problem/5605674> 
2203         Make <video> display WebKit context menu instead of the QTKit one.
2204     
2205         It doesn't really matter where the QTMovieView is.
2206
2207         * ChangeLog:
2208         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2209         (WebCore::MediaPlayerPrivate::createQTMovieView):
2210         (WebCore::MediaPlayerPrivate::setRect):
2211
2212 2007-12-13  Dan Bernstein  <mitz@apple.com>
2213
2214         Reviewed by Adam Roben.
2215
2216         - ensure that Unicode bidi control characters are rendered as zero width
2217           spaces
2218
2219         Test: fast/text/international/bidi-control-chars-treated-as-ZWS.html
2220
2221         * platform/graphics/Font.h:
2222         (WebCore::Font::treatAsZeroWidthSpace):
2223         * platform/graphics/GlyphPageTreeNode.cpp:
2224         (WebCore::GlyphPageTreeNode::initializePage):
2225         * platform/text/CharacterNames.h:
2226
2227 2007-12-13  Brady Eidson  <beidson@apple.com>
2228
2229         Build fix
2230
2231         * platform/wx/TemporaryLinkStubs.cpp:
2232
2233 2007-12-12  Brady Eidson  <beidson@apple.com>
2234
2235         Build fix
2236
2237         * platform/gtk/TemporaryLinkStubs.cpp:
2238
2239 2007-12-12  Brady Eidson  <beidson@apple.com>
2240
2241         Build fix
2242
2243         * WebCore.pro:
2244         * history/qt/CachedPageQt.cpp: Removed. Whole purpose for this method being platform-specific has been removed
2245
2246 2007-12-12  Brady Eidson  <beidson@apple.com>
2247
2248         Build fix
2249
2250         * platform/win/TemporaryLinkStubs.cpp:
2251
2252 2007-12-12  Brady Eidson  <beidson@apple.com>
2253
2254         Reviewed by Sam Weinig
2255
2256         Fix for <rdar://problem/4886844> and lay groundwork for <rdar://problem/4516170> (Back/Forward Cache on Windows)
2257
2258         All back/forward list and page cache related items used to be in WebKit.
2259         When they were pushed into WebCore, some sloppy compromises were made to keep the Back/Forward cache working on Mac.
2260         Namely, a WebCore::HistoryItem had to know how to keep a WebDocumentView alive.  We accomplished this via some #ifdefs
2261         in CachedPage and having the Mac-only CachedPageMac.mm
2262
2263         To get rid of that nastiness and pave the way for adding Back/Forward cache on other platforms, this patch adds the 
2264         concept of "CachedPagePlatformData" which can contain anything the platform API wants.  
2265
2266         I also took the opportunity to do other cleanup and renaming client methods to better fit their new purposes.
2267
2268         * WebCore.base.exp:
2269         * WebCore.xcodeproj/project.pbxproj:
2270
2271         * history/CachedPage.cpp:
2272         (WebCore::CachedPage::~CachedPage): Combined "close()" and "clear()" to just "clear()" - call it from here.
2273         (WebCore::CachedPage::clear): Call clear() on the CachedPagePlatformData if it exists.  Also delete the CachedPagePlatformData.
2274         (WebCore::CachedPage::setCachedPagePlatformData):
2275         (WebCore::CachedPage::cachedPagePlatformData):
2276         * history/CachedPage.h:
2277
2278         * history/CachedPagePlatformData.h: Added.
2279         (WebCore::CachedPagePlatformData::~CachedPagePlatformData): Virtual d'tor.
2280         (WebCore::CachedPagePlatformData::clear): Virtual method for platforms that need to do cleanup at the same time as CachedPage::clear().
2281
2282         * history/PageCache.cpp:
2283         (WebCore::PageCache::releaseAutoreleasedPagesNow): Call "clear()" instead of "close()"
2284
2285         * history/mac/CachedPageMac.mm: Removed. Functionality replaced with CachedPagePlatformData.
2286
2287         * loader/FrameLoader.cpp:
2288         (WebCore::FrameLoader::transitionToCommitted): Call the new client methods.  Make some work previously done by WebKitMac cross platform 
2289           (setting the cached DocumentLoader to the Frame).
2290         (WebCore::FrameLoader::cachePageForHistoryItem):  Renamed the client methods
2291
2292         * loader/FrameLoaderClient.h:  The very Mac-centric "makeDocumentView", "setDocumentViewFromCachedPage", and "saveDocumentViewToCachedPage"
2293           become "transitionToCommittedForNewPage", "transitionToCommittedFromCachedPage", and "savePlatformDataToCachedPage" accordingly
2294
2295         * svg/graphics/SVGImageEmptyClients.h:
2296         (WebCore::SVGEmptyFrameLoaderClient::savePlatformDataToCachedPage):
2297         (WebCore::SVGEmptyFrameLoaderClient::transitionToCommittedFromCachedPage):
2298         (WebCore::SVGEmptyFrameLoaderClient::transitionToCommittedForNewPage):
2299
2300 2007-12-12  Dan Bernstein  <mitz@apple.com>
2301
2302         Reviewed by Oliver Hunt.
2303
2304         - fix <rdar://problem/5074620> text with font:initial; fails to appear (causes fast/text/font-initial.html to fail)
2305
2306         * css/CSSStyleSelector.cpp:
2307         (WebCore::CSSStyleSelector::applyProperty): When the font property is
2308         set to 'initial', set the font size to its initial value, 'medium',
2309         and the font family to the standard family.
2310
2311 2007-12-12  Justin Garcia  <justin.garcia@apple.com>
2312
2313         Reviewed by Darin Adler.
2314
2315         <rdar://problem/5433862> Mail crashes at WebCore::highestAncestor() when deleting a particular selection
2316
2317         * editing/DeleteSelectionCommand.cpp:
2318         (WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows):
2319         Don't remove the table row that contained the end of the selection if it is where we are
2320         about to place the ending selection.
2321         Don't remove all empty rows after the row that contained the start of the selection,
2322         they might come after the row that contained the end of the selection.
2323
2324 2007-12-12  Sam Weinig  <sam@webkit.org>
2325
2326         Reviewed by Anders Carlsson.
2327
2328         Add button to clear the Web Inspector's console.
2329
2330         * English.lproj/InspectorLocalizedStrings.js:
2331         * page/inspector/ConsolePanel.js:
2332         * page/inspector/inspector.css:
2333
2334 2007-12-12  Anders Carlsson  <andersca@apple.com>
2335
2336         Reviewed by Adam and Jon.
2337
2338         <rdar://problem/5349282>
2339         popup blocking is not applied to plugins on Windows.
2340         
2341         Implement popup blocking. If the plug-in supports the new 
2342         NPN_PushPopupsEnabledState/NPN_PopPopupsEnabledState API we just use that
2343         to determine if a plug-in request can open new windows.
2344         
2345         If a plug-in does not support the new API, we assume that a plug-in can open new windows
2346         in response to either mouse click or key press events.
2347         
2348         * plugins/win/PluginViewWin.cpp:
2349         (WebCore::PluginRequestWin::PluginRequestWin):
2350         (WebCore::PluginRequestWin::shouldAllowPopups):
2351         Add new shouldAllowPopups member.
2352         
2353         (WebCore::PluginViewWin::popPopupsStateTimerFired):
2354         Reset the popup state.
2355         
2356         (WebCore::isWindowsMessageUserGesture):
2357         New function that given a windows message id returns whether it's a user gesture or not.
2358         
2359         (WebCore::PluginViewWin::wndProc):
2360         Allow popups if the window message is a user gesture.
2361         
2362         (WebCore::PluginViewWin::dispatchNPEvent):
2363         New method that dispatches an NPEvent, turning on popups if necessary.
2364         
2365         (WebCore::PluginViewWin::paint):
2366         (WebCore::PluginViewWin::handleKeyboardEvent):
2367         (WebCore::PluginViewWin::handleMouseEvent):
2368         Call dispatchNPEvent().
2369         
2370         (WebCore::PluginViewWin::performRequest):
2371         (WebCore::PluginViewWin::load):
2372         Add calls to shouldAllowPopups().
2373         
2374         (WebCore::PluginViewWin::pushPopupsEnabledState):
2375         (WebCore::PluginViewWin::popPopupsEnabledState):
2376         New methods that maintain the popup state stack.
2377         
2378         (WebCore::PluginViewWin::arePopupsAllowed):
2379         New method that returns whether popups are allowed.
2380         
2381         (WebCore::PluginViewWin::PluginViewWin):
2382         * plugins/win/PluginViewWin.h:
2383         Add new instance variables.
2384         
2385         * plugins/win/npapi.cpp:
2386         (NPN_PushPopupsEnabledState):
2387         (NPN_PopPopupsEnabledState):
2388         Implement these.
2389
2390 2007-12-12  Dan Bernstein  <mitz@apple.com>
2391
2392         Reviewed by John Sullivan.
2393
2394         - fix a bug in debug builds only where selecting an earlier item in
2395           a popup selects the first item
2396
2397         Test: fast/forms/menulist-selection-reset.html
2398
2399         * html/HTMLSelectElement.cpp:
2400         (WebCore::HTMLSelectElement::recalcListItems): Added an argument that
2401         tells that function whether it should update the selected state of
2402         option elements.
2403         (WebCore::HTMLSelectElement::checkListItems): Changed to pass false
2404         as the above argument.
2405         * html/HTMLSelectElement.h:
2406
2407 2007-12-12  Adele Peterson  <adele@apple.com>
2408
2409         Reviewed by Geoff.
2410
2411         Fix for <rdar://problem/5643054> Remove cue point implementation for media elements
2412
2413         When the specification for cue ranges is more final, we will implement those.
2414
2415         * html/HTMLMediaElement.cpp:
2416         (WebCore::HTMLMediaElement::~HTMLMediaElement):
2417         (WebCore::HTMLMediaElement::load):
2418         * html/HTMLMediaElement.h:
2419         * html/HTMLMediaElement.idl:
2420         * platform/graphics/MediaPlayer.cpp:
2421         * platform/graphics/MediaPlayer.h:
2422         (WebCore::MediaPlayerClient::mediaPlayerTimeChanged):
2423         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2424         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2425         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
2426         (WebCore::MediaPlayerPrivate::load):
2427         (WebCore::MediaPlayerPrivate::play):
2428         (WebCore::MediaPlayerPrivate::pause):
2429         (WebCore::MediaPlayerPrivate::setEndTime):
2430         (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
2431         (WebCore::MediaPlayerPrivate::endPointTimerFired):
2432         (WebCore::MediaPlayerPrivate::timeChanged):
2433         (WebCore::MediaPlayerPrivate::didEnd):
2434         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
2435         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
2436         (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
2437         (WebCore::MediaPlayerPrivate::endPointTimerFired):
2438         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
2439
2440 2007-12-12  MorganL  <morganl.webkit@yahoo.com>
2441
2442         Reviewed by Maciej.
2443
2444         Fixes:
2445         http://bugs.webkit.org/show_bug.cgi?id=16408
2446
2447         When navigating back/forward to a http:// link, we should prefer to
2448         load from cache if possible.
2449
2450         * loader/FrameLoader.cpp:
2451
2452 2007-12-12  Anders Carlsson  <andersca@apple.com>
2453
2454         Reviewed by Sam.
2455
2456         <rdar://problem/5132003>
2457         dumpResourceLoadCallbacks is not implemented in DRT on Windows.
2458         
2459         * platform/network/cf/ResourceErrorCF.cpp:
2460         (WebCore::ResourceError::unpackPlatformError):
2461         Handle kCFErrorDomainWinSock.
2462         
2463         * platform/network/cf/ResourceHandleCFNet.cpp:
2464         (WebCore::willSendRequest):
2465         Ignore willSendRequest calls where the redirect response is null, like we do in 
2466         the Mac version.
2467
2468 2007-12-12  Steve Falkenburg  <sfalken@apple.com>
2469
2470         <rdar://problem/5643785> Fix iBench regression caused by mis-placed nested timer check.
2471         
2472         Reviewed by Anders.
2473
2474         * platform/win/SharedTimerWin.cpp:
2475         (WebCore::TimerWindowWndProc): Don't set high-resolution timer flag inside non-high-resolution timer proc.
2476
2477 2007-12-12  Beth Dakin  <bdakin@apple.com>
2478
2479         Reviewed by Oliver.
2480
2481         Fix for <rdar://problem/5643770> REGRESSION: Free-standing SVGs 
2482         with width and height 100% clip to 300 x 150
2483
2484         Though it was correct in an earlier iteration of my patch, it is 
2485         not sufficient in the final, committed version to ask if the 
2486         relativeWidthValue() or relativeHeightValue() is greater than 0 
2487         just to determine if one has been set, for, they are now 
2488         initialized to 300 and 150 respectively! This patch instead adds a 
2489         bool to keep track of whether a container size has been set, and 
2490         only used the relative value if it has.
2491
2492         * rendering/RenderSVGRoot.cpp:
2493         (WebCore::RenderSVGRoot::calcViewport):
2494         * svg/SVGSVGElement.cpp:
2495         (WebCore::SVGSVGElement::SVGSVGElement):
2496         * svg/SVGSVGElement.h:
2497         (WebCore::SVGSVGElement::setContainerSize):
2498         (WebCore::SVGSVGElement::hasSetContainerSize):
2499
2500 2007-12-12  Brady Eidson  <beidson@apple.com>
2501
2502         Reviewed by Steve Falkenburg 
2503
2504         <rdar://problem/5012636> - WebURLProtectionSpace::realm returns the hostname rather than the authentication realm
2505
2506         * platform/network/ProtectionSpace.cpp:
2507         (WebCore::ProtectionSpace::ProtectionSpace): Assign the realm to m_realm, instead of the host
2508
2509 2007-12-12  Alp Toker  <alp@atoker.com>
2510
2511         Reviewed by Maciej.
2512
2513         http://bugs.webkit.org/show_bug.cgi?id=16388
2514         [GTK] Widget::setCursor() gets called frequently
2515
2516         Cache the current cursor to avoid calling gdk_window_set_cursor() when
2517         there's no change in cursor.
2518
2519         * platform/gtk/WidgetGtk.cpp:
2520         (WebCore::Widget::Widget):
2521         (WebCore::Widget::cursor):
2522         (WebCore::Widget::setCursor):
2523
2524 2007-12-12  Rodney Dawes  <dobey@wayofthemonkey.com>
2525
2526         Reviewed by Maciej.
2527
2528         http://bugs.webkit.org/show_bug.cgi?id=16342
2529         Build Warning and Error fixes in WebCore GTK+
2530
2531         Use C-style casts for casting function pointers to gpointer
2532         Use static_cast<int> to cast a float to int to fix a warning
2533
2534         * platform/gtk/PlatformScrollBarGtk.cpp:
2535         (PlatformScrollbar::PlatformScrollbar):
2536         (PlatformScrollbar::~PlatformScrollbar):
2537         (PlatformScrollbar::gtkValueChanged):
2538         * platform/gtk/ThreadingGtk.cpp:
2539         (callFunctionOnMainThread):
2540         (callOnMainThread):
2541
2542 2007-12-12  Dan Bernstein  <mitz@apple.com>
2543
2544         Reviewed by Darin Adler.
2545
2546         - better fix for a crash when pressing a key that is not associated
2547           with a command
2548
2549         * editing/EditorCommand.cpp:
2550         (WebCore::Editor::command): Return the empty command if the command name
2551         is empty.
2552
2553 2007-12-12  Alexey Proskuryakov  <ap@webkit.org>
2554
2555         Reviewed by Darin.
2556
2557         http://bugs.webkit.org/show_bug.cgi?id=16410
2558         Implement isKeypadEvent() on Windows
2559
2560         Test: platform/win/fast/events/keyLocation-numpad.html
2561
2562         * platform/win/KeyEventWin.cpp:
2563         (WebCore::isKeypadEvent): Added.
2564         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Also fixed a mistake with autorepeat.
2565
2566 2007-12-12  Oliver Hunt  <oliver@apple.com>
2567
2568         Reviewed by Maciej.
2569
2570         <rdar://problem/5071781> window.mouseout events are not sent 
2571         to window when mouse moves out of window 
2572
2573         Make PlatformMouseEvent recognise WM_MOUSELEAVE.
2574
2575         * platform/win/PlatformMouseEventWin.cpp:
2576         (WebCore::messageToEventType):
2577         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2578
2579 2007-12-12  Sam Weinig  <sam@webkit.org>
2580
2581         Fix Mac release build.
2582
2583         * WebCore.base.exp:
2584
2585 2007-12-12  Sam Weinig  <sam@webkit.org>
2586
2587         Build fix for Qt, Gtk, and Wx.
2588
2589         * css/CSSParser.cpp:
2590         (WebCore::CSSParser::parseValue):
2591         * loader/win/FrameLoaderWin.cpp:
2592         (WebCore::FrameLoader::urlSelected):
2593         * platform/network/curl/ResourceHandleManager.cpp:
2594         (WebCore::parseDataUrl):
2595         (WebCore::ResourceHandleManager::startJob):
2596         * platform/network/win/CookieJarWin.cpp:
2597         (WebCore::setCookies):
2598         (WebCore::cookies):
2599         * platform/network/win/ResourceHandleWin.cpp:
2600         (WebCore::ResourceHandle::start):
2601         * platform/qt/PasteboardQt.cpp:
2602         (WebCore::Pasteboard::writeURL):
2603
2604 2007-12-11  Dan Bernstein  <mitz@apple.com>
2605
2606         Reviewed by Maciej Stachowiak.
2607
2608         - allow non-integer font sizes on Windows for small caps
2609
2610         * platform/graphics/win/FontDataWin.cpp:
2611         (WebCore::FontData::smallCapsFontData):
2612         * platform/graphics/win/FontPlatformData.h:
2613         (WebCore::FontPlatformData::size):
2614         (WebCore::FontPlatformData::setSize):
2615         * platform/graphics/win/FontPlatformDataWin.cpp:
2616         (WebCore::FontPlatformData::FontPlatformData):
2617
2618 2007-12-11  Sam Weinig  <sam@webkit.org>
2619
2620         Build fix for Qt, Gtk, and Wx.
2621
2622         * platform/gtk/CookieJarGtk.cpp:
2623         (WebCore::setCookies):
2624         (WebCore::cookies):
2625         * platform/qt/ClipboardQt.cpp:
2626         (WebCore::ClipboardQt::writeURL):
2627         * platform/qt/CookieJarQt.cpp:
2628         (WebCore::setCookies):
2629         (WebCore::cookies):
2630         * platform/wx/PasteboardWx.cpp:
2631         (WebCore::Pasteboard::writeURL):
2632
2633 2007-12-11  Sam Weinig  <sam@webkit.org>
2634
2635         Reviewed by Darin Adler.
2636
2637         Scrub URL out of the tree in preparation for renaming KURL to URL.
2638             - Renames Document::URL() -> Document::url()
2639             - Renames DocumentLoader::URL() -> DocumentLoader::url()
2640             - Renames KURL::url() to KURL::string() and KURL::deprecatedString()
2641             - Remove FrameLoader::URL()
2642             - Various variable renames.
2643
2644         The change from Document::URL() to Document::url() required changes
2645         to the bindings scripts as well, because URL() is the name of a DOM
2646         method.  The code generation scripts now have code to special case URL()
2647         to url().
2648
2649         * WebCore.base.exp:
2650         * bindings/js/kjs_events.cpp:
2651         (WebCore::JSLazyEventListener::parseCode):
2652         * bindings/js/kjs_navigator.cpp:
2653         (KJS::Navigator::getValueProperty):
2654         * bindings/js/kjs_proxy.cpp:
2655         (WebCore::KJSProxy::initScript):
2656         * bindings/js/kjs_window.cpp:
2657         (KJS::Window::put):
2658         (KJS::Window::allowsAccessFrom):
2659         (KJS::Location::put):
2660         (KJS::LocationProtoFuncReplace::callAsFunction):
2661         (KJS::LocationProtoFuncReload::callAsFunction):
2662         (KJS::LocationProtoFuncAssign::callAsFunction):
2663         * bindings/scripts/CodeGenerator.pm:
2664         * bindings/scripts/CodeGeneratorCOM.pm:
2665         * bindings/scripts/CodeGeneratorJS.pm:
2666         * bindings/scripts/CodeGeneratorObjC.pm:
2667         * css/CSSImportRule.cpp:
2668         (WebCore::CSSImportRule::insertedIntoParent):
2669         * css/CSSParser.cpp:
2670         (WebCore::CSSParser::parseValue):
2671         (WebCore::CSSParser::parseContent):
2672         (WebCore::CSSParser::parseBackgroundImage):
2673         (WebCore::CSSParser::parseFontFaceSrc):
2674         (WebCore::CSSParser::parseBorderImage):
2675         (WebCore::CSSParser::createImportRule):
2676         * css/CSSStyleSelector.cpp:
2677         (WebCore::CSSStyleSelector::setEncodedURL):
2678         * dom/Document.cpp:
2679         (WebCore::Document::processHttpEquiv):
2680         (WebCore::Document::cookie):
2681         (WebCore::Document::setCookie):
2682         (WebCore::Document::domain):
2683         (WebCore::Document::setDomain):
2684         (WebCore::Document::getImageMap):
2685         (WebCore::Document::completeURL):
2686         * dom/Document.h:
2687         (WebCore::Document::url):
2688         (WebCore::Document::baseURL):
2689         * dom/Element.cpp:
2690         (WebCore::Element::baseURI):
2691         * dom/ProcessingInstruction.h:
2692         * dom/StyledElement.cpp:
2693         (WebCore::StyledElement::addCSSImageProperty):
2694         * dom/StyledElement.h:
2695         * dom/XMLTokenizer.cpp:
2696         (WebCore::XMLTokenizer::endElementNs):
2697         (WebCore::XMLTokenizer::end):
2698         (WebCore::):
2699         * dom/XMLTokenizer.h:
2700         * editing/Editor.cpp:
2701         (WebCore::Editor::copy):
2702         * editing/markup.cpp:
2703         (WebCore::completeURLs):
2704         * history/CachedPage.h:
2705         (WebCore::CachedPage::url):
2706         * history/HistoryItem.cpp:
2707         (WebCore::HistoryItem::HistoryItem):
2708         (WebCore::HistoryItem::setURL):
2709         (WebCore::HistoryItem::isCurrentDocument):
2710         * html/HTMLBaseElement.cpp:
2711         (WebCore::HTMLBaseElement::process):
2712         * html/HTMLParser.cpp:
2713         (WebCore::HTMLParser::reportErrorToConsole):
2714         * html/HTMLScriptElement.cpp:
2715         (WebCore::HTMLScriptElement::childrenChanged):
2716         (WebCore::HTMLScriptElement::insertedIntoDocument):
2717         (WebCore::HTMLScriptElement::evaluateScript):
2718         * html/HTMLScriptElement.h:
2719         * html/HTMLTokenizer.cpp:
2720         (WebCore::HTMLTokenizer::scriptExecution):
2721         * loader/Cache.cpp:
2722         (WebCore::createResource):
2723         (WebCore::Cache::requestResource):
2724         * loader/CachedCSSStyleSheet.cpp:
2725         (WebCore::CachedCSSStyleSheet::checkNotify):
2726         * loader/CachedResource.cpp:
2727         (WebCore::CachedResource::CachedResource):
2728         * loader/CachedResource.h:
2729         (WebCore::CachedResource::):
2730         * loader/CachedScript.h:
2731         * loader/DocLoader.cpp:
2732         (WebCore::DocLoader::checkForReload):
2733         (WebCore::DocLoader::requestResource):
2734         * loader/DocumentLoader.cpp:
2735         (WebCore::DocumentLoader::url):
2736         (WebCore::DocumentLoader::replaceRequestURLForAnchorScroll):
2737         (WebCore::DocumentLoader::setRequest):
2738         (WebCore::DocumentLoader::startLoadingMainResource):
2739         * loader/DocumentLoader.h:
2740         * loader/FrameLoader.cpp:
2741         (WebCore::FormSubmission::FormSubmission):
2742         (WebCore::ScheduledRedirection::ScheduledRedirection):
2743         (WebCore::FrameLoader::changeLocation):
2744         (WebCore::FrameLoader::urlSelected):
2745         (WebCore::FrameLoader::requestFrame):
2746         (WebCore::FrameLoader::loadSubframe):
2747         (WebCore::FrameLoader::submitFormAgain):
2748         (WebCore::FrameLoader::submitForm):
2749         (WebCore::FrameLoader::didExplicitOpen):
2750         (WebCore::FrameLoader::replaceContentsWithScriptResult):
2751         (WebCore::FrameLoader::executeScript):
2752         (WebCore::FrameLoader::receivedFirstData):
2753         (WebCore::FrameLoader::begin):
2754         (WebCore::FrameLoader::startIconLoader):
2755         (WebCore::FrameLoader::commitIconURLToIconDatabase):
2756         (WebCore::FrameLoader::scheduleRefresh):
2757         (WebCore::FrameLoader::redirectionTimerFired):
2758         (WebCore::FrameLoader::loadPlugin):
2759         (WebCore::FrameLoader::didNotOpenURL):
2760         (WebCore::FrameLoader::updatePolicyBaseURL):
2761         (WebCore::FrameLoader::scrollToAnchor):
2762         (WebCore::FrameLoader::startRedirectionTimer):
2763         (WebCore::FrameLoader::load):
2764         (WebCore::FrameLoader::canLoad):
2765         (WebCore::FrameLoader::shouldHideReferrer):
2766         (WebCore::FrameLoader::shouldAllowNavigation):
2767         (WebCore::FrameLoader::commitProvisionalLoad):
2768         (WebCore::FrameLoader::clientRedirected):
2769         (WebCore::FrameLoader::open):
2770         (WebCore::FrameLoader::didTellBridgeAboutLoad):
2771         (WebCore::FrameLoader::haveToldBridgeAboutLoad):
2772         (WebCore::FrameLoader::post):
2773         (WebCore::FrameLoader::loadResourceSynchronously):
2774         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
2775         (WebCore::FrameLoader::shouldTreatURLAsSameAsCurrent):
2776         (WebCore::FrameLoader::createHistoryItem):
2777         (WebCore::FrameLoader::addBackForwardItemClippedAtTarget):
2778         (WebCore::FrameLoader::loadItem):
2779         (WebCore::FrameLoader::urlsMatchItem):
2780         (WebCore::FrameLoader::recursiveGoToItem):
2781         (WebCore::FrameLoader::updateHistoryForStandardLoad):
2782         (WebCore::FrameLoader::updateHistoryForRedirectWithLockedHistory):
2783         * loader/FrameLoader.h:
2784         (WebCore::FrameLoader::url):
2785         * loader/ImageDocument.cpp:
2786         (WebCore::ImageDocument::createDocumentStructure):
2787         * loader/MainResourceLoader.cpp:
2788         (WebCore::shouldLoadAsEmptyDocument):
2789         (WebCore::MainResourceLoader::didFinishLoading):
2790         * loader/NavigationAction.cpp:
2791         (WebCore::NavigationAction::NavigationAction):
2792         * loader/NavigationAction.h:
2793         (WebCore::NavigationAction::url):
2794         * loader/PluginDocument.cpp:
2795         (WebCore::PluginTokenizer::createDocumentStructure):
2796         * loader/SubresourceLoader.cpp:
2797         (WebCore::SubresourceLoader::load):
2798         (WebCore::SubresourceLoader::create):
2799         * loader/icon/IconLoader.cpp:
2800         (WebCore::IconLoader::startLoading):
2801         (WebCore::IconLoader::finishLoading):
2802         * loader/loader.cpp:
2803         (WebCore::Loader::servePendingRequests):
2804         * loader/mac/LoaderNSURLExtras.m:
2805         (urlOriginalData):
2806         * page/Chrome.cpp:
2807         (WebCore::Chrome::setToolTip):
2808         * page/ContextMenuController.cpp:
2809         (WebCore::ContextMenuController::contextMenuItemSelected):
2810         * page/Frame.cpp:
2811         (WebCore::Frame::setUserStyleSheetLocation):
2812         * page/InspectorController.cpp:
2813         (WebCore::InspectorResource::type):
2814         (WebCore::addSourceToFrame):
2815         (WebCore::InspectorController::addScriptResource):
2816         (WebCore::InspectorController::updateScriptResourceRequest):
2817         (WebCore::InspectorController::didCommitLoad):
2818         * page/mac/WebCoreFrameBridge.mm:
2819         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
2820         * platform/KURL.h:
2821         (WebCore::KURL::string):
2822         (WebCore::KURL::deprecatedString):
2823         * platform/mac/ClipboardMac.mm:
2824         (WebCore::ClipboardMac::getData):
2825         * platform/mac/CookieJar.mm:
2826         (WebCore::cookies):
2827         (WebCore::setCookies):
2828         * platform/mac/PasteboardMac.mm:
2829         (WebCore::Pasteboard::writeURL):
2830         (WebCore::fileWrapperForImage):
2831         (WebCore::Pasteboard::writeImage):
2832         (WebCore::Pasteboard::plainText):
2833         * platform/network/ResourceHandle.cpp:
2834         (WebCore::ResourceHandle::portAllowed):
2835         * platform/network/ResourceRequestBase.cpp:
2836         (WebCore::ResourceRequestBase::isNull):
2837         * platform/network/cf/ResourceHandleCFNet.cpp:
2838         (WebCore::willSendRequest):
2839         (WebCore::didReceiveResponse):
2840         (WebCore::didReceiveData):
2841         (WebCore::didFinishLoading):
2842         (WebCore::didFail):
2843         (WebCore::didReceiveChallenge):
2844         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
2845         (WebCore::ResourceHandle::~ResourceHandle):
2846         (WebCore::ResourceHandle::start):
2847         * platform/win/ClipboardUtilitiesWin.cpp:
2848         (WebCore::createGlobalData):
2849         (WebCore::urlToMarkup):
2850         * platform/win/ClipboardWin.cpp:
2851         (WebCore::writeURL):
2852         (WebCore::writeImageToDataObject):
2853         (WebCore::ClipboardWin::writeURL):
2854         (WebCore::ClipboardWin::writeRange):
2855         * platform/win/PasteboardWin.cpp:
2856         (WebCore::Pasteboard::writeSelection):
2857         (WebCore::Pasteboard::writeURL):
2858         * plugins/win/PluginDatabaseWin.cpp:
2859         (WebCore::PluginDatabaseWin::findPlugin):
2860         * plugins/win/PluginStreamWin.cpp:
2861         (WebCore::PluginStreamWin::startStream):
2862         (WebCore::PluginStreamWin::destroyStream):
2863         * plugins/win/PluginViewWin.cpp:
2864         (WebCore::scriptStringIfJavaScriptURL):
2865         (WebCore::PluginViewWin::performRequest):
2866         * svg/SVGImageLoader.cpp:
2867         (WebCore::SVGImageLoader::updateFromElement):
2868         * xml/XMLHttpRequest.cpp:
2869         (WebCore::XMLHttpRequest::getResponseXML):
2870         (WebCore::XMLHttpRequest::urlMatchesDocumentDomain):
2871         * xml/XSLImportRule.cpp:
2872         (WebCore::XSLImportRule::loadSheet):
2873         * xml/XSLTProcessor.cpp:
2874         (WebCore::XSLTProcessor::createDocumentFromSource):
2875         (WebCore::xsltStylesheetPointer):
2876         (WebCore::xmlDocPtrFromNode):
2877
2878 2007-12-11  Beth Dakin  <bdakin@apple.com>
2879
2880         Reviewed by Darin.
2881
2882         Fix for <rdar://problem/5641255> SVGs with width and height 100% 
2883         fail to render when used as background images
2884
2885         CachedImage now has a setImageContainerSize function. It is only 
2886         needed for SVG right now.
2887         * loader/CachedImage.cpp:
2888         (WebCore::CachedImage::setImageContainerSize):
2889         * loader/CachedImage.h:
2890
2891         Relatively sized SVGs have no intrinsic size. Because this call is 
2892         low-level enough that we cannot pass in the container size and get 
2893         the real size of the SVG, we need to know if it has relative 
2894         dimensions, and if so, we need to get the size from scaledTileSize.
2895         * platform/graphics/Image.cpp:
2896         (WebCore::Image::drawTiled):
2897         * platform/graphics/Image.h:
2898         (WebCore::Image::setContainerSize):
2899         (WebCore::Image::hasRelativeWidth):
2900         (WebCore::Image::hasRelativeHeight):
2901
2902         Re-factored calculateBackgroundSize a bit so that it returns an 
2903         IntSize. Made it a member function so that it can send m_width and 
2904         m_height along to setImageContainerSize.
2905         * rendering/RenderBox.cpp:
2906         (WebCore::RenderBox::calculateBackgroundSize):
2907         (WebCore::RenderBox::calculateBackgroundImageGeometry):
2908         * rendering/RenderBox.h:
2909
2910         Need to account for relatively sized SVGs in calcViewport()
2911         * rendering/RenderSVGRoot.cpp:
2912         (WebCore::RenderSVGRoot::calcViewport):
2913         
2914         Added new member variables to store the size of the SVG container. 
2915         relativeWidthValue() and relativeHeightValue() use the stored SVG 
2916         container size to correctly calculate the width and height of a 
2917         relatively sized SVG.
2918         * svg/SVGSVGElement.cpp:
2919         (WebCore::SVGSVGElement::SVGSVGElement):
2920         (WebCore::SVGSVGElement::setContainerSize):
2921         (WebCore::SVGSVGElement::relativeWidthValue):
2922         (WebCore::SVGSVGElement::relativeHeightValue):
2923         * svg/SVGSVGElement.h:
2924         (WebCore::SVGSVGElement::containerSize):
2925         
2926         Re-factored size calculations to use the size of the container.
2927         * svg/graphics/SVGImage.cpp:
2928         (WebCore::SVGImage::setContainerSize):
2929         (WebCore::SVGImage::size):
2930         (WebCore::SVGImage::hasRelativeWidth):
2931         (WebCore::SVGImage::hasRelativeHeight):
2932         * svg/graphics/SVGImage.h:
2933
2934 2007-12-11  Darin Adler  <darin@apple.com>
2935
2936         * editing/Editor.cpp:
2937         (WebCore::Editor::yankFromKillRing): Try to fix non-Mac builds by adding
2938         a missing return statement.
2939
2940 2007-12-11  Darin Adler  <darin@apple.com>
2941
2942         Reviewed by Geoff.
2943
2944         - exposed many new commands to the DOM Document executeCommand function by
2945           merging the JSEditor and Editor executeCommand implementations
2946         - replaced the execCommand function with a EditorCommand class
2947         - replaced the WTF::StrHash<> class template with the WebCore::StringHash class
2948         - replaced the WTF::CaseInsensitiveHash<> class template with the
2949           WebCore::CaseFoldingHash class
2950
2951         * WebCore.base.exp: Updated.
2952         * WebCore.pro: Added EditorCommand.cpp, removed JSEditor.cpp.
2953         * WebCore.vcproj/WebCore.vcproj: Ditto.
2954         * WebCore.xcodeproj/project.pbxproj: Ditto.
2955         * WebCoreSources.bkl: Ditto.
2956
2957         * dom/Document.cpp:
2958         (WebCore::Document::Document): Removed code to set up m_jsEditor.
2959         (WebCore::Document::~Document): Removed code to delete m_jsEditor.
2960         (WebCore::command): Added. Helper function that gets an Editor::Command.
2961         (WebCore::Document::executeCommand): Changed to use Editor::Command instead of
2962         JSEditor.
2963         (WebCore::Document::queryCommandEnabled): Ditto.
2964         (WebCore::Document::queryCommandIndeterm):
2965         (WebCore::Document::queryCommandState): Ditto.
2966         (WebCore::Document::queryCommandSupported): Ditto.
2967         (WebCore::Document::queryCommandValue): Ditto.
2968
2969         * dom/Document.h: Removed JSEditor, jsEditor, m_jsEditor. Changed to
2970         use CaseFoldingHash.
2971
2972         * editing/Editor.cpp:
2973         (WebCore::Editor::selectionForCommand): Renamed from selectionForEvent and
2974         made into a member function so it is accessible from the new EditorCommand.cpp file.
2975         Also changed to get the selection from the passed-in frame instead of from the
2976         page, because this should work on the targeted frame unless the event overrides it.
2977         (WebCore::Editor::handleKeypress): Updated for selectionForCommand change.
2978         (WebCore::Editor::handleInputMethodKeypress): Ditto.
2979         (WebCore::imageElementFromImageDocument): Renamed and changed to return
2980         a HTMLImageElement instead of a Node*.
2981         (WebCore::Editor::canCopy): Updated for name change.
2982         (WebCore::Editor::selectionUnorderedListState): Updated for TriState change.
2983         (WebCore::Editor::selectionOrderedListState): Ditto.
2984         (WebCore::Editor::selectionStartHasStyle): Make type of local more specific.
2985         (WebCore::updateState): Moved here from Frame.
2986         (WebCore::Editor::selectionHasStyle): Ditto.
2987         (WebCore::Editor::Editor): Initialize m_shouldStartNewKillRingSequence.
2988         (WebCore::Editor::insertTextWithoutSendingTextEvent): Updated for
2989         selectionForCommand change.
2990         (WebCore::Editor::copy): Updated for imageElementFromImageDocument change.
2991         (WebCore::Editor::toggleBold): Call the ToggleBold command via the command
2992         machinery since it's no longer in this file as a local function.
2993         (WebCore::Editor::toggleUnderline): Call the ToggleUnderline command.
2994         (WebCore::Editor::setBaseWritingDirection): Change type of argument and of
2995         local variable.
2996         (WebCore::Editor::addToKillRing): Moved here from EditorMac. Not useful
2997         without a kill ring, but it's relatively straightforward to implement one.
2998         (WebCore::Editor::appendToKillRing): Put default implementation here for
2999         platforms other than Mac. We should probably put a simple kill ring
3000         implementation here -- doesn't need to be shared with the OS oh platforms
3001         other than Mac.
3002         (WebCore::Editor::prependToKillRing): Ditto.
3003         (WebCore::Editor::yankFromKillRing): Ditto.
3004         (WebCore::Editor::startNewKillRingSequence): Ditto.
3005         (WebCore::Editor::setKillRingToYankedState): Ditto.
3006
3007         * editing/Editor.h: Moved the TriState enum here instead of inside the
3008         Frame class. Added EditorCommandSource enum. Moved selectionHasStyle
3009         here from the Frame class. Added Editor::Command class with five functions
3010         for the various things you can do with a command (execute it, check if it
3011         can be used, and its state and value). Changed hte parameter of
3012         setBaseWritingDirection to be a const String& rather than a String.
3013         Got rid of the kill-ring-related operations, but added the kill ring
3014         functions themselves. Made selectedRange() public. Made the
3015         m_startNewKillRingSequence not Mac-specific and added "should" to its
3016         name.
3017
3018         * editing/EditorCommand.cpp: Copied from WebCore/editing/Editor.cpp.
3019         Retained only the editing commands.
3020         (WebCore::targetFrame): Moved to the top of the file.
3021         (WebCore::executeApplyStyle): Added. Helper function for commands
3022         that need to apply styles.
3023         (WebCore::executeToggleStyle): Added. Helper function for commands
3024         that need to toggle styles based on the style of the start of selection.
3025         (WebCore::executeApplyParagraphStyle): Added. Like executeApplyStyle, but
3026         for paragraph styles.
3027         (WebCore::executeInsertFragment): Added. Helper function for commands
3028         that need to insert a DOM fragment.
3029         (WebCore::executeInsertNode): Added. Helper function for commands that
3030         need to insert a tree rooted in a single DOM node.
3031         (WebCore::stateStyle): Added. Helper function for the state of commands
3032         that represent style.
3033         (WebCore::valueStyle): Added. Helper function for the value of commands
3034         that represent style.
3035         (WebCore::canScroll): Added. Helper functions for some move and scroll
3036         commands that need to determine if the renderer they are in can scroll.
3037         (WebCore::unionDOMRanges): Moved here from EditorMac.
3038         (WebCore::executeBackColor):
3039         (WebCore::executeBackwardDelete):
3040         (WebCore::executeCopy):
3041         (WebCore::executeCreateLink):
3042         (WebCore::executeCut):
3043         (WebCore::executeDelete):
3044         (WebCore::executeDeleteToMark):
3045         (WebCore::executeDeleteWordBackward):
3046         (WebCore::executeDeleteWordForward):
3047         (WebCore::executeFindString):
3048         (WebCore::executeFontName):
3049         (WebCore::executeFontSize):
3050         (WebCore::executeFontSizeDelta):
3051         (WebCore::executeForeColor):
3052         (WebCore::executeFormatBlock):
3053         (WebCore::executeForwardDelete):
3054         (WebCore::executeIndent):
3055         (WebCore::executeInsertBacktab):
3056         (WebCore::executeInsertHorizontalRule):
3057         (WebCore::executeInsertHTML):
3058         (WebCore::executeInsertImage):
3059         (WebCore::executeInsertLineBreak):
3060         (WebCore::executeInsertNewline):
3061         (WebCore::executeInsertNewlineInQuotedContent):
3062         (WebCore::executeInsertOrderedList):
3063         (WebCore::executeInsertParagraph):
3064         (WebCore::executeInsertTab):
3065         (WebCore::executeInsertText):
3066         (WebCore::executeInsertUnorderedList):
3067         (WebCore::executeJustifyCenter):
3068         (WebCore::executeJustifyFull):
3069         (WebCore::executeJustifyLeft):
3070         (WebCore::executeJustifyRight):
3071         (WebCore::executeMoveBackward):
3072         (WebCore::executeMoveBackwardAndModifySelection):
3073         (WebCore::executeMoveDown):
3074         (WebCore::executeMoveDownAndModifySelection):
3075         (WebCore::executeMoveDownByPageAndModifyCaret):
3076         (WebCore::executeMoveForward):
3077         (WebCore::executeMoveForwardAndModifySelection):
3078         (WebCore::executeMoveLeft):
3079         (WebCore::executeMoveLeftAndModifySelection):
3080         (WebCore::executeMoveRight):
3081         (WebCore::executeMoveRightAndModifySelection):
3082         (WebCore::executeMoveToBeginningOfDocument):
3083         (WebCore::executeMoveToBeginningOfDocumentAndModifySelection):
3084         (WebCore::executeMoveToBeginningOfLine):
3085         (WebCore::executeMoveToBeginningOfLineAndModifySelection):
3086         (WebCore::executeMoveToBeginningOfParagraph):
3087         (WebCore::executeMoveToBeginningOfParagraphAndModifySelection):
3088         (WebCore::executeMoveToBeginningOfSentence):
3089         (WebCore::executeMoveToBeginningOfSentenceAndModifySelection):
3090         (WebCore::executeMoveToEndOfDocument):
3091         (WebCore::executeMoveToEndOfDocumentAndModifySelection):
3092         (WebCore::executeMoveToEndOfSentence):
3093         (WebCore::executeMoveToEndOfSentenceAndModifySelection):
3094         (WebCore::executeMoveToEndOfLine):
3095         (WebCore::executeMoveToEndOfLineAndModifySelection):
3096         (WebCore::executeMoveToEndOfParagraph):
3097         (WebCore::executeMoveToEndOfParagraphAndModifySelection):
3098         (WebCore::executeMoveParagraphBackwardAndModifySelection):
3099         (WebCore::executeMoveParagraphForwardAndModifySelection):
3100         (WebCore::executeMoveUp):
3101         (WebCore::executeMoveUpAndModifySelection):
3102         (WebCore::executeMoveUpByPageAndModifyCaret):
3103         (WebCore::executeMoveWordBackward):
3104         (WebCore::executeMoveWordBackwardAndModifySelection):
3105         (WebCore::executeMoveWordForward):
3106         (WebCore::executeMoveWordForwardAndModifySelection):
3107         (WebCore::executeMoveWordLeft):
3108         (WebCore::executeMoveWordLeftAndModifySelection):
3109         (WebCore::executeMoveWordRight):
3110         (WebCore::executeMoveWordRightAndModifySelection):
3111         (WebCore::executeOutdent):
3112         (WebCore::executePaste):
3113         (WebCore::executePasteAndMatchStyle):
3114         (WebCore::executePrint):
3115         (WebCore::executeRedo):
3116         (WebCore::executeRemoveFormat):
3117         (WebCore::executeSelectAll):
3118         (WebCore::executeSelectToMark):
3119         (WebCore::executeSetMark):
3120         (WebCore::executeStrikethrough):
3121         (WebCore::executeSubscript):
3122         (WebCore::executeSuperscript):
3123         (WebCore::executeSwapWithMark):
3124         (WebCore::executeToggleBold):
3125         (WebCore::executeToggleItalic):
3126         (WebCore::executeTranspose):
3127         (WebCore::executeUnderline):
3128         (WebCore::executeUndo):
3129         (WebCore::executeUnlink):
3130         (WebCore::executeUnscript):
3131         (WebCore::executeUnselect):
3132         (WebCore::executeYank):
3133         (WebCore::executeYankAndSelect):
3134         (WebCore::supported):
3135         (WebCore::supportedPaste):
3136         (WebCore::enabled):
3137         (WebCore::enabledAnySelection):
3138         (WebCore::enabledAnySelectionAndMark):
3139         (WebCore::enableCaretInEditableText):
3140         (WebCore::enabledCopy):
3141         (WebCore::enabledCut):
3142         (WebCore::enabledInEditableText):
3143         (WebCore::enabledInRichlyEditableText):
3144         (WebCore::enabledPaste):
3145         (WebCore::enabledRangeInEditableText):
3146         (WebCore::enabledRangeInRichlyEditableText):
3147         (WebCore::enabledRedo):
3148         (WebCore::enabledUndo):
3149         (WebCore::stateNone):
3150         (WebCore::stateBold):
3151         (WebCore::stateItalic):
3152         (WebCore::stateOrderedList):
3153         (WebCore::stateStrikethrough):
3154         (WebCore::stateSubscript):
3155         (WebCore::stateSuperscript):
3156         (WebCore::stateUnderline):
3157         (WebCore::stateUnorderedList):
3158         (WebCore::valueNull):
3159         (WebCore::valueBackColor):
3160         (WebCore::valueFontName):
3161         (WebCore::valueFontSize):
3162         (WebCore::valueFontSizeDelta):
3163         (WebCore::valueForeColor):
3164         (WebCore::createCommandMap): Added lots of commands, including all the commands
3165         from JSEditor. A few commands needed different behavior based on whether they are
3166         invoked from the DOM or a keyboard binding.
3167         (WebCore::Editor::command): Added. Gets a command object given a name.
3168         (WebCore::Editor::Command::Command): Added.
3169         (WebCore::Editor::Command::execute): Added.
3170         (WebCore::Editor::Command::isSupported): Added.
3171         (WebCore::Editor::Command::isEnabled): Added.
3172         (WebCore::Editor::Command::state): Added.
3173         (WebCore::Editor::Command::value): Added.
3174         (WebCore::Editor::execCommand): Changed to call command().execute().
3175
3176         * editing/JSEditor.cpp: Removed.
3177         * editing/JSEditor.h: Removed.
3178
3179         * editing/mac/EditorMac.mm: Changed to provide kill ring primitives intead of
3180         kill ring commands, so the kill ring commands can be cross-platform.
3181         (WebCore::Editor::appendToKillRing): Added.
3182         (WebCore::Editor::prependToKillRing): Added.
3183         (WebCore::Editor::yankFromKillRing): Added.
3184         (WebCore::Editor::startNewKillRingSequence): Added.
3185         (WebCore::Editor::setKillRingToYankedState): Added.
3186
3187         * page/Frame.cpp: Removed selectionHasStyle, TriState, and updateState.
3188         * page/Frame.h: Ditto.
3189
3190         * page/mac/WebCoreFrameBridge.mm: Removed selectionHasStyle.
3191         * page/mac/WebCoreFrameBridge.h: Ditto.
3192
3193         * platform/ContextMenu.cpp:
3194         (WebCore::ContextMenu::checkOrEnableIfNeeded): Updated for TriState change.
3195
3196         * platform/text/StringHash.h:
3197         (WebCore::StringHash::hash): Merged the StrHash<> template classes into this.
3198         (WebCore::StringHash::equal): Ditto.
3199         (WebCore::CaseFoldingHash::hash): Merged the CaseInsensitiveHash<> template
3200         classes into this.
3201         (WebCore::CaseFoldingHash::equal): Ditto.
3202
3203         * platform/text/StringImpl.cpp:
3204         (WebCore::equal): Changed to invoke StringHash.
3205         (WebCore::equalIgnoringCase): Changed to invoke CaseFoldingHash.
3206
3207         * dom/DOMImplementation.cpp:
3208         (WebCore::addString): Updated to use StringHash and CaseFoldingHash.
3209         (WebCore::isSVG10Feature): Ditto.
3210         (WebCore::isSVG11Feature): Ditto.
3211         * loader/FrameLoader.cpp:
3212         (WebCore::localSchemes): Ditto.
3213         * platform/graphics/FontCache.cpp:
3214         (WebCore::computeHash): Ditto.
3215         * platform/network/HTTPHeaderMap.h: Ditto.
3216         * platform/text/PlatformString.h: Ditto.
3217         * platform/text/StringImpl.h: Ditto.
3218         * rendering/RenderPartObject.cpp:
3219         (WebCore::RenderPartObject::updateWidget): Ditto.
3220         * xml/XMLHttpRequest.cpp:
3221         (WebCore::canSetRequestHeader): Ditto.
3222
3223         * rendering/RenderTreeAsText.cpp: Removed stray include of JSEditor.h.
3224
3225 2007-12-11  Darin Adler  <darin@apple.com>
3226
3227         * platform/wx/KeyboardEventWx.cpp:
3228         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Another try at fixing the
3229         WX build. Changes the code around a little bit.
3230
3231 2007-12-11  Darin Adler  <darin@apple.com>
3232
3233         * platform/wx/KeyboardEventWx.cpp:
3234         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Quick try at fixing build.
3235
3236 2007-12-11  Dan Bernstein  <mitz@apple.com>
3237
3238         Reviewed by Darin Adler.
3239
3240         - fix <rdar://problem/5631507> Text doesn't wrap properly at Tamil version of Wikipedia
3241
3242         Test: fast/text/international/complex-character-based-fallback.html
3243
3244         * platform/graphics/Font.cpp:
3245         (WebCore::Font::glyphDataForCharacter): Added a forceSmallCaps argument
3246         that forces this function to use the small caps font. It is used for
3247         combining marks that need to combine with a small cap.
3248         * platform/graphics/Font.h:
3249         * platform/win/UniscribeController.cpp:
3250         (WebCore::UniscribeController::advance): Changed to split the string
3251         into runs of characters that will be rendered using the same FontData.
3252         This is done by calling glyphDataForCharacter() for each cahracter to
3253         find the FontData it should be rendered with.
3254         (WebCore::UniscribeController::itemizeShapeAndPlace): Added a fontData
3255         argument that is passed on to shapeAndPlaceItem() instead of the
3256         smallCaps argument.
3257         (WebCore::UniscribeController::shapeAndPlaceItem): Added a fontData
3258         argument and removed the font fallback logic from this function, as
3259         it is now expected to be called with an item all of whose characters
3260         can be rendered with the given fontData.
3261         * platform/win/UniscribeController.h:
3262
3263 2007-12-07  Alexey Proskuryakov  <ap@webkit.org>
3264
3265         Reviewed by Darin.
3266
3267         <rdar://problem/5535636>
3268         Have to press 4 times instead of 2 times to get the expected result of ^^ with german keyboard.
3269
3270         http://bugs.webkit.org/show_bug.cgi?id=13916
3271         JavaScript detects Tab as a character input on a textfield validation
3272
3273         Test: platform/win/fast/events/double-dead-char.html
3274
3275         * platform/PlatformKeyboardEvent.h:
3276         (WebCore::PlatformKeyboardEvent::):
3277         (WebCore::PlatformKeyboardEvent::type):
3278         (WebCore::PlatformKeyboardEvent::windowsVirtualKeyCode):
3279         (WebCore::PlatformKeyboardEvent::setWindowsVirtualKeyCode):
3280         (WebCore::PlatformKeyboardEvent::keyIdentifier):
3281         (WebCore::PlatformKeyboardEvent::setIsAutoRepeat):
3282         Added an explicit type member to differentiate different kinds of events:
3283           RawKeyDown == keydown == WM_KEYDOWN
3284           KeyUp == keyup == WM_KEYUP
3285           Char == keypress == WM_CHAR
3286           KeyDown == e.g. NSKeyDown or NSFlagsChanged, used on platforms that have a different model for
3287           event processing, and needs to be converted to RawKeyDown (+ Char) for processing in DOM.
3288
3289         * platform/mac/KeyEventMac.mm:
3290         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Updated for changed data members.
3291         Fix Enter (numeric keypad) charCode to match Return, as we check for it from keypress default handlers.
3292         (WebCore::windowsKeyCodeForKeyEvent): 
3293         (WebCore::isKeyUpEvent): Made it do something closer to what it claims; added a FIXME explaining
3294         that it still fails.
3295         (WebCore::disambiguateKeyDownEvent): Downgrade from KeyDown to RawKeyDown or Char, removing information that
3296         should not be available in those (because it cannot be provided on Windows).
3297
3298         * platform/win/KeyEventWin.cpp:
3299         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Updated for changed data members.
3300         Used standard Windows constants for bit masks instead of our own ones.
3301         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Should never be called on Windows.
3302
3303         * platform/gtk/KeyEventGtk.cpp:
3304         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3305         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
3306         * platform/qt/PlatformKeyboardEventQt.cpp:
3307         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3308         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
3309         * platform/wx/KeyboardEventWx.cpp:
3310         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3311         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
3312         Updated for cross-platform changes as much as it was possible without appropriate build
3313         environments.
3314
3315         * WebCore.base.exp: Export PlatformKeyboardEvent::disambiguateKeyDownEvent(), used by platforms that need to
3316         convert their fancy key events to RawKeyDown/Char pairs. Export Editor::isTextInsertionCommand().
3317
3318         * bridge/EditorClient.h:
3319         Renamed handleKeypress() to handleKeyboardEvent(), as it gets both keydowns and keypresses.
3320         Renamed handleInputMethodKeypress() to handleInputMethodKeydown(), as IMs work with raw keydowns.
3321
3322         * dom/Document.h:
3323         * dom/Document.cpp:
3324         (WebCore::Document::defaultEventHandler): Moved accesskey processing to EventHandler.
3325
3326         * dom/KeyboardEvent.h: Added comments describing keyCode/charCode behavior.
3327
3328         * dom/KeyboardEvent.cpp:
3329         (WebCore::eventTypeForKeyboardEventType):
3330         (WebCore::KeyboardEvent::KeyboardEvent): Conversion between platform and DOM event types is
3331         now straightforward, so scary hacks such as using autorepeat to distinguish types are
3332         not needed.
3333         (WebCore::KeyboardEvent::keyCode): Added a comment describing other browsers' behavior.
3334         (WebCore::KeyboardEvent::charCode): Added a comment describing other browsers' behavior.
3335         Changed to a more compatible behavior: raw keydown/keyup events do not and can not have
3336         character codes.
3337
3338         * editing/Editor.h:
3339         * editing/Editor.cpp:
3340         (WebCore::Editor::isTextInsertionCommand): Is this command actually text input in disguise?
3341         (WebCore::Editor::handleKeyboardEvent): Updated for new function names.
3342         (WebCore::Editor::handleInputMethodKeydown): Ditto.
3343
3344         * html/HTMLButtonElement.cpp:
3345         (WebCore::HTMLButtonElement::defaultEventHandler): Perform the default action when handling an
3346         appropriate event. Enter is processed on keypress (and thus should be checked for via charCode,
3347         not keyIdentifier), Space is processed on keydown+keyup! We now match IE in that a button is
3348         highlighted when Space is pressed.
3349
3350         * html/HTMLInputElement.cpp:
3351         (WebCore::HTMLInputElement::defaultEventHandler):
3352         * html/HTMLSelectElement.cpp:
3353         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
3354         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
3355         Made a number of fixes to when default actions take place, similar to HTMLButtonElement ones
3356         described above.
3357
3358         * page/EventHandler.cpp:
3359         (WebCore::EventHandler::keyEvent): Unless we have a combined KeyDown, just forward the event
3360         to the target. Call accesskey handling directly, as it doesn't seem to be part of normal event
3361         handling in IE. Also streamlined the code in KeyDown case, thanks to handleInputMethodKeypress()
3362         now being handleInputMethodKeydown().
3363         (WebCore::EventHandler::handleTextInputEvent): Check that we were not called from keydown.
3364         (WebCore::EventHandler::defaultTextInputEventHandler): Removed a call to defaultTabEventHandler,
3365         as default tab handling happens when processing keydown.
3366         (WebCore::handleAccessKey): Moved from Document, as access keys are processed outside normal
3367         event handling. Fixed accesskey processing to use information that's available in a raw keydown
3368         event.
3369
3370         (WebCore::EventHandler::defaultKeyboardEventHandler): Do not ignore keydown; in particular,
3371         handle tabs during keydown processing.
3372
3373         * page/mac/EventHandlerMac.mm:
3374         (WebCore::EventHandler::currentKeyboardEvent): Disambiguate KeyDown as RawKeyDown, as this is
3375         what callers want.
3376
3377         * platform/text/PlatformString.h:
3378         * platform/text/String.cpp:
3379         (WebCore::String::characterStartingAt):
3380         * platform/text/StringImpl.cpp:
3381         (WebCore::StringImpl::characterStartingAt):
3382         * platform/text/StringImpl.h:
3383         Added a UChar32 accessor.
3384
3385         * svg/graphics/SVGImageEmptyClients.h:
3386         (WebCore::SVGEmptyEditorClient::handleKeyboardEvent):
3387         (WebCore::SVGEmptyEditorClient::handleInputMethodKeydown):
3388         Updated for new function names.
3389
3390 2007-12-11  John Sullivan  <sullivan@apple.com>
3391
3392         Reviewed by Adele
3393
3394         Tiger build fix -- don't call QTMovieView setDelegate: directly because it's not public
3395
3396         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3397         (WebCore::MediaPlayerPrivate::createQTMovieView):
3398         (WebCore::MediaPlayerPrivate::detachQTMovieView):
3399
3400 2007-12-11  Alexey Proskuryakov  <ap@webkit.org>
3401
3402         Reviewed by Darin.
3403
3404         http://bugs.webkit.org/show_bug.cgi?id=16325
3405         <rdar://problem/5632997> REGRESSION: www.xerox.ru doesn't work
3406
3407         Fix this on Windows, too!
3408
3409         Test: http/tests/misc/empty-cookie.html
3410
3411         * platform/network/win/CookieJarWin.cpp:
3412         (WebCore::setCookies):
3413         (WebCore::cookies):
3414         Same fix as on Mac, translated into CF.
3415
3416         * platform/win/CookieJarWin.cpp: Removed - the real one is in platform/network/win.
3417
3418 2007-12-11  Christian Dywan  <christian@twotoasts.de>
3419
3420         Reviewed by Alp Toker.
3421
3422         http://bugs.webkit.org/show_bug.cgi?id=16371
3423         Implement additional mouse cursors for Gtk
3424
3425         Added cursor bitmaps from Mozilla:
3426         http://lxr.mozilla.org/mozilla1.8/source/widget/src/gtk2/nsGtkCursors.h
3427
3428         * platform/gtk/CursorGtk.cpp:
3429         (WebCore::customCursorNew):
3430         (WebCore::verticalTextCursor):
3431         (WebCore::cellCursor):
3432         (WebCore::contextMenuCursor):
3433         (WebCore::noDropCursor):
3434         (WebCore::copyCursor):
3435         (WebCore::progressCursor):
3436         (WebCore::aliasCursor):
3437         (WebCore::noneCursor):
3438         (WebCore::notAllowedCursor):
3439         (WebCore::zoomInCursor):
3440         (WebCore::zoomOutCursor):
3441         * platform/gtk/CursorGtk.h: Added.
3442
3443 2007-12-10  Oliver Hunt  <oliver@apple.com>
3444
3445         Reviewed by Weinig, Dan, and Alexey.
3446
3447         Fix character set used for dynamically loaded scripts.
3448
3449         Fix for:
3450             <rdar://problem/5333163> Safari can not display the mouse over pop menu on ChinaTimes News site correctly.
3451             <rdar://problem/5530048> [Safari]? :Leopard9A576: The typed CH characters displays as garbage in Sina website after reloading the webpage.
3452             <rdar://problem/5416588> All menus for chinese IBM site have wrong encoding
3453             
3454         Use the same logic to determine the charset for a script loaded dynamically
3455         as we do for a statically loaded script.
3456
3457         * html/HTMLScriptElement.cpp:
3458         (WebCore::HTMLScriptElement::insertedIntoDocument):
3459
3460 2007-12-10  Justin Garcia  <justin.garcia@apple.com>
3461
3462         Reviewed by Oliver Hunt.
3463
3464         <rdar://problem/5482023> GoogleDocs: After FormatBlock in an empty document, certain functions are disabled
3465         
3466         We were trying to insert a block of the requested type before the body element.
3467         
3468         * editing/FormatBlockCommand.cpp:
3469         (WebCore::FormatBlockCommand::doApply): 
3470         Removed unnecessary ()s in the if condition.
3471         Removed "|| !upstreamStart.node()->isDescendantOf(root)" from the if condition, since
3472         a) upstreamStart will never be outside the root editable element, since in that case
3473         there would be no block inside the editable root to Format, and b) if upstreamStart.node() 
3474         *is* the root, then refNode is the root, and we shouldn't insert before the root, we should insert
3475         at [root, 0].
3476         Added comments to explain the use of upstream() in the second if-clause.
3477         Added an early return for case where there is nothing selected, in that case, there is nothing
3478         to move.
3479
3480 2007-12-10  Adele Peterson  <adele@apple.com>
3481
3482         Reviewed and partially fixed by Tim Hatcher.
3483
3484         Remaining part of fix for <rdar://problem/5633400>
3485         Transformed <video> is not clipped correctly until a repaint is forced
3486
3487         Replace the implementation of a QTKit method to avoid repaints from the NSView system associated with the QTMovie
3488         from clobbering the WebCore repaints.
3489
3490         * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaPlayerRepaint): Added.
3491         * html/HTMLMediaElement.h:
3492         * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::repaint): Added.
3493         * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::mediaPlayerRepaint): Added.
3494
3495         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3496         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3497         (method_setImplementation): Added for Tiger.
3498
3499         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate): Call detachQTMovieView, which now does more cleanup.
3500         (WebCore::MediaPlayerPrivate::cancelLoad): ditto.
3501         (WebCore::MediaPlayerPrivate::setVisible): ditto.
3502         (WebCore::MediaPlayerPrivate::detachQTMovieView): Clear the delegate as well as m_qtMovieView pointer.
3503
3504         (WebCore::MediaPlayerPrivate::repaint): Added.  Triggers a repaint on the video renderer.
3505         (-[WebCoreMovieObserver repaint]): ditto.
3506
3507         (WebCore::mainThreadSetNeedsDisplay): Added.
3508          Does a WebCore repaint instead of going through the view repaint system for QTMovieView.
3509         (WebCore::MediaPlayerPrivate::createQTMovieView): Replace the implementation of _mainThreadSetNeedsDisplay.
3510
3511 2007-12-10  Geoffrey Garen  <ggaren@apple.com>
3512
3513         Reviewed by Sam Weinig.
3514
3515         Updated for rename in JavaScriptCore.
3516
3517         * bridge/mac/WebCoreScriptDebugger.mm:
3518         (-[WebCoreScriptCallFrame scopeChain]):
3519         (-[WebCoreScriptCallFrame functionName]):
3520         (-[WebCoreScriptCallFrame evaluateWebScript:]):
3521
3522 2007-12-10  Rodney Dawes  <dobey@wayofthemonkey.com>
3523
3524         Bug 16383: Ambiguous Window Usage in kjs_dom.cpp
3525         <http://bugs.webkit.org/show_bug.cgi?id=16383>
3526
3527         Use KJS::Window not the ambiguous Window
3528
3529         Reviewed by ddkilzer.
3530
3531         * bindings/js/kjs_dom.cpp (checkNodeSecurity):
3532
3533 2007-12-10  Sam Weinig  <sam@webkit.org>
3534
3535         Fix non-mac builds.
3536
3537         * page/WindowFeatures.cpp: #include <wtf/MathExtras.h> for isnan.
3538
3539 2007-12-10  Marvin Decker  <marv.decker@gmail.com>
3540
3541         Reviewed by Darin.
3542
3543         Fix a divide by 0 in the progress tracker.
3544         http://bugs.webkit.org/show_bug.cgi?id=15055
3545
3546         * loader/ProgressTracker.cpp:
3547         (WebCore::ProgressTracker::incrementProgress):
3548
3549 2007-12-09  Sam Weinig  <sam@webkit.org>
3550
3551         Reviewed by Darin.
3552
3553         More cleanup of kjs_window.
3554         - Move WindowFeatures from bridge/ to page/
3555         - Move functions related to WindowFeatures (boolFeature,
3556           floatFeature, setWindowFeature, parseWindowFeatures) into the class.
3557         - Fix up whitespace.