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