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