WebCore:
[WebKit-https.git] / WebCore / ChangeLog
1 2008-01-02  Alice Liu  <alice.liu@apple.com>
2
3         Reviewed by Maciej.
4
5         Fixed <rdar://5283861> (problems scrolling in gmail message content area)
6
7         * platform/ScrollView.h:
8         * platform/win/ScrollViewWin.cpp:
9         (WebCore::ScrollView::scroll):
10          Changed return value to bool to reflect success of scroll attempt
11
12 2008-01-02  Alexey Proskuryakov  <ap@webkit.org>
13
14         Fixed a typo (pointed out in review, but I somehow missed it at first).
15
16         * editing/EditorCommand.cpp: (WebCore::executeDelete):
17
18 2008-01-02  Alexey Proskuryakov  <ap@webkit.org>
19
20         Reviewed by Darin.
21
22         Resolved several FIXMEs in EditorCommand.
23         Made recently added commands hidden from JS again.
24         Removed BackwardDelete implementation, which used to be dead code, but got exposed now.
25
26         Tests: editing/execCommand/delete-no-scroll.html
27                editing/execCommand/forward-delete-no-scroll.html
28                editing/execCommand/insert-line-break-no-scroll.html
29
30         * editing/EditorCommand.cpp:
31         (WebCore::executeDelete):
32         (WebCore::executeForwardDelete):
33         (WebCore::executeInsertLineBreak):
34         (WebCore::supportedFromMenuOrKeyBinding):
35         (WebCore::CommandEntry::):
36
37 2008-01-02  Alexey Proskuryakov  <ap@webkit.org>
38
39         Reviewed by Darin.
40
41         http://bugs.webkit.org/show_bug.cgi?id=14555
42         action=mailto + method=get - The generated mailto URI is incorrect and the hvalues are encoded twice
43
44         http://bugs.webkit.org/show_bug.cgi?id=14774
45         Submitted data only includes first input item
46
47         Reworked encoding of mailto URLs to match other browsers.
48         Moved most of related logic from FrameLoader::submitForm() to HTMLFormElement::submit().
49
50         Tests: fast/forms/mailto/advanced-get.html
51                fast/forms/mailto/advanced-put.html
52                fast/forms/mailto/get-multiple-items-text-plain.html
53                fast/forms/mailto/get-multiple-items-x-www-form-urlencoded.html
54                fast/forms/mailto/get-multiple-items.html
55                fast/forms/mailto/get-non-ascii.html
56                fast/forms/mailto/get-non-ascii-text-plain.html
57                fast/forms/mailto/get-overwrite-query.html
58                fast/forms/mailto/post-append-query.html
59                fast/forms/mailto/post-multiple-items-multipart-form-data.html
60                fast/forms/mailto/post-multiple-items-text-plain.html
61                fast/forms/mailto/post-multiple-items-x-www-form-urlencoded.html
62                fast/forms/mailto/post-multiple-items.html
63
64         * html/HTMLFormElement.cpp:
65         (WebCore::HTMLFormElement::submit):
66         * loader/FrameLoader.cpp:
67         (WebCore::FrameLoader::submitForm):
68
69 2008-01-02  Mark Rowe  <mrowe@apple.com>
70
71         Autotools build fix.
72
73         * GNUmakefile.am: Remove files before generating them, not after.
74
75 2008-01-02  Mark Rowe  <mrowe@apple.com>
76
77         Rubber-stamped by Alp Toker.
78
79         Add missing dependencies to some GNUmakefile.am rules.
80
81         * GNUmakefile.am:
82
83 2008-01-02  Mark Rowe  <mrowe@apple.com>
84
85         Reviewed by Alp Toker.
86
87         Autotools build fix.  Make can expand $@ to any of the targets for the rule,
88         while we always want to use the name of the .cpp file as the output file.
89
90         * GNUmakefile.am:
91
92 2008-01-02  Luca Bruno  <lethalman88@gmail.com>
93
94         Reviewed by Alp Toker.
95
96         http://bugs.webkit.org/show_bug.cgi?id=16115
97         [GTK] ContextMenu and ContextMenuItem lacks an implementation
98
99         Add context menu support.
100
101         Based on a patch by Holger Freyther.
102
103         * platform/gtk/ContextMenuGtk.cpp:
104         (WebCore::menuItemActivated):
105         (WebCore::ContextMenu::ContextMenu):
106         (WebCore::ContextMenu::~ContextMenu):
107         (WebCore::ContextMenu::appendItem):
108         (WebCore::ContextMenu::setPlatformDescription):
109         (WebCore::ContextMenu::releasePlatformDescription):
110         * platform/gtk/ContextMenuItemGtk.cpp:
111         (WebCore::ContextMenuItem::ContextMenuItem):
112         (WebCore::ContextMenuItem::~ContextMenuItem):
113         (WebCore::ContextMenuItem::releasePlatformDescription):
114         (WebCore::ContextMenuItem::type):
115         (WebCore::ContextMenuItem::action):
116         (WebCore::ContextMenuItem::setAction):
117         (WebCore::ContextMenuItem::platformSubMenu):
118         (WebCore::ContextMenuItem::setSubMenu):
119         (WebCore::ContextMenuItem::setChecked):
120         (WebCore::ContextMenuItem::setEnabled):
121
122 2008-01-02  Alp Toker  <alp@atoker.com>
123
124         GTK+ autotools build fix. Track changes in r29073.
125
126         * GNUmakefile.am:
127
128 2008-01-01  Darin Adler  <darin@apple.com>
129
130         - fix release build
131
132         * bindings/js/kjs_binding.cpp:
133         (KJS::setDOMException): Initialize to avoid uninitialized variable warning.
134         Removed default so we get a warning if there's a missing case.
135
136 2008-01-01  David D. Kilzer  <ddkilzer@webkit.org>
137
138         Scripting MIME Types application/ecmascript, application/javascript not viewable
139         <http://bugs.webkit.org/show_bug.cgi?id=11063>
140
141         Reviewed by Darin.
142
143         This patch consolidates the list of acceptable MIME types for JavaScript
144         source into the MIMETypeRegistry class, and replaces checks for these
145         types with a call to MIMETypeRegistry::isSupportedJavaScriptMIMEType().
146
147         No tests added since viewing JavaScript source is not testable.
148
149         * dom/DOMImplementation.cpp:
150         (WebCore::DOMImplementation::isTextMIMEType): Use
151         MIMETypeRegistry::isSupportedJavaScriptMIMEType() instead of a single
152         hard-coded MIME type, "application/x-javascript".
153
154         * html/HTMLScriptElement.cpp:
155         (WebCore::HTMLScriptElement::shouldExecuteAsJavaScript): Moved list of
156         JavaScript MIME types from here to
157         MIMETypeRegistry::initialiseSupportedJavaScriptMIMETypes().
158
159         * platform/MIMETypeRegistry.cpp:
160         (WebCore::initialiseSupportedJavaScriptMIMETypes): Added. List of
161         MIME types came from HTMLScriptElement::shouldExecuteAsJavaScript().
162         (WebCore::initialiseSupportedNonImageMimeTypes): Remove single
163         hard-coded MIME type, "application/x-javascript", from the list.
164         (WebCore::initialiseMIMETypeRegistry): Initialise
165         supportedJavaScriptMIMETypes, then pre-populate supportedNonImageMIMETypes
166         with values in supportedJavaScriptMIMETypes.
167         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType): Added.
168
169         * platform/MIMETypeRegistry.h: Added isSupportedJavaScriptMIMEType().
170
171 2008-01-01  Sam Weinig  <sam@webkit.org>
172
173         Reviewed by Darin.
174
175         Patch for http://bugs.webkit.org/show_bug.cgi?id=16691
176         Use real JS objects for the rest of the DOMExceptions (EventException, RangeException, etc)
177
178         - Create JS objects for all the different types of exceptions, each with there own prototype and constructor.
179         - Abstract all the logic and storage for exception classes in to an ExceptionBase class.
180         - Move specialized ExceptionCodes into the exception classes. (ie. the EventExceptionCode enum is now in EventException).
181
182         Tests: fast/dom/DOMException/EventException.html
183                fast/dom/DOMException/RangeException.html
184                fast/dom/DOMException/XPathException.html
185                http/tests/xmlhttprequest/XMLHttpRequestException.html
186                svg/custom/SVGException.html
187
188         * DerivedSources.make:
189         * WebCore.pro:
190         * WebCore.vcproj/WebCore.vcproj:
191         * WebCore.xcodeproj/project.pbxproj:
192         * WebCoreSources.bkl:
193         * bindings/js/JSSVGMatrixCustom.cpp:
194         (WebCore::JSSVGMatrix::inverse):
195         (WebCore::JSSVGMatrix::rotateFromVector):
196         * bindings/js/kjs_binding.cpp:
197         (KJS::setDOMException):
198         * bindings/scripts/CodeGeneratorJS.pm: Use the constant values defined
199         in the IDL as the ObjC bindings do.
200         * bindings/scripts/CodeGeneratorObjC.pm:
201         * dom/DOMCoreException.cpp: Removed.
202         * dom/DOMCoreException.h:
203         (WebCore::DOMCoreException::DOMCoreException):
204         * dom/DOMCoreException.idl:
205         * dom/Event.h:
206         * dom/EventException.h: Copied from WebCore/dom/DOMCoreException.h.
207         (WebCore::EventException::EventException):
208         (WebCore::EventException::):
209         * dom/EventException.idl: Copied from WebCore/dom/DOMCoreException.idl.
210         * dom/EventTargetNode.cpp:
211         (WebCore::EventTargetNode::dispatchEvent):
212         * dom/ExceptionBase.cpp: Copied from WebCore/dom/DOMCoreException.cpp.
213         (WebCore::ExceptionBase::ExceptionBase):
214         (WebCore::ExceptionBase::toString):
215         * dom/ExceptionBase.h: Copied from WebCore/dom/DOMCoreException.h.
216         (WebCore::ExceptionBase::code):
217         * dom/ExceptionCode.cpp:
218         (WebCore::getExceptionCodeDescription):
219         * dom/ExceptionCode.h:
220         (WebCore::):
221         * dom/Range.cpp:
222         (WebCore::Range::insertNode):
223         (WebCore::Range::checkNodeWOffset):
224         (WebCore::Range::checkNodeBA):
225         (WebCore::Range::selectNode):
226         (WebCore::Range::selectNodeContents):
227         (WebCore::Range::surroundContents):
228         * dom/RangeException.h:
229         (WebCore::RangeException::RangeException):
230         (WebCore::RangeException::):
231         * dom/RangeException.idl:
232         * page/DOMWindow.idl:
233         * svg/SVGColor.cpp:
234         (WebCore::SVGColor::setRGBColor):
235         * svg/SVGException.h:
236         (WebCore::SVGException::SVGException):
237         (WebCore::SVGException::):
238         * svg/SVGException.idl:
239         * svg/SVGLocatable.cpp:
240         (WebCore::SVGLocatable::getTransformToElement):
241         * xml/XMLHttpRequest.cpp:
242         (WebCore::XMLHttpRequest::dispatchEvent):
243         (WebCore::XMLHttpRequest::open):
244         (WebCore::XMLHttpRequest::send):
245         * xml/XMLHttpRequest.h:
246         * xml/XMLHttpRequestException.h: Copied from WebCore/dom/DOMCoreException.h.
247         (WebCore::XMLHttpRequestException::XMLHttpRequestException):
248         (WebCore::XMLHttpRequestException::):
249         * xml/XMLHttpRequestException.idl: Copied from WebCore/dom/DOMCoreException.idl.
250         * xml/XPathEvaluator.h:
251         * xml/XPathException.h: Copied from WebCore/dom/DOMCoreException.h.
252         (WebCore::XPathException::XPathException):
253         (WebCore::XPathException::):
254         * xml/XPathException.idl: Copied from WebCore/dom/DOMCoreException.idl.
255         * xml/XPathParser.cpp:
256         (WebCore::XPath::Parser::parseStatement):
257         * xml/XPathResult.cpp:
258         (WebCore::XPathResult::convertTo):
259         (WebCore::XPathResult::numberValue):
260         (WebCore::XPathResult::stringValue):
261         (WebCore::XPathResult::booleanValue):
262         (WebCore::XPathResult::singleNodeValue):
263         (WebCore::XPathResult::snapshotLength):
264         (WebCore::XPathResult::iterateNext):
265         (WebCore::XPathResult::snapshotItem):
266
267 2008-01-01  Sam Weinig  <sam@webkit.org>
268
269         Remove JSDomExceptionConstructor.lut.h from clean step
270         as it no longer exists.
271
272         * GNUmakefile.am:
273
274 2008-01-01  Dan Bernstein  <mitz@apple.com>
275
276         - Windows build fix
277
278         * WebCore.vcproj/WebCore.vcproj:
279
280 2008-01-01  Sam Weinig  <sam@webkit.org>
281
282         Try again to fix the builds
283
284         * DerivedSources.make:
285
286 2008-01-01  Sam Weinig  <sam@webkit.org>
287
288         Fix non-mac builds.
289
290         * WebCore.pro:
291         * WebCore.vcproj/WebCore.vcproj:
292         * WebCoreSources.bkl:
293
294 2008-01-01  Eric Seidel  <eric@webkit.org>
295
296         Reviewed by Alexey.
297
298         Don't replace \ with / in data: urls
299         http://bugs.webkit.org/show_bug.cgi?id=16692
300
301         Test: fast/loader/url-data-replace-backslash.html
302
303         * platform/KURL.cpp:
304         (WebCore::KURL::init):
305
306 2008-01-01  Alp Toker  <alp@atoker.com>
307
308         GTK+ autotools build fix. Track changes in r29051, r29058 and pass the
309         correct parameter to AM_INIT_AUTOMAKE.
310
311         * GNUmakefile.am:
312
313 2007-12-31  Sam Weinig  <sam@webkit.org>
314
315         Reviewed by Darin.
316
317         Patch for http://bugs.webkit.org/show_bug.cgi?id=16637
318         Acid3 expects ExeceptionCode constants to be defined on DOMException objects
319
320         - Make DOMException a real JS object.
321
322         Test: fast/dom/DOMException/prototype-object.html
323
324         * DerivedSources.make:
325         * WebCore.xcodeproj/project.pbxproj:
326
327         This is no longer needed as the autogenerated classes now includes the
328         constructor.
329         * bindings/js/JSDOMExceptionConstructor.cpp: Removed.
330         * bindings/js/JSDOMExceptionConstructor.h: Removed.
331
332         Create on demand and use the new class for DOMExceptions.
333         * bindings/js/kjs_binding.cpp:
334         (KJS::setDOMException):
335
336         Remove no longer needed custom constructor getter.
337         * bindings/js/kjs_window.cpp:
338         (KJS::Window::getValueProperty):
339
340         Don't expose DOMCoreException as the name of class by special casing
341         the user visible class name to be DOMException.
342         * bindings/scripts/CodeGeneratorJS.pm:
343
344         The DOMException class/file needs to be named DOMCoreException because there is
345         name conflict with one of the Objective-C bindings classes.  It should be renamed
346         to DOMException when the Objective-C bindings are moved into WebKit.
347         * dom/DOMCoreException.cpp: Added.
348         (WebCore::DOMCoreException::DOMCoreException):
349         (WebCore::DOMCoreException::toString):
350         * dom/DOMCoreException.h: Added.
351         (WebCore::DOMCoreException::):
352         (WebCore::DOMCoreException::code):
353         (WebCore::DOMCoreException::name):
354         (WebCore::DOMCoreException::message):
355         * dom/DOMCoreException.idl: Added.
356         * page/DOMWindow.idl:
357
358 2007-12-31  Sam Weinig  <sam@webkit.org>
359
360         Re-enable querySelector and querySelectorAll and touch the necessary files to not
361         kill the windows build.
362
363         * WebCore.vcproj/build-generated-files.sh:
364         * bindings/scripts/CodeGeneratorCOM.pm:
365         * dom/Document.idl:
366         * dom/Element.idl:
367
368 2007-12-31  Darin Adler  <darin@apple.com>
369
370         - fix Windows build
371
372         * dom/Document.idl: Temporarily disable querySelector and querySelectorAll, since they are showing
373         up as pure virtual functions. Sam can fix this later.
374         * dom/Element.idl: Ditto.
375
376 2007-12-31  Dan Bernstein  <mitz@apple.com>
377
378         Reviewed by Darin Adler.
379
380         - fix http://bugs.webkit.org/show_bug.cgi?id=14134
381           <rdar://problem/5655160> REGRESSION (r25353): Whitespace nodes ignored between inline list items
382
383         Test: fast/dynamic/create-renderer-for-whitespace-only-text.html
384
385         * dom/Node.cpp:
386         (WebCore::Node::attach): Added code to check if this node's renderer
387         has become the "previous renderer" of any sibling text node, and if so,
388         ensure that that node gets a renderer if it now needs one.
389         (WebCore::Node::createRendererIfNeeded): Removed the assertion that the
390         node is not attached.
391
392 2007-12-31  Darin Adler  <darin@apple.com>
393
394         Reviewed by Mitz.
395
396         - fix http://bugs.webkit.org/show_bug.cgi?id=16641
397           Acid3 reveals HTMLFormElement.elements fails to update when element name changes
398
399         Test: fast/dom/HTMLFormElement/elements-not-in-document.html
400
401         This was a bug specific to forms that are not in the document tree.
402         The fix was to change the code to increment the document version number to match
403         up with other document change tracking. Maybe at some point we can clean these up
404         so we don't have so many competing change notification systems.
405
406         * dom/ContainerNode.cpp:
407         (WebCore::ContainerNode::replaceChild): Removed bogus comment.
408         (WebCore::ContainerNode::addChild): Added an explicit incDOMTreeVersion
409         call here, since this code path bypasses the subtree-modified event code.
410
411         * dom/Element.cpp:
412         (WebCore::Element::setAttribute): Remove the inDocument() check -- not all HTML
413         collections are for things in the document.
414         (WebCore::Element::setAttributeMap): Ditto.
415
416         * dom/EventTargetNode.cpp:
417         (WebCore::EventTargetNode::dispatchSubtreeModifiedEvent): Added a call to
418         incDOMTreeVersion here; covers most cases of tree structure changes.
419
420         * dom/Node.cpp:
421         (WebCore::Node::attach): Remove call to incDOMTreeVersion -- creating a renderer
422         has nothing to do with changes to the DOM tree!
423         (WebCore::Node::detach): Ditto.
424
425         * html/HTMLFormElement.cpp:
426         (WebCore::HTMLFormElement::registerFormElement): Remove call to incDOMTreeVersion.
427         This is handled at a lower level and doesn't need to be here.
428         (WebCore::HTMLFormElement::removeFormElement): Ditto.
429
430 2007-12-31  Henry Mason  <hmason@mac.com>
431
432         Reviewed by Darin.
433
434         Patch for http://bugs.webkit.org/show_bug.cgi?id=14994
435         Support for MessageEvent and cross-domain messaging
436
437         Test: http/tests/messaging/cross-domain-message-send.html
438
439         * DerivedSources.make:
440         * WebCore.pro:
441         * WebCore.vcproj/WebCore.vcproj:
442         * WebCore.xcodeproj/project.pbxproj:
443         * WebCoreSources.bkl:
444         * bindings/js/JSDOMWindowCustom.cpp:
445         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Allow cross-domain access to the
446         postMessage function.
447         (WebCore::JSDOMWindow::postMessage):
448         * bindings/js/JSEventCustom.cpp:
449         (WebCore::toJS):
450         * dom/Event.cpp:
451         (WebCore::Event::isMessageEvent):
452         * dom/Event.h:
453         * dom/EventNames.h: New event name
454         * dom/MessageEvent.cpp: Added.
455         * dom/MessageEvent.h: Added.
456         * dom/MessageEvent.idl: Added.
457         * page/DOMWindow.cpp:
458         (WebCore::DOMWindow::postMessage): Added.
459         * page/DOMWindow.h:
460         * page/DOMWindow.idl:
461
462 2007-12-31  Darin Adler  <darin@apple.com>
463
464         Suggested by Antti.
465
466         - turn ENABLE_VIDEO back off for Windows until we can install QuickTime on the build bots
467
468         * WebCore.vcproj/WebCore.vcproj: Removed ENABLE_VIDEO.
469         * WebCore.vcproj/build-generated-files.sh: Ditto.
470
471 2007-12-30  Alp Toker  <alp@atoker.com>
472
473         Reviewed by Dan Bernstein.
474
475         Silence warning.
476
477         * dom/NodeList.h:
478
479 2007-12-30  Sam Weinig  <sam@webkit.org>
480
481         Reviewed by Oliver Hunt.
482
483         Fix for http://bugs.webkit.org/show_bug.cgi?id=16387
484         Variable names can be enumerated across domains
485         <rdar://problem/5640454>
486
487         Test: http/tests/security/cross-frame-access-enumeration.html
488
489         * bindings/js/kjs_window.cpp:
490         (KJS::Window::getPropertyNames): Override method to test same-origin policy.
491         * bindings/js/kjs_window.h:
492
493 2007-12-30  Sam Weinig  <sam@webkit.org>
494
495         Reviewed by Oliver Hunt.
496
497         Patch for http://bugs.webkit.org/show_bug.cgi?id=10686
498         event instanceof MouseEvent throws exception
499
500         Add JS constructors for all the Event types.
501
502         Test: fast/events/event-instanceof.html
503
504         * WebCore.xcodeproj/project.pbxproj:
505         * dom/KeyboardEvent.idl:
506         * dom/MouseEvent.idl:
507         * dom/MutationEvent.idl:
508         * dom/OverflowEvent.idl:
509         * dom/ProgressEvent.idl:
510         * dom/TextEvent.idl:
511         * dom/UIEvent.idl:
512         * dom/WheelEvent.idl:
513         * page/DOMWindow.idl:
514
515 2007-12-30  David Kilzer  <ddkilzer@webkit.org>
516
517         Reviewed by Darin.
518
519         - fix http://bugs.webkit.org/show_bug.cgi?id=15359
520           JPEG image not shown when height is specified as percentage inside a table
521
522         The problem occurs when a replaced element (image, canvas, etc.) with
523         a percent-height attribute is contained by a table cell with an auto-
524         or percent-height attribute.  If there are no other conditions to cause
525         the table cell's height to expand, an available height of zero will
526         always be returned.  In these cases, the intrinsic height of the
527         replaced element should be used if it is greater than the available
528         height of the table cell.
529
530         Tests: fast/replaced/table-percent-height.html
531                tables/mozilla/bugs/bug137388-1.html
532                tables/mozilla/bugs/bug137388-2.html
533
534         * rendering/RenderBox.cpp:
535         (WebCore::RenderBox::calcReplacedHeightUsing):
536
537 2007-12-30  Luca Bruno  <lethalman88@gmail.com>
538
539         Reviewed by Alp Toker.
540
541         http://bugs.webkit.org/show_bug.cgi?id=16099
542         Crash in CURL for empty POST
543
544         We have to set POST even when the data is empty, otherwise cURL will
545         hang while waiting for a response.
546
547         * platform/network/curl/ResourceHandleManager.cpp
548         (ResourceHandleManager::setupPOST): allow empty POST
549
550 2007-12-29  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
551
552         Reviewed by Alp Toker.
553
554         Move all SVG related stuff inside SVG block. Don't include
555         SVGNames, SVGElementFactory, and XLinkNames when SVG is not
556         enabled
557
558         * GNUmakefile.am:
559
560 2007-12-29  Alexey Proskuryakov  <ap@webkit.org>
561
562         Reviewed by Darin.
563
564         http://bugs.webkit.org/show_bug.cgi?id=14428
565         FCKEditor: Images disappear on drag/drop and copy/paste
566
567         Test: editing/pasteboard/drag-image-in-about-blank-frame.html
568
569         * editing/markup.cpp: (WebCore::createFragmentFromMarkup): Don't use "about:blank" as a
570         base URL, just like we don't use an empty one.
571
572 2007-12-29  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
573
574         Reviewed by Alp Toker.
575
576         http://bugs.webkit.org/show_bug.cgi?id=16669
577         autotools update and fixes
578
579         Autotools update and database/icon database inclusion guard fixes
580
581         * GNUmakefile.am:
582           - Update autotools config as per -r29012 changes
583           - Fix CSSGrammar.h/cpp generation (Seo Sanghyeon, sanxiyn)
584         * dom/Document.cpp:
585         * loader/icon/IconDatabase.h:
586         * page/DOMWindow.cpp:
587         * page/InspectorController.cpp:
588         * page/Settings.cpp:
589         * storage/Database.h:
590           - Remove ENABLE(DATABASE) inclusion guard. Let the includer add the guard instead.
591
592 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
593
594         Reviewed by Alexey.
595
596         Respect horiz-origin-x / horiz-origin-y / vert-origin-x / vert-origin-y properties when drawing SVG Fonts.
597         (Fixes fonts-elem-05-t.svg in a --svg-fonts build)
598
599         * svg/SVGFont.cpp:
600         (WebCore::Font::drawGlyphsWithSVGFont):
601
602 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
603
604         Reviewed by Oliver.
605
606         Further SVG Font work. Parse all <glyph> attributes, using SVGGlyphElement::buildGlyphIdentifier.
607         SVGFontElement::collectGlyphs() now uses this method. Per character advance values work well now.
608
609         * platform/graphics/FontData.cpp:
610         (WebCore::SVGFontData::convertEmUnitToPixel): Add helper function.
611         (WebCore::FontData::ascent):
612         (WebCore::FontData::descent):
613         * platform/graphics/FontData.h:
614         * svg/SVGFont.cpp:
615         (WebCore::isVerticalWritingMode): Add helper function.
616         (WebCore::Font::drawGlyphsWithSVGFont):
617         * svg/SVGFontElement.cpp:
618         (WebCore::SVGFontElement::collectGlyphs): Simplified implementation - SVGGlyphIdentifier now build by SVGGlyphElement.
619         * svg/SVGGlyphElement.cpp:
620         (WebCore::parseArabicForm): Helper function.
621         (WebCore::parseOrientation): Ditto.
622         (WebCore::parsePathData): Ditto.
623         (WebCore::SVGGlyphElement::buildGlyphIdentifier):
624         * svg/SVGGlyphElement.h:
625         (WebCore::SVGGlyphElement::rendererIsNeeded):
626
627 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
628
629         Reviewed by Oliver.
630
631         Refactor SVGAnimationElement::parseValues into a generic function parseDelimitedString.
632         SVGAnimationElement needs to parse semicolon-seperated strings, SVGGlyphElement comma-seperated.
633
634         * svg/SVGAnimationElement.cpp:
635         (WebCore::SVGAnimationElement::parseMappedAttribute):
636         * svg/SVGParserUtilities.cpp:
637         (WebCore::parseDelimitedString):
638         * svg/SVGParserUtilities.h:
639
640 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
641
642         Reviewed by Maciej.
643
644         Add new helper structure SVGFontData - FontData holds this object as OwnPtr.
645         Store several attribute values there (horiz-adv-x, horiz-origin-x etc..)
646
647         To optimize for the common case ('FontData' used for HTML rendering) it feels
648         better to hold one OwnPtr in FontData, than several floats.
649
650         Parse all <font> attributes in SVGFontFaceElement::createFontData.
651
652         * platform/graphics/FontData.cpp:
653         (WebCore::SVGFontData::SVGFontData):
654         (WebCore::FontData::FontData):
655         (WebCore::FontData::ascent):
656         (WebCore::FontData::descent):
657         * platform/graphics/FontData.h:
658         (WebCore::FontData::isSVGFont):
659         (WebCore::FontData::svgFontData):
660         * svg/SVGFont.cpp:
661         (WebCore::Font::drawGlyphsWithSVGFont):
662         * svg/SVGFontElement.cpp:
663         * svg/SVGFontElement.h:
664         (WebCore::SVGFontElement::rendererIsNeeded):
665         * svg/SVGFontFaceElement.cpp:
666         (WebCore::SVGFontFaceElement::unitsPerEm):
667         (WebCore::SVGFontFaceElement::createFontData):
668
669 2007-12-28  Darin Adler  <darin@apple.com>
670
671         - try to fix Windows and WX builds (broken by SVG Fonts check-in)
672
673         * platform/graphics/win/FontWin.cpp:
674         (WebCore::Font::drawGlyphs): Pass font size to FontData::ascent, now that it requires it.
675         I can't see how it can be right to require the font size for ascent and descent,
676         but not for other metrics functions in FontData.
677
678         * platform/graphics/wx/FontWx.cpp:
679         (WebCore::Font::drawGlyphs): Pass font size to FontData::ascent and FontData::descent.
680
681 2007-12-28  Dan Bernstein  <mitz@apple.com>
682
683         Reviewed by Mark Rowe.
684
685         - fix http://bugs.webkit.org/show_bug.cgi?id=16650
686           <rdar://problem/5664872> REGRESSION (r28278-r28314): ATSUI uses LTR writing direction for all text runs
687
688         Covered by existing pixel tests.
689
690         * platform/graphics/mac/FontMac.mm:
691         (WebCore::Font::drawComplexText): Corrected to maintain the style
692         information in the adjusted text run when passing it to
693         ATSUILayoutParameters. Prior to r28298 the style was passed separately.
694
695 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
696
697         Build fix, not reviewed.
698
699         Add wtf/OwnPtr.h include, to fix --svg-fonts build.
700
701         * css/SVGCSSFontFace.h:
702
703 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
704
705         Reviewed by Eric.
706
707         Fixes: http://bugs.webkit.org/show_bug.cgi?id=10649 (WebKit SVG needs SVG Fonts support)
708
709         Begin implementation of SVG Fonts module. Basic documents using SVG Fonts already work.
710         Only local, in-document fonts who declare their glyphs using the <glyph d="..."> path syntax
711         are supported. (<glyph> containing arbitary SVG content as child elements, not supported yet).
712
713         Limited to single char <-> glyph mapping, no ligatures supported yet.
714         (ie. <glyph unicode='A'/> <glyph unicode='AB'/> - it ignores the 'AB' glyph definition for now)
715
716         Mark all SVG Font related classes & usages in ENABLE(SVG_FONTS) blocks.
717
718         No layout test changes for a --no-svg-fonts build, heavy changes if enabled. Because a lot of SVG Font
719         attributes are not processed yet, the rendering looks wrong - hence disabled by default.)
720
721         * DerivedSources.make: Add SVGFontElement/SVGGlyphElement/SVGMissingGlyphElement
722         * WebCore.pro: Updated build system.
723         * WebCore.vcproj/WebCore.vcproj: Ditto.
724         * WebCore.xcodeproj/project.pbxproj: Ditto.
725         * bindings/js/JSSVGElementWrapperFactory.cpp: Add JSSVGFontElement/JSSVGGlyphElement/JSSVGMissingGlyphElement
726         * bindings/objc/DOM.mm: Ditto (for DOMSVG*).
727         (WebCore::createElementClassMap):
728         * bindings/objc/DOMInternal.h: Ditto.
729         * bindings/objc/DOMSVG.h: Ditto.
730         * css/CSSFontFace.h: Mark three functions 'virtual', to be overriden by SVGCSSFontFace
731         * css/CSSFontFaceSrcValue.h: Add functionality to identify as SVG CSS font face source.
732         (WebCore::CSSFontFaceSrcValue::m_fontFaceElement): Hold a pointer to the font face which created it.
733         (WebCore::CSSFontFaceSrcValue::svgFontFaceElement):
734         (WebCore::CSSFontFaceSrcValue::setSVGFontFaceElement):
735         * css/CSSFontSelector.cpp: Build 'SVGCSSFontFace' objects for local, in-document SVG fonts.
736         (WebCore::CSSFontSelector::addFontFaceRule):
737         * css/SVGCSSFontFace.cpp: Added. (Simplified implementation for SVG Fonts)
738         (WebCore::SVGCSSFontFace::SVGCSSFontFace):
739         (WebCore::SVGCSSFontFace::~SVGCSSFontFace):
740         (WebCore::SVGCSSFontFace::isValid):
741         (WebCore::SVGCSSFontFace::addSource):
742         (WebCore::SVGCSSFontFace::getFontData):
743         * css/SVGCSSFontFace.h: Added.
744         * platform/graphics/cg/PathCG.cpp:
745         (WebCore::Path::closeSubpath): Silence a CG warning when calling closeSubpath() on empty path.
746         * platform/graphics/Font.cpp: Add some logic to call into SVG Font code when operating on SVG Fonts.
747         (WebCore::Font::ascent): Pass font size to FontData::ascent() call
748         (WebCore::Font::descent): Pass font size to FontData::descent() call
749         (WebCore::Font::canUseGlyphCache): Always return true for SVG fonts here.
750         (WebCore::Font::drawGlyphBuffer): Call drawGlyphsWithSVGFont (instead of drawGlyphs) if the primary font is a SVG font.
751         * platform/graphics/Font.h: Add (SVG-only!) ability to store a RenderObject pointer, to the element which invoked the drawText() call.
752         (WebCore::TextRun::TextRun):
753         (WebCore::TextRun::referencingRenderObject):
754         (WebCore::TextRun::setReferencingRenderObject):
755         * platform/graphics/FontData.cpp:
756         (WebCore::FontData::FontData):
757         (WebCore::FontData::ascent):
758         (WebCore::FontData::descent):
759         * platform/graphics/FontData.h: Store a pointer to the SVGFontFaceElement, which created this FontData object - needed for drawGlyphsWithSVGFont().
760         (WebCore::FontData::isSVGFont): Offer a way to determine wheter this is a FontData object, created by a SVGFontFaceElement.
761         (WebCore::FontData::svgFontFace):
762         * rendering/SVGInlineTextBox.cpp:
763         (WebCore::SVGInlineTextBox::calculateGlyphWidth): Add assertion.
764         * rendering/SVGRootInlineBox.cpp:
765         (WebCore::svgTextRunForInlineTextBox): Always call 'setReferencingRenderObject(myRenderSVGText)' on the new TextRun
766         * svg/SVGFont.cpp: Added.
767         (WebCore::Font::drawGlyphsWithSVGFont): Outsourced implementation of SVG Fonts into it's own file.
768         * svg/SVGFontElement.cpp: Added. (Note: this holds the GlyphHashMap which associates certain <glyph> objects with unicode values)
769         (WebCore::SVGFontElement::SVGFontElement):
770         (WebCore::SVGFontElement::~SVGFontElement):
771         (WebCore::SVGFontElement::parseMappedAttribute):
772         (WebCore::SVGFontElement::collectGlyphs):
773         (WebCore::SVGFontElement::glyphIdentifierForGlyphCode):
774         * svg/SVGFontElement.h: Added.
775         (WebCore::GlyphHash::hash):
776         (WebCore::GlyphHash::equal):
777         (WebCore::GlyphHashTraits::deletedValue):
778         (WebCore::SVGFontElement::rendererIsNeeded):
779         (WebCore::SVGFontElement::contextElement):
780         * svg/SVGFontElement.idl: Added.
781         * svg/SVGFontFaceElement.cpp: Build SVG specific 'FontData' object
782         (WebCore::SVGFontFaceElement::unitsPerEm):
783         (WebCore::SVGFontFaceElement::fontFamily):
784         (WebCore::SVGFontFaceElement::createFontData): Builds SVG specified 'FontData' object with the markup specified ascent/descent values etc..
785         (WebCore::SVGFontFaceElement::rebuildFontFace): Construct CSSFontFaceSrc object (marked as 'isSVGFontFaceSrc') to satisfy CSSFontSelector::addFontFaceRule.
786         (WebCore::SVGFontFaceElement::insertedIntoDocument): Rebuild font face.
787         (WebCore::SVGFontFaceElement::glyphIdentifierForGlyphCode): Allows drawGlyphsWithSVGFont to access the glyph hash map living in the SVGFontElement.
788         * svg/SVGFontFaceElement.h: Fixed code formatting issues & wrap in ENABLE(SVG_FONTS) blocks.
789         * svg/SVGFontFaceElement.idl: Ditto.
790         * svg/SVGFontFaceFormatElement.cpp: Ditto.
791         * svg/SVGFontFaceFormatElement.h: Ditto.
792         * svg/SVGFontFaceFormatElement.idl: Ditto.
793         * svg/SVGFontFaceNameElement.cpp: Ditto.
794         * svg/SVGFontFaceNameElement.h: Ditto.
795         * svg/SVGFontFaceNameElement.idl: Ditto.
796         * svg/SVGFontFaceSrcElement.cpp: Ditto.
797         * svg/SVGFontFaceSrcElement.h: Ditto.
798         * svg/SVGFontFaceSrcElement.idl: Ditto.
799         * svg/SVGFontFaceUriElement.cpp: Ditto.
800         * svg/SVGFontFaceUriElement.h: Ditto.
801         * svg/SVGFontFaceUriElement.idl: Ditto.
802         * svg/SVGDefinitionSrcElement.cpp: Ditto.
803         * svg/SVGDefinitionSrcElement.h: Ditto.
804         * svg/SVGDefinitionSrcElement.idl: Ditto.
805         * svg/SVGGlyphElement.cpp: Added.
806         (WebCore::SVGGlyphElement::SVGGlyphElement):
807         (WebCore::SVGGlyphElement::parseMappedAttribute):
808         (WebCore::SVGGlyphElement::childrenChanged):
809         * svg/SVGGlyphElement.h: Added.
810         (WebCore::SVGGlyphElement::rendererIsNeeded):
811         (WebCore::SVGGlyphIdentifier::): Structure holding all data to represent a SVG glyph (origin, advance, orientation etc..)
812         (WebCore::SVGGlyphIdentifier::SVGGlyphIdentifier):
813         * svg/SVGGlyphElement.idl: Added.
814         * svg/SVGMissingGlyphElement.cpp: Added. (stub implementation)
815         (WebCore::SVGMissingGlyphElement::SVGMissingGlyphElement):
816         (WebCore::SVGMissingGlyphElement::parseMappedAttribute):
817         (WebCore::SVGMissingGlyphElement::childrenChanged):
818         * svg/SVGMissingGlyphElement.h: Added.
819         (WebCore::SVGMissingGlyphElement::rendererIsNeeded):
820         * svg/SVGMissingGlyphElement.idl: Added.
821         * svg/svgtags.in: Wrap all SVGFont* elements in ENABLE(SVG_FONTS) block - to assure --no-svg-fonts compilation works (which is the default for now!).
822
823 2007-12-27  Dan Bernstein  <mitz@apple.com>
824
825         Reviewed by Alexey Proskuryakov.
826
827         - fix http://bugs.webkit.org/show_bug.cgi?id=16628
828           ASSERTION FAILED: m_resizeLayer (running layout tests)
829
830         * rendering/RenderLayer.cpp:
831         (WebCore::RenderLayer::~RenderLayer): Avoid calling
832         EventHandler::resizeLayerDestroyed() if the document is being destroyed.
833
834 2007-12-27  Dan Bernstein  <mitz@apple.com>
835
836         Reviewed by Oliver Hunt.
837
838         - fix http://bugs.webkit.org/show_bug.cgi?id=16603
839           <rdar://problem/5664199> Crash when resizing text field
840
841         Test: fast/layers/resize-layer-deletion-crash.html
842
843         The event handler has only a weak reference to the layer that is
844         currently in resize mode, so it is the layer's responsibility to let
845         the event handler know if it has been destroyed while in that mode.
846
847         * page/EventHandler.cpp:
848         (WebCore::EventHandler::resizeLayerDestroyed): Added. Resets
849         m_resizeLayer to 0.
850         * page/EventHandler.h:
851         * rendering/RenderLayer.cpp:
852         (WebCore::RenderLayer::~RenderLayer): Added a call to
853         EventHandler::resizeLayerDestroyed() if the layer is in resize mode.
854
855 2007-12-27  Collin Jackson  <webkit@collinjackson.com>
856
857         Reviewed by Sam Weinig.
858
859         http://bugs.webkit.org/show_bug.cgi?id=16539
860         <rdar://problem/5659269>
861
862         The same-origin check was missing in the implementation of 
863         setTimeout, setInterval, addEventListener, and removeEventListener.
864
865         Suppose <http://www.badguy.com/> contains an iframe to 
866         <http://www.goodguy.com/>. Now www.badguy.com can steal
867         www.goodguy.com cookies by running this code:
868
869         setTimeout.call(frames[0], "alert(document.cookie)", 1000);
870
871         This patch changes the behavior so that setTimeout to does 
872         nothing and returns an undefined value if the caller is not
873         permitted to script the window whose setTimeout method is being
874         called. The same applies to setInterval, addEventListener, and 
875         removeEventListener.
876
877         Tests: http/tests/security/cross-frame-access-call.html
878
879         * bindings/js/kjs_window.cpp:
880         (KJS::WindowProtoFuncSetTimeout::callAsFunction)
881         (KJS::WindowProtoFuncSetInterval::callAsFunction)
882         (KJS::WindowProtoFuncAddEventListener::callAsFunction)
883         (KJS::WindowProtoFuncRemoveEventListener::callAsFunction)
884
885 2007-12-27  Dan Bernstein  <mitz@apple.com>
886
887         Reviewed by Dave Hyatt and Sam Weinig.
888
889         - fix <rdar://problem/5605937> Inspector: Disclosure triangle not drawn in node's properties panel until click
890
891         Test: fast/layers/add-layer-with-nested-stacking.html
892         Test: fast/layers/remove-layer-with-nested-stacking.html
893
894         * rendering/RenderLayer.cpp:
895         (WebCore::RenderLayer::addChild): If the new child is overflow-only
896         but has children of its own, dirty the stacking context's z-order lists
897         since the grandchildren might need to be in them.
898         (WebCore::RenderLayer::removeChild): Similarly for the old child.
899
900 2007-12-27  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
901
902         Reviewed by Alp Toker.
903
904         http://bugs.webkit.org/show_bug.cgi?id=16353
905         [GTK] Check for deprecated API use (G_DISABLE_DEPRECATED etc.)
906
907         Added the flags mentioned in the bug only when doing 'debug'
908         builds. -DGST_DISABLE_DEPRECATED only added when video is enabled.
909
910         * GNUmakefile.am:
911         * WebCore.pro:
912
913 2007-12-27  Dan Bernstein  <mitz@apple.com>
914
915         Reviewed by Eric Seidel.
916
917         - fix http://bugs.webkit.org/show_bug.cgi?id=16490
918           ASSERT in ~FrameView while viewing/reloading WICD test case
919
920         Test: fast/dynamic/paused-event-dispatch.html
921
922         * page/FrameView.cpp:
923         (WebCore::FrameView::~FrameView):
924         (WebCore::FrameView::layout): Changed to always pause event dispatch and
925         always resume event dispatch, regardless of whether the post-layout
926         task timer is active. However, if it is active, assert that event
927         dispatch is still paused.
928
929 2007-12-27  Alexey Proskuryakov  <ap@webkit.org>
930
931         Reviewed by Maciej.
932
933         http://bugs.webkit.org/show_bug.cgi?id=14500
934         need to be more generous about charset declaration with meta tag
935         
936         http://bugs.webkit.org/show_bug.cgi?id=12526
937         <rdar://problem/4867183> Safari ignores encoding description "charset=Shift_JIS" in invalid html
938
939         <rdar://problem/4892428> Unlike other browsers, WebKit ignores <meta> charset definitions outside the head
940
941         <rdar://problem/5643774> REGRESSION: Text is garbled when clicking a link inside an Arabic website
942
943         Tests: fast/encoding/ahram-org-eg.html
944                fast/encoding/bandai-co-jp-releases.html
945                fast/encoding/floraexpress-ru.html
946                fast/encoding/hanarei-blog32-fc2-com.html
947                fast/encoding/yahoo-mail.html
948
949         * loader/TextResourceDecoder.cpp:
950         (WebCore::TextResourceDecoder::checkForHeadCharset): Don't stop looking for <meta> until we've
951         seen at least 512 bytes of input.
952
953 2007-12-26  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
954
955         Reviewed by Alp Toker.
956
957         http://bugs.webkit.org/show_bug.cgi?id=16390
958         Use autotools or GNU make as the build system for the GTK port
959
960         * GNUmakefile.am: Added.
961
962 2007-12-26  Alexey Proskuryakov  <ap@webkit.org>
963
964         Reviewed by Sam Weinig.
965
966         http://bugs.webkit.org/show_bug.cgi?id=16609
967         Make manual-tests/xmlhttprequest-contenttype-empty.html test automatic
968
969         * manual-tests/xmlhttprequest-contenttype-empty.html: Removed (moved to LayoutTests/http).
970
971 2007-12-26  Mark Rowe  <mrowe@apple.com>
972
973         Windows build fix.
974
975         * platform/Threading.h:
976
977 2007-12-25  Rob Buis  <buis@kde.org>
978
979         Reviewed by Eric.
980
981         http://bugs.webkit.org/show_bug.cgi?id=15514
982         <clipPath> with <use> not respected
983         http://bugs.webkit.org/show_bug.cgi?id=16557
984         SVG circle elements have been clipped away completely, instead of partially.
985
986         Add toClipPath to get clip path data for the clipping paths. Implement it for <use>, thereby allowing clip paths using use.
987
988         * svg/SVGClipPathElement.cpp:
989         (WebCore::SVGClipPathElement::canvasResource):
990         * svg/SVGStyledTransformableElement.h:
991         (WebCore::SVGStyledTransformableElement::toClipPath):
992         * svg/SVGUseElement.cpp:
993         (WebCore::isDirectReference):
994         (WebCore::SVGUseElement::toClipPath):
995         * svg/SVGUseElement.h:
996
997 2007-12-25  Sam Weinig  <sam@webkit.org>
998
999         Reviewed by Eric Seidel.
1000
1001         Clean up the files relating to NodeLists.
1002
1003         * dom/ChildNodeList.cpp:
1004         (WebCore::ChildNodeList::ChildNodeList):
1005         (WebCore::ChildNodeList::length):
1006         (WebCore::ChildNodeList::item):
1007         (WebCore::ChildNodeList::nodeMatches):
1008         * dom/ChildNodeList.h:
1009         * dom/DynamicNodeList.cpp:
1010         (WebCore::DynamicNodeList::itemForwardsFromCurrent):
1011         (WebCore::DynamicNodeList::itemBackwardsFromCurrent):
1012         (WebCore::DynamicNodeList::itemWithName):
1013         * dom/DynamicNodeList.h:
1014         (WebCore::DynamicNodeList::needsNotifications):
1015         * dom/NameNodeList.cpp:
1016         (WebCore::NameNodeList::NameNodeList):
1017         (WebCore::NameNodeList::rootNodeAttributeChanged):
1018         (WebCore::NameNodeList::nodeMatches):
1019         * dom/NameNodeList.h:
1020         * dom/NodeList.h:
1021         * dom/SelectorNodeList.h:
1022
1023 2007-12-25  Sam Weinig  <sam@webkit.org>
1024
1025         Fix non-mac builds.
1026
1027         * WebCore.pro:
1028         * WebCore.vcproj/WebCore.vcproj:
1029         * WebCoreSources.bkl:
1030
1031 2007-12-25  Sam Weinig  <sam@webkit.org>
1032
1033         Rubber stamped by Eric Seidel.
1034
1035         Move TagNodeList into its own file.
1036
1037         * WebCore.xcodeproj/project.pbxproj:
1038         * dom/Node.cpp:
1039         * dom/TagNodeList.cpp: Copied from dom/Node.cpp.
1040         (WebCore::TagNodeList::TagNodeList):
1041         * dom/TagNodeList.h: Copied from dom/Node.cpp.
1042
1043 2007-12-25  Sam Weinig  <sam@webkit.org>
1044
1045         Reviewed by Eric Seidel.
1046
1047         Simplify the NodeList architecture.
1048         - Rename recursiveItem() to item(), since it is not recursive.
1049         - Make recursiveLength() iterative and rename to length().
1050         - Remove now unneeded overrides of item() and length() that used 
1051           to call the recursive variants.
1052
1053         * dom/ClassNodeList.cpp:
1054         * dom/ClassNodeList.h:
1055         * dom/DynamicNodeList.cpp:
1056         (WebCore::DynamicNodeList::length):
1057         (WebCore::DynamicNodeList::item):
1058         (WebCore::DynamicNodeList::rootNodeAttributeChanged): Move implementation 
1059         into the .cpp file since virtual methods can't be inlined.
1060         * dom/DynamicNodeList.h:
1061         * dom/NameNodeList.cpp:
1062         * dom/NameNodeList.h:
1063         * dom/Node.cpp:
1064
1065 2007-12-25  Alp Toker  <alp@atoker.com>
1066
1067         More complete GTK+/Qt/Wx/Win build fixes for breakage introduced in
1068         r28981.
1069
1070         * WebCore.pro:
1071         * WebCore.vcproj/WebCore.vcproj:
1072         * WebCoreSources.bkl:
1073
1074 2007-12-25  Alp Toker  <alp@atoker.com>
1075
1076         Win build fix for breakage introduced in r28981.
1077
1078         * WebCore.vcproj/WebCore.vcproj:
1079
1080 2007-12-25  Alp Toker  <alp@atoker.com>
1081
1082         Wx build fix for breakage introduced in r28981.
1083
1084         * WebCoreSources.bkl:
1085
1086 2007-12-25  Alp Toker  <alp@atoker.com>
1087
1088         GTK+/Qt build fix for breakage introduced in r28981.
1089
1090         * WebCore.pro:
1091
1092 2007-12-25  David Smith  <catfish.man@gmail.com> and Sam Weinig  <sam@webkit.org>
1093
1094         Reviewed by Oliver.
1095         
1096         - http://bugs.webkit.org/show_bug.cgi?id=16587
1097         Implement the most useful part of the W3C Selectors API.
1098
1099         * WebCore.xcodeproj/project.pbxproj:
1100         * css/CSSStyleSelector.h: Make Node a friend of CSSStyleSelector so it can use checkSelector()
1101         * dom/ChildNodeList.cpp:
1102         (WebCore::ChildNodeList::ChildNodeList): Change to being a DynamicNodeList
1103         * dom/ChildNodeList.h:
1104         * dom/ClassNodeList.cpp:
1105         (WebCore::ClassNodeList::ClassNodeList): Change to being a DynamicNodeList
1106         * dom/ClassNodeList.h:
1107         * dom/Document.idl: Add the new functions
1108         * dom/DynamicNodeList.cpp: Copied from WebCore/dom/NodeList.cpp.
1109         (WebCore::DynamicNodeList::DynamicNodeList): Rename NodeList to DynamicNodeList, to differentiate it from the new StaticNodeList
1110         (WebCore::DynamicNodeList::~DynamicNodeList):
1111         (WebCore::DynamicNodeList::recursiveLength):
1112         (WebCore::DynamicNodeList::itemForwardsFromCurrent):
1113         (WebCore::DynamicNodeList::itemBackwardsFromCurrent):
1114         (WebCore::DynamicNodeList::recursiveItem):
1115         (WebCore::DynamicNodeList::itemWithName):
1116         (WebCore::DynamicNodeList::rootNodeChildrenChanged):
1117         (WebCore::DynamicNodeList::Caches::Caches):
1118         (WebCore::DynamicNodeList::Caches::reset):
1119         * dom/DynamicNodeList.h: Copied from WebCore/dom/NodeList.h.
1120         (WebCore::DynamicNodeList::rootNodeAttributeChanged):
1121         * dom/Element.idl: Add the new functions
1122         * dom/NameNodeList.cpp: Change to being a DynamicNodeList
1123         (WebCore::NameNodeList::NameNodeList):
1124         * dom/NameNodeList.h:
1125         (WebCore::NameNodeList::rootNodeAttributeChanged):
1126         * dom/Node.cpp:
1127         (WebCore::TagNodeList::TagNodeList): Change to being a DynamicNodeList
1128         (WebCore::Node::registerDynamicNodeList):
1129         (WebCore::Node::unregisterDynamicNodeList):
1130         (WebCore::Node::getElementsByName):
1131         (WebCore::Node::getElementsByClassName):
1132         (WebCore::Node::querySelector): new
1133         (WebCore::Node::querySelectorAll): new
1134         * dom/Node.h:
1135         * dom/NodeList.cpp: Removed.
1136         * dom/NodeList.h: This is now an abstract superclass of DynamicNodeList and StaticNodeList
1137         (WebCore::NodeList::NodeList):
1138         (WebCore::NodeList::~NodeList):
1139         * dom/SelectorNodeList.cpp: Added.
1140         (WebCore::SelectorNodeList::SelectorNodeList): New StaticNodeList subclass that filters elements by CSS selector
1141         * dom/SelectorNodeList.h: Added.
1142         * dom/StaticNodeList.cpp: Added.
1143         (WebCore::StaticNodeList::length):
1144         (WebCore::StaticNodeList::item):
1145         (WebCore::StaticNodeList::itemWithName):
1146         * dom/StaticNodeList.h: Added.
1147         (WebCore::StaticNodeList::StaticNodeList):
1148         (WebCore::StaticNodeList::~StaticNodeList):
1149
1150 2007-12-25  Mark Rowe  <mrowe@apple.com>
1151
1152         Reviewed by Sam Weinig.
1153
1154         Implement a lock-free ThreadSafeShared for i386, x86_64, ppc and ppc64.
1155         http://bugs.webkit.org/show_bug.cgi?id=16596
1156
1157         This is a 1.7x as fast as the lock-based implementation on x86 for a single-threaded use
1158         of ThreadSafeShared but is closer to 280x as fast when there is heavy concurrent multi-threaded
1159         access to a single ThreadSafeShared object.
1160
1161         The atomic operations are based on those used by the Boost C++ library's shared_ptr implementation.
1162
1163         * platform/Threading.h:
1164         (WebCore::atomicIncrement):
1165         (WebCore::atomicDecrement):
1166         (WebCore::ThreadSafeShared::ThreadSafeShared):
1167         (WebCore::ThreadSafeShared::ref): Use lock-free operations if available.
1168         (WebCore::ThreadSafeShared::deref): Ditto.
1169         (WebCore::ThreadSafeShared::hasOneRef):
1170         (WebCore::ThreadSafeShared::refCount):
1171         (WebCore::ThreadSafeShared::isThreadSafe):
1172
1173 2007-12-24  Darin Adler  <darin@apple.com>
1174
1175         * platform/text/PlatformString.h: Removed now-incorrect comment.
1176         Added a comment about copy().
1177         * platform/text/StringImpl.h: Added a comment about copy().
1178
1179 2007-12-24  Darin Adler  <darin@apple.com>
1180
1181         Reviewed by Maciej.
1182
1183         - http://bugs.webkit.org/show_bug.cgi?id=16550
1184           make StringImpl immutable
1185
1186         I tried to keep the changes to a minimum. In some cases there is
1187         room for optimization -- I didn't try to add in the "single ref count"
1188         optimizations and there might be a tiny bit more string copying than
1189         we had before.
1190
1191         * WebCore.base.exp: Updated.
1192
1193         * dom/CharacterData.cpp:
1194         (WebCore::CharacterData::appendData): Changed to use String since
1195         StringImpl doesn't have mutating functions any more.
1196         (WebCore::CharacterData::insertData): Ditto.
1197         (WebCore::CharacterData::deleteData): Ditto.
1198         (WebCore::CharacterData::replaceData): Ditto.
1199         * dom/Text.cpp:
1200         (WebCore::Text::splitText): Changed to use substring instead of
1201         remove since StringImpl does't have mutating functions any more.
1202         * editing/CompositeEditCommand.cpp:
1203         (WebCore::CompositeEditCommand::deleteInsignificantText): Changed
1204         to use String instead of StringImpl so we can use remove.
1205
1206         * platform/text/PlatformString.h: Removed newUninitialized.
1207         Added append that takes a character pointer and length.
1208
1209         * platform/text/String.cpp:
1210         (WebCore::String::insert): Added an implementation that does not
1211         rely on an underlying StringImpl function.
1212         (WebCore::String::append): Ditto.
1213         (WebCore::String::truncate): Ditto.
1214         (WebCore::String::remove): Ditto.
1215         (WebCore::String::charactersWithNullTermination): Added an
1216         implementation that uses the new StringImpl null termination feature,
1217         which does not require modifying a string.
1218
1219         * platform/text/StringImpl.cpp:
1220         (WebCore::isSpace): Fix comment.
1221         (WebCore::StringImpl::StringImpl): Added a new constructor that makes
1222         a string with a trailing null character.
1223         (WebCore::StringImpl::substring): Marked const.
1224         (WebCore::StringImpl::replace): Marked const; had to add quite a few
1225         const_cast. Also rewrote one of these to work without modifying the
1226         existing string.
1227
1228         * platform/text/StringImpl.h: Fixed a mistake where the empty string had
1229         m_hasTerminatingNullCharacter uninitialized. Added a type and constructor
1230         for creating strings that have a trailing null character. Added a
1231         hasTerminatingNullCharacter function. Removed newUninitialized,
1232         charactersWithNullTermination, append, insert, truncate, and remove.
1233         Marked lots of other functions const.
1234
1235         * platform/text/TextCodecLatin1.cpp:
1236         (WebCore::TextCodecLatin1::decode): Rewrote to use a Vector instead of
1237         newUninitialized.
1238         * platform/text/TextCodecUTF16.cpp:
1239         (WebCore::TextCodecUTF16::decode): Ditto.
1240         * platform/text/TextCodecUserDefined.cpp:
1241         (WebCore::TextCodecUserDefined::decode): Ditto.
1242
1243         * rendering/RenderStyle.cpp:
1244         (WebCore::RenderStyle::setContent): Changed to use String since
1245         StringImpl doesn't have mutating functions any more.
1246
1247 2007-12-24  Alexey Proskuryakov  <ap@webkit.org>
1248
1249         Reviewed by Oliver.
1250
1251         Fix fast/events/arrow-keys-on-body.html, failing on Windows.
1252
1253         * platform/win/KeyEventWin.cpp:
1254         (WebCore::isKeypadEvent):
1255         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1256         Use HIWORD() macro instead of shifting the value explicitly (no change in behavior).
1257
1258 2007-12-23  Alexey Proskuryakov  <ap@webkit.org>
1259
1260         Fix Debug and Release QTMovieWin bulds.
1261
1262         * WebCore.vcproj/QTMovieWin.vcproj:
1263         * WebCore.vcproj/debug.vsprops:
1264         * WebCore.vcproj/debug_internal.vsprops:
1265         * WebCore.vcproj/release.vsprops:
1266         Use LibraryConfigSuffix instead of WebKitConfigSuffix for pthreadVC2.
1267         Build release import lib into \lib, not \bin.
1268
1269 2007-12-23  Alp Toker  <alp@atoker.com>
1270
1271         Reviewed by Holger Freyther.
1272
1273         http://bugs.webkit.org/show_bug.cgi?id=15382
1274         [CAIRO] Canvas pattern support
1275
1276         http://bugs.webkit.org/show_bug.cgi?id=16577
1277         Merge Cairo enhancements from Apollo project
1278
1279         Add support for canvas patterns.
1280
1281         Make Image::nativeImageForCurrentFrame() public.
1282
1283         Fix some typos along the way.
1284
1285         The globalAlpha canvas fixes are not included in this patch as
1286         they're slightly more intrusive and may conflict conceptually with
1287         GraphicsContext::setAlpha().
1288
1289         * html/CanvasPattern.cpp:
1290         (WebCore::CanvasPattern::CanvasPattern):
1291         (WebCore::CanvasPattern::~CanvasPattern):
1292         (WebCore::CanvasPattern::createPattern):
1293         * html/CanvasPattern.h:
1294         (WebCore::CanvasPattern::platformImage):
1295         * html/CanvasRenderingContext2D.cpp:
1296         (WebCore::CanvasRenderingContext2D::setShadow):
1297         (WebCore::CanvasRenderingContext2D::applyShadow):
1298         (WebCore::CanvasRenderingContext2D::drawImage):
1299         (WebCore::CanvasRenderingContext2D::createPattern):
1300         (WebCore::CanvasRenderingContext2D::applyStrokePattern):
1301         (WebCore::CanvasRenderingContext2D::applyFillPattern):
1302         * platform/graphics/Image.h:
1303         (WebCore::Image::nativeImageForCurrentFrame):
1304
1305 2007-12-23  Kevin Ollivier  <kevino@theolliviers.com>
1306
1307         Reviewed by Eric Seidel.
1308
1309         Remove getWxBitmap as we have nativeImageForCurrentFrame now,
1310         and don't draw a border in fillRect.
1311
1312         * platform/graphics/BitmapImage.h:
1313         * platform/graphics/wx/GraphicsContextWx.cpp:
1314         (WebCore::GraphicsContext::fillRect):
1315         * platform/graphics/wx/ImageWx.cpp:
1316
1317 2007-12-23  Alp Toker  <alp@atoker.com>
1318
1319         Reviewed by Holger Freyther.
1320
1321         http://bugs.webkit.org/show_bug.cgi?id=16577
1322         Merge Cairo enhancements from Apollo project
1323
1324         This patch is based on initial merging work by Brent Fulgham. Adobe's
1325         code has been modified in a few places to better suit the existing
1326         coding style.
1327
1328         Implement more clipping and drawing functions.
1329
1330         Save and restore the fill rule manually when clipping.
1331
1332         Avoid image surface creation when the image buffer has height zero.
1333
1334         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1335         (WebCore::GraphicsContext::clip):
1336         (WebCore::GraphicsContext::addInnerRoundedRectClip):
1337         (WebCore::GraphicsContext::addPath):
1338         (WebCore::GraphicsContext::clipOut):
1339         (WebCore::GraphicsContext::clipOutEllipseInRect):
1340         (WebCore::GraphicsContext::fillRoundedRect):
1341         * platform/graphics/cairo/ImageSourceCairo.cpp:
1342         (WebCore::ImageSource::createFrameAtIndex):
1343
1344 2007-12-23  Nikolas Zimmermann  <zimmermann@kde.org>
1345
1346         Reviewed by Mark.
1347
1348         Fix wrong placed ifdef - wrapping SVGDefsElement, instead of SVGDefinitionSrcElement in SVG_FONTS block.
1349
1350         * bindings/objc/DOM.mm:
1351         (WebCore::createElementClassMap):
1352
1353 2007-12-22  Alp Toker  <alp@atoker.com>
1354
1355         GTK+ build fix
1356
1357         GTK_TARGET_OTHER_APP is not available in older GTK+ versions. Pass
1358         empty target flags for now.
1359
1360         Check GTK+, not GLib versions, since they are different.
1361
1362         * platform/gtk/PasteboardGtk.cpp:
1363         (WebCore::Pasteboard::documentFragment):
1364
1365 2007-12-22  Luca Bruno  <lethalman88@gmail.com>
1366
1367         Reviewed by Alp Toker.
1368
1369         http://bugs.webkit.org/show_bug.cgi?id=16311
1370         [Gtk] Copy rich text to clipboard as text/plain and text/html.
1371
1372         Hook into the WebView to get the correct clipboard object on the
1373         appropriate display. This is necessary because GTK+ does not have
1374         global clipboards.
1375
1376         * WebCore.pro:
1377         * platform/Pasteboard.h:
1378         (WebCore::Pasteboard::setHelper): added for GTK
1379         (WebCore::Pasteboard::m_helper): private added for GTK
1380         * platform/gtk/PasteboardGtk.cpp:
1381         (WebCore::PasteboardSelectionData): added to support GTK selection data callback
1382         (WebCore::clipboard_get_contents_cb): added
1383         (WebCore::clipboard_clear_contents_cb): added
1384         (WebCore::Pasteboard::~Pasteboard):
1385         (WebCore::Pasteboard::setHelper):
1386         (WebCore::Pasteboard::writeSelection): copy rich text
1387         (WebCore::Pasteboard::documentFragment): 
1388         (WebCore::Pasteboard::plainText): 
1389         * platform/gtk/PasteboardHelper.h: Added.
1390
1391 2007-12-22  Nikolas Zimmermann  <zimmermann@kde.org>
1392
1393         Reviewed by Oliver.
1394
1395         Fixes: http://bugs.webkit.org/show_bug.cgi?id=15966 (Crash in SVGRootInlineBox::walkTextChunks() on mouse hover)
1396
1397         Add new isSVGRootInlineBox() function to InlineBox to be able to differentiate between RootInlineBox/SVGRootInlineBox.
1398         SVG assumed it's root inline box (for <text> elements) is always of type SVGRootInlineBox, which is not the case
1399         for HTML text in <foreignObject>. Text selection doesn't work so far as line box offsets are wrong - which is visible
1400         in Web Inspector.
1401
1402         * rendering/InlineBox.h:
1403         (WebCore::InlineBox::isSVGRootInlineBox):
1404         * rendering/SVGInlineTextBox.cpp:
1405         (WebCore::SVGInlineTextBox::svgRootInlineBox):
1406         (WebCore::SVGInlineTextBox::closestCharacterToPosition):
1407         (WebCore::SVGInlineTextBox::selectionRect):
1408         * rendering/SVGRenderTreeAsText.cpp:
1409         (WebCore::writeSVGInlineTextBox):
1410         * rendering/SVGRootInlineBox.h:
1411         (WebCore::SVGRootInlineBox::isSVGRootInlineBox):
1412
1413 2007-12-22  Alp Toker  <alp@atoker.com>
1414
1415         LOW_BANDWIDTH_DISPLAY build fix
1416
1417         Track recent KURL DeprecatedString changes.
1418
1419         * loader/FrameLoader.cpp:
1420         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
1421
1422 2007-12-22  Dan Bernstein  <mitz@apple.com>
1423
1424         - Windows build fix
1425
1426         * WebCore.vcproj/WebCore.vcproj:
1427
1428 2007-12-22  Xan Lopez  <xan@gnome.org>
1429
1430         Reviewed by Alp Toker.
1431
1432         Add missing return 0 to fix a compile warning.
1433
1434         * page/gtk/FrameGtk.cpp:
1435         (WebCore::Frame::createScriptInstanceForWidget):
1436
1437 2007-12-21  Antti Koivisto  <antti@apple.com>
1438
1439         Reviewed by Darin, Adam and Steve.
1440
1441         Add media playback support for Windows.
1442         
1443         The implementation uses low level QuickTime API. DLL is
1444         needed to work around CF use in both WebKit and QuickTime.
1445         
1446         This makes Windows build depend on the QuickTime SDK 
1447         
1448         http://developer.apple.com/quicktime/download/
1449         
1450         but not QuickTime itself.
1451         
1452         QTMovieWinTimer contains some copy code from SharedTimerWin. It
1453         is used in the QuickTime access DLL which can't use WebCore
1454         SharedTimer due to dependency problems.
1455
1456         * WebCore.vcproj/QTMovieWin.vcproj: Added.
1457         * WebCore.vcproj/WebCore.vcproj:
1458         * WebCore.vcproj/build-generated-files.sh:
1459         * html/HTMLMediaElement.cpp:
1460         (WebCore::HTMLMediaElement::setSrc):
1461         * platform/graphics/MediaPlayer.cpp:
1462         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp: Added.
1463         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
1464         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
1465         (WebCore::MediaPlayerPrivate::load):
1466         (WebCore::MediaPlayerPrivate::play):
1467         (WebCore::MediaPlayerPrivate::pause):
1468         (WebCore::MediaPlayerPrivate::duration):
1469         (WebCore::MediaPlayerPrivate::currentTime):
1470         (WebCore::MediaPlayerPrivate::seek):
1471         (WebCore::MediaPlayerPrivate::doSeek):
1472         (WebCore::MediaPlayerPrivate::cancelSeek):
1473         (WebCore::MediaPlayerPrivate::seekTimerFired):
1474         (WebCore::MediaPlayerPrivate::setEndTime):
1475         (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
1476         (WebCore::MediaPlayerPrivate::endPointTimerFired):
1477         (WebCore::MediaPlayerPrivate::paused):
1478         (WebCore::MediaPlayerPrivate::seeking):
1479         (WebCore::MediaPlayerPrivate::naturalSize):
1480         (WebCore::MediaPlayerPrivate::hasVideo):
1481         (WebCore::MediaPlayerPrivate::setVolume):
1482         (WebCore::MediaPlayerPrivate::setMuted):
1483         (WebCore::MediaPlayerPrivate::setRate):
1484         (WebCore::MediaPlayerPrivate::dataRate):
1485         (WebCore::MediaPlayerPrivate::maxTimeBuffered):
1486         (WebCore::MediaPlayerPrivate::maxTimeSeekable):
1487         (WebCore::MediaPlayerPrivate::maxTimeLoaded):
1488         (WebCore::MediaPlayerPrivate::bytesLoaded):
1489         (WebCore::MediaPlayerPrivate::totalBytesKnown):
1490         (WebCore::MediaPlayerPrivate::totalBytes):
1491         (WebCore::MediaPlayerPrivate::cancelLoad):
1492         (WebCore::MediaPlayerPrivate::updateStates):
1493         (WebCore::MediaPlayerPrivate::didEnd):
1494         (WebCore::MediaPlayerPrivate::setRect):
1495         (WebCore::MediaPlayerPrivate::setVisible):
1496         (WebCore::MediaPlayerPrivate::paint):
1497         (WebCore::MediaPlayerPrivate::getSupportedTypes):
1498         (WebCore::MediaPlayerPrivate::movieEnded):
1499         (WebCore::MediaPlayerPrivate::movieLoadStateChanged):
1500         (WebCore::MediaPlayerPrivate::movieTimeChanged):
1501         (WebCore::MediaPlayerPrivate::movieNewImageAvailable):
1502         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h: Added.
1503         (WebCore::MediaPlayerPrivate::networkState):
1504         (WebCore::MediaPlayerPrivate::readyState):
1505         * platform/graphics/win/QTMovieWin.cpp: Added.
1506         (updateTaskTimer):
1507         (QTMovieWinPrivate::QTMovieWinPrivate):
1508         (QTMovieWinPrivate::~QTMovieWinPrivate):
1509         (taskTimerFired):
1510         (QTMovieWinPrivate::startTask):
1511         (QTMovieWinPrivate::endTask):
1512         (QTMovieWinPrivate::task):
1513         (QTMovieWinPrivate::registerDrawingCallback):
1514         (QTMovieWinPrivate::drawingComplete):
1515         (QTMovieWinPrivate::createGWorld):
1516         (QTMovieWinPrivate::setSize):
1517         (QTMovieWinPrivate::deleteGWorld):
1518         (QTMovieWin::QTMovieWin):
1519         (QTMovieWin::~QTMovieWin):
1520         (QTMovieWin::play):
1521         (QTMovieWin::pause):
1522         (QTMovieWin::rate):
1523         (QTMovieWin::setRate):
1524         (QTMovieWin::duration):
1525         (QTMovieWin::currentTime):
1526         (QTMovieWin::setCurrentTime):
1527         (QTMovieWin::setVolume):
1528         (QTMovieWin::setMuted):
1529         (QTMovieWin::dataSize):
1530         (QTMovieWin::maxTimeLoaded):
1531         (QTMovieWin::loadState):
1532         (QTMovieWin::getNaturalSize):
1533         (QTMovieWin::setSize):
1534         (QTMovieWin::setVisible):
1535         (QTMovieWin::paint):
1536         (QTMovieWin::load):
1537         (movieDrawingCompleteProc):
1538         (initializeSupportedTypes):
1539         (QTMovieWin::countSupportedTypes):
1540         (QTMovieWin::getSupportedType):
1541         (QTMovieWin::initializeQuickTime):
1542         (DllMain):
1543         * platform/graphics/win/QTMovieWin.h: Added.
1544         * platform/graphics/win/QTMovieWinTimer.cpp: Added.
1545         (TimerWindowWndProc):
1546         (initializeOffScreenTimerWindow):
1547         (setSharedTimerFiredFunction):
1548         (timerFired):
1549         (setSharedTimerFireDelay):
1550         (stopSharedTimer):
1551         (setSharedTimerInstanceHandle):
1552         (systemTime):
1553         * platform/graphics/win/QTMovieWinTimer.h: Added.
1554         * rendering/RenderMedia.cpp:
1555         (WebCore::MediaControlPlayButtonElement::update):
1556
1557 2007-12-21  Brent Fulgham  <bfulgham@gmail.com>
1558
1559         Reviewed by Alp Toker.
1560
1561         http://bugs.webkit.org/show_bug.cgi?id=16558
1562         Cairo WebCore Rendering Fails on arc drawing
1563
1564         Fix for bug reported (and patched) by Apollo team in which
1565         arcs were draw in reverse (resulting in inverted images).
1566         Review of the source found that the 'clockwise' term was
1567         actually meant to mean 'anticlockwise' so the IDL and
1568         supporting classes have been changed to match this. 
1569
1570         * html/CanvasRenderingContext2D.cpp:
1571         (WebCore::CanvasRenderingContext2D::arc):
1572         * html/CanvasRenderingContext2D.idl:
1573         * platform/graphics/cairo/PathCairo.cpp:
1574         (WebCore::Path::addArc):
1575         (WebCore::Path::addEllipse):
1576         * platform/graphics/Path.h:
1577
1578 2007-12-21  Alexey Proskuryakov  <ap@webkit.org>
1579
1580         Reviewed by Oliver.
1581
1582         <rdar://problem/5629995> Incorrect display of Danish characters on web site.
1583
1584         Test: http/tests/xmlhttprequest/response-encoding.html
1585
1586         * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::didReceiveData):
1587         Default to UTF-8 for HTML, too. It's unfortunate that we have to use different
1588         rules for main content and XHR responses, but this matches both IE and Firefox.
1589
1590 2007-12-20  Jon Honeycutt  <jhoneycutt@apple.com>
1591
1592         Reviewed by Kevin Decker.
1593
1594         <rdar://problem/5655797> REGRESSION(304-306A10) Safari does not find
1595         shockwave plugin on freshly installed OS
1596
1597         Look for Director plugin in its native directory.
1598
1599         * plugins/win/PluginDatabaseWin.cpp:
1600         (WebCore::PluginDatabaseWin::getPluginsInPaths): The Director plugin
1601         doesn't start with "np," so special case its filename.
1602         (WebCore::addMacromediaPluginPaths): Add Flash and "Shockwave 10"
1603         directories to the plugin paths.
1604         (WebCore::PluginDatabaseWin::defaultPluginPaths):
1605
1606 2007-12-20  Peter Kasting  <zerodpx@gmail.com>
1607
1608         Reviewed by Alp Toker.
1609
1610         http://bugs.webkit.org/show_bug.cgi?id=16508
1611         Fix regression in GIFImageDecoder.cpp: "Haeberli hack" led to wrongly
1612         decoded transparent areas.
1613
1614         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1615         (WebCore::GIFImageDecoder::haveDecodedRow):
1616         * platform/image-decoders/gif/GIFImageDecoder.h:
1617         * platform/image-decoders/gif/GIFImageReader.cpp:
1618         (GIFImageReader::output_row):
1619
1620 2007-12-20  Justin Garcia  <justin.garcia@apple.com>
1621
1622         Reviewed by Oliver Hunt.
1623
1624         <rdar://problem/5543472> GoogleDocs: Safari hangs when creating a list from a particular selection
1625         
1626         Still need to fix similar issues with the other operations that iterate 
1627         over selected paragraphs, like FormatBlock, Indent and Outdent (<rdar://problem/5658933>).
1628
1629         * editing/IndentOutdentCommand.cpp:
1630         (WebCore::IndentOutdentCommand::indentRegion): Added a FIXME.
1631         * editing/IndentOutdentCommand.h: Removed an unused function.
1632         * editing/InsertListCommand.cpp:
1633         (WebCore::InsertListCommand::modifyRange): 
1634         Renamed visibleStart to startOfSelection and visibleEnd to endOfSelection.
1635         Call the new selectionForParagraphIteration, which a) prevents operations like this
1636         one from being performed on a table that isn't fully selected (where the selection
1637         starts just before the table and ends inside it), and b) helps prevent paragraph
1638         iteration from going past the end of the selection.
1639         Call the new startOfNextParagraph, instead of using endOfParagraph(v).next(),
1640         since when v is in the last paragraph of the last cell of a table, that expression 
1641         will return the position after the table, not the start of the next paragraph.
1642         * editing/htmlediting.cpp:
1643         (WebCore::enclosingListChild): Don't go above a table cell, so that list operations
1644         take effect inside the table cell where they are performed.
1645         (WebCore::selectionForParagraphIteration): Added, see above.
1646         (WebCore::indexForVisiblePosition): Moved from IndentOutdentCommand.cpp.
1647         * editing/htmlediting.h:
1648         * editing/visible_units.cpp:
1649         (WebCore::startOfNextParagraph): Added, see above.
1650         * editing/visible_units.h:
1651         * editing/TextIterator.h:
1652         (WebCore::TextIterator::exitNode): Added a FIXME.
1653
1654 2007-12-20  Alp Toker  <alp@atoker.com>
1655
1656         Rubber-stamped by Maciej.
1657
1658         http://bugs.webkit.org/show_bug.cgi?id=16542
1659         [GTK] Text is missing with old Pango version
1660
1661         Back out commits r28880, r28876, r28865, r28864 which added Pango font
1662         selection support. These changes caused a regression where no text was
1663         displayed with older Pango versions.
1664
1665         * platform/graphics/gtk/FontCacheGtk.cpp:
1666         (WebCore::FontCache::fontExists):
1667         * platform/graphics/gtk/FontDataGtk.cpp:
1668         (WebCore::FontData::platformDestroy):
1669         (WebCore::FontData::containsCharacters):
1670         * platform/graphics/gtk/FontPlatformData.h:
1671         (WebCore::FontPlatformData::FontPlatformData):
1672         (WebCore::FontPlatformData::hash):
1673         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
1674         (WebCore::FontPlatformData::FontPlatformData):
1675         (WebCore::FontPlatformData::init):
1676         (WebCore::FontPlatformData::~FontPlatformData):
1677         (WebCore::FontPlatformData::isFixedPitch):
1678         (WebCore::FontPlatformData::operator==):
1679         * platform/graphics/gtk/GlyphPageTreeNodeGtk.cpp:
1680         (WebCore::GlyphPage::fill):
1681
1682 2007-12-20  Timothy Hatcher  <timothy@apple.com>
1683
1684         Reviewed by Sam Weinig.
1685
1686         <rdar://problem/5604897> Double-clicking on JavaScript console error
1687         won't show the line where it occurred
1688
1689         Make the URLs clickable in the console, since double clicking is used for
1690         word text selection. Makes the word "line" localizable. Messages that don't
1691         have a URL will no longer print "undefined". Messages that have a line number
1692         less than or equal to 0 will no longer be printed.
1693
1694         * English.lproj/InspectorLocalizedStrings.js: Add "%s (line %d)".
1695         * page/inspector/ConsolePanel.js: Tweak how the DOM nodes are created
1696           and change the click handler to look for a link with the
1697           "console-message-url" class name.
1698         * page/inspector/SourcePanel.js: Call setupSourceFrameIfNeeded() if a
1699           line row is needed. 
1700         * page/inspector/inspector.css: Update the look of the URL in the console.
1701
1702 2007-12-20  Adam Barth  <hk9565@gmail.com>
1703
1704         Reviewed and landed by Sam Weinig.
1705
1706         http://bugs.webkit.org/show_bug.cgi?id=15313
1707         <rdar://problem/5514516>
1708
1709         The same-origin check was incorrect in two cases (both fixed in this
1710         patch):
1711
1712         A) If both the source and the target have set their document.domain
1713            to the same value, the protocol must also match in order for
1714            access to be allowed.  Without this requirement, the browser is
1715            vulnerable to the following attack:
1716
1717            1) Suppose there is an HTTPS site (www.example.com) that sets
1718               document.domain = "example.com".
1719            2) A network attacker redirects the browser to http://www.example.com/
1720               a) injects script to set document.domain = "example.com", and
1721               b) opens a window to https://www.example.com/
1722            3) Now the network attacker can inject script into the HTTPS page,
1723               stealing cookies and issuing banking transactions.
1724
1725         B) If only one of the source and target has set document.domain, then
1726            access should be denied.  With this behavior, the browser is
1727            vulnerable to the following attack:
1728
1729            1) Suppose http://foo.example.com/ opens an iframe to
1730               http://foo.example.com/frame.html that
1731               a) sets document.domain = "example.com", and
1732               b) opens an iframe to http://bar.example.com/
1733               This is a common usage of document.domain for cross-domain
1734               communication, see for example:
1735                 http://www.collinjackson.com/research/papers/fp801-jackson.pdf
1736            2) The inner-most iframe, which is from bar.example.com, sets
1737               document.domain = "example.com".
1738            3) Now the inner-most iframe can inject script into the middle
1739               iframe (say via document.write).  This bar.example.com script
1740               now has access to the outer-most frame (from foo.example.com).
1741
1742         Both these changes cause WebKit to match the behavior of Firefox 2 and
1743         IE6 in these cases.  This patch includes regression tests for both
1744         issues.
1745
1746         Internet Explorer 7 and Opera 9 are more strict in that they require
1747         the port numbers to match when both pages have document.domain set.
1748         Opera 9 allows access when only one page has set document.domain, but
1749         this is a security vulnerability.
1750
1751         Tests: http/tests/security/cross-frame-access-child-explicit-domain.html
1752                http/tests/security/cross-frame-access-parent-explicit-domain.html
1753
1754         * bindings/js/kjs_window.cpp:
1755         (KJS::createWindow):
1756         (KJS::Window::allowsAccessFrom):
1757         * dom/Document.cpp:
1758         (WebCore::Document::domain):
1759         (WebCore::Document::setDomain):
1760         (WebCore::Document::initSecurityOrigin):
1761         * dom/Document.h:
1762         (WebCore::Document::securityOrigin):
1763         * loader/FrameLoader.cpp:
1764         (WebCore::FrameLoader::begin):
1765         (WebCore::FrameLoader::checkCallImplicitClose):
1766         (WebCore::FrameLoader::shouldAllowNavigation):
1767         * platform/SecurityOrigin.cpp:
1768         (WebCore::SecurityOrigin::setForURL):
1769         (WebCore::SecurityOrigin::createForFrame):
1770         (WebCore::SecurityOrigin::canAccess):
1771         * platform/SecurityOrigin.h:
1772         (WebCore::SecurityOrigin::domain):
1773         * storage/Database.cpp:
1774         (WebCore::Database::openDatabase):
1775         (WebCore::Database::Database):
1776         (WebCore::Database::securityOriginData):
1777         * storage/Database.h:
1778         (WebCore::Database::databaseDebugName):
1779         * storage/DatabaseTracker.cpp:
1780         (WebCore::DatabaseTracker::canEstablishDatabase):
1781         * storage/SQLTransaction.cpp:
1782         (WebCore::SQLTransaction::postflightAndCommit):
1783         (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
1784
1785 2007-12-20  Rodney Dawes  <dobey@wayofthemonkey.com>
1786
1787         Reviewed by Darin Adler.
1788
1789         Define XP_UNIX when building with plugins on X11.
1790         Use new npruntime_internal.h instead of npruntime.h.
1791         http://bugs.webkit.org/show_bug.cgi?id=15669
1792
1793         * ForwardingHeaders/bindings/npruntime_internal.h
1794         * WebCore.pro:
1795         * html/HTMLPlugInElement.h:
1796
1797 2007-12-19  johnnyding.webkit  <johnnyding.webkit@gmail.com>
1798
1799         Reviewed by Alexey. Landed by Stephanie.
1800
1801         - fix http://bugs.webkit.org/show_bug.cgi?id=16179 | <rdar://problem/5619399>
1802           Any attribute name start with a unicode which like #xx00(x could be any hex number[0-9a-f]) will cause HTMLTokenizer parse error
1803           Actually any unicode characters which great than 255 in attribute name will cause Webkit parse the attribute name wrong. So after comparing 
1804           the same scenario in IE 6/7, FireFox 2/3, Opera, we should treat those characters as part of attribute name.
1805
1806
1807         * html/HTMLTokenizer.cpp:
1808         (WebCore::HTMLTokenizer::parseEntity): Handle Unicode Entity Name by using ASCII version of findEntity.
1809         (WebCore::HTMLTokenizer::parseTag): Let type of ptr match type of cBuffer.
1810         * html/HTMLTokenizer.h: Change type of cBuffer from char to UChar.
1811
1812 2007-12-20  Eric Seidel  <eric@webkit.org>
1813
1814         Reviewed by Nikolas Zimmermann.
1815
1816         WebKit claims to support SVG feature strings it shouldn't
1817         http://bugs.webkit.org/show_bug.cgi?id=15480
1818
1819         * dom/DOMImplementation.cpp:
1820         (WebCore::isSVG10Feature):
1821         (WebCore::isSVG11Feature):
1822
1823 2007-12-20  John Sullivan  <sullivan@apple.com>
1824
1825         Reviewed by Oliver and Geoff
1826         
1827         - fix <rdar://problem/5536858> Yellow highlight for find results is sometimes shorter 
1828           than white "hole" behind it
1829
1830         * rendering/RenderText.cpp:
1831         (WebCore::RenderText::addLineBoxRects):
1832         respect useSelectionHeight in all cases; we were only respecting it in one of the two cases
1833
1834 2007-12-20  Dan Bernstein  <mitz@apple.com>
1835
1836         Reviewed by Darin Adler.
1837
1838         - fix <rdar://problem/5656368> REGRESSION(3.0.4-ToT): Acid2 test fails to render anything
1839
1840         * platform/win/ScrollViewWin.cpp:
1841         (WebCore::ScrollView::maximumScroll): Changed back to return the maximum
1842         scroll offsets even if scrolling is not allowed, because navigation and
1843         scrollTo should still work.
1844         (WebCore::ScrollView::wheelEvent): Added early return if scrolling is
1845         not allowed.
1846
1847 2007-12-17  Tony Chang  <idealisms@gmail.com>
1848
1849         Reviewed by Darin.
1850
1851         - Fix for http://bugs.webkit.org/show_bug.cgi?id=16479
1852           text selection does not always begin at mouse down point
1853           Reset the m_dragSrc object on mouse down on all platforms.
1854
1855         Test: fast/text/reset-drag-on-mouse-down.html
1856
1857         * page/EventHandler.cpp:
1858         (WebCore::EventHandler::handleMousePressEvent):
1859         * page/mac/EventHandlerMac.mm:
1860         (WebCore::EventHandler::mouseDown):
1861
1862 2007-12-19  Geoffrey Garen  <ggaren@apple.com>
1863
1864         Reviewed by Oliver Hunt.
1865
1866         Build support:
1867         * ForwardingHeaders/kjs/SymbolTable.h: Added.
1868         * ForwardingHeaders/wtf/VectorTraits.h: Added.
1869
1870         * bindings/js/JSDOMWindowCustom.cpp:
1871         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Replaced use of
1872         getDirectLocation with getOwnPropertySlot. getDirectLocation is no
1873         longer valid, since global declarations are not stored in the property
1874         map.
1875
1876         (WebCore::JSDOMWindow::customPut): Replaced use of JSObject::put with
1877         JSGlobalObject::put. JSObject::put is no longer valid, since global
1878         declarations are not stored in the property map.
1879
1880         * bindings/js/kjs_window.cpp: Replaced JSObject:: calls with Base::
1881         calls, since JSObject is not our base class. This was always a bug, but
1882         the bug is even more apparent after some of my changes.
1883
1884         (KJS::Window::clear): Removed call to clearProperties because
1885         JSGlobalObject::reset takes care of that now.
1886
1887         * history/CachedPage.cpp:
1888         * history/CachedPage.h: Added support for saving a symbol table and
1889         localStorage to the page cache, and restoring it.
1890
1891 2007-12-19  Dan Bernstein  <mitz@apple.com>
1892
1893         Reviewed by Darin Adler and Dave Hyatt.
1894
1895         - Substitute the user's preferred standard font for an unknown primary
1896           font before falling back on the platform's last resort font
1897
1898         Cannot be tested in DumpRenderTree because it sets the standard font to
1899         Times, which is also the hard-coded last resort font on Mac.
1900
1901         * css/CSSFontSelector.cpp:
1902         (WebCore::CSSFontSelector::getFontData): Changed the early bail out
1903         condition to allow getting generic font families from settings even if
1904         there are not @font-face rules. Fixed a typo that mapped fantasy to
1905         cursive. Added a mapping from -webkit-standard to the standard family.
1906         * css/CSSStyleSelector.cpp:
1907         (WebCore::CSSStyleSelector::CSSStyleSelector): Changed to always create
1908         a font selector.
1909         (WebCore::CSSRuleSet::addRulesFromSheet):
1910         (WebCore::CSSStyleSelector::applyProperty): Changed to always use the
1911         font selector.
1912         * css/CSSStyleSelector.h:
1913         (WebCore::CSSStyleSelector::fontSelector):
1914         * platform/graphics/FontCache.cpp:
1915         (WebCore::FontCache::getFontData): Try the user's preferred standard
1916         font before the platform's last resort font.
1917
1918 2007-12-19  Sven Herzberg  <sven@imendio.com>
1919
1920         Reviewed by Alp Toker.
1921
1922         Scaled font destruction takes place in FontData::platformDestroy(). No
1923         need to do it in FontPlatformData::~FontPlatformData().
1924
1925         Destroying platform data in platformDestroy() is a convention we
1926         borrow from the Mac and Win ports.
1927
1928         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
1929
1930 2007-12-19  Alice Liu  <alice.liu@apple.com>
1931
1932         build fix (Windows)
1933
1934         Changed uint to unsigned int.  uint caused Windows build breakage
1935
1936         * page/Page.cpp:
1937         (WebCore::Page::markAllMatchesForText):
1938         * page/Page.h:
1939
1940 2007-12-19  Christian Dywan  <christian@twotoasts.de> 
1941
1942         Reviewed by Alp Toker.
1943
1944         http://bugs.webkit.org/show_bug.cgi?id=16222
1945         [GTK] Implement inline search and highlighting of matching strings.
1946
1947         Implement search and highlighting logic directly in WebCore.
1948
1949         * page/Page.cpp:
1950         (WebCore::incrementFrame):
1951         (WebCore::Page::findString):
1952         (WebCore::Page::markAllMatchesForText):
1953         (WebCore::Page::unmarkAllTextMatches):
1954         * page/Page.h:
1955
1956 2007-12-19  Geoffrey Garen  <ggaren@apple.com>
1957
1958         Reviewed by Sam Weinig, Dan Bernstein.
1959
1960         Tiger build fix: restored some graphics code still needed on Tiger.
1961
1962         * platform/graphics/GraphicsTypes.h:
1963         * platform/graphics/cg/GraphicsContextCG.cpp:
1964         * platform/graphics/mac/GraphicsContextMac.mm:
1965         (WebCore::GraphicsContext::setCompositeOperation):
1966
1967 2007-12-19  Alp Toker  <alp@atoker.com>
1968
1969         Build fix for Pango < 1.18.0 breakage introduced in r28864. Use Fc and
1970         the Pango backend API in these cases.
1971
1972         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
1973         (WebCore::FontPlatformData::FontPlatformData):
1974         (WebCore::FontPlatformData::~FontPlatformData):
1975
1976 2007-12-19  Alice Liu  <alice.liu@apple.com>
1977
1978         Reviewed by Darin.
1979
1980         Fixed <rdar://problem/5592485> Safari crashed trying to get a motorcycle insurance quote
1981         on Geico.com WebCore::Document::inPageCache()
1982
1983         Calling Node::willRemove on the focusedNode would immediately tell the document to remove
1984         the focused node, and trigger JS events.  This means that the document is mutated while
1985         the engine is trying to tell all child nodes that it's about to removed.  To avoid
1986         crashing, we need to hold off on mutating the document until node traversal is finished.
1987
1988         * dom/ContainerNode.cpp:
1989         (WebCore::ContainerNode::removeChild):
1990         (WebCore::ContainerNode::removeChildren):
1991         * dom/Node.cpp:
1992         * dom/Node.h:
1993         (WebCore::Node::willRemove):
1994         * loader/FrameLoader.cpp:
1995         (WebCore::FrameLoader::clear):
1996
1997 2007-12-19  Andre Boule  <aboule@apple.com>
1998
1999         Reviewed by Dan Bernstein.
2000
2001         Test: fast/canvas/canvas-composite.html
2002
2003         Fix for:
2004         <rdar://problem/5640059> GraphicsContext::setCompositeOperation should use CGContextSetBlendMode
2005
2006         This fix makes setCompositeOperation consistent across all platforms that use CG.
2007
2008         The following compositing modes don't pass however that is covered by another bug:
2009         source-in
2010         source-out
2011         destination-in
2012         destination-atop
2013         copy
2014         <rdar://problem/5651783> Some canvas tag compositing modes don't render correctly
2015
2016         * platform/graphics/GraphicsTypes.h:
2017         * platform/graphics/cg/GraphicsContextCG.cpp:
2018         (WebCore::GraphicsContext::setCompositeOperation):
2019         * platform/graphics/mac/GraphicsContextMac.mm:
2020         * platform/win/GraphicsContextWin.cpp:
2021
2022 2007-12-19  Dan Bernstein  <mitz@apple.com>
2023
2024         Reviewed by Dave Hyatt.
2025
2026         - fix <rdar://problem/5650045> REGRESSION: major layout problems in svn r28754 WebKit on Vox.com page
2027
2028         Test: fast/dynamic/subtree-boundary-percent-height.html
2029
2030         * rendering/RenderObject.cpp:
2031         (WebCore::objectIsRelayoutBoundary): Do not allow overflows with
2032         percent heights because sometimes they compute to 'auto'.
2033
2034 2007-12-19  Sam Weinig  <sam@webkit.org>
2035
2036         Reviewed by Maciej.
2037
2038         http://bugs.webkit.org/show_bug.cgi?id=16511
2039         Speed up ClassNodeList and NamedNodeList by using the caching mechanism employed by ChildNodeList.
2040         - This give a ~2.15x speedup on the native test @ http://ejohn.org/apps/classname/
2041
2042         * dom/ChildNodeList.cpp: Use the caching NodeList constructor to turn on caching.
2043         (WebCore::ChildNodeList::ChildNodeList):
2044         * dom/ClassNodeList.cpp:
2045         (WebCore::ClassNodeList::ClassNodeList):
2046         * dom/ClassNodeList.h:
2047
2048         Move getElementsByName and getElementsByClassName to Node so they
2049         can use easily employ the caching already used by ChildNodeLists.  In the case of 
2050         getElementsByClassName, this reduces code duplication in Element as well
2051         * dom/Document.cpp:
2052         * dom/Document.h:
2053
2054         Move getElementsByClassName to Node.
2055         * dom/Element.cpp:
2056         * dom/Element.h:
2057
2058         * dom/NameNodeList.cpp: Use the caching NodeList constructor to turn on caching.
2059         (WebCore::NameNodeList::NameNodeList):
2060         (WebCore::NameNodeList::item):
2061         * dom/NameNodeList.h:
2062
2063         Add maps of caches for ClassNodeLists and NameNodeList to NodeListsNodeData.
2064         * dom/Node.cpp:
2065         (WebCore::TagNodeList::TagNodeList):
2066         (WebCore::Node::Node):
2067         (WebCore::Node::~Node):
2068         (WebCore::Node::childNodes):
2069         (WebCore::Node::registerNodeList):
2070         (WebCore::Node::getElementsByName):
2071         (WebCore::Node::getElementsByClassName):
2072         * dom/Node.h: Make m_nodeLists an OwnPtr.  Moved getElementsByName and getElementsByClassName here
2073
2074         Allow subclasses to choose whether they want to receive the notifications using a new bit.
2075         * dom/NodeList.cpp:
2076         (WebCore::NodeList::NodeList):
2077         * dom/NodeList.h:
2078         (WebCore::NodeList::needsNotifications):
2079
2080 2007-12-19  Dave Hyatt  <hyatt@apple.com>
2081
2082         Add support for GDI text rendering to WebKit.
2083       
2084         Reviewed by mitz
2085         
2086         * css/CSSStyleSelector.cpp:
2087         (WebCore::CSSStyleSelector::applyProperty):
2088         * dom/Document.cpp:
2089         (WebCore::Document::recalcStyle):
2090         * page/Settings.cpp:
2091         (WebCore::Settings::setFontRenderingMode):
2092         (WebCore::Settings::fontRenderingMode):
2093         * page/Settings.h:
2094         * platform/graphics/Font.h:
2095         (WebCore::Font::renderingMode):
2096         * platform/graphics/FontCache.cpp:
2097         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
2098         (WebCore::FontPlatformDataCacheKey::operator==):
2099         (WebCore::computeHash):
2100         (WebCore::FontCache::getCachedFontPlatformData):
2101         * platform/graphics/FontDescription.h:
2102         (WebCore::):
2103         (WebCore::FontDescription::FontDescription):
2104         (WebCore::FontDescription::renderingMode):
2105         (WebCore::FontDescription::setRenderingMode):
2106         (WebCore::FontDescription::operator==):
2107         * platform/graphics/GraphicsContext.h:
2108         * platform/graphics/win/FontCacheWin.cpp:
2109         (WebCore::FontCache::fontExists):
2110         (WebCore::FontCache::createFontPlatformData):
2111         * platform/graphics/win/FontDataWin.cpp:
2112         (WebCore::FontData::platformInit):
2113         (WebCore::FontData::smallCapsFontData):
2114         (WebCore::FontData::containsCharacters):
2115         (WebCore::FontData::determinePitch):
2116         (WebCore::FontData::platformWidthForGlyph):
2117         * platform/graphics/win/FontPlatformData.h:
2118         (WebCore::FontPlatformData::FontPlatformData):
2119         (WebCore::FontPlatformData::useGDI):
2120         (WebCore::FontPlatformData::operator==):
2121         * platform/graphics/win/FontPlatformDataWin.cpp:
2122         (WebCore::FontPlatformData::FontPlatformData):
2123         * platform/graphics/win/FontWin.cpp:
2124         (WebCore::Font::drawGlyphs):
2125         * platform/graphics/win/IconWin.cpp:
2126         (WebCore::Icon::paint):
2127         * platform/win/GraphicsContextWin.cpp:
2128         (WebCore::GraphicsContext::getWindowsContext):
2129         (WebCore::GraphicsContext::releaseWindowsContext):
2130         * platform/win/UniscribeController.cpp:
2131         (WebCore::UniscribeController::shapeAndPlaceItem):
2132         * platform/win/UniscribeController.h:
2133         * plugins/win/PluginViewWin.cpp:
2134         (WebCore::PluginViewWin::paint):
2135
2136 2007-12-19  Sven Herzberg  <sven@imendio.com>
2137
2138         Reviewed by Alp Toker.
2139
2140         Replace the fontconfig/freetype based font management with a pango
2141         based one. Fixes:
2142         http://bugs.webkit.org/show_bug.cgi?id=15229
2143
2144         * platform/gtk/FontDataGtk.cpp (FontData::platformDestroy()): updated
2145         the platform specific destroy code
2146         (FontData::containsCharacters()): implemented font coverage with pango
2147         * platform/gtk/FontPlatformData.h: replaced fontconfig specific
2148         members with pango-specific ones
2149         * platform/gtk/FontPlatformDataGtk.cpp: added static members for the
2150         FontPlatformData class
2151         (FontPlatformData::FontPlatformData()): implemented the font-matching
2152         with a PangoFontDescription instead of an FcPattern; initialize the
2153         scaled font by using the API for PangoCairoFont
2154         (FontPlatformData::init()): initialize the PangoFontMap and set up a
2155         hash table to translate the font family name into a font family
2156         (FontPlatformData::isFixedPitch()): implemented by querying the
2157         PangoFontFamily
2158         (FontPlatformData::operator==): compare the FontPlatformData by
2159         comparing the font pointers or the described fonts
2160         * platform/gtk/GlyphPageTreeNodeGtk.cpp (pango_font_get_glyph()):
2161         added a function to query a glyph from a PangoFont
2162         (GlyphPage::fill()): implemented the fill function with Pango instead
2163         of fontconfig/freetype
2164
2165 2007-12-19  Alp Toker  <alp@atoker.com>
2166
2167         Reviewed by Holger Freyther.
2168
2169         Improve graphics operator approximations
2170         
2171         These changes match Cairo's own CG approximations.
2172
2173         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2174         (WebCore::toCairoOperator):
2175
2176 2007-12-19  Alp Toker  <alp@atoker.com>
2177
2178         Reviewed by Holger Freyther.
2179
2180         Check the bounding box before doing a full hit test
2181
2182         * platform/graphics/cairo/PathCairo.cpp:
2183         (WebCore::Path::contains):
2184
2185 2007-12-18  Sam Weinig  <sam@webkit.org>
2186
2187         Reviewed by Geoff.
2188
2189         Fix for <rdar://problem/5646478>
2190         REGRESSION: fast/events/event-view-toString fails on Leopard
2191
2192         This fixes an issue where we were incorrectly setting the lastInPrototypeChain
2193         for the JSDOMWindow (the global object) before a call to setPrototype overwrote
2194         it. This fixes it by passing the prototype up the constructor chain so that it
2195         is set before any calls can be made.
2196
2197         * bindings/js/kjs_window.cpp:
2198         (KJS::Window::Window):
2199         * bindings/js/kjs_window.h:
2200         * bindings/scripts/CodeGeneratorJS.pm:
2201
2202 2007-12-18  Beth Dakin  <bdakin@apple.com>
2203
2204         Reviewed by Oliver.
2205
2206         Fix for <rdar://problem/5616982> SVGs with width and height 100% 
2207         fail to render when used as <img> or CSS image (16167)
2208
2209         This final part of the work fixes the <img> tag.
2210
2211         This is the real fix. 
2212         * rendering/RenderImage.cpp:
2213         (WebCore::RenderImage::calcReplacedWidth): Set the container size 
2214         on the image. Setting the container size only actually sticks if 
2215         the values are non-zero, so if the container size really was set, 
2216         use the imageSize that is calculated using the container size. If 
2217         it did not stick but the image does have relative width (meaning 
2218         that the container size is 0), set the width to 0 by hand. We want 
2219         to avoid setting the width before we have a container size or we 
2220         will end up incorrectly using the default size of 300x150.
2221         (WebCore::RenderImage::calcReplacedHeight): Same as above, but for 
2222         height.
2223
2224         A few more pieces of information have to be exposed through cached 
2225         image to make this happen.
2226         * loader/CachedImage.cpp:
2227         (WebCore::CachedImage::usesImageContainerSize): As mentioned above, 
2228         when setContainerSize() is called, the container size is only 
2229         actually set if the values are non-zero. This call tells you if it 
2230         was set.
2231         (WebCore::CachedImage::imageHasRelativeWidth):
2232         (WebCore::CachedImage::imageHasRelativeHeight):
2233         * loader/CachedImage.h:
2234         * platform/graphics/Image.h:
2235         (WebCore::Image::usesContainerSize):
2236         * svg/graphics/SVGImage.cpp:
2237         (WebCore::SVGImage::usesContainerSize):
2238         * svg/graphics/SVGImage.h:
2239
2240 2007-12-18  Mark Rowe  <mrowe@apple.com>
2241
2242         Rubber-stamped by Maciej Stachowiak.
2243
2244         Remove outdated and non-functioning project files for the Apollo port.
2245
2246         * WebCore.apolloproj: Removed.
2247
2248 2007-12-18  Steve Falkenburg  <sfalken@apple.com>
2249
2250         <rdar://problem/5649911> REGRESSION (304-306A9): Typing 'p' in popup menu for type-to-select brings up Safari Help
2251         
2252         Need to translate the char back into a key code for posting our WM_KEYDOWN.
2253         
2254         Reviewed by Ada.
2255
2256         * platform/win/PopupMenuWin.cpp:
2257         (WebCore::PopupWndProc):
2258
2259 2007-12-18  Steve Falkenburg  <sfalken@apple.com>
2260
2261         <rdar://problem/5651534> REGRESSION(r28764-r28765): GDI leak drawing text when no appropriate font is available
2262         
2263         Our captured metafile from Uniscribe may contain multiple calls to CreateFontIndirect.
2264         Only create a font with the last one.
2265         
2266         Reviewed by Mitz, Darin.
2267
2268         * platform/graphics/win/FontCacheWin.cpp:
2269         (WebCore::metaFileEnumProc):
2270         (WebCore::FontCache::getFontDataForCharacters):
2271
2272 2007-12-17  Brent Fulgham  <bfulgham@gmail.com>
2273
2274         Reviewed by Darin.
2275
2276         http://bugs.webkit.org/show_bug.cgi?id=16464
2277         Modify WebCore to use win32 thread primitives
2278
2279         Updates to support native windows threading primitives
2280         rather than pthreads emulation library.
2281
2282         * WebCore.vcproj/WebCore.vcproj:
2283         * config.h:
2284         * platform/Threading.h:
2285         * platform/win/MutexWin.cpp: Added.
2286         (WebCore::Mutex::Mutex):
2287         (WebCore::Mutex::~Mutex):
2288         (WebCore::Mutex::lock):
2289         (WebCore::Mutex::tryLock):
2290         (WebCore::Mutex::unlock):
2291         * platform/win/ThreadConditionWin.cpp: Added.
2292         (WebCore::ThreadCondition::ThreadCondition):
2293         (WebCore::ThreadCondition::~ThreadCondition):
2294         (WebCore::ThreadCondition::wait):
2295         (WebCore::ThreadCondition::signal):
2296         (WebCore::ThreadCondition::broadcast):
2297         * platform/win/ThreadingWin.cpp:
2298         (WebCore::threadMapMutex):
2299         (WebCore::threadMap):
2300         (WebCore::storeThreadHandleByIdentifier):
2301         (WebCore::identifierByThreadHandle):
2302         (WebCore::threadHandleForIdentifier):
2303         (WebCore::clearThreadHandleForIdentifier):
2304         (WebCore::createThread):
2305         (WebCore::waitForThreadCompletion):
2306         (WebCore::detachThread):
2307         (WebCore::currentThread):
2308
2309 2007-12-18  Rodney Dawes  <dobey@wayofthemonkey.com>
2310
2311         Reviewed by Darin Adler.
2312
2313         Handle EINTR when set by select() and try the select() again
2314         http://bugs.webkit.org/show_bug.cgi?id=16071
2315
2316         * platform/network/curl/ResourceHandleManager.cpp:
2317         (ResourceHandleManager::downloadTimerCallback):
2318
2319 2007-12-18  Dan Bernstein  <mitz@apple.com>
2320
2321         Reviewed by Dave Hyatt.
2322
2323         - avoid the simplified Chinese font linking code for characters that are
2324           not in any Windows code page
2325
2326         * platform/graphics/win/FontCacheWin.cpp:
2327         (WebCore::FontCache::getFontDataForCharacters):
2328
2329 2007-12-18  Brady Eidson <beidson@apple.com>
2330
2331         Reviewed by Adele
2332
2333         <rdar://problem/5525770> REGRESSION: HTTP Auth protected favicon request results in a password sheet
2334
2335         Some http-auth protected sites have the main resource(s) unprotected, but many subresources are
2336         protected by authentication.  Occasionally one can view the main page of a site but the favicon
2337         is behind the iron curtain - in these cases, we should *not* prompt for a username and password
2338         solely for the favicon.
2339
2340         * loader/ResourceLoader.h: Make didReceiveAuthenticationChallenge virtual
2341
2342         * loader/SubresourceLoader.cpp:
2343         (WebCore::SubresourceLoader::didReceiveAuthenticationChallenge): Now that this method
2344           is virtual from ResourceLoader, SubresourceLoader can override.  First call to the 
2345           SubresourceLoaderClient.  If they cancel the resource load, return early. Otherwise, let
2346           ResourceLoader work its magic (resulting in the auth sheet coming down)
2347         * loader/SubresourceLoader.h:
2348
2349         * loader/SubresourceLoaderClient.h:
2350         (WebCore::SubresourceLoaderClient::didReceiveAuthenticationChallenge):
2351
2352         * loader/icon/IconLoader.cpp:
2353         (WebCore::IconLoader::didReceiveAuthenticationChallenge): Cancel the resource load, since we should
2354           never prompt the user for credentials just for a favicon.
2355         * loader/icon/IconLoader.h:
2356
2357 2007-12-18  John Sullivan  <sullivan@apple.com>
2358
2359         Reviewed by Brady
2360         
2361         - fixed <rdar://problem/5652380> Initial prompt shows "" for databases with no user-visible name
2362
2363         * storage/DatabaseTracker.cpp:
2364         (WebCore::DatabaseTracker::canEstablishDatabase):
2365         pass "name" instead of "displayName" if there's no displayName
2366
2367 2007-12-17  Dan Bernstein  <mitz@apple.com>
2368
2369         Reviewed by Maciej Stachowiak.
2370
2371         - restore ButtonFace and ThreeDFace to their previous values for non-Mac
2372           platforms. The Mac port also uses the same values for now instead
2373           of NSColor-based ones.
2374
2375         * rendering/RenderTheme.cpp:
2376         (WebCore::RenderTheme::systemColor):
2377
2378 2007-12-17  Rodney Dawes  <dobey@wayofthemonkey.com>
2379
2380         Reviewed by Maciej Stachowiak.
2381
2382         Define WTF_USE_NPOBJECT and WTF_USE_JAVASCRIPTCORE_BINDINGS for GTK+
2383         Add required Frame::createScriptInstanceForWidget to FrameGtk
2384
2385         * config.h:
2386         * page/gtk/FrameGtk.cpp (Frame::createScriptInstanceForWidget):
2387
2388 2007-12-17  Alice Liu  <alice.liu@apple.com>
2389
2390         Reviewed by Adam.
2391
2392         Fixed <rdar://5566435> window with no scrollbars can be scrolled
2393
2394         * platform/win/ScrollViewWin.cpp:
2395         (WebCore::ScrollView::maximumScroll):
2396         corrected maximumScroll() to account for scrolling not allowed.
2397         (WebCore::ScrollView::wheelEvent):
2398
2399 2007-12-14  Juan A. Suarez Romero  <jasuarez@igalia.com>
2400
2401         Reviewed by Alp Toker.
2402
2403         http://bugs.webkit.org/show_bug.cgi?id=16042
2404         [GTK] Eliminate webkit_init()
2405
2406         Move webkit initialization to WebView class init.
2407
2408         * WebCore.pro:
2409
2410 2007-12-17  Jon Honeycutt  <jhoneycutt@apple.com>
2411
2412         Reviewed by Darin.
2413
2414         <rdar://problem/5651291> REGRESSION: Flash content doesn't display
2415         (www.adobe.com)
2416
2417         We were passing NPEvent** instead of NPEvent* to NPP_HandleEvent.
2418
2419         * plugins/win/PluginViewWin.cpp:
2420         (WebCore::PluginViewWin::dispatchNPEvent): Changed to take NPEvent&, not
2421         NPEvent*
2422         (WebCore::PluginViewWin::paint): Pass NPEvent, not NPEvent*
2423         (WebCore::PluginViewWin::handleKeyboardEvent): same
2424         (WebCore::PluginViewWin::handleMouseEvent): same
2425         * plugins/win/PluginViewWin.h:
2426
2427 2007-12-17  Alexey Proskuryakov  <ap@webkit.org>
2428
2429         Reviewed by Darin.
2430
2431         Live to the promise of never making AppKit special character codes visible via DOM.
2432
2433         Test: fast/events/arrow-keys-on-body.html
2434
2435         * page/EventHandler.cpp:
2436         (WebCore::EventHandler::keyEvent): Check for empty keypress characters after disambiguation,
2437         to let quirks-aware code strip special charactrers.
2438         * platform/mac/KeyEventMac.mm:
2439         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): If not in keyboard event quirks
2440         mode, remove the text if it's a special character.
2441
2442 2007-12-17  Mark Rowe  <mrowe@apple.com>
2443
2444         Reviewed by Darin Adler.
2445
2446         Fix incorrect array size and incorrect array index in convertNSColorToColor.
2447
2448         * rendering/RenderThemeMac.mm:
2449         (WebCore::convertNSColorToColor):
2450
2451 2007-12-17  Darin Adler  <darin@apple.com>
2452
2453         Reviewed by Mark Rowe.
2454
2455         - fix http://bugs.webkit.org/show_bug.cgi?id=16468
2456           REGRESSION(r28781): Crash running storage/transaction_callback_exception_crash.html
2457
2458         * storage/DatabaseThread.cpp:
2459         (WebCore::DatabaseThread::dispatchNextTaskIdentifier): Use a RefPtr for the database
2460         because there's no guarantee it won't lose its last reference otherwise.
2461
2462 2007-12-17  Dan Bernstein  <mitz@apple.com>
2463
2464         Reviewed by Maciej Stachowiak.
2465
2466         - fix <rdar://problem/5333260> Some Chinese characters in Text Encoding menu are bold, others are not
2467           and <rdar://problem/5280188> Chinese text looks worse on Safari for Windows cf. Safari for Mac
2468
2469         * platform/graphics/win/FontCacheWin.cpp:
2470         (WebCore::FontCache::getFontDataForCharacters): To ensure that font
2471         linking gives consistent results for characters that are exclusive to
2472         the simplified Chinese code page and characters that belong to that
2473         code page and other code pages, always ask to map to simplified Chinese
2474         alone first.
2475
2476 2007-12-17  Christian Dywan  <christian@twotoasts.de>
2477
2478         Reviewed by Alp Toker.
2479
2480         http://bugs.webkit.org/show_bug.cgi?id=16378
2481         Implement Icon for Gtk
2482
2483         Icon provides a GdkPixbuf containing a themed icon.
2484         The icon theme is probed for an icon name according to the
2485         Icon Naming Specification or conventional Gnome icon names respectively.
2486
2487         See http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
2488
2489         * platform/graphics/Icon.h:
2490         * platform/graphics/gtk/IconGtk.cpp:
2491         (WebCore::Icon::~Icon):
2492         (WebCore::lookupIconName):
2493         (WebCore::Icon::newIconForFile):
2494         (WebCore::Icon::paint):
2495
2496 2007-12-16  Sam Weinig  <sam@webkit.org>
2497
2498         Reviewed by Mitz.
2499
2500         Fix for http://bugs.webkit.org/show_bug.cgi?id=16466
2501         Move the JS Location object to its own file
2502
2503         - Move Location into its own file and rename it JSLocation.
2504
2505         * DerivedSources.make:
2506         * WebCore.pro:
2507         * WebCore.vcproj/WebCore.vcproj:
2508         * WebCore.xcodeproj/project.pbxproj:
2509         * WebCoreSources.bkl:
2510         * bindings/js/JSDocumentCustom.cpp:
2511         * bindings/js/JSLocation.cpp: Copied from WebCore/bindings/js/kjs_window.cpp.
2512         (WebCore::):
2513         (WebCore::JSLocation::JSLocation):
2514         (WebCore::JSLocation::getValueProperty):
2515         (WebCore::JSLocation::getOwnPropertySlot):
2516         (WebCore::JSLocation::put):
2517         (WebCore::JSLocationProtoFuncReplace::callAsFunction):
2518         (WebCore::JSLocationProtoFuncReload::callAsFunction):
2519         (WebCore::JSLocationProtoFuncAssign::callAsFunction):
2520         (WebCore::JSLocationProtoFuncToString::callAsFunction):
2521         * bindings/js/JSLocation.h: Copied from WebCore/bindings/js/kjs_window.h.
2522         (WebCore::JSLocation::):
2523         (WebCore::JSLocation::frame):
2524         (WebCore::JSLocation::classInfo):
2525         * bindings/js/kjs_window.cpp:
2526         (KJS::Window::location):
2527         * bindings/js/kjs_window.h:
2528         * history/CachedPage.cpp:
2529
2530 2007-12-16  Dan Bernstein  <mitz@apple.com>
2531
2532         Reviewed by Sam Weinig.
2533
2534         - make 'cursor: copy' and 'cursor: none' work.
2535
2536         Already covered by manual-tests/cursor.html
2537
2538         * rendering/RenderStyle.h: Increase the _cursor_style field to 6 bits,
2539         needed for the 33rd and 34th cursor values.
2540
2541 2007-12-16  Mark Rowe  <mrowe@apple.com>
2542
2543         Reviewed by Maciej Stachowiak.
2544
2545         Refactor Mac plugin stream code to use the shared NetscapePlugInStreamLoader implementation.
2546
2547         * WebCore.base.exp:
2548         * WebCore.xcodeproj/project.pbxproj:
2549         * loader/NetscapePlugInStreamLoader.h:
2550         * loader/mac/NetscapePlugInStreamLoaderMac.mm: Removed.
2551         * loader/mac/WebPlugInStreamLoaderDelegate.h: Moved to WebKit.
2552
2553 2007-12-16  Sam Weinig  <sam@webkit.org>
2554
2555         Reviewed by Maciej.
2556
2557         Yet more of http://bugs.webkit.org/show_bug.cgi?id=16385
2558         Cleanup kjs_window
2559
2560         - Move ScheduledAction into its own file and put it in the WebCore namespace.
2561
2562         * WebCore.pro:
2563         * WebCore.vcproj/WebCore.vcproj:
2564         * WebCore.xcodeproj/project.pbxproj:
2565         * WebCoreSources.bkl:
2566         * bindings/js/PausedTimeouts.cpp:
2567         * bindings/js/PausedTimeouts.h:
2568         * bindings/js/ScheduledAction.cpp: Copied from bindings/js/kjs_window.cpp.
2569         (WebCore::ScheduledAction::ScheduledAction):
2570         (WebCore::ScheduledAction::execute):
2571         * bindings/js/ScheduledAction.h: Copied from bindings/js/kjs_window.h.
2572         (WebCore::ScheduledAction::ScheduledAction):
2573         * bindings/js/kjs_window.cpp:
2574         (KJS::DOMWindowTimer::DOMWindowTimer):
2575         (KJS::DOMWindowTimer::action):
2576         (KJS::DOMWindowTimer::takeAction):
2577         (KJS::Window::installTimeout):
2578         (KJS::Window::timerFired):
2579         * bindings/js/kjs_window.h:
2580
2581 2007-12-16  Alp Toker  <alp@atoker.com>
2582
2583         Reviewed by Maciej.
2584
2585         http://bugs.webkit.org/show_bug.cgi?id=16356
2586         [GTK] Integrate GStreamer video with the graphics backend
2587
2588         Integrate the GStreamer media backend with the Cairo graphics backend.
2589         There are still some issues: Data is copied more often than necessary,
2590         and repaint() is not called, causing transformed video not to update
2591         sometimes.
2592
2593         * WebCore.pro:
2594         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
2595         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
2596         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
2597         (WebCore::MediaPlayerPrivate::currentTime):
2598         (WebCore::MediaPlayerPrivate::setEndTime):
2599         (WebCore::MediaPlayerPrivate::seeking):
2600         (WebCore::MediaPlayerPrivate::naturalSize):
2601         (WebCore::MediaPlayerPrivate::setMuted):
2602         (WebCore::MediaPlayerPrivate::setRect):
2603         (WebCore::MediaPlayerPrivate::setVisible):
2604         (WebCore::MediaPlayerPrivate::repaint):
2605         (WebCore::MediaPlayerPrivate::paint):
2606         (WebCore::MediaPlayerPrivate::createGSTPlayBin):
2607         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
2608         * platform/graphics/gtk/VideoSinkGStreamer.cpp: Added.
2609         (webkit_video_sink_base_init):
2610         (webkit_video_sink_init):
2611         (webkit_video_sink_idle_func):
2612         (webkit_video_sink_render):
2613         (webkit_video_sink_set_caps):
2614         (webkit_video_sink_dispose):
2615         (webkit_video_sink_finalize):
2616         (webkit_video_sink_set_property):
2617         (webkit_video_sink_get_property):
2618         (webkit_video_sink_stop):
2619         (webkit_video_sink_class_init):
2620         (webkit_video_sink_new):
2621         (webkit_video_sink_set_surface):
2622         (plugin_init):
2623         * platform/graphics/gtk/VideoSinkGStreamer.h: Added.
2624
2625 2007-12-16  Mark Rowe  <mrowe@apple.com>
2626
2627         Mac build fix.
2628
2629         * WebCore.xcodeproj/project.pbxproj: Remove NetscapePlugInStreamLoader.cpp from the WebCore target.
2630         Mac currently has its own implementation in NetscapePlugInStreamLoaderMac.mm which conflicts with the
2631         new shared implementation.
2632
2633 2007-12-16  Rodney Dawes  <dobey@wayofthemonkey.com>
2634
2635         Reviewed by Maciej Stachowiak.
2636
2637         http://bugs.webkit.org/show_bug.cgi?id=16389
2638         Bug 16389: Common Implementation of NetscapePlugInStreamLoader
2639
2640         * WebCore.vcproj/WebCore.vcproj: Remove NetscapePlugInStreamLoaderWin.cpp.
2641         * loader/NetscapePlugInStreamLoader.cpp: Copy method implementations from NetscapePlugInStreamLoaderWin.cpp.
2642         * loader/win/NetscapePlugInStreamLoaderWin.cpp: Removed.
2643
2644 2007-12-16  Grace Kloba  <klobag@gmail.com>
2645
2646         Reviewed by Darin Adler.
2647
2648         Fix http://bugs.webkit.org/show_bug.cgi?id=16433.
2649         Bug 16433: LOW_BANDWIDTH_DISPLAY build is broken
2650
2651         * dom/Document.cpp:
2652         (WebCore::Document::Document):
2653         * loader/FrameLoader.cpp:
2654         (WebCore::FrameLoader::addLowBandwidthDisplayRequest):
2655         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
2656
2657 2007-12-16  Darin Adler  <darin@apple.com>
2658
2659         Reviewed by Maciej.
2660
2661         - fix <rdar://problem/5636065> First form of SQLTransaction.executeSql() fails with TYPE_ERROR dom exception
2662
2663         Test: storage/execute-sql-args.html
2664
2665         * bindings/js/JSSQLTransactionCustom.cpp:
2666         (WebCore::JSSQLTransaction::executeSql): Added exception handling code so that once an
2667         exception happens, we won't try to do any more argument processing. Changed processing
2668         of the second argument so that we allow an undefined value or null, and simply omit the
2669         array. Changed processing of the second argument so that we don't require an actual
2670         JavaScript array. Instead, as with the JavaScript array operations themselves, we use
2671         the length property and corresponding numeric properties of the object, allowing other
2672         objects to act as arrays. Changed processing of the third and fourth arguments to
2673         allow the undefined value as well as null; we check the value of the argument rather
2674         than looking at the size of the passed-in arguments list.
2675
2676 2007-12-16  Sam Weinig  <sam@webkit.org>
2677
2678         Reviewed by Darin.
2679
2680         More of http://bugs.webkit.org/show_bug.cgi?id=16385
2681         Cleanup kjs_window
2682
2683         - Move PausedTimeouts into its own file and put it in the WebCore namespace.
2684
2685         * WebCore.pro:
2686         * WebCore.vcproj/WebCore.vcproj:
2687         * WebCore.xcodeproj/project.pbxproj:
2688         * WebCoreSources.bkl:
2689         * bindings/js/PausedTimeouts.cpp: Copied from bindings/js/kjs_window.cpp.
2690         * bindings/js/PausedTimeouts.h: Copied from bindings/js/kjs_window.h.
2691         * bindings/js/kjs_window.cpp:
2692         (KJS::Window::pauseTimeouts):
2693         * bindings/js/kjs_window.h:
2694         * history/CachedPage.cpp:
2695         * history/CachedPage.h:
2696         * page/Chrome.cpp:
2697
2698 2007-12-16  Beth Dakin  <bdakin@apple.com>
2699
2700         Reviewed by Geoff.
2701
2702         Make relative-size SVGs work in border-image.
2703
2704         * rendering/RenderBox.cpp:
2705         (WebCore::RenderBox::calculateBackgroundSize):
2706         * rendering/RenderObject.cpp:
2707         (WebCore::RenderObject::paintBorderImage):
2708
2709 2007-12-16  Darin Adler  <darin@apple.com>
2710
2711         - fix Tiger build (my fault it was broken)
2712
2713         * rendering/RenderThemeMac.mm: Define NSUInteger if on Tiger.
2714
2715 2007-12-16  Andrew Wellington  <proton@wiretapped.net>
2716
2717         Reviewed by Darin.
2718         
2719         http://bugs.webkit.org/show_bug.cgi?id=6129
2720         Incomplete implementation of CSS 2.1 system colors
2721
2722         Test: fast/css/css2-system-color.html
2723         
2724         Based on original patch by Rob Buis.
2725         
2726         System colors are retrieved from NSColor as appropriate. If the color is a pattern color
2727         (and therefore NSColor won't let us retrieve a color from it) we draw a 1x1 image of the
2728         color and sample that to get a solid color.
2729
2730         * css/CSSStyleSelector.cpp:
2731         (WebCore::):
2732         (WebCore::colorForCSSValue):
2733         * rendering/RenderTheme.cpp:
2734         (WebCore::RenderTheme::systemColor):
2735         * rendering/RenderTheme.h:
2736         * rendering/RenderThemeMac.h:
2737         * rendering/RenderThemeMac.mm:
2738         (WebCore::getSystemColor):
2739         (WebCore::RenderThemeMac::platformColorsDidChange):
2740         (WebCore::RenderThemeMac::systemColor):
2741
2742 2007-12-16  Dan Bernstein  <mitz@apple.com>
2743
2744         Reviewed by Darin Adler.
2745
2746         - fix http://bugs.webkit.org/show_bug.cgi?id=16426
2747           Divs with overflow:auto: scrollbars not correctly updated when contents change
2748
2749         Test: fast/overflow/scrollbar-position-update.html
2750
2751         * platform/mac/PlatformScrollBarMac.mm:
2752         (WebCore::PlatformScrollbar::updateThumbProportion): Update the
2753         NSScroller's value for the new proportions.
2754         * rendering/RenderLayer.cpp:
2755         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Removed unnecessary
2756         repaint(). Scrollbars repaint themselves as needed.
2757
2758 2007-12-16  Alexey Proskuryakov  <ap@webkit.org>
2759
2760         Reviewed by Darin.
2761
2762         http://bugs.webkit.org/show_bug.cgi?id=14140
2763         <rdar://problem/5270958> REGRESSION: Complex system KeyBindings don't work properly
2764
2765         * dom/KeyboardEvent.h:
2766         (WebCore::KeypressCommand::KeypressCommand):
2767         (WebCore::KeyboardEvent::keypressCommands):
2768         Change stored command class to preserve complete information about commands.
2769
2770         * editing/EditorCommand.cpp: (WebCore::CommandEntry::): Mark InsertText as a text insertion
2771         command, which it is. Previously, we couldn't do it because WebKit didn't really treat insertText:
2772         as a command.
2773
2774         * page/EventHandler.cpp: (WebCore::EventHandler::keyEvent): Copy commands saved while interpreting
2775         a keydown event into keypress, to avoid losing state when running interpretKeyEvents: again.
2776
2777 2007-12-16  Alexey Proskuryakov  <ap@webkit.org>
2778
2779         Reviewed by Darin.
2780
2781         http://bugs.webkit.org/show_bug.cgi?id=16462
2782         REGRESSION: access keys broken on Windows
2783
2784         * page/EventHandler.cpp:
2785         (WebCore::EventHandler::handleAccessKey):
2786         (WebCore::EventHandler::keyEvent):
2787         * page/EventHandler.h:
2788         Make handleAccessKey a class method; rely on WebKit to call it on Windows and wxWidgets.
2789
2790 2007-12-16  Xan Lopez  <xan@gnome.org>
2791
2792         Reviewed by Alexey Proskuryakov.
2793
2794         http://bugs.webkit.org/show_bug.cgi?id=16454
2795         [GTK] Text input doesn't work consistently on PPC
2796
2797         * platform/gtk/KeyEventGtk.cpp:
2798         (WebCore::singleCharacterString):
2799
2800         UChar is 2 bytes (UTF-16), so transform accordingly from
2801         gunichar (UCS-4). Fixes keyboard input on big endian systems.
2802
2803 2007-12-15  Darin Adler  <darin@apple.com>
2804
2805         Reviewed by Mark Rowe.
2806
2807         - better build fix for the problem affecting GTK and some other platforms
2808           "this time for sure"
2809
2810         * WebCore.xcodeproj/project.pbxproj:
2811         * bindings/js/JSEventTargetBase.cpp: Move the include of the .lut.h file here.
2812         * bindings/js/JSEventTargetBase.h: Instead of including the .lut.h file in the header,
2813         which won't work, declare the tables that are in the .lut.h file in the header.
2814
2815 2007-12-12  Kevin Watters  <kevin@dotsyntax.com>
2816
2817         Reviewed by Darin Adler.
2818
2819         Fixed the Wx port's FontPlatformData for use in HashTable.
2820         - FontPlatformData(Deleted) made unequal to FontPlatformData()
2821
2822         * platform/graphics/wx/FontPlatformData
2823
2824 2007-12-15  Dan Bernstein  <mitz@apple.com>
2825
2826         Reviewed by Darin Adler.
2827
2828         - fix <rdar://problem/5636090> Text in Georgia, Armenian, Inuktitut, Cree, or Cherokee (KA, HY, IU, CR, CHR) draws as all missing glyphs
2829
2830         * platform/graphics/win/FontCacheWin.cpp:
2831         (WebCore::metaFileEnumProc): Added. Called during metafile record
2832         enumeration and extracts the font from the create font record.
2833         (WebCore::FontCache::getFontDataForCharacters): If font linking fails,
2834         let Uniscribe draw the characters and see what font it chooses.
2835
2836 2007-12-15  Darin Adler  <darin@apple.com>
2837
2838         * WebCore.pro: Roll my last change out. Was wrong and didn't fix the build.
2839
2840 2007-12-15  Darin Adler  <darin@apple.com>
2841
2842         Another try at a GTK build fix.
2843
2844         * WebCore.pro: Add JSEventTargetBase.cpp to LUT_TABLE_FILES instead of LUT_FILES.
2845
2846 2007-12-15  Sam Weinig  <sam@webkit.org>
2847
2848         Force windows to regenerate COM DOM bindings.
2849
2850         * WebCore.vcproj/build-generated-files.sh: Add license. 
2851         * bindings/scripts/CodeGeneratorCOM.pm: Use shared WK_ucfirst.
2852
2853 2007-12-15  Sam Weinig  <sam@webkit.org>
2854
2855         Fix Windows and wx builds.
2856
2857         * WebCore.vcproj/WebCore.vcproj:
2858         * WebCoreSources.bkl:
2859
2860 2007-12-15  Mark Rowe  <mrowe@apple.com>
2861
2862         Gtk build fix.  Add JSEventTargetBase.cpp to SOURCES.
2863
2864         * WebCore.pro:
2865
2866 2007-12-15  Sam Weinig  <sam@webkit.org>
2867
2868         Fix wx build.
2869
2870         * WebCoreSources.bkl:
2871
2872 2007-12-15  Nikolas Zimmermann  <zimmermann@kde.org>
2873
2874         Not reviewed. Build fix for Qt/Gtk.
2875
2876         * WebCore.pro: Include JSEventTargetBase.lut.h in generation
2877
2878 2007-12-15  Nikolas Zimmermann  <zimmermann@kde.org>
2879
2880         Reviewed by Eric.
2881
2882         Fixes: http://bugs.webkit.org/show_bug.cgi?id=16445 (Refactor EventTargetNode & JSEventTargetNode for an upcoming SVG patch)
2883
2884         Split up JSEventTargetNode in JSEventTargetNode & JSEventTargetBase - where most functionality has been moved down
2885         in the base class. Applied the same refactorization to EventTargetNode.
2886
2887         This makes it possible for the upcoming patch implementing the EventTarget interface for SVGElementInstance
2888         to share as much code as possible with the EventTargetNode classes.
2889
2890         * DerivedSources.make:
2891         * WebCore.xcodeproj/project.pbxproj:
2892         * bindings/js/JSEventTargetBase.cpp: Added.
2893         (WebCore::retrieveEventTargetAndCorrespondingNode):
2894         (WebCore::eventNameForPropertyToken):
2895         * bindings/js/JSEventTargetBase.h: Added.
2896         (WebCore::JSEventTargetProperties::):
2897         (WebCore::JSEventTargetPrototypeFunctionBase::JSEventTargetPrototypeFunctionBase):
2898         (WebCore::JSEventTargetPrototypeFunction::JSEventTargetPrototypeFunction):
2899         (WebCore::):
2900         (WebCore::::create):
2901         (WebCore::JSEventTargetBase::JSEventTargetBase):
2902         (WebCore::JSEventTargetBase::getValueProperty):
2903         (WebCore::JSEventTargetBase::putValueProperty):
2904         (WebCore::JSEventTargetBase::getOwnPropertySlot):
2905         (WebCore::JSEventTargetBase::put):
2906         (WebCore::JSEventTargetPrototype::JSEventTargetPrototype):
2907         (WebCore::JSEventTargetPrototype::self):
2908         (WebCore::JSEventTargetPrototype::getOwnPropertySlot):
2909         (WebCore::JSEventTargetPrototype::classInfo):
2910         * bindings/js/JSEventTargetNode.cpp:
2911         (WebCore::JSEventTargetNode::getOwnPropertySlot):
2912         (WebCore::JSEventTargetNode::getValueProperty):
2913         (WebCore::JSEventTargetNode::put):
2914         (WebCore::JSEventTargetNode::putValueProperty):
2915         (WebCore::JSEventTargetNode::setListener):
2916         (WebCore::toEventTargetNode):
2917         * bindings/js/JSEventTargetNode.h:
2918         (WebCore::JSEventTargetPrototypeInformation::prototypeClassName):
2919         (WebCore::JSEventTargetPrototypeInformation::prototypeIdentifier):
2920         * dom/EventTarget.cpp:
2921         (WebCore::EventTarget::addEventListener):
2922         (WebCore::EventTarget::removeEventListener):
2923         (WebCore::EventTarget::dispatchGenericEvent):
2924         (WebCore::EventTarget::removeAllEventListeners):
2925         (WebCore::EventTarget::insertedIntoDocument):
2926         (WebCore::EventTarget::removedFromDocument):
2927         (WebCore::EventTarget::handleLocalEvents):
2928         (WebCore::EventTarget::applySVGEventTargetRules):
2929         (WebCore::forbidEventDispatch):
2930         (WebCore::allowEventDispatch):
2931         (WebCore::eventDispatchForbidden):
2932         * dom/EventTarget.h:
2933         (WebCore::EventTarget::preDispatchEventHandler):
2934         (WebCore::EventTarget::postDispatchEventHandler):
2935         (WebCore::forbidEventDispatch):
2936         (WebCore::allowEventDispatch):
2937         * dom/EventTargetNode.cpp:
2938         (WebCore::EventTargetNode::~EventTargetNode):
2939         (WebCore::EventTargetNode::insertedIntoDocument):
2940         (WebCore::EventTargetNode::removedFromDocument):
2941         (WebCore::EventTargetNode::addEventListener):
2942         (WebCore::EventTargetNode::removeEventListener):
2943         (WebCore::EventTargetNode::removeAllEventListeners):
2944         (WebCore::EventTargetNode::handleLocalEvents):
2945         (WebCore::EventTargetNode::dispatchEvent):
2946         (WebCore::EventTargetNode::dispatchWindowEvent):
2947         * dom/EventTargetNode.h:
2948         (WebCore::EventTargetNode::localEventListeners):
2949         * svg/SVGElement.cpp:
2950         (WebCore::SVGElement::sendSVGLoadEventIfPossible):
2951         (WebCore::SVGElement::dispatchEvent):
2952
2953 2007-12-15  Eric Seidel  <eric@webkit.org>
2954
2955         Reviewed by Oliver.
2956         
2957         Width of SVG elements not applied to container elements
2958         http://bugs.webkit.org/show_bug.cgi?id=16305
2959         Added calcPrefWidths for RenderSVGRoot (copied from RenderReplaced)
2960         This is caused by poor factoring in the render tree.  RenderContainer probably should be a template.
2961
2962         svg/css/css-box-min-width.html
2963
2964         * rendering/RenderSVGRoot.cpp:
2965         (WebCore::RenderSVGRoot::calcPrefWidths): Added.
2966         * rendering/RenderSVGRoot.h:
2967         * css/SVGCSSStyleSelector::applySVGProperty: fixed ASSERT in debug builds
2968
2969 2007-12-15  David Kilzer  <ddkilzer@apple.com>
2970
2971         Fix comment after isSafeScript() was renamed to allowsAccessFrom().
2972
2973         * bindings/js/kjs_window.cpp:
2974         (KJS::createWindow):
2975
2976 2007-12-15  Alp Toker  <alp@atoker.com>
2977
2978         Reviewed by Mark Rowe.
2979
2980         http://bugs.webkit.org/show_bug.cgi?id=16449
2981         cairo_arc() functions hang or crash when passed inf as radius or start/end angle
2982
2983         Add checks. This matches a similar workaround for a CG bug in the CG
2984         graphics backend: <rdar://problem/5189233>
2985
2986         Fixes:
2987           fast/canvas/arc-crash.html
2988           fast/canvas/canvas-with-incorrect-args.html
2989
2990         * platform/graphics/cairo/PathCairo.cpp:
2991         (WebCore::Path::addArc):
2992
2993 2007-12-15  Alexey Proskuryakov  <ap@webkit.org>
2994
2995         Reviewed by Darin.
2996
2997         http://bugs.webkit.org/show_bug.cgi?id=16078
2998         Google Maps zooming via the scroll wheel (almost) always zooms IN only.
2999
3000         * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent):
3001         Ensure that delta is never rounded down to zero - we are getting values less than 1 from 
3002         many mice on OS X, and Google Maps code assumes scrolling up if event.wheelDelta is zero.
3003
3004 2007-12-14  Dan Bernstein  <mitz@apple.com>
3005
3006         - Windows build fix
3007
3008         * WebCore.vcproj/WebCore.vcproj:
3009
3010 2007-12-14  Alp Toker  <alp@atoker.com>
3011
3012         GTK+/Qt build fix. Track added files in r28722.
3013
3014         * WebCore.pro:
3015
3016 2007-12-14  Sam Weinig  <sam@webkit.org>
3017
3018         Reviewed by Geoff.
3019
3020         Speed up getElementByClassName.
3021         - This makes getElementByClassName 33% faster on the stress test
3022           linked to at http://bugs.webkit.org/show_bug.cgi?id=15760.
3023
3024         * platform/text/StringImpl.cpp:
3025         (WebCore::StringImpl::foldCase): Optimize the case when all the characters are ASCII.
3026
3027 2007-12-14  Alp Toker  <alp@atoker.com>
3028
3029         Reviewed by Maciej.
3030
3031         http://bugs.webkit.org/show_bug.cgi?id=16432
3032         [GTK] Update license headers
3033
3034         Consent has been given by the authors of these files to change license
3035         to the LGPL as outlined in the bug report.
3036
3037         * platform/gtk/ClipboardGtk.cpp:
3038         * platform/gtk/ContextMenuGtk.cpp:
3039         * platform/gtk/ContextMenuItemGtk.cpp:
3040         * platform/gtk/CookieJarGtk.cpp:
3041         * platform/gtk/CursorGtk.cpp:
3042         * platform/gtk/DragDataGtk.cpp:
3043         * platform/gtk/DragImageGtk.cpp:
3044         * platform/gtk/PasteboardGtk.cpp:
3045         * platform/gtk/PlatformScreenGtk.cpp:
3046         * platform/gtk/PlatformScrollBarGtk.cpp:
3047         * platform/gtk/SearchPopupMenuGtk.cpp:
3048         * platform/gtk/WidgetGtk.cpp:
3049
3050 2007-12-14  Darin Adler  <darin@apple.com>
3051
3052         Reviewed by Adele.
3053
3054         - fix http://bugs.webkit.org/show_bug.cgi?id=16442
3055           navigation policy delegate gets called twice for each load
3056
3057         * loader/MainResourceLoader.cpp:
3058         (WebCore::MainResourceLoader::willSendRequest): Removed call to checkNavigationPolicy.
3059         That's handled by FrameLoader.
3060
3061         * loader/MainResourceLoader.h: Removed callContinueAfterNavigationPolicy
3062         and continueAfterNavigationPolicy.
3063
3064 2007-12-14  Anders Carlsson  <andersca@apple.com>
3065
3066         Reviewed by Brady.
3067
3068         Make document.open count as committing a document load, so that -[WebFrame dataSource:] won't
3069         return nil in that case.
3070         
3071         * loader/FrameLoader.cpp:
3072         (WebCore::FrameLoader::didExplicitOpen):
3073
3074 2007-12-14  David Smith  <catfish.man@gmail.com>
3075
3076         Reviewed by Mitz.
3077
3078         - fix http://bugs.webkit.org/show_bug.cgi?id=14955
3079           Implement getElementsByClassName.
3080
3081         This patch also renames AtomicStringList to ClassNames to better reflect its actual use,
3082         and takes advantage of admitting that it's class-specific to encapsulate class attribute 
3083         parsing so it can be shared.  It also changes the class to use a Vector, rather than a linked
3084         list to store the class names.
3085
3086         Tests: fast/dom/getElementsByClassName/001.html
3087                fast/dom/getElementsByClassName/002.html
3088                fast/dom/getElementsByClassName/003.html
3089                fast/dom/getElementsByClassName/004.html
3090                fast/dom/getElementsByClassName/005.html
3091                fast/dom/getElementsByClassName/006.html
3092                fast/dom/getElementsByClassName/007.html
3093                fast/dom/getElementsByClassName/008.html
3094                fast/dom/getElementsByClassName/009.html
3095                fast/dom/getElementsByClassName/010.xml
3096                fast/dom/getElementsByClassName/011.xml
3097                fast/dom/getElementsByClassName/012.html
3098                fast/dom/getElementsByClassName/013.html
3099                fast/dom/getElementsByClassName/014.html
3100                fast/dom/getElementsByClassName/array/001.html
3101                fast/dom/getElementsByClassName/array/002.html
3102                fast/dom/getElementsByClassName/array/003.html
3103                fast/dom/getElementsByClassName/array/004.html
3104                fast/dom/getElementsByClassName/dumpNodeList.html
3105
3106         * WebCore.xcodeproj/project.pbxproj:
3107         * css/CSSStyleSelector.cpp:
3108         (WebCore::CSSStyleSelector::matchRules):
3109         (WebCore::CSSStyleSelector::checkOneSelector):
3110         * dom/AtomicStringList.h: Removed.
3111         * dom/ClassNames.cpp: Added.
3112         (WebCore::ClassNames::contains):
3113         (WebCore::ClassNames::parseClassAttribute):
3114         * dom/ClassNames.h: Copied from WebCore/dom/AtomicStringList.h.
3115         (WebCore::ClassNames::ClassNames):
3116         (WebCore::ClassNames::size):
3117         (WebCore::ClassNames::clear):
3118         (WebCore::ClassNames::operator[]):
3119         (WebCore::isClassWhitespace):
3120         * dom/ClassNodeList.cpp: Added.
3121         (WebCore::ClassNodeList::ClassNodeList):
3122         (WebCore::ClassNodeList::length):
3123         (WebCore::ClassNodeList::item):
3124         (WebCore::ClassNodeList::nodeMatches):
3125         * dom/ClassNodeList.h: Added.
3126         * dom/Document.cpp:
3127         (WebCore::Document::getElementsByName):
3128         (WebCore::Document::getElementsByClassName):
3129         * dom/Document.h:
3130         * dom/Document.idl:
3131         * dom/Element.cpp:
3132         (WebCore::Element::getClassNames):
3133         (WebCore::Element::getElementsByClassName):
3134         * dom/Element.h:
3135         * dom/Element.idl:
3136         * dom/NameNodeList.cpp:
3137         (WebCore::NameNodeList::NameNodeList):
3138         (WebCore::NameNodeList::item):
3139         (WebCore::NameNodeList::nodeMatches):
3140         * dom/NameNodeList.h:
3141         * dom/NamedMappedAttrMap.cpp:
3142         (WebCore::NamedMappedAttrMap::clearAttributes):
3143         (WebCore::NamedMappedAttrMap::parseClassAttribute):
3144         * dom/NamedMappedAttrMap.h:
3145         (WebCore::NamedMappedAttrMap::getClassNames):
3146         * dom/StyledElement.cpp:
3147         (WebCore::StyledElement::getClassNames):
3148         * dom/StyledElement.h:
3149
3150 2007-12-14  Darin Adler  <darin@apple.com>
3151
3152         Reviewed by Sam.
3153
3154         - fix http://bugs.webkit.org/show_bug.cgi?id=16351
3155           FontFallbackList.h doesn't include wtf/PassRefPtr.h
3156           
3157         * platform/graphics/FontFallbackList.h: Added include of <wtf/Forward.h>
3158         * platform/graphics/GlyphPageTreeNode.h: Removed an unneeded include.
3159
3160 2007-12-14  Darin Adler  <darin@apple.com>
3161
3162         Reviewed by Alexey.
3163
3164         - http://bugs.webkit.org/show_bug.cgi?id=16420
3165           change regression tests to use document.execCommand instead of textInputController.doCommand
3166
3167         Add a few more operations to document.execCommand.
3168
3169         Finished up the transition to the new Editor::Command, including removing
3170         the Editor::execCommand function.
3171
3172         * WebCore.base.exp: Added Editor::Command::isSupported.
3173         * editing/Editor.h: Removed execCommand.
3174         * editing/EditorCommand.cpp:
3175         (WebCore::expandSelectionToGranularity): Added.
3176         (WebCore::verticalScrollDistance): Added; replaces canScroll.
3177         (WebCore::executeDeleteBackward): Added. Moved code here from WebHTMLView.
3178         (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter): Ditto.
3179         (WebCore::executeDeleteForward): Ditto.
3180         (WebCore::executeDeleteToBeginningOfLine): Ditto.
3181         (WebCore::executeDeleteToBeginningOfParagraph): Ditto.
3182         (WebCore::executeDeleteToEndOfLine): Ditto.
3183         (WebCore::executeDeleteToEndOfParagraph): Ditto.
3184         (WebCore::executeMovePageDown): Renamed this command to be consistent with all the other
3185         Move commands. They all modify the caret. Reimplemented to match the Mac OS X version by
3186         removing the explicit scrolling, and letting it be done automatically by code that makes
3187         the caret visible. In some cases the old code would scroll twice which was harmless but
3188         unnecessary.
3189         (WebCore::executeMovePageDownAndModifySelection): Added. Moved code here from WebHTMLView.
3190         (WebCore::executeMovePageUp): See MovePageDown above.
3191         (WebCore::executeMovePageUpAndModifySelection): Added. Moved code here from WebHTMLView.
3192         (WebCore::executeSelectLine): Ditto.
3193         (WebCore::executeSelectParagraph): Ditto.
3194         (WebCore::executeSelectSentence): Ditto.
3195         (WebCore::executeSelectWord): Ditto.
3196         (WebCore::executeSwapWithMark): Some small tweaks.
3197
3198         * page/ContextMenuController.cpp:
3199         (WebCore::ContextMenuController::contextMenuItemSelected): Changed to use Editor::command()
3200         instead of Editor::execCommand(). This code could be changed to use Editor::Command quite a
3201         bit more, but I didn't do that this time.
3202
3203         - Removed some obsolete unused code.
3204
3205         * page/mac/EventHandlerMac.mm:
3206         (WebCore::EventHandler::passMouseDownEventToWidget): Removed the special case code for
3207         NSTextView. This was left over from when we used NSTextField and NSTextView for form
3208         elements and is no longer used at all.
3209
3210         * page/mac/WebCoreFrameBridge.h: Removed 20 unused methods that were still on one side
3211         of the bridge or another. We really need to find a time to tear down the rest of the
3212         bridge, but that's not this patch.
3213
3214         * page/mac/WebCoreFrameBridge.mm:
3215         (-[WebCoreFrameBridge addData:]): Changed to get at the _shouldCreateRenderers field directly
3216         instead of using a method.
3217         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
3218         Took out obsolete comment about matching enums (we use a single enum now and have for some
3219         time).
3220         (-[WebCoreFrameBridge selectionGranularity]): Ditto.
3221
3222 2007-12-14  Justin Garcia  <justin.garcia@apple.com>
3223
3224         Reviewed by Darin Adler.
3225
3226         <rdar://problem/5575101> GoogleDocs: Hang in SplitElementCommand::doApply when outdenting a list item in a particular list
3227
3228         * editing/CompositeEditCommand.cpp:
3229         (WebCore::CompositeEditCommand::splitTreeToNode): Moved here.
3230         * editing/CompositeEditCommand.h:
3231         * editing/IndentOutdentCommand.cpp: Moved splitTreeToNode.
3232         * editing/IndentOutdentCommand.h: Ditto, and removed unimplemented splitTreeTo.
3233         * editing/InsertListCommand.cpp:
3234         (WebCore::InsertListCommand::doApply): Split ancestors of listChildNode between
3235         it and listNode, if they exists, so that moving listChildNode doesn't put it out
3236         of order.  Added a test case to cover each change.
3237         * editing/SplitElementCommand.cpp:
3238         (WebCore::SplitElementCommand::doApply): Added an ASSERT to catch code that
3239         tries to split a container at a bogus child, and an early return to avoid a
3240         hang in that case.
3241
3242 2007-12-14  Anders Carlsson  <andersca@apple.com>
3243
3244         Reviewed by Darin and Geoff.
3245
3246         <rdar://problem/5619295> 
3247         REGRESSION: 303-304: Embedded YouTube video fails to render- JS errors (16150) (Flash 9)
3248
3249         _NPN_CreateScriptObject doesn't take an origin root object anymore.
3250         
3251         * html/HTMLPlugInElement.cpp:
3252         (WebCore::HTMLPlugInElement::createNPObject):
3253         * page/Frame.cpp:
3254         (WebCore::Frame::windowScriptNPObject):
3255
3256 2007-12-14  Dan Bernstein  <mitz@apple.com>
3257
3258         Reviewed by Darin Adler.
3259
3260         - fix <rdar://problem/5643663> text-shadow and box-shadow offsets 1px smaller than specified
3261           which is the root cause of:
3262           http://bugs.webkit.org/show_bug.cgi?id=12943
3263           box-shadow: small values don't affect shadow position
3264           http://bugs.webkit.org/show_bug.cgi?id=14736
3265           Safari implementation of text-shadow off by 1px
3266
3267         * platform/graphics/cg/GraphicsContextCG.cpp:
3268         (WebCore::GraphicsContext::setShadow): Slightly increase the magnitude
3269         of the offsets passed to CGContextSetShadow* to ensure that the end
3270         result after truncation is the desired integer offsets.
3271
3272 2007-12-13  Alp Toker  <alp@atoker.com>
3273
3274         curl backend build fix for breakage introduced in r28709.
3275
3276         * platform/network/ResourceHandleInternal.h:
3277         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3278
3279 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
3280
3281         Reviewed by Oliver Hunt.
3282
3283         <rdar://problem/5607069> In Mail, a crash occurs at WebCore::AppendNodeCommand() after dragging image into a <FORM> element
3284
3285         * editing/InsertLineBreakCommand.cpp:
3286         (WebCore::InsertLineBreakCommand::shouldUseBreakElement): Equip this function to
3287         handle editing positions, like [input, 0];
3288         * editing/InsertParagraphSeparatorCommand.cpp:
3289         (WebCore::InsertParagraphSeparatorCommand::doApply): Pass enclosingBlock a node peeled
3290         off of a non-editing position, to fix a bug where the enclosing block of [input, 0] was
3291         the input element itself.
3292         Insert a <br> when a <form> element is the enclosing block instead of splitting/cloning or
3293         nesting a <div>.
3294
3295 2007-12-13  Alp Toker  <alp@atoker.com>
3296
3297         Reviewed by Oliver Hunt.
3298
3299         http://bugs.webkit.org/show_bug.cgi?id=16365
3300         [cURL] Acid2 test segmentation fault
3301
3302         This patch makes the Acid2 test pass.
3303
3304         Defer the cleanup of cancelled jobs and halt further transfer as early
3305         as possible.
3306
3307         Bug found by and initial patch provided by Luca Bruno.
3308
3309         * platform/network/curl/ResourceHandleManager.cpp:
3310         (WebCore::writeCallback):
3311         (WebCore::headerCallback):
3312         (WebCore::ResourceHandleManager::downloadTimerCallback):
3313         (WebCore::ResourceHandleManager::cancel):
3314
3315 2007-12-13  Sam Weinig  <sam@webkit.org>
3316
3317         Reviewed by Mark Rowe.
3318
3319         Fix typos and rename InspectorController::moveByUnrestricted to InspectorController::moveWindowBy.
3320
3321         * page/InspectorController.cpp:
3322         (WebCore::moveByUnrestricted):
3323         (WebCore::InspectorController::windowScriptObjectAvailable):
3324         (WebCore::InspectorController::moveWindowBy):
3325         * page/InspectorController.h:
3326         * page/inspector/inspector.js:
3327
3328 2007-12-13  Dan Bernstein  <mitz@apple.com>
3329
3330         Reviewed by Dave Hyatt.
3331
3332         - fix <rdar://problem/5642426> explicit cubic-bezier curves all treated as "default" for transition-timing-function
3333
3334         Test: fast/css/transition-timing-function.html
3335
3336         * css/CSSStyleSelector.cpp: Changed the HANDLE_MULTILAYER_VALUE macro to
3337         not reject non-primitive non-list values, and instead made sure that the
3338         mapping functions rejected them if necessary. This allows non-primitive
3339         timing functions to be mapped.
3340         (WebCore::CSSStyleSelector::mapBackgroundAttachment):
3341         (WebCore::CSSStyleSelector::mapBackgroundClip):
3342         (WebCore::CSSStyleSelector::mapBackgroundComposite):
3343         (WebCore::CSSStyleSelector::mapBackgroundOrigin):
3344         (WebCore::CSSStyleSelector::mapBackgroundImage):
3345         (WebCore::CSSStyleSelector::mapBackgroundRepeat):
3346         (WebCore::CSSStyleSelector::mapBackgroundXPosition):
3347         (WebCore::CSSStyleSelector::mapBackgroundYPosition):
3348         (WebCore::CSSStyleSelector::mapTransitionDuration):
3349         (WebCore::CSSStyleSelector::mapTransitionRepeatCount):
3350         (WebCore::CSSStyleSelector::mapTransitionTimingFunction):
3351         (WebCore::CSSStyleSelector::mapTransitionProperty):
3352         * css/CSSTimingFunctionValue.cpp:
3353         (WebCore::CSSTimingFunctionValue::cssText): Implemented for use in the
3354         regression test.
3355         * css/CSSTimingFunctionValue.h:
3356         (WebCore::CSSTimingFunctionValue::isTransitionTimingFunctionValue):
3357         Added. Returns true.
3358         * css/CSSValue.h:
3359         (WebCore::CSSValue::isTransitionTimingFunctionValue): Added. Returns
3360         false.
3361
3362 2007-12-13  Steve Falkenburg  <sfalken@apple.com>
3363
3364         Move source file generation into its own vcproj to fix build dependencies.
3365
3366         Reviewed by Adam.
3367
3368         * WebCore.vcproj/WebCore.make:
3369         * WebCore.vcproj/WebCore.sln:
3370         * WebCore.vcproj/WebCore.submit.sln:
3371         * WebCore.vcproj/WebCore.vcproj:
3372         * WebCore.vcproj/WebCoreGenerated.vcproj: Added.
3373
3374 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
3375
3376         Reviewed by Oliver Hunt.
3377         
3378         <rdar://problem/4145786> Undoing a color change of text in a compose window always changes it back to black
3379         
3380         Some of the operations performed in removeHTMLFontStyle were non-undoable.
3381         
3382         I'm having trouble writing a layout test for this because I can't get DRT to
3383         perform editing operations in separate Undo steps without adding unacceptably long
3384         wait times between operations.  I filed:
3385         
3386         <rdar://problem/5646779> Can't get DRT to perform editing operations in separate Undo steps
3387
3388         * editing/ApplyStyleCommand.cpp:
3389         (WebCore::ApplyStyleCommand::removeHTMLFontStyle):
3390
3391 2007-12-13  Sam Weinig  <sam@webkit.org>
3392
3393         Reviewed by Anders.
3394
3395         Fix for http://bugs.webkit.org/show_bug.cgi?id=16352
3396         Toolbar dragged inspector cannot be moved beyond screen edges
3397
3398         * page/InspectorController.cpp:
3399         (WebCore::moveByUnrestricted):
3400         (WebCore::InspectorController::windowScriptObjectAvailable):
3401         (WebCore::InspectorController::moveByUnrestricted):
3402         * page/InspectorController.h:
3403         * page/inspector/inspector.js:
3404
3405 2007-12-13  Adam Roben  <aroben@apple.com>
3406
3407         Fix <rdar://5517707> Crash on wptv.wp.pl when "make bigger" button is clicked
3408
3409         Windows Media Player has a modal message loop that will deliver
3410         messages to us at inappropriate times and we will crash if we handle
3411         them when they are delivered. In PluginViewWin, we add a quirk for
3412         Media Player to set a flag whenever we give the plugin a chance to
3413         execute code, and in SharedTimerWin we check if the plugin is
3414         executing code and repost messages if so.
3415
3416         Reviewed by Anders.
3417
3418         * platform/win/SharedTimerWin.cpp:
3419         (WebCore::TimerWindowWndProc): Repost messages if we're calling a
3420         plugin.
3421         * plugins/win/PluginViewWin.cpp: Surround all calls to the plugin with
3422         setCallingPlugin(true/false).
3423         (WebCore::PluginViewWin::updateWindow):
3424         (WebCore::PluginViewWin::dispatchNPEvent):
3425         (WebCore::PluginViewWin::setNPWindowRect):
3426         (WebCore::PluginViewWin::start):
3427         (WebCore::PluginViewWin::stop):
3428         (WebCore::PluginViewWin::performRequest):
3429         (WebCore::PluginViewWin::bindingInstance):
3430         (WebCore::PluginViewWin::determineQuirks):
3431         (WebCore::PluginViewWin::setCallingPlugin): Added.
3432         (WebCore::PluginViewWin::isCallingPlugin): Added.
3433         * plugins/win/PluginViewWin.h: Added a new quirk.
3434
3435 2007-12-13  Alp Toker  <alp@atoker.com>
3436
3437         Add a missing DEPENDPATH. Fixes non-clean builds following networking
3438         header changes.
3439
3440         * WebCore.pro:
3441
3442 2007-12-13  Dan Bernstein  <mitz@apple.com>
3443
3444         Reviewed by Anders Carlsson.
3445
3446         - fix regression in fast/text/international/bidi-override on Tiger
3447
3448         * platform/graphics/GlyphPageTreeNode.cpp:
3449         (WebCore::GlyphPageTreeNode::initializePage): Add bidi overrides here
3450         too. I forgot to add them when I added them to treatAsZeroWidthSpace in
3451         an earlier patch.
3452
3453 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
3454
3455         Reviewed by Darin Adler.
3456
3457         <rdar://problem/5601583> GMail Editor: Copied link doesn't paste as a link, just colored text
3458         
3459         The code that checks the selected Range to see if it's inside an anchor
3460         checks ancestors of the Range's commonAncestor() but not the
3461         commonAncestor() itself, and so we'd fail to add markup for the enclosing
3462         anchor to the pasteboard.
3463         
3464         Some enclosing element getters check the node passed to the getter and some
3465         don't.  There were a few places where we incorrectly assumed that enclosing 
3466         element getters check the node passed to the getter, but this is the only 
3467         case that I'm able to write a test case for at the moment.
3468         
3469         In this patch I've:
3470         Changed enclosingNodeWithType and enclosingNodeWithTag to take in positions,
3471         like the newer enclosing element getters.  This is important because we must
3472         soon add code to the getters so that they understand that some editing positions
3473         inside nodes don't actually refer to positions inside those nodes but positions
3474         before and after them.  Like [table, 0].
3475         Changed enclosingNodeWithType and enclosingNodeWithTag to check nodes starting with
3476         n where [n, o] is the position passed to the getter, instead of starting the the parent
3477         of n.  This makes all but a few of the enclosing element getters behave consistently.
3478         Changed enclosingNodeWithType and enclosingNodeWithTag to not return non-editable 
3479         nodes if the input position was editable.  This fixes a bug that that the above change
3480         exposed.
3481         Changed enclosingTableCell to simply call enclosingNodeWithType.  We should do
3482         this for the rest of the getters, or simply remove them in favor of enclosingNodeWithType
3483         unless doing so would affect readability, like it would in the case of enclosingTableCell.
3484         Ditto for enclosingBlock.
3485
3486         * editing/AppendNodeCommand.cpp:
3487         (WebCore::AppendNodeCommand::doApply):
3488         * editing/DeleteButtonController.cpp:
3489         (WebCore::enclosingDeletableElement):
3490         * editing/DeleteSelectionCommand.cpp:
3491         (WebCore::DeleteSelectionCommand::initializePositionData):
3492         (WebCore::DeleteSelectionCommand::saveFullySelectedAnchor):
3493         * editing/Editor.cpp:
3494         (WebCore::Editor::selectionUnorderedListState):
3495         (WebCore::Editor::selectionOrderedListState):
3496         * editing/IndentOutdentCommand.cpp:
3497         (WebCore::IndentOutdentCommand::prepareBlockquoteLevelForInsertion):
3498         (WebCore::IndentOutdentCommand::outdentParagraph):
3499         * editing/InsertNodeBeforeCommand.cpp:
3500         (WebCore::InsertNodeBeforeCommand::doApply):
3501         * editing/InsertParagraphSeparatorCommand.cpp:
3502         (WebCore::InsertParagraphSeparatorCommand::doApply):
3503         * editing/ReplaceSelectionCommand.cpp:
3504         (WebCore::ReplaceSelectionCommand::shouldMerge):
3505         (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
3506         (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent):
3507         * editing/TextIterator.cpp:
3508         * editing/htmlediting.cpp:
3509         (WebCore::enclosingBlock):
3510         (WebCore::enclosingNodeWithTag):
3511         (WebCore::enclosingNodeOfType):
3512         (WebCore::enclosingTableCell):
3513         (WebCore::isTableCell):
3514         * editing/htmlediting.h:
3515         * editing/markup.cpp:
3516         (WebCore::appendStartMarkup):
3517         (WebCore::createMarkup):
3518
3519 2007-12-13  Alexey Proskuryakov  <ap@webkit.org>
3520
3521         Reviewed by Darin.
3522
3523         Turn on keyboard event processing quirks for feed views and old applications on Mac OS X.
3524
3525         * WebCore.base.exp:
3526         * dom/KeyboardEvent.cpp:
3527         (WebCore::KeyboardEvent::charCode):
3528         * page/EventHandler.cpp:
3529         (WebCore::EventHandler::needsKeyboardEventDisambiguationQuirks):
3530         (WebCore::EventHandler::keyEvent):
3531         * page/EventHandler.h:
3532         * page/Settings.cpp:
3533         (WebCore::Settings::Settings):
3534         (WebCore::Settings::setNeedsKeyboardEventDisambiguationQuirks):
3535         * page/Settings.h:
3536         (WebCore::Settings::needsKeyboardEventDisambiguationQuirks):
3537         * page/mac/EventHandlerMac.mm:
3538         (WebCore::EventHandler::needsKeyboardEventDisambiguationQuirks):
3539         * platform/PlatformKeyboardEvent.h:
3540         * platform/mac/KeyEventMac.mm:
3541         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3542         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
3543
3544 2007-12-13  Dan Bernstein  <mitz@apple.com>
3545
3546         - build fix
3547
3548         * platform/network/cf/ResourceErrorCF.cpp:
3549
3550 2007-12-13  Antti Koivisto  <antti@apple.com>
3551
3552         Reviewed by Tim Hatcher.
3553
3554         Fix <rdar://problem/5605674> 
3555         Make <video> display WebKit context menu instead of the QTKit one.
3556     
3557         It doesn't really matter where the QTMovieView is.
3558
3559         * ChangeLog:
3560         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3561         (WebCore::MediaPlayerPrivate::createQTMovieView):
3562         (WebCore::MediaPlayerPrivate::setRect):
3563
3564 2007-12-13  Dan Bernstein  <mitz@apple.com>
3565
3566         Reviewed by Adam Roben.
3567
3568         - ensure that Unicode bidi control characters are rendered as zero width
3569           spaces
3570
3571         Test: fast/text/international/bidi-control-chars-treated-as-ZWS.html
3572
3573         * platform/graphics/Font.h:
3574         (WebCore::Font::treatAsZeroWidthSpace):
3575         * platform/graphics/GlyphPageTreeNode.cpp:
3576         (WebCore::GlyphPageTreeNode::initializePage):
3577         * platform/text/CharacterNames.h:
3578
3579 2007-12-13  Brady Eidson  <beidson@apple.com>
3580
3581         Build fix
3582
3583         * platform/wx/TemporaryLinkStubs.cpp:
3584