Reviewed by Darin and Geoff.
[WebKit-https.git] / WebCore / ChangeLog
1 2007-04-22  Maciej Stachowiak  <mjs@apple.com>
2
3         Reviewed by Darin and Geoff.
4
5         - move most of Window's data members into a separate private object, to avoid needing
6         to use the oversize allocator for it
7         
8         It was the only remaining JSObject subclass to use the oversize
9         allocator on 32-bit platforms, and having oversize objects around
10         makes garbage collection slower so this would hurt performance
11         with many tabs/windows open.
12         
13         No significant effect on JS iBench.
14
15         * bindings/js/kjs_events.cpp:
16         (KJS::JSUnprotectedEventListener::JSUnprotectedEventListener):
17         (KJS::JSUnprotectedEventListener::~JSUnprotectedEventListener):
18         (KJS::JSEventListener::JSEventListener):
19         (KJS::JSEventListener::~JSEventListener):
20         (KJS::JSLazyEventListener::parseCode):
21         * bindings/js/kjs_window.cpp:
22         (KJS::WindowPrivate::WindowPrivate):
23         (KJS::Window::Window):
24         (KJS::Window::~Window):
25         (KJS::Window::location):
26         (KJS::Window::selection):
27         (KJS::Window::locationbar):
28         (KJS::Window::menubar):
29         (KJS::Window::personalbar):
30         (KJS::Window::statusbar):
31         (KJS::Window::toolbar):
32         (KJS::Window::scrollbars):
33         (KJS::Window::mark):
34         (KJS::Window::getValueProperty):
35         (KJS::Window::findJSEventListener):
36         (KJS::Window::findJSUnprotectedEventListener):
37         (KJS::Window::clearHelperObjectProperties):
38         (KJS::Window::clear):
39         (KJS::Window::setCurrentEvent):
40         (KJS::Window::setReturnValueSlot):
41         (KJS::Window::clearAllTimeouts):
42         (KJS::Window::installTimeout):
43         (KJS::Window::pauseTimeouts):
44         (KJS::Window::resumeTimeouts):
45         (KJS::Window::clearTimeout):
46         (KJS::Window::timerFired):
47         (KJS::Window::disconnectFrame):
48         (KJS::Window::jsEventListeners):
49         (KJS::Window::jsHTMLEventListeners):
50         (KJS::Window::jsUnprotectedEventListeners):
51         (KJS::Window::jsUnprotectedHTMLEventListeners):
52         * bindings/js/kjs_window.h:
53
54 2007-04-22  David Hyatt  <hyatt@apple.com>
55
56         Fix 1% regression on the PLT.  Make sure roundToDevicePixels does no
57         work when no scale is in effect.
58
59         Reviewed by mjs
60
61 2007-04-22  Darin Adler  <darin@apple.com>
62
63         Reviewed by Oliver.
64
65         - fix small things noticed while looking into a font subsitution bug
66
67         * platform/Font.h: (WebCore::Font::operator==): Corrected a misleading comment.
68
69         * platform/Font.cpp:
70         (WebCore::Font::Font): Initialize m_pageZero to 0 in the empty constructor instead
71         of leaving it uninitialized. Initialize m_fontList for tighter code. Remove unneeded
72         initialization of RefPtr members to 0. Changed the copy constructor to use initialization
73         for tighter code.
74         (WebCore::Font::operator=): Sorted to match the order from the header and the copy
75         constructor, and removed the uneeded self-assignment check.
76
77 2007-04-22  Darin Adler  <darin@apple.com>
78
79         Reviewed by Maciej.
80
81         - fix http://bugs.webkit.org/show_bug.cgi?id=5196
82           <rdar://problem/4537384> input type=file fields with style=display:none do not post
83           their values (5196)
84
85         - fix http://bugs.webkit.org/show_bug.cgi?id=8248
86           Can not clear file input field
87
88         * manual-tests/clear-input-file.html: Added.
89
90         * html/HTMLInputElement.cpp:
91         (WebCore::HTMLInputElement::appendFormData): Remove check that prevents submission of
92         form data when there is no renderer or the renderer is invisible. While well-intentioned,
93         the rule does not match the behavior of other web browsers.
94         (WebCore::HTMLInputElement::setValue): Instead of disallowing all value changes for file
95         type, allow changes to the empty string.
96         (WebCore::HTMLInputElement::storesValueSeparateFromAttribute): Made file type return true
97         for this. 1) The file type does store its value separate from the value attribute.
98         2) The code in setInputType() should do the right thing given this new value, according to
99         my inspection of the code. 3) The code in both reset() and setValue() will work properly
100         if this is true, which was the motivation for changing it.
101
102         * platform/FileChooser.h: Added a clear function.
103         * platform/FileChooser.cpp: (WebCore::FileChooser::clear): Clear the filename and the icon.
104
105         * rendering/RenderFileUploadControl.cpp:
106         (WebCore::RenderFileUploadControl::valueChanged): Used a local variable to make the code
107         a little bit more readable (and match the change below).
108         (WebCore::RenderFileUploadControl::updateFromElement): Used local variables a bit more in
109         the old code. Added code that will call clear on the FileChooser and repaint if the DOM
110         element has an empty value and the FileChooser does not.
111
112 2007-04-22  Grace Kloba  <klobag@gmail.com>
113
114         Reviewed by Hyatt.
115
116         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12279
117         Implemented two pass loading. Enabled by WTF_USE_LOW_BANDWIDTH_DISPLAY flag.
118
119         * dom/Document.cpp:
120         (WebCore::Document::Document): initialize member variable m_inLowBandwidthDisplay
121
122         * dom/Document.h:
123         (WebCore::Document::haveStylesheetsLoaded): while in low bandwidth display mode, ignore pending style sheets
124         (WebCore::Document::setDocLoader):
125         (WebCore::Document::inLowBandwidthDisplay):
126         (WebCore::Document::setLowBandwidthDisplay):
127         * html/HTMLTokenizer.cpp:
128         (WebCore::HTMLTokenizer::scriptHandler): while in low bandwidth display mode, don't execute JavaScript
129
130         * loader/Cache.cpp:
131         (WebCore::Cache::requestResource): while in low bandwidth display mode, don't let style sheet and JavaScript block
132
133         * loader/CachedCSSStyleSheet.cpp:
134         (WebCore::CachedCSSStyleSheet::checkNotify): add notifyFinished() as client may need "this" pointer
135
136         * loader/DocLoader.h:
137         (WebCore::DocLoader::replaceDocument):
138         * loader/FrameLoader.cpp:
139         (WebCore::FrameLoader::FrameLoader):
140         (WebCore::FrameLoader::requestFrame): while in low bandwidth display mode, don't load sub-frame
141         (WebCore::FrameLoader::stopLoading):
142         (WebCore::FrameLoader::begin): set to low bandwidth display mode if the top frame is HTML document
143         (WebCore::FrameLoader::write):
144         (WebCore::FrameLoader::endIfNotLoading):
145         (WebCore::FrameLoader::checkCompleted): while in low bandwidth display mode, don't set complete
146         (WebCore::FrameLoader::requestObject): while in low bandwidth display mode, don't care Object
147         (WebCore::FrameLoader::addLowBandwidthDisplayRequest):
148         (WebCore::FrameLoader::removeAllLowbandwidthDisplayRequests):
149         (WebCore::FrameLoader::notifyFinished):
150         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
151         * loader/FrameLoader.h:
152         (WebCore::FrameLoader::FrameLoader::needToSwitchOutLowBandwidthDisplay):
153         (WebCore::FrameLoader::FrameLoader::setUseLowBandwidthDisplay):
154         (WebCore::FrameLoader::FrameLoader::useLowBandwidthDisplay):
155
156 2007-04-22  Darin Adler  <darin@apple.com>
157
158         Reviewed by Tim Hatcher.
159
160         - fix http://bugs.webkit.org/show_bug.cgi?id=13439
161           4 problems found in dashboard-region parser and serializer
162
163         Test: fast/css/dashboard-region-parser.html
164
165         * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::cssText):
166         Fix code that overwrote each additional region with the previous one to
167         instead build a space-separated list. Check for the case of an identifier
168         that's invalid, since that's (accidentally) how we represent a region
169         value that doesn't have explicit top/right/bottom/left values. The old code
170         would end up writing out four spaces after the region type.
171
172         * css/cssparser.cpp: (WebCore::CSSParser::parseDashboardRegions):
173         Fail to parse if there is something after the "none" identifier or after
174         the arguments inside the dashboard-region "function". Also replaced code
175         that produced a identifier with CSS_VAL_INVALID in a roundabout way with
176         code that does it explicitly.
177
178 2007-04-22  Darin Adler  <darin@apple.com>
179
180         Reviewed by Adele.
181
182         - support for fix for <rdar://problem/5100240> REGRESSION: Control-O broken
183
184         * dom/KeyboardEvent.h: Include a vector of command names in the KeypressCommand object
185         instead of a single command name.
186
187 2007-04-22  Alexey Proskuryakov  <ap@webkit.org>
188
189         Reviewed by Darin.
190
191         http://bugs.webkit.org/show_bug.cgi?id=13115
192         REGRESSION: 1000% performance regression in DOM access by index, which was already slow
193
194         * dom/NodeList.h: Move cached data into a separate class, so it can be shared.
195
196         * dom/Node.h: Replace the set of registered NodeLists with a struct that also
197         contains a shared NodeList::Caches (so the size of Node doesn't change).
198
199         * dom/NodeList.cpp:
200         (WebCore::NodeList::NodeList):
201         (WebCore::NodeList::~NodeList):
202         (WebCore::NodeList::recursiveLength):
203         (WebCore::NodeList::itemForwardsFromCurrent):
204         (WebCore::NodeList::itemBackwardsFromCurrent):
205         (WebCore::NodeList::recursiveItem):
206         (WebCore::NodeList::itemWithName):
207         (WebCore::NodeList::rootNodeChildrenChanged):
208         (WebCore::NodeList::NodeListInfo::NodeListInfo):
209         (WebCore::NodeList::NodeListInfo::reset):
210         * dom/ChildNodeList.cpp:
211         (WebCore::ChildNodeList::ChildNodeList):
212         (WebCore::ChildNodeList::length):
213         (WebCore::ChildNodeList::item):
214         (WebCore::ChildNodeList::nodeMatches):
215         * dom/ChildNodeList.h:
216         * dom/Node.cpp:
217         (WebCore::Node::childNodes):
218         (WebCore::Node::registerNodeList):
219         (WebCore::Node::unregisterNodeList):
220         (WebCore::Node::notifyLocalNodeListsAttributeChanged):
221         (WebCore::Node::notifyLocalNodeListsChildrenChanged):
222         Adjust for the above changes.
223
224 2007-04-21  Mitz Pettel  <mitz@webkit.org>
225
226         Reviewed by Darin.
227
228         - fix http://bugs.webkit.org/show_bug.cgi?id=13391
229           REGRESSION (r18819): Incomplete repaint of button text
230
231         Test: fast/repaint/control-clip.html
232
233         Ignore controls' lightweight clip in repaint rect computation for now.
234
235         * rendering/RenderBox.cpp:
236         (WebCore::RenderBox::computeAbsoluteRepaintRect):
237
238 2007-04-21  Darin Adler  <darin@apple.com>
239
240         Reviewed by Adam.
241
242         - fix <rdar://problem/4816343> :-khtml-drag CSS pseudo-class changed to :-webkit-drag, need alias
243
244         * css/CSSSelector.cpp: (WebCore::CSSSelector::extractPseudoType):
245         Since Apple documentation claims "-khtml-drag" works, we need to keep it working,
246         so add it back as an alias.
247
248 2007-04-21  Darin Adler  <darin@apple.com>
249
250         Reviewed by Oliver.
251
252         - fix <rdar://problem/4782422> REGRESSION: -[stringByEvaluatingJavaScriptFromString]
253           returns an empty string instead of nil for non-string results
254
255         * page/mac/WebCoreFrameBridge.mm:
256         (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
257         Added a call to nsStringNilIfEmpty to restore the old behavior. It might be nice to
258         distinguish the empty string from a non-string result, but there's no obvious way
259         to do that, and for compatibility it's probably best to just restore the old
260         behavior instead.
261
262 2007-04-21  David Hyatt  <hyatt@apple.com>
263
264         Fix for bug 13432, determineFlowSpacing is O(n^2).
265
266         Reviewed by aroben
267
268         * rendering/InlineBox.cpp:
269         (WebCore::InlineBox::nextOnLineExists):
270         (WebCore::InlineBox::prevOnLineExists):
271         * rendering/InlineBox.h:
272         (WebCore::InlineBox::InlineBox):
273
274 2007-04-21  Lamar Goddard <lamargoddard@gmail.com>
275
276         Reviewed by Darin.
277
278         Fix for http://bugs.webkit.org/show_bug.cgi?id=5262
279         <rdar://problem/5018778>
280         XMLSerializer drops Namespace information
281
282         Updated WebCore::markup to output namespace information for elements/attributes whose namespace information
283         doesn't appear in its scope in the output.
284
285         Added test case: fast/dom/serialize-nodes.xhtml
286
287         * WebCore/editing/markup.cpp:
288         (WebCore::createMarkup(const Node*, ...)): Changed call to WebCore::markup to match parameters
289         (WebCore::markup): Changed recursive call to match tree structure, removed ASSERT and no longer needed includeSiblings parameter.
290         (WebCore::startMarkup): Added optional parameter to track namespaces in the current scope.
291         (WebCore::addNamespace): Function to add namespace information to markup.
292         (WebCore::shouldAddNamespaceAttr):
293         (WebCore::shouldAddNamespaceElem): Functions that test whether namespace information should be added for a given node.
294         * WebCore/dom/Document.idl:
295         (createElementNS):
296         (createAttributeNS):
297         (getElementsByTagNameNS): Added [ConvertNullToNullString] to namespaceURI parameter.
298         * WebCore/dom/Node.cpp:
299         (Node::getElementsByTagNameNS): removed test for namespaceURI being null as null can be a valid namespace.
300
301 2007-04-21  Alexey Proskuryakov  <ap@webkit.org>
302
303         Reviewed by Darin.
304
305         http://bugs.webkit.org/show_bug.cgi?id=13300
306         Reproducible crash opening anekdot.ru
307
308         * html/HTMLParser.cpp:
309         (WebCore::HTMLParser::HTMLParser):
310         (WebCore::HTMLParser::getNode):
311         (WebCore::HTMLParser::handleIsindex):
312         * html/HTMLParser.h:
313         Made HTMLParser::form a RefPtr, and renamed it to m_currentFormElement.
314         Made m_currentMapElement a RefPtr.
315
316 2007-04-21  Mitz Pettel  <mitz@webkit.org>
317
318         Reviewed by Darin.
319
320         - fix http://bugs.webkit.org/show_bug.cgi?id=13353
321           REGRESSION (r20754-20766): Textarea does not resize when scrollbar is present
322
323         Test: fast/overflow/hit-test-overflow-controls.html
324
325         * page/EventHandler.cpp:
326         (WebCore::EventHandler::handleMouseMoveEvent): Avoid activating scrollbars
327         during layer resize.
328         * rendering/RenderBlock.cpp:
329         (WebCore::RenderBlock::isPointInOverflowControl): Renamed isPointInScrollbar
330         to this, to reflect that it returns true for points in the resize corner
331         as well. Changed it to call the layer to do the actual work.
332         (WebCore::RenderBlock::nodeAtPoint): Updated for the above rename.
333         * rendering/RenderBlock.h:
334         * rendering/RenderLayer.cpp:
335         (WebCore::RenderLayer::horizontalScrollbarWidget): Fixed typo in this function's
336         name (it was horizontaScrollbarWidget).
337         (WebCore::RenderLayer::hitTestOverflowControls): Added. Returns whether the
338         hit point is in one of the scrollbars or the resize corner, and updates the
339         platform scrollbar in the hit test result if a scrollbar was hit.
340         * rendering/RenderLayer.h:
341         * rendering/RenderListBox.cpp:
342         (WebCore::RenderListBox::isPointInOverflowControl): Rename.
343         * rendering/RenderListBox.h:
344
345 2007-04-21  Mitz Pettel  <mitz@webkit.org>
346
347         Reviewed by Darin.
348
349         - fix http://bugs.webkit.org/show_bug.cgi?id=13417
350           Repro crash when the first argument to getMatchedCSSRules is not an element
351
352         Test: fast/dom/Window/getMatchedCSSRules-null-crash.html
353
354         * css/cssstyleselector.cpp:
355         (WebCore::CSSStyleSelector::styleRulesForElement): Added null check.
356
357 2007-04-21  Mitz Pettel  <mitz@webkit.org>
358
359         Reviewed by Darin.
360
361         - fix http://bugs.webkit.org/show_bug.cgi?id=13416
362           Repro crash after referencing the user stylesheet from JavaScript
363
364         No test included because DumpRenderTree does not support setting the user stylesheet.
365
366         * css/cssstyleselector.cpp:
367         (WebCore::CSSStyleSelector::CSSStyleSelector):
368         (WebCore::CSSStyleSelector::~CSSStyleSelector):
369         * css/cssstyleselector.h: Made m_userSheet a RefPtr.
370
371 2007-04-21  MorganL  <morganl.webkit@yahoo.com>
372
373         Reviewed by Adam.
374
375         NPObject should be forward declared using 'struct' instead of 'class'
376
377         * page/Frame.h:
378
379 2007-04-21  Alp Toker  <alp@atoker.com>
380
381         Gdk build fix.
382
383         * platform/gdk/FontPlatformDataGdk.cpp:
384         (WebCore::FontPlatformData::FontPlatformData): Use the correct casts.
385
386 2007-04-20  Brady Eidson  <beidson@apple.com>
387
388         Reviewed by Oliver (Black Sheep)
389
390         <rdar://problem/3559794>
391         [WebView setMaintainsBackForwardList:] doesn't actually flush out the current page caches
392
393         * WebCore.exp:
394         * history/BackForwardList.cpp:
395         (WebCore::BackForwardList::BackForwardList): Set the flag to true by default
396         (WebCore::BackForwardList::addItem): Check the flag and bail if its false
397         (WebCore::BackForwardList::setCapacity): More correct if it set the m_current to 
398           NoCurrentItemIndex if we're setting capacity to 0
399         (WebCore::BackForwardList::enabled): 
400         (WebCore::BackForwardList::setEnabled): If we're disabling, cycle capacity to 0 and 
401           back to flush things out
402         * history/BackForwardList.h: Add enabled(), setEnabled(bool), and m_enabled
403
404 2007-04-20  David Hyatt  <hyatt@apple.com>
405
406         Bug 13424, firstLineStyle and verticalPositionHint together take
407         33% of the time on the new tag nesting PLT.  Don't waste time even
408         looking for first-line styles if no stylesheet used them.
409
410         Reviewed by beth
411
412         * css/CSSGrammar.y:
413         * dom/Document.cpp:
414         (WebCore::Document::Document):
415         * dom/Document.h:
416         (WebCore::Document::usesFirstLineRules):
417         (WebCore::Document::setUsesFirstLineRules):
418         * rendering/RenderObject.cpp:
419         (WebCore::RenderObject::verticalPositionHint):
420         (WebCore::RenderObject::firstLineStyle):
421
422 2007-04-20  Peter Kasting  <pkasting@google.com>
423
424         Reviewed by Oliver.
425
426         - fix http://bugs.webkit.org/show_bug.cgi?id=13420
427
428         * platform/TextEncodingRegistry.cpp:
429         (WebCore::addToTextEncodingNameMap): Change a pointer comparison to a
430         strcmp(), since the strings here are not necessarily
431         pointer-equivalent.
432
433 2007-04-20  Darin Adler  <darin@apple.com>
434
435         Reviewed by Geoff Garen and John Sullivan.
436
437         - fix <rdar://problem/4671964> document property on <iframe> elements causes problems for SAP application
438
439         Test: fast/dom/iframe-document.html
440
441         * bindings/js/kjs_html.h: Removed IFrameDocument.
442         * bindings/js/kjs_html.cpp: (KJS::JSHTMLElement::iFrameGetter): Ditto.
443
444 2007-04-19  Alp Toker  <alp@atoker.com>
445
446         Reviewed by Mark.
447
448         * platform/gdk/FontGdk.cpp:
449         (WebCore::Font::drawGlyphs):
450         * platform/gdk/FontPlatformDataGdk.cpp:
451         (WebCore::FontPlatformData::FontPlatformData): Fix font support in Gdk port.
452
453 2007-04-19  David Hyatt  <hyatt@apple.com>
454
455         Fix for bug 13208, implement word-break.  This patch produces a partial
456         implementation of word-break.  word-break: break-all is implemented.  In
457         addition, a custom value, word-break: break-word is added that is a hybrid
458         of word-wrap: break-word and word-break: break-all (and more useful than
459         either).
460
461         Reviewed by beth
462
463         Added fast/text/word-break.html
464
465         * css/CSSComputedStyleDeclaration.cpp:
466         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
467         * css/CSSPropertyNames.in:
468         * css/CSSValueKeywords.in:
469         * css/cssparser.cpp:
470         (WebCore::CSSParser::parseValue):
471         * css/cssstyleselector.cpp:
472         (WebCore::CSSStyleSelector::applyProperty):
473         * rendering/RenderStyle.cpp:
474         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
475         (WebCore::StyleRareInheritedData::operator==):
476         (WebCore::RenderStyle::diff):
477         * rendering/RenderStyle.h:
478         (WebCore::):
479         (WebCore::RenderStyle::breakWords):
480         (WebCore::RenderStyle::wordBreak):
481         (WebCore::RenderStyle::setWordBreak):
482         (WebCore::RenderStyle::initialWordBreak):
483         (WebCore::RenderStyle::initialWordWrap):
484         * rendering/RenderText.cpp:
485         (WebCore::RenderText::calcMinMaxWidthInternal):
486         * rendering/RenderTextControl.cpp:
487         (WebCore::RenderTextControl::createInnerTextStyle):
488         (WebCore::RenderTextControl::calcHeight):
489         * rendering/bidi.cpp:
490         (WebCore::RenderBlock::findNextLineBreak):
491
492 2007-04-20  Mark Rowe  <mrowe@apple.com>
493
494         Qt build fix for FreeBSD.
495
496         * WebCore.pro: FreeBSD needs HAVE_PTHREAD_NP_H defined.
497
498 2007-04-19  Mitz Pettel  <mitz@webkit.org>
499
500         Reviewed by Darin.
501
502         - fix http://bugs.webkit.org/show_bug.cgi?id=13403
503           REGRESSION (r18875-r18899): Can no longer type into search form field after searching and then clicking "back"
504
505         The problem was that the page was loaded from the page cache with a subtree
506         marked for layout and the layout timer stopped (having been stopped when the
507         page entered the page cache). FrameView::needsLayout() was returning false
508         which prevented the pending layout from completing.
509
510         * page/FrameView.cpp:
511         (WebCore::FrameView::clear): Removed the call to stop the layout timer, since
512         reset() does that already.
513         (WebCore::FrameView::needsLayout): Changed to return true if there's a subtree
514         pending relayout.
515
516 2007-04-19  Justin Garcia  <justin.garcia@apple.com>
517
518         Reviewed by harrison
519         
520         <rdar://problem/5144139> 
521         On delete, <BR> inserted into non-editable ToDo <TABLE> element
522         
523         The fact that the br was being inserted at a bad position 
524         (a non-editable position and one inside a table instead of 
525         before it) was fixed in the previous checkin. This change 
526         stops us from inserting a br at all, to fix the bug.
527         
528         After a delete, we need a placeholder if the selection
529         started at the start of a paragraph and ended at the end 
530         of a paragraph. But not if it starts just before a table 
531         and ends inside that table.  We need placeholders to hold 
532         open emptied out table cells, but that is handled separately.
533         
534         Also, moved lineBreakExistsAtPosition to htmlediting.cpp 
535         so that it can be used in more places.
536
537         * editing/CompositeEditCommand.cpp:
538         (WebCore::CompositeEditCommand::removePlaceholderAt):
539         (WebCore::CompositeEditCommand::moveParagraphs):
540         * editing/DeleteSelectionCommand.cpp:
541         (WebCore::DeleteSelectionCommand::doApply):
542         * editing/InsertLineBreakCommand.cpp:
543         * editing/InsertParagraphSeparatorCommand.cpp:
544         (WebCore::InsertParagraphSeparatorCommand::doApply):
545         * editing/htmlediting.cpp:
546         (WebCore::lineBreakExistsAtPosition):
547         * editing/htmlediting.h:
548
549 2007-04-19  Justin Garcia  <justin.garcia@apple.com>
550
551         Reviewed by harrison
552         
553         Fixes some issues found while investigating:
554         <rdar://problem/5144139> On delete, <BR> inserted into non-editable ToDo <TABLE> element
555         
556         Move the code to handle inserting content before/after
557         tables for [table, 0/max] to insertNodeAt, so that
558         all insertions get it, not just some.
559         Changed insertNodeAt to take in a position instead of a
560         node and an offset.
561
562         * editing/CompositeEditCommand.cpp:
563         (WebCore::CompositeEditCommand::insertNodeAt):
564         (WebCore::CompositeEditCommand::insertNodeAtTabSpanPosition):
565         (WebCore::CompositeEditCommand::insertBlockPlaceholder):
566         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
567         If paragrahStart.node() is an atomic node, insertNodeAt can handle
568         insertion, we don't need to special case it.
569         (WebCore::CompositeEditCommand::moveParagraphs):
570         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
571         * editing/CompositeEditCommand.h:
572         * editing/DeleteSelectionCommand.cpp:
573         (WebCore::DeleteSelectionCommand::mergeParagraphs):
574         (WebCore::DeleteSelectionCommand::doApply):
575         * editing/FormatBlockCommand.cpp:
576         (WebCore::FormatBlockCommand::doApply):
577         * editing/IndentOutdentCommand.cpp:
578         (WebCore::IndentOutdentCommand::indentRegion):
579         (WebCore::IndentOutdentCommand::outdentParagraph):
580         * editing/InsertLineBreakCommand.cpp:
581         (WebCore::InsertLineBreakCommand::doApply):
582         * editing/InsertListCommand.cpp:
583         (WebCore::InsertListCommand::doApply):
584         * editing/InsertParagraphSeparatorCommand.cpp:
585         (WebCore::InsertParagraphSeparatorCommand::doApply):
586         * editing/InsertTextCommand.cpp:
587         (WebCore::InsertTextCommand::prepareForTextInsertion): Removed some
588         dead code that handled insertion at non-editable positions.
589         (WebCore::InsertTextCommand::insertTab):
590         * editing/ReplaceSelectionCommand.cpp:
591         (WebCore::ReplaceSelectionCommand::doApply):
592         (WebCore::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted):
593         * editing/ReplaceSelectionCommand.h:
594
595 2007-04-19  Mitz Pettel  <mitz@webkit.org>
596
597         Reviewed by Darin.
598
599         - fix http://bugs.webkit.org/show_bug.cgi?id=13336
600           REGRESSION (r20646): editing/execCommand/hilitecolor.html crashes under guardMalloc
601
602         Avoid calling selectionRect() and selectionGapRects() on a renderer that needs
603         layout.
604
605         * rendering/RenderBlock.cpp:
606         (WebCore::RenderBlock::selectionGapRects):
607         * rendering/RenderBlock.h:
608         (WebCore::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
609         * rendering/RenderListMarker.cpp:
610         (WebCore::RenderListMarker::selectionRect):
611         * rendering/RenderObject.h:
612         (WebCore::RenderObject::SelectionInfo::SelectionInfo):
613         * rendering/RenderReplaced.cpp:
614         (WebCore::RenderReplaced::selectionRect):
615         * rendering/RenderText.cpp:
616         (WebCore::RenderText::selectionRect):
617
618 2007-04-19  Justin Garcia  <justin.garcia@apple.com>
619
620         Reviewed by darin
621
622         <rdar://problem/5142012> 
623         GoogleDocs: Crash at WebCore::Range::startPosition() when creating a list from a link
624         
625         List creation uses moveParagraphs to push content into list items.
626         Its fragment creation (using createMarkup) incorrectly uses regular
627         spaces instead of nbsps for spaces that were rendered (11475), which 
628         causes spaces to be collapsed during the move operation.  This results 
629         in a call to rangeFromLocationAndLength with a location past the end
630         of the document.  We use the result from rangeFromLocationAndLength
631         (null) and crash.
632         
633         Also when moveParagraphs tries to push content into a list item surrounded
634         by an anchor, it fails because positionAvoidingSpecialElementBoundary avoids 
635         the anchor, which also avoids the list item.  This was fixed by pushing
636         down anchors before avoiding them.
637         
638         * editing/CompositeEditCommand.cpp:
639         (WebCore::CompositeEditCommand::pushAnchorElementDown): Remove the
640         old anchor after we push down clones of it, this is what callers
641         expect.
642         (WebCore::CompositeEditCommand::pushPartiallySelectedAnchorElementsDown):
643         Call the new enclosingAnchorElement, that takes in a position instead
644         of a node.
645         (WebCore::CompositeEditCommand::moveParagraphs): If spaces collapsed
646         as a result of the move, rangeFromLocationAndLength can return null,
647         bail and don't try to preserve the selection in that case.
648         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
649         Moved from htmlediting.cpp.
650         Make sure anchors are pushed down before avoiding them so that we don't
651         also avoid structural elements like lists and blocks.
652         * editing/CompositeEditCommand.h:
653         * editing/TypingCommand.cpp: Moved isFirst/LastPositionBefore/AfterTable
654         to htmlediting.cpp.
655         * editing/htmlediting.cpp:
656         Moved positionAvoidingSpecialElementBoundary so that it could call
657         pushAnchorElementDown.
658         (WebCore::isFirstPositionAfterTable): Moved here.
659         (WebCore::isLastPositionBeforeTable): Moved here.
660         (WebCore::enclosingAnchorElement): Moved here.
661         (WebCore::enclosingListChild): Removed an extraneous space.
662         * editing/htmlediting.h:
663
664 2007-04-19  Beth Dakin  <bdakin@apple.com>
665
666         Reviewed by Hyatt.
667
668         Fix for <rdar://problem/5120889> Sized table cells w/borders not 
669         drawn to correct size
670
671         When table cells have children with %-height, the cells were 
672         incorrectly shrinking down to be the size of the child. This 
673         exposed another problem with replaced children and sizing.
674
675         * rendering/RenderBox.cpp:
676         (WebCore::RenderBox::calcReplacedHeightUsing): The exposed problem. 
677         Subtract our borders and padding in the auto or percent table cell 
678         containing block case.
679         * rendering/RenderTableSection.cpp:
680         (WebCore::RenderTableSection::layoutRows): When our children can 
681         flex, do not always set the cellTopExtra and cellBottomExtra to 0! 
682         That is bad! We should do the same as the non-flex case.
683
684 2007-04-19  Anders Carlsson  <andersca@apple.com>
685
686         Reviewed by Geoff.
687
688         http://bugs.webkit.org/show_bug.cgi?id=13333
689         Support naturalWidth/naturalHeight on image elements
690
691         * html/HTMLImageElement.cpp:
692         (WebCore::HTMLImageElement::naturalWidth):
693         (WebCore::HTMLImageElement::naturalHeight):
694         * html/HTMLImageElement.h:
695         * html/HTMLImageElement.idl:
696
697 2007-04-19  Patti Hoa  <patti@apple.com>
698
699         Reviewed by Darin.
700         - review suggestion for rdar://5145011 code change
701         
702         * bridge/mac/WebCoreAXObject.mm:
703         (-[WebCoreAXObject value]):
704         return early if value attribute is not supported by the attachment view.
705
706 2007-04-19  Patti Hoa  <patti@apple.com>
707
708         Reviewed by Darin.
709
710         <rdar://problem/5145011> Allow attachment view of web object to handle accessibility actions
711         
712         * bridge/mac/WebCoreAXObject.mm:
713         (-[WebCoreAXObject value]):
714         Only allow asking the attachmentView for value if attachmentView supports this value attribute 
715         (-[WebCoreAXObject title]):
716         (-[WebCoreAXObject accessibilityAttributeNames]):
717         Should not return that long list of unrelated attributes for attachmentView.
718         (-[WebCoreAXObject accessibilityActionNames]):
719         (-[WebCoreAXObject accessibilityPerformAction:]):
720         Allow attachmentView a chance to handle actions.
721         (-[WebCoreAXObject accessibilityParameterizedAttributeNames]):
722         Should not return that long list of unrelated attributes for attachmentView.
723         
724 2007-04-19  Mitz Pettel  <mitz@webkit.org>
725
726         Reviewed by Hyatt.
727
728         - fix http://bugs.webkit.org/show_bug.cgi?id=13291
729           REGRESSION (r19595): WebViewDidBeginEditingNotification not posted when focusing with the mouse
730
731         Covered by editing tests.
732
733         * dom/Document.cpp:
734         (WebCore::Document::setFocusedNode): Moved the call to Editor::didBeginEditing()
735         back into here.
736         * dom/Element.cpp:
737         (WebCore::Element::updateFocusAppearance): Removed the call to didBeginEditing().
738         * html/HTMLInputElement.cpp:
739         (WebCore::HTMLInputElement::updateFocusAppearance): Ditto.
740
741 2007-04-19  Sam Weinig  <sam@webkit.org>
742
743         Reviewed by Darin.
744
745         - Patch for http://bugs.webkit.org/show_bug.cgi?id=12249
746           FCKeditor: <hr>, <ul> and <ol> have id="undefined"
747
748         Convert undefined and null to a null string for third argument of
749         execCommand(); 
750
751         Test: editing/execCommand/arguments-combinations.html
752
753         * WebCore.xcodeproj/project.pbxproj:
754         * bindings/js/kjs_binding.cpp:
755         (KJS::valueToStringWithUndefinedOrNullCheck):
756         * bindings/js/kjs_binding.h:
757         * bindings/scripts/CodeGeneratorJS.pm:
758         * dom/Document.idl:
759
760 2007-04-19  Alp Toker  <alp@atoker.com>
761
762         Reviewed by hyatt.
763
764         * WebCoreSources.bkl: Remove obsolete source file from build.
765
766 2007-04-18  Alp Toker  <alp@atoker.com>
767
768         Gdk build fix.  Reviewed by Sam Weinig.
769
770         Track changes to make GdkLauncher work again.
771
772         * WebCoreSources.bkl:
773         * platform/gdk/ChromeClientGdk.h:
774         * platform/gdk/TemporaryLinkStubs.cpp:
775         (ChromeClientGdk::createWindow):
776         (ChromeClientGdk::createModalDialog):
777         (Editor::markBadGrammar):
778
779 2007-04-17  Brady Eidson  <beidson@apple.com>
780
781         Reviewed by Tim
782
783         <rdar://problem/5008925>
784         Expose the NSURLConnection delegate willCacheResponse API to WebResourceLoadDelegate
785
786         * WebCore.xcodeproj/project.pbxproj: Added ResourceLoaderMac.mm
787
788         * loader/FrameLoaderClient.h: Add the willCacheResponse SPI for WebKit to implement
789
790         * loader/ResourceLoader.h:
791         * loader/mac/ResourceLoaderMac.mm: Added.
792         (WebCore::ResourceLoader::willCacheResponse): Return the new cachedResponse from the client
793
794         * platform/graphics/svg/SVGImageEmptyClients.h:
795         (WebCore::SVGEmptyFrameLoaderClient::willCacheResponse): Stub
796
797         * platform/network/ResourceHandleClient.h:
798         (WebCore::ResourceHandleClient::willCacheResponse):  Return the new cachedResponse from the client
799
800         * platform/network/mac/ResourceHandleMac.mm:
801         (-[WebCoreResourceHandleAsDelegate connection:willCacheResponse:]): Call to get the new 
802           cachedURLResponse before calling for the cache policy
803
804 2007-04-18  Darin Adler  <darin@apple.com>
805
806         Reviewed by Hyatt.
807
808         - fix http://bugs.webkit.org/show_bug.cgi?id=13375
809           REGRESSION (r20901): failing fast/overflow/scrollRevealButton.html
810
811         * dom/Document.cpp: (WebCore::Document::updateLayout):
812         If we have a parent frame, update its layout too.
813
814 2007-04-18  Alp Toker  <alp@atoker.com>
815
816         Gdk build fix.  Reviewed by Mark.
817
818         * loader/gdk/FrameLoaderClientGdk.cpp:
819         (WebCore::FrameLoaderClientGdk::loadedFromCachedPage):
820         (WebCore::FrameLoaderClientGdk::setDocumentViewFromCachedPage):
821         (WebCore::FrameLoaderClientGdk::saveDocumentViewToCachedPage):
822         * loader/gdk/FrameLoaderClientGdk.h:
823         * platform/gdk/TemporaryLinkStubs.cpp:
824         (CachedPage::close): Track PageCache to CachedPage refactoring.
825
826 2007-04-17  Mitz Pettel  <mitz@webkit.org>
827
828         Reviewed by Darin.
829
830         - fix http://bugs.webkit.org/show_bug.cgi?id=13369
831           REGRESSION (r13366): Invisible table cell background is painted
832
833         Test: fast/table/invisible-cell-background.html
834
835         * rendering/RenderTableCell.cpp:
836         (WebCore::RenderTableCell::paintBackgroundsBehindCell): Don't paint any
837         background if the cell is not visible. This behavior matches WinIE and Opera.
838
839 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
840
841         Reviewed by harrison
842
843         <rdar://problem/5119244> 
844         Crash when indenting a selected ToDo
845         
846         indentRegion() was using the old (incorrect) editable root 
847         getter, which returned null for a valid, editable position, 
848         causing the crash.
849
850         * editing/IndentOutdentCommand.cpp:
851         (WebCore::IndentOutdentCommand::indentRegion):
852         The editable root for a position is editableRootForPosition(p),
853         not p.node()->rootEditableElement(), because of VisiblePositions 
854         before/after tables, replaced elements and others.
855
856 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
857
858         Reviewed by hyatt
859
860         <rdar://problem/5138441> 
861         GoogleDocs: Indented text looks like text that's been Quoted
862         
863         GoogleDocs uses FormatBlock, blockquotes and a style rule
864         for blockquotes to implement a "Quote Text" feature.  Styles
865         intended only for those blockquotes were added to the 
866         blockquotes that we use for indenting.
867
868         * css/html4.css: Removed the webkit-indent-blockquote class rule.
869         * editing/IndentOutdentCommand.cpp:
870         (WebCore::createIndentBlockquoteElement): Use custom margins
871         and turn off border and padding to override author rules for
872         blockquotes.
873
874 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
875
876         Reviewed by darin
877
878         <rdar://problem/5136770> 
879         Gmail Editor: Hang when turning a particular multi-line selection into a list
880         
881         When InsertListCommand pushes content into list items, 
882         it creates an empty list item and then calls moveParagraphs.  
883         But moveParagraphs' selection preservation code fails when 
884         it encounters empty list items (list items w/o placeholders).
885         This causes InsertListCommand to lose track of where it has 
886         already been performed, which causes the hang.
887
888         * editing/InsertListCommand.cpp:
889         (WebCore::InsertListCommand::doApply): Use brs to hold open 
890         empty list items.
891
892 2007-04-17  Darin Adler  <darin@apple.com>
893
894         Oops, rolled that last change out. I'll redo it again later after making
895         som additional refinments.
896
897 2007-04-17  Darin Adler  <darin@apple.com>
898
899         Reviewed by Brady.
900
901         - a few baby steps to try to make lockHistory and userGesture less confusing
902
903         * page/FrameLoadRequest.h:
904         (WebCore::FrameLoadRequest::FrameLoadRequest): Add initialization of m_isUserGesture
905         to true.
906         (WebCore::FrameLoadRequest::shouldLockHistory): Renamed from lockHistory to avoid having
907         a getter that sounds like a verb phrase.
908         (WebCore::FrameLoadRequest::setShouldLockHistory): Ditto.
909         (WebCore::FrameLoadRequest::isUserGesture): Added.
910         (WebCore::FrameLoadRequest::setIsUserGesture): Ditto.
911
912         * loader/FrameLoader.h: Remove userGesture parameter from load that takes
913         FrameLoadRequest. Remove default values for lockHistory and userGesture parameters,
914         since that just makes it more likely we'll forget to pass them in. Remove one of
915         the overloads of urlSelected, since it's only called one place.
916
917         * loader/FrameLoader.cpp:
918         (WebCore::FrameLoader::createWindow): Remove userGesture parameter, relying on
919         the true default in FrameLoadRequest.
920         (WebCore::FrameLoader::urlSelected): Call setShouldLockHistory and setIsUserGesture
921         on the FrameLoadRequest, and call load directly; also eliminate the other urlSelected
922         overload since this was the only place it was called.
923         (WebCore::FrameLoader::load): Remove userGesture parameter, relying on the true
924         default in FrameLoadRequest. In the other overload, clean up logic to eliminate the
925         argsReferrer variable and get rid of the userGesture parameter, using the value from
926         FrameLoadRequest.
927         (WebCore::FrameLoader::submitForm): Remove userGesture parameter, relying on the value
928         in the FrameLoadRequest. This actually changes behavior.
929
930         * bindings/js/kjs_html.cpp: (KJS::JSHTMLDocument::putValueProperty): Pass
931         false for userGesture explicitly instead of relying on default argument.
932
933         * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected):
934         Remove userGesture parameter, relying on the true default in FrameLoadRequest.
935
936 2007-04-16  David Kilzer  <ddkilzer@webkit.org>
937
938         Reviewed by NOBODY (fixed misspelling).
939
940         * manual-tests/containing-block-position-chage.html: Removed.
941         * manual-tests/containing-block-position-change.html: Added.
942
943 2007-04-16  Justin Garcia  <justin.garcia@apple.com>
944
945         Reviewed by darin
946
947         <rdar://problem/5134759> 
948         GMail Editor: Hang after pasting underlined text multiple times
949         
950         The moveParagraphs call that ReplaceSelectionCommand
951         performs must receive only inline content from createMarkup, 
952         or else it will result in another call to moveParagraphs 
953         when it performs the move, resulting in infinite recursion.
954
955         * editing/markup.cpp:
956         (WebCore::startMarkup): We were only converting a block to
957         an inline if it had an inline style declaration or styles 
958         coming from matched rules.  Cleaned up this code a bit by 
959         handling an element's style separately from its other 
960         attributes.
961
962 2007-04-16  Darin Adler  <darin@apple.com>
963
964         - get layout tests going again
965
966         * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry):
967         Replace assertion with a runtime check. We can consider changing it back to
968         an assertion some day, but it's not important.
969
970 2007-04-16  Darin Adler  <darin@apple.com>
971
972         Reviewed by John Sullivan.
973
974         - fix http://bugs.webkit.org/show_bug.cgi?id=13303
975           <rdar://problem/5126341> REGRESSION: controls in a background Safari window
976           maintain active appearance if the address bar has focus (13303)
977
978         - fix a related problem where elements could look focused in non-active windows
979
980         - simplify secure keyboard entry logic in Frame::setIsActive
981
982         * WebCore.exp: Add two new symbols for use by WebKit.
983
984         * html/HTMLInputElement.cpp:
985         (WebCore::HTMLInputElement::dispatchFocusEvent): Call setUseSecureKeyboardEntryWhenActive
986         rather than calling setSecureKeyboardEntry directly -- does nothing if the frame is not active.
987         (WebCore::HTMLInputElement::dispatchBlurEvent): Ditto.
988
989         * page/Frame.cpp:
990         (WebCore::Frame::setUseSecureKeyboardEntryWhenActive): Added. Calls
991         setUseSecureKeyboardEntry only if the frame is active, but also stores away the state,
992         so that the setIsActive function doesn't have to recompute it.
993         (WebCore::Frame::setIsActive): Rewrote all the comments in the function. Removed the code
994         to manage control tints, which are not based on the whether the frame is active but rather
995         on AppKit's concept of whether the window should have "key appearance". Simplified the
996         logic about when to call setUseSecureKeyboardEntry by using the value of
997         m_useSecureKeyboardEntryWhenActive.
998         (WebCore::FramePrivate::FramePrivate): Initialize m_useSecureKeyboardEntryWhenActive.
999         * page/Frame.h: Made setSecureKeyboardEntry private and renamed it to
1000         setUseSecureKeyboardEntry, removed isSecureKeyboardEntry, and
1001         added a public setUseSecureKeyboardEntryWhenActive.
1002         * page/FramePrivate.h: Added m_useSecureKeyboardEntryWhenActive.
1003         * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry): Added an assertion,
1004         and removed isSecureKeyboardEntry().
1005
1006         * page/FrameView.h: Added updateControlTints.
1007         * page/FrameView.cpp: (WebCore::FrameView::updateControlTints): Added. Code was moved
1008         here from setIsActive for two reasons: (1) it makes more sense in the view class, and
1009         (2) it needs to be called at the appropriate time for AppKit, not when active changes.
1010
1011         * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isFocused): Added an isActive
1012         check here to match the logic in the implementation of the CSS pseudo-state.
1013         * rendering/RenderThemeMac.mm:
1014         (WebCore::RenderThemeMac::updateFocusedState): Use the isFocused function instead of
1015         repeating the logic here. Removed the "need to add a key window test here" comment.
1016         (WebCore::RenderThemeMac::controlSupportsTints): Added a comment about the NSCell
1017         SPI that's related to the _windowChangedKeyState method we now use in WebHTMLView.
1018
1019 2007-04-16  Darin Adler  <darin@apple.com>
1020
1021         Reviewed by John Sullivan.
1022
1023         - fix http://bugs.webkit.org/show_bug.cgi?id=13227
1024           StringImpl::isLower incorrectly assumes islower returns 1 (it can return any non-0)
1025
1026         * platform/StringImpl.cpp:
1027         (WebCore::StringImpl::isLower): Based on test application results, changed to use &&
1028         instead of trying to use & to avoid branches. Use U16_NEXT so we can handle characters
1029         outside the BMP. Improved comments.
1030         (WebCore::StringImpl::lower): Improved comments.
1031         (WebCore::equalIgnoringCase): Changed to use && instead of trying to use & to avoid
1032         branches. Improved comments. Added an assertion about the assumption we're
1033         making that characters in the char* are all ASCII.
1034
1035 2007-04-13  David Kilzer  <ddkilzer@webkit.org>
1036
1037         Patch and review by hyatt.  Testing and landing by ddkilzer.
1038
1039         <rdar://problem/5078866>
1040         tables don't inherit text-align (in strict mode; they're not supposed to in quirks mode)
1041
1042         Test: fast/css/table-text-align-quirk.html
1043               fast/css/table-text-align-strict.html
1044
1045         Previous commit (r20731) removed the wrong property from WebCore/css/html4.css.  However,
1046         when the correct property was removed, it caused tables to inherit alignment properties
1047         from tags like <center> and <div align="center">.  This is fixed in
1048         WebCore::CSSStyleSelector::adjustRenderStyle() by special-casing tables to reset the
1049         text-align property.
1050
1051         * css/CSSComputedStyleDeclaration.cpp:
1052         (WebCore::valueForTextAlign): Renamed KHTML_CENTER, KHTML_LEFT and KHTML_RIGHT to
1053         WEBKIT_CENTER, WEBKIT_LEFT and WEBKIT_RIGHT.
1054         * css/cssparser.cpp:
1055         (WebCore::CSSParser::parseValue): Ditto.
1056         * css/cssstyleselector.cpp:
1057         (WebCore::CSSStyleSelector::adjustRenderStyle): Tables should not support -webkit-center,
1058         -webkit-left or -webkit-right values for text-align, so reset them back to auto.
1059         * css/html4.css: Removed "text-align: -webkit-auto;" property from tables selector.  It
1060         was previously added to css/quirks.css in r20731.
1061         * rendering/RenderBlock.cpp:
1062         (WebCore::RenderBlock::determineHorizontalPosition): Renamed KHTML_* to WEBKIT_*.
1063         * rendering/RenderBox.cpp:
1064         (WebCore::RenderBox::calcHorizontalMargins): Ditto.
1065         * rendering/RenderFlow.cpp:
1066         (WebCore::RenderFlow::caretRect): Ditto.
1067         * rendering/RenderStyle.h: Ditto.
1068         (WebCore::):
1069         * rendering/bidi.cpp:
1070         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Ditto.
1071
1072 2007-04-12  Brady Eidson  <beidson@apple.com>
1073
1074         Reviewed by Black Sheep
1075
1076         <rdar://problem/4664154> and http://bugs.webkit.org/show_bug.cgi?id=3546
1077
1078         When you click on a link that opens in a new window from within gmail, they first create a new window 
1079         with an empty URL, then immediately document.write() into the window to schedule a redirect.
1080
1081         Since the initial page doesn't have a URL associated with it, a history item never gets created.  The 
1082         reasonable solution?  To actually create the history item after the redirect (in updateHistoryForInternalLoad)
1083
1084         * loader/FrameLoader.cpp:
1085         (WebCore::FrameLoader::addHistoryForCurrentLocation): Updates global and B/F history with a new history item
1086         (WebCore::FrameLoader::updateHistoryForStandardLoad): Call addHistoryForCurrentLocation
1087         (WebCore::FrameLoader::updateHistoryForInternalLoad): Call addHistoryForCurrentLocation if there is not already
1088           a current history item
1089         * loader/FrameLoader.h:
1090
1091 2007-04-12  Oliver Hunt  <oliver@apple.com>
1092
1093         Reviewed by Adam.
1094
1095         This fixes <rdar://problem/5060766> -- Frameset with 
1096         an empty frame crashes due to null document.  Debug
1097         builds hit the frame->document() assertion in 
1098         EventHandler::prepareMouseEvent
1099
1100         This null check seems necessary now, having run through 
1101         all the logic on the path to this crash it appears that
1102         we can't avoid this null check.  
1103
1104         * page/EventHandler.cpp:
1105         (WebCore::EventHandler::updateDragAndDrop):
1106
1107 2007-04-12  Justin Garcia  <justin.garcia@apple.com>
1108
1109         Reviewed by darin
1110         
1111         <rdar://problem/5131716> 
1112         Clicking just before a ToDo doesn't put the caret before the ToDo
1113         
1114         * rendering/RenderBlock.cpp:
1115         (WebCore::RenderBlock::positionForCoordinates):
1116         Consider clicks inside the blocks padding, instead of
1117         incorrectly sending them to the position before the block.
1118
1119 2007-04-12  John Sullivan  <sullivan@apple.com>
1120
1121         Reviewed by Anders
1122
1123         - WebCore part of fix for:
1124         <rdar://problem/5128697> REGRESSION: At least one PDF context menu item isn't appearing on Leopard
1125
1126         * platform/ContextMenuItem.h:
1127         (WebCore::):
1128         add two PDF-related context menu items to enum to keep it in sync with WebKit
1129
1130         * platform/ContextMenu.cpp:
1131         (WebCore::ContextMenu::checkOrEnableIfNeeded):
1132         add the new context menu items to the do-nothing case of a big switch statement
1133
1134 2007-04-12  Simon Hausmann  <hausmann@kde.org>
1135
1136         Reviewed by Zack.
1137
1138         Fixed drawing of justified text in the Qt port.
1139
1140         * platform/qt/FontQt.cpp:
1141         (Font::drawGlyphs):
1142
1143 2007-04-11  Oliver Hunt  <oliver@apple.com>
1144
1145         Reviewed by Maciej.
1146
1147         Adding RetainPtr to the many global obj-c pointers we use in
1148         C/C++ methods.  This is necessary to prevent GC from collecting
1149         globals we want to keep around.
1150
1151         We use RetainPtr in obj-c++ and c++ files, and CFRetain/Release in pure
1152         obj-c.
1153
1154         Also made the Pasteboard::m_pasteboard a RetainPtr although it
1155         shouldn't be necessary as the only NSPasteboard instances that 
1156         should ever be inserted are the system clipboard and dragging 
1157         pasteboard.  Neither of which should ever be collected.
1158
1159         * page/mac/WebCoreFrameBridge.mm:
1160         (_getPreSmartSet):
1161         (_getPostSmartSet):
1162         * platform/Pasteboard.h:
1163         * platform/graphics/mac/ColorMac.mm:
1164         (WebCore::nsColor):
1165         * platform/graphics/mac/GraphicsContextMac.mm:
1166         (WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar):
1167         * platform/mac/FontDataMac.mm:
1168         (WebCore::webFallbackFontFamily):
1169         * platform/mac/PasteboardMac.mm:
1170         (WebCore::writableTypesForURL):
1171         (WebCore::writableTypesForImage):
1172         (WebCore::Pasteboard::clear):
1173         (WebCore::Pasteboard::writeSelection):
1174         (WebCore::Pasteboard::writeURL):
1175         (WebCore::Pasteboard::writeFileWrapperAsRTFDAttachment):
1176         (WebCore::Pasteboard::writeImage):
1177         (WebCore::Pasteboard::canSmartReplace):
1178         (WebCore::Pasteboard::plainText):
1179         (WebCore::Pasteboard::documentFragment):
1180
1181 2007-04-11  Mitz Pettel  <mitz@webkit.org>
1182
1183         Reviewed by Dave Hyatt.
1184
1185         - fix http://bugs.webkit.org/show_bug.cgi?id=11362
1186           Native popup with size="1" wraps options
1187
1188         Test: fast/forms/menulist-option-wrap.html
1189
1190         * css/html4.css: Added white-space declaration for select[size="0"] and
1191         select[size="1"]. Added border-radius declaration for select.
1192
1193 2007-04-11  MorganL  <morganl.webkit@yahoo.com>
1194
1195         Reviewed by Maciej.
1196
1197         Add a Frame pointer to ChromeClient methods:
1198         http://bugs.webkit.org/show_bug.cgi?id=13127
1199
1200         * loader/FrameLoader.cpp:
1201         (WebCore::FrameLoader::createWindow):
1202         * page/Chrome.cpp:
1203         (WebCore::Chrome::createWindow):
1204         (WebCore::Chrome::createModalDialog):
1205         * page/Chrome.h:
1206         * page/ChromeClient.h:
1207         * page/ContextMenuController.cpp:
1208         (WebCore::openNewWindow):
1209         * platform/graphics/svg/SVGImageEmptyClients.h:
1210         (WebCore::SVGEmptyChromeClient::createWindow):
1211         (WebCore::SVGEmptyChromeClient::createModalDialog):
1212
1213 2007-04-11  Brady Eidson  <beidson@apple.com>
1214
1215         Reviewed by Ada
1216
1217         <rdar://problem/5080987> - Crash in DocumentLoader::frameLoader() const
1218
1219         This was free nil checking lost during the ObjC -> C++ conversion
1220
1221         * loader/FrameLoader.cpp:
1222         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Null check the DocumentLoader
1223
1224 2007-04-11  Justin Garcia  <justin.garcia@apple.com>
1225
1226         Reviewed by harrison
1227
1228         <rdar://problem/5126166> 
1229         Deleting selection starting at before ToDo checkbox to end of line, inserts a BR in the subsequent ToDo
1230         
1231         If a selection ends in a table cell, we shouldn't perform
1232         a merge after deleting that selection.  We have code in
1233         place to prevent those merges, but it failed here.
1234         
1235         It fails because the end of the selection was [tableCell, 0],
1236         (normally not a valid VisiblePosition, but valid here
1237         because the table cell is empty).  We prevent the merge
1238         if the node of the position at the end of the selection 
1239         has an enclosingTableCell.  Even though [tableCell, 0] has 
1240         an enclosing table cell, the node tableCell doesn't, so 
1241         the check fails.
1242         
1243         Fixed this by changing enclosingTableCell to take in
1244         a position, instead of a node.  The other enclosing element
1245         getters should be changed in this way as well.
1246
1247         * editing/DeleteSelectionCommand.cpp:
1248         (WebCore::DeleteSelectionCommand::initializePositionData):
1249         Call the new enclosingTableCell.
1250         * editing/ReplaceSelectionCommand.cpp:
1251         (WebCore::ReplaceSelectionCommand::shouldMerge): Ditto.
1252         * editing/htmlediting.cpp:
1253         (WebCore::enclosingTableCell): Take in a position instead
1254         of a node.
1255         * editing/htmlediting.h:
1256
1257 2007-04-12  Mark Rowe  <mrowe@apple.com>
1258
1259         Qt build fix.
1260
1261         * WebCore.pro:
1262         * editing/qt/EditorQt.cpp:
1263         (WebCore::Editor::markBadGrammar):
1264         * history/qt/CachedPageQt.cpp: Added.
1265         (WebCore::CachedPage::close):
1266         * history/qt/PageCacheQt.cpp: Removed.
1267
1268 2007-04-11  Brady Eidson  <beidson@apple.com>
1269
1270         Reviewed by Antti
1271
1272         <rdar://problem/5125648> and http://bugs.webkit.org/show_bug.cgi?id=13326
1273
1274         Crash opening a link in a new window from Gmail
1275
1276         Problem here is that the currentHistoryItem in the new window is null.  This *shouldn't* be the case, 
1277         and is the cause of a very long standing bug - 
1278         http://bugs.webkit.org/show_bug.cgi?id=3546 - Can't go back to first page in new window opened from gmail
1279
1280         For now, adding a null check prevents this crash and restores the original, long standing regression
1281  
1282         * loader/FrameLoader.cpp:
1283         (WebCore::FrameLoader::updateHistoryForInternalLoad): NULL check
1284
1285 2007-04-11  Adam Roben  <aroben@apple.com>
1286
1287         Reviewed by Anders.
1288
1289         Made image document copying more cross-platform.
1290
1291         All layout tests pass.
1292
1293         * editing/Editor.cpp:
1294         (WebCore::imageNodeFromImageDocument): Added.
1295         (WebCore::Editor::canCopy): Called imageNodeFromImageDocument.
1296         (WebCore::Editor::copy): Ditto.
1297         (WebCore::Editor::copyImage): Updated for changes to Pasteboard.
1298         * platform/Pasteboard.h: Made writeImage more general, which allowed
1299         getting rid of its second incarnation.
1300         * platform/gdk/TemporaryLinkStubs.cpp:
1301         * platform/mac/PasteboardMac.mm:
1302         (WebCore::Pasteboard::writeImage): Collapsed logic from the two
1303         writeImage methods into one.
1304         (Pasteboard::writeImage): Updated for Pasteboard changes.
1305         * platform/qt/PasteboardQt.cpp:
1306         (WebCore::Pasteboard::writeImage): Ditto.
1307
1308 2007-04-11  Darin Adler  <darin@apple.com>
1309
1310         * css/CSSValueKeywords.in: Fix a comment.
1311
1312 2007-04-09  Justin Garcia  <justin.garcia@apple.com>
1313
1314         Reviewed by harrison
1315         
1316         <rdar://problem/4932260> 
1317         Invalid attributed string for attachment range obtained via AXPreviousWordStartTextMarkerForTextMarker
1318         
1319         By default, text iterators don't emit anything for replaced 
1320         elements.  Boundary finding code works around this but has 
1321         bugs: replaced elements act as sentence boundaries and the 
1322         above bug, where previousBoundary moves past the start of a 
1323         word if there is a replaced element just before it. This 
1324         patch fixes these issues by treating replaced elements as 
1325         punctuation for boundary finding.
1326
1327         * editing/TextIterator.cpp:
1328         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1329         Set m_pastStartNode, the node after (in a reverse pre-order traversal) the 
1330         last one that should be processed.
1331         (WebCore::SimplifiedBackwardsTextIterator::advance):
1332         Stop at m_pastStartNode.
1333         Iterate over nodes in reverse pre-order (TextIterator traverses in 
1334         pre-orer). This makes knowing when to emit characters after nodes vs. when
1335         to emit characters before nodes easier.
1336         Remove the special case for entering a new block, emitting characters 
1337         after nodes can now be handled generally, in handleNonTextNode(), because
1338         of the way we traverse.
1339         Set m_handledChildren to false every iteration since we now do traverse in 
1340         reverse pre-order.
1341         (WebCore::SimplifiedBackwardsTextIterator::handleReplacedElement):
1342         Emit a comma for replaced elements.  We only use this kind of iterator 
1343         for finding boundaries, so we can do this unconditionally.
1344         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode):
1345         Don't use emitNewline, instead specify where the newline should be positioned.
1346         A node is handled before its children, so characters emitted here should 
1347         be positioned after the node, not before it.
1348         (WebCore::SimplifiedBackwardsTextIterator::exitNode): 
1349         Don't use emitNewline, instead specify where the newline should be positioned.
1350         (WebCore::CharacterIterator::CharacterIterator): 
1351         Create a TextIterator that emits content for replaced elements, if requested.
1352         * editing/TextIterator.h:
1353         * editing/visible_units.cpp:
1354         (WebCore::previousBoundary): 
1355         Removed replaced element handling code.
1356         If the start of the chunk that contained the boundary was in a non-text
1357         node, then the boundary is not necessarily in that node.  Particularly
1358         because it is only the end of the chunk that is guaranteed to be a valid
1359         position in those cases.  We must iterate backwards by character from 
1360         the end of the chunk to find the boundary.
1361         (WebCore::nextBoundary): Removed replaced element handling code.
1362
1363 2007-04-10  Brady Eidson  <beidson@apple.com>
1364
1365         Reviewed by Darin
1366
1367         <rdar://problem/4887095> - PageCache and PageState should be combined
1368
1369         These two objects are a relic of when the PageCache was split between WebCore and WebKit
1370         It just makes good sense to combine them now, and the new object is more appropriately
1371         called "CachedPage"
1372
1373         This patch is vast in scope, but simple in depth - anywhere a PageCache or PageState object 
1374         was used has been adjusted to use a CachedPage object instead.  The most notable change is
1375         that HistoryItem - which always used to have a PageCache object which may or may not have 
1376         had a PageState - now may or may not have a CachedPage.  This actually simplifies the 
1377         HistoryItem code a bit while making the role of CachedPage much more clear.
1378
1379         * WebCore.exp:
1380         * WebCore.xcodeproj/project.pbxproj:
1381
1382         * history/BackForwardList.cpp:
1383         (WebCore::BackForwardList::addItem):
1384         (WebCore::BackForwardList::setCapacity):
1385         (WebCore::BackForwardList::setPageCacheSize):
1386         (WebCore::BackForwardList::clearPageCache):
1387         (WebCore::BackForwardList::close):
1388
1389         * history/PageCache.cpp: Removed.
1390         * history/PageCache.h: Removed.
1391         * page/PageState.cpp: Removed.
1392         * page/PageState.h: Removed.
1393         * history/CachedPage.cpp: Added.
1394         (WebCore::CachedPage::create):
1395         (WebCore::CachedPage::CachedPage):
1396         (WebCore::CachedPage::~CachedPage):
1397         (WebCore::CachedPage::restore):
1398         (WebCore::CachedPage::clear):
1399         (WebCore::CachedPage::setDocumentLoader):
1400         (WebCore::CachedPage::documentLoader):
1401         (WebCore::CachedPage::setTimeStamp):
1402         (WebCore::CachedPage::setTimeStampToNow):
1403         (WebCore::CachedPage::timeStamp):
1404         * history/CachedPage.h: Added.
1405         (WebCore::CachedPage::document):
1406         (WebCore::CachedPage::mousePressNode):
1407         (WebCore::CachedPage::URL):
1408
1409         * history/HistoryItem.cpp:
1410         (WebCore::HistoryItem::HistoryItem):
1411         (WebCore::HistoryItem::setCachedPage):
1412         (WebCore::HistoryItem::setURL):
1413         (WebCore::HistoryItem::alwaysAttemptToUseCachedPage):
1414         (WebCore::HistoryItem::setAlwaysAttemptToUseCachedPage):
1415         (WebCore::HistoryItem::cachedPage):
1416         (WebCore::cachedPagesPendingRelease):
1417         (WebCore::HistoryItem::releaseCachedPagesOrReschedule):
1418         (WebCore::HistoryItem::releaseAllPendingCachedPages):
1419         (WebCore::HistoryItem::scheduleCachedPageForRelease):
1420         * history/HistoryItem.h:
1421         * history/mac/HistoryItemMac.mm:
1422
1423         * history/HistoryItemTimer.cpp:
1424         (WebCore::HistoryItemTimer::HistoryItemTimer):
1425         (WebCore::HistoryItemTimer::callReleaseCachedPagesOrReschedule):
1426         * history/HistoryItemTimer.h:
1427
1428         * history/mac/PageCacheMac.mm: Removed.
1429         * history/mac/CachedPageMac.mm: Added.
1430         (WebCore::CachedPage::close):
1431         (WebCore::CachedPage::setDocumentView):
1432         (WebCore::CachedPage::documentView):
1433
1434         * loader/DocumentLoader.cpp:
1435         (WebCore::DocumentLoader::DocumentLoader):
1436         (WebCore::DocumentLoader::loadFromCachedPage):
1437         (WebCore::DocumentLoader::setLoadingFromCachedPage):
1438         (WebCore::DocumentLoader::isLoadingFromCachedPage):
1439         * loader/DocumentLoader.h:
1440
1441         * loader/FrameLoader.cpp:
1442         (WebCore::FrameLoader::provisionalLoadStarted):
1443         (WebCore::FrameLoader::commitProvisionalLoad):
1444         (WebCore::FrameLoader::transitionToCommitted):
1445         (WebCore::FrameLoader::open):
1446         (WebCore::FrameLoader::startLoading):
1447         (WebCore::FrameLoader::receivedMainResourceError):
1448         (WebCore::FrameLoader::opened):
1449         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1450         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
1451         (WebCore::FrameLoader::cachePageToHistoryItem):
1452         (WebCore::FrameLoader::createHistoryItem):
1453         (WebCore::FrameLoader::purgePageCache):
1454         (WebCore::FrameLoader::invalidateCurrentItemCachedPage):
1455         (WebCore::FrameLoader::loadItem):
1456         (WebCore::FrameLoader::updateHistoryForStandardLoad):
1457         (WebCore::FrameLoader::updateHistoryForClientRedirect):
1458         (WebCore::FrameLoader::updateHistoryForBackForwardNavigation):
1459         (WebCore::FrameLoader::updateHistoryForReload):
1460         (WebCore::FrameLoader::updateHistoryForInternalLoad):
1461         (WebCore::FrameLoader::updateHistoryForCommit):
1462         * loader/FrameLoader.h:
1463         * loader/FrameLoaderClient.h:
1464
1465         * page/mac/WebCoreFrameBridge.h: Got rid of unused WebCorePageCacheStateKey
1466         * page/mac/WebCoreFrameBridge.mm: Ditto
1467
1468         * platform/graphics/svg/SVGImage.cpp:
1469         * platform/graphics/svg/SVGImageEmptyClients.h: Update to reflect the new names
1470         (WebCore::SVGEmptyFrameLoaderClient::loadProvisionalItemFromCachedPage):
1471         (WebCore::SVGEmptyFrameLoaderClient::invalidateCurrentItemCachedPage):
1472         (WebCore::SVGEmptyFrameLoaderClient::loadedFromCachedPage):
1473         (WebCore::SVGEmptyFrameLoaderClient::clearLoadingFromCachedPage):
1474         (WebCore::SVGEmptyFrameLoaderClient::isLoadingFromCachedPage):
1475         (WebCore::SVGEmptyFrameLoaderClient::setDocumentViewFromCachedPage):
1476         (WebCore::SVGEmptyFrameLoaderClient::saveDocumentViewToCachedPage):
1477
1478 2007-04-10  Antti Koivisto  <antti@apple.com>
1479
1480         Reviewed by Hyatt.
1481
1482         Fix <rdar://5057686> 
1483         Flex box layout example hangs in WebCore::RenderFlexibleBox::allowedChildFlex
1484         
1485         Forcibly distribute remaining pixels if the algorithm is not advancing.
1486
1487         * rendering/RenderFlexibleBox.cpp:
1488         (WebCore::RenderFlexibleBox::layoutHorizontalBox):
1489         (WebCore::RenderFlexibleBox::layoutVerticalBox):
1490
1491 2007-04-11  Mark Rowe  <mrowe@apple.com>
1492
1493         Build fix.
1494
1495         * bridge/mac/WebCoreAXObject.mm:
1496         (-[WebCoreAXObject accessibilityDescription]):
1497
1498 2007-04-10  Patti Hoa <patti@apple.com>
1499
1500         Reviewed by Justin Garcia.
1501
1502         <rdar://problem/5122276> Allow focused frame to fire off notification
1503         Improve accessibility support for Mail WebView embedded Notes.
1504
1505         * bridge/mac/AXObjectCacheMac.mm:
1506         (WebCore::AXObjectCache::postNotification):
1507         The focused document with the selection change should fire the selection changed notification, not the top level document
1508         * bridge/mac/WebCoreAXObject.mm:
1509         (-[WebCoreAXObject accessibilityDescription]):
1510         Allow the name attribute of the html body to be used as the accessibility description
1511
1512 2007-04-09  Geoffrey Garen  <ggaren@apple.com>
1513
1514         Reviewed by Maciej Stachowiak.
1515         
1516         Support for fixing fast/forms/textarea-paste-newline.html.
1517         
1518         Changed clients to use new preference specifying whether a Page should 
1519         allow pasting through the DOM API, instead of a global flag.
1520
1521         Removed old behavior of always allowing DOM paste in debug builds. In 
1522         light of the new preference-based API, that behavior makes no sense anymore. 
1523         Instead, developers who want to test paste inside Safari can set the 
1524         preference for themselves.
1525
1526         * WebCore.exp:
1527         * editing/CommandByName.cpp: Removed crazy hack to keep an identically 
1528         named but invalid copy of the global "pate allowed" flag in this file.
1529         (WebCore::Frame::enabledPaste):
1530         * editing/JSEditor.cpp: Removed "always allow" behavior for debug builds.
1531         (WebCore::JSEditor::queryCommandSupported):
1532         * editing/JSEditor.h:
1533         * page/Settings.cpp:
1534         (WebCore::Settings::setDOMPasteAllowed):
1535         * page/Settings.h:
1536         (WebCore::Settings::isDOMPasteAllowed):
1537         * rendering/RenderTreeAsText.cpp:
1538         (WebCore::externalRepresentation): Removed crazy hack to allow DOM paste
1539         after this function has been called.
1540
1541 2007-04-10  John Sullivan  <sullivan@apple.com>
1542
1543         Reviewed by Tim Hatcher
1544
1545         - fixed <rdar://problem/4859132> Grammar must always be checked in entire-sentence chunks, 
1546           and shouldn't show markers for current sentence
1547
1548         * editing/Editor.h:
1549         add markBadGrammar, now distinct from markMisspellings
1550
1551         * editing/mac/EditorMac.mm:
1552         (WebCore::Editor::markMisspellingsAfterTypingToPosition):
1553         call markMisspellings on one word, and markBadGrammar on entire sentence
1554         (WebCore::markMisspellingsOrBadGrammar):
1555         new static function, extracted from markMisspellings
1556         (WebCore::Editor::markMisspellings):
1557         now calls extracted function
1558         (WebCore::Editor::markBadGrammar):
1559         new method, calls extracted function
1560
1561         * page/Frame.cpp:
1562         (WebCore::Frame::respondToChangedSelection):
1563         update grammar markers for entire new and old sentences
1564
1565 2007-04-09  Anders Carlsson  <andersca@apple.com>
1566
1567         Reviewed by John.
1568
1569         * WebCore.exp:
1570         Add __ZNK7WebCore11FrameLoader10isCompleteEv.
1571         
1572 2007-04-09  Brady Eidson  <beidson@apple.com>
1573
1574         Reviewed by Darin
1575
1576         Fixes <rdar://4921797> and http://bugs.webkit.org/show_bug.cgi?id=12005
1577
1578         The original regression was to claim that more loads were the result of a "user gesture" than really
1579         were.  A lot of the ways a frame load could be kicked off didn't properly set up this flag, and it 
1580         wasn't properly propagated and respected where it should've been.
1581
1582         This patch cleans much of that up.  One loose end is the "treatAsUserGesture" flag which is a stop
1583         gap measure to keep "slow redirects" working to create a new history item.  In the future, we need
1584         to cleanup the meaning and use of "userGesture" and "lockHistory."  This includes integrating them 
1585         in to FrameLoadRequest and being very clear of what their meaning actually is at different stages of
1586         the Frame load process.
1587
1588         * dom/Document.cpp:
1589         (WebCore::Document::processHttpEquiv): Pass only the delay for the redirect
1590
1591         * html/HTMLAnchorElement.cpp:
1592         (WebCore::HTMLAnchorElement::defaultEventHandler): Pass "lockHistory" false, "userGesture" true
1593
1594         * ksvg2/svg/SVGAElement.cpp:
1595         (WebCore::SVGAElement::defaultEventHandler): Pass "lockHistory" false, "userGesture" true
1596
1597         * loader/FrameLoader.cpp:
1598         (WebCore::ScheduledRedirection::ScheduledRedirection): Figure "lockHistory" and "userGesture" from the 
1599           delay here, instead of at 3 other different sites that call this method
1600         (WebCore::FrameLoader::changeLocation): Set userGesture correctly
1601         (WebCore::FrameLoader::urlSelected): Propagate userGesture down
1602         (WebCore::FrameLoader::requestFrame): 
1603         (WebCore::FrameLoader::receivedFirstData):
1604         (WebCore::FrameLoader::scheduleRedirection): Pass only the delay here
1605         (WebCore::FrameLoader::redirectionTimerFired): Set userGesture correctly
1606         (WebCore::FrameLoader::load):
1607         (WebCore::FrameLoader::updateHistoryForInternalLoad): Insteading of asserting we aren't a redirect,
1608           handle the case where we *are* a redirect by updating the previous history item
1609         * loader/FrameLoader.h:
1610
1611 2007-04-09  Anders Carlsson  <andersca@apple.com>
1612
1613         Reviewed by Darin.
1614
1615         <rdar://problem/5120801> 
1616         http://bugs.webkit.org/show_bug.cgi?id=13247
1617         Closing a page during slow cloning causes crash in setJSStatusBarText (13247)
1618
1619         * bindings/js/kjs_window.cpp:
1620         (KJS::Window::put):
1621         Return early if m_frame is null. A closed window only has one property, "closed" 
1622         so no properties should be settable in that case.
1623
1624 2007-04-09  Andrew Wellington  <proton@wiretapped.net>
1625
1626         Reviewed by Justin Garcia.
1627         
1628         Fix for http://bugs.webkit.org/show_bug.cgi?id=12959
1629         "REGRESSION: Edit -> Copy not enabled on standalone images"
1630
1631         * dom/Document.h: Add support for determining if a document is an image
1632         (WebCore::Document::isImageDocument):
1633         * editing/Editor.cpp:
1634         (WebCore::Editor::canCopy): Image documents are copyable
1635         (WebCore::Editor::copy): If copying an image document, call appropriate pasteboard methods
1636         * loader/ImageDocument.h:
1637         (WebCore::ImageDocument::isImageDocument): Override to return true for image documents
1638         * platform/Pasteboard.h: Add new writeImage function to pasteboard
1639         * platform/mac/PasteboardMac.mm:
1640         (WebCore::Pasteboard::writeImage): Add writeImage implementation that takes Node and URL
1641         * platform/qt/PasteboardQt.cpp:
1642         (WebCore::Pasteboard::writeImage): Stub for Qt implementation of pasteboard
1643
1644 2007-04-08  Oliver Hunt  <oliver@apple.com>
1645
1646         rs=Adam.
1647
1648         Add ASSERT(selectedRange) to previous change
1649
1650         * platform/mac/PasteboardMac.mm:
1651         (WebCore::Pasteboard::writeSelection):
1652
1653 2007-04-08  Oliver Hunt  <oliver@apple.com>
1654
1655         rs=Adam.
1656
1657         Fix minor error when writing selection to pasteboard.
1658         This shouldn't have an effect as selectedRange should be the
1659         selected range from source frame, however this is safer.
1660
1661         * platform/mac/PasteboardMac.mm:
1662         (WebCore::Pasteboard::writeSelection):
1663
1664 2007-04-08  David Hyatt  <hyatt@apple.com>
1665
1666         Fix mouseover/out failing layout tests.
1667
1668         Reviewed by aroben
1669
1670         * page/EventHandler.cpp:
1671         (WebCore::EventHandler::handleMouseMoveEvent):
1672         (WebCore::EventHandler::updateMouseEventTargetNode):
1673         (WebCore::EventHandler::dispatchMouseEvent):
1674         * page/EventHandler.h:
1675
1676 2007-04-08  Oliver Hunt  <oliver@apple.com>
1677
1678         Reviewed by Adam.
1679
1680         Fix for <rdar://problem/5113621> REGRESSION: Dragging PDF as image does not give any feedback
1681
1682         If we fail when attempting to create a drag image for a dragged
1683         image, we fall back to the appropriate icon.
1684
1685         * page/DragController.cpp:
1686         (WebCore::DragController::doImageDrag):
1687
1688 2007-04-08  Adam Roben  <aroben@apple.com>
1689
1690         Reviewed by Oliver.
1691
1692         Bestowed the gift of -webkit-dashboard-region upon all platforms, since
1693         there's nothing Mac-specific about it other than the name. This also
1694         allowed me to get rid of FrameViewMac.mm.
1695
1696         Removed a lot of #if PLATFORM(MAC):
1697
1698         * css/CSSComputedStyleDeclaration.cpp:
1699         (WebCore::):
1700         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1701         * css/CSSPrimitiveValue.cpp:
1702         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1703         (WebCore::CSSPrimitiveValue::cleanup):
1704         (WebCore::CSSPrimitiveValue::cssText):
1705         * css/CSSPrimitiveValue.h:
1706         (WebCore::CSSPrimitiveValue::getDashboardRegionValue):
1707         (WebCore::CSSPrimitiveValue::):
1708         * css/cssparser.cpp:
1709         (WebCore::CSSParser::parseValue):
1710         (WebCore::CSSParser::parseDashboardRegions):
1711         * css/cssparser.h:
1712         * css/cssstyleselector.cpp:
1713         (WebCore::CSSStyleSelector::applyProperty):
1714         * dom/Document.cpp:
1715         (WebCore::Document::Document):
1716         * dom/Document.h:
1717         * page/Frame.cpp:
1718         (WebCore::Frame::paint):
1719         * page/Frame.h:
1720         * page/FrameView.cpp:
1721         (WebCore::FrameView::layout):
1722         (WebCore::FrameView::updateDashboardRegions): Moved from FrameViewMac.mm.
1723         * page/FrameView.h:
1724         * page/qt/FrameQt.cpp:
1725         (WebCore::Frame::dashboardRegionsChanged): Stubbed out.
1726         * platform/gdk/FrameGdk.cpp:
1727         (WebCore::Frame::dashboardRegionsChanged): Ditto.
1728         * rendering/RenderLayer.cpp:
1729         (WebCore::RenderLayer::scrollToOffset):
1730         (WebCore::RenderLayer::setHasHorizontalScrollbar):
1731         (WebCore::RenderLayer::setHasVerticalScrollbar):
1732         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
1733         * rendering/RenderObject.cpp:
1734         (WebCore::RenderObject::setStyle):
1735
1736         * WebCore.xcodeproj/project.pbxproj: Removed FrameViewMac.mm.
1737         * bridge/mac/FrameViewMac.mm: Removed.
1738
1739 2007-04-08  Mark Rowe  <mrowe@apple.com>
1740
1741         Qt build fix.
1742
1743         * platform/qt/TemporaryLinkStubs.cpp:
1744
1745 2007-04-06  Geoffrey Garen  <ggaren@apple.com>
1746
1747         Reviewed by Beth Dakin.
1748         
1749         Fixed one more case of <rdar://problem/5112273> REGRESSION(TOT): 
1750         Reproducible crash loading an old version of amazon.com as a web archive
1751
1752         * bindings/js/JSXMLHttpRequest.cpp:
1753         (KJS::JSXMLHttpRequestPrototypeFunction::callAsFunction):
1754
1755 2007-04-06  Oliver Hunt  <oliver@apple.com>
1756
1757         Reviewed by Adam.
1758
1759         Fix MouseEvent so it's possible to distinguish between
1760         a MouseMouseEvent with NoButton down, and a move with
1761         LeftButton down.  It would be nice if the DOM allowed 
1762         for NoButton to exist, but it doesn't so this is necessary.
1763
1764         * dom/EventTargetNode.cpp:
1765         (WebCore::EventTargetNode::dispatchMouseEvent):
1766         * dom/MouseEvent.cpp:
1767         (WebCore::MouseEvent::MouseEvent):
1768         (WebCore::MouseEvent::initMouseEvent):
1769         * dom/MouseEvent.h:
1770         (WebCore::MouseEvent::noButton):
1771
1772 2007-04-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1773
1774         Not reviewed - gdk build fix.
1775
1776         * platform/gdk/MouseEventGdk.cpp:
1777
1778 2007-04-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1779
1780         Reviewed by darin.
1781
1782         Coverity fix. Coverity says:
1783         "Event var_deref_op: Variable "info_ptr" tracked as NULL was dereferenced."
1784
1785         * platform/image-decoders/png/pngrutil.c:
1786         (png_handle_gAMA):
1787
1788 2007-04-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1789
1790         Reviewed by darin.
1791
1792         Coverity fix. Coverity says:
1793         "Event var_deref_model: Variable "(this)->clientptr" tracked as NULL was passed to a function that dereferences it."
1794
1795         * platform/image-decoders/gif/GIFImageReader.cpp:
1796         (GIFImageReader::read):
1797
1798 2007-04-06  David Hyatt  <hyatt@apple.com>
1799
1800         Fix more of the layout test failures caused by fixing the slider layout test failure (sigh).  clear()
1801         needs to null out the capturingMouseEventsNode in the case where a mousedown or move while captured
1802         causes a navigation to another page.
1803
1804         * page/EventHandler.cpp:
1805         (WebCore::EventHandler::clear):
1806         (WebCore::EventHandler::handleMouseReleaseEvent):
1807
1808 2007-04-06  David Hyatt  <hyatt@apple.com>
1809
1810         Fix failing slider layout test.  Don't clear the subframe capture unless we really were capturing on a
1811         subframe.
1812
1813         Reviewed by adele, darin
1814
1815         * page/EventHandler.cpp:
1816         (WebCore::EventHandler::handleMouseReleaseEvent):
1817
1818 2007-04-06  Beth Dakin  <bdakin@apple.com>
1819
1820         Reviewed by Geoff and Darin.
1821
1822         Fix for <rdar://problem/4875433> WebView underlines are too thick 
1823         when scaled small
1824
1825         When we have a small scale factor, we should follow the line-
1826         drawing code as if we were printing. Meaning, specifically, that we 
1827         should not round to device pixels and we should antialias.
1828
1829         * platform/graphics/cg/GraphicsContextCG.cpp:
1830         (WebCore::GraphicsContext::drawLineForText):
1831
1832 2007-04-06  Geoffrey Garen  <ggaren@apple.com>
1833
1834         Reviewed by Beth Dakin.
1835         
1836         Fixed <rdar://problem/5112273> REGRESSION(TOT): Reproducible crash loading 
1837         an old version of amazon.com as a web archive
1838         
1839         The problem was JavaScript executing inside a frame with a NULL document.
1840         It's probably a bug that the document was NULL, but we don't want a minor
1841         bug to be a crasher, and we don't want the DOM to depend on the implementation
1842         details of the JS bindings, so I added NULL checks.
1843
1844         * bindings/js/kjs_window.cpp: Call FrameLoader::completeURL instead of
1845         Document::completeURL, since FrameLoader::completeURL is safe against a
1846         NULL document.
1847         (KJS::Window::put):
1848         (KJS::WindowFunc::callAsFunction):
1849         (KJS::Location::put):
1850         (KJS::LocationFunc::callAsFunction):
1851
1852 2007-04-06  David Hyatt  <hyatt@apple.com>
1853
1854         Fix for bug 13274.  Rework mouse events so that subframe capturing works again.  Make sure
1855         everything just comes down through the top FrameView even when capturing is in effect.  Update
1856         scrollbar handling logic so that scrollbars receive events correctly while capturing is in
1857         effect.  Eliminate the notion of widget capture.  Fix mouse moves so that they only fire
1858         on the innermost hit frame.
1859
1860         Reviewed by olliej
1861
1862         * page/EventHandler.cpp:
1863         (WebCore::EventHandler::handleMouseDraggedEvent):
1864         (WebCore::subframeForTargetNode):
1865         (WebCore::EventHandler::handleMousePressEvent):
1866         (WebCore::EventHandler::handleMouseMoveEvent):
1867         (WebCore::EventHandler::handleMouseReleaseEvent):
1868         * page/EventHandler.h:
1869         * platform/PopupMenu.h:
1870         (WebCore::PopupMenu::scrollbarCapturingMouse):
1871         (WebCore::PopupMenu::setScrollbarCapturingMouse):
1872         * platform/ScrollBar.h:
1873         (WebCore::Scrollbar::handleMouseReleaseEvent):
1874         * platform/Widget.h:
1875         (WebCore::Widget::geometryChanged):
1876
1877 2007-04-06  Justin Garcia  <justin.garcia@apple.com>
1878
1879         Reviewed by john
1880
1881         <rdar://problem/5115601> 
1882         REGRESSION: Crash deleting a selection that starts in an editable table cell
1883         
1884         The selection starts at the start of an editable 
1885         root that's embedded in a non-editable ToDo (table).  
1886         Removing the selection removes all editable 
1887         VisiblePositions from the root.  Then, the creation 
1888         of mergeDestination fails, and using it causes a crash.
1889
1890         * editing/DeleteSelectionCommand.cpp:
1891         (WebCore::DeleteSelectionCommand::mergeParagraphs):
1892         Nil-check mergeDestination to avoid crashing and
1893         also insert a break in that case at m_upstreamStart, 
1894         so that we can create a valid mergeDestination and
1895         perform the merge.
1896         
1897         
1898 2007-04-06  Mitz Pettel  <mitz@webkit.org>
1899
1900         Reviewed by Oliver.
1901
1902         Eliminate PlatformMouseEvent::currentEvent.
1903
1904         No test possible (no change to functionality).
1905
1906         * page/EventHandler.cpp:
1907         (WebCore::EventHandler::handleDrag):
1908         * platform/PlatformMouseEvent.h:
1909         * platform/gdk/TemporaryLinkStubs.cpp:
1910         * platform/mac/PlatformMouseEventMac.mm:
1911         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1912         * platform/qt/PlatformMouseEventQt.cpp:
1913         * platform/win/TemporaryLinkStubs.cpp:
1914
1915 2007-04-05  Oliver Hunt  <oliver@apple.com>
1916
1917         Reviewed by Maciej.
1918
1919         Fix for rdar://problem/4849948 -- JSCanvasRenderingContext2D::drawImage
1920         crashes when given invalid arguments.
1921
1922         JSCanvasRenderingContext2D frequently casts from JSValue* to JSObject*
1923         and then checks isObject *after* the cast.  JSObject::isObject is unsafe 
1924         if applied to a JSImmediate value (null, undefined, etc).  This patch 
1925         corrects the logic in a number of places by performing the isObject check
1926         before casting to JSObject.
1927
1928         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
1929         (WebCore::JSCanvasRenderingContext2D::drawImage):
1930         (WebCore::JSCanvasRenderingContext2D::drawImageFromRect):
1931         (WebCore::JSCanvasRenderingContext2D::createPattern):
1932
1933 2007-04-05  Adele Peterson  <adele@apple.com>
1934
1935         Reviewed by Oliver.
1936
1937         Fix for <rdar://problem/4965597> REGRESSION: mouseup doesn't fire for slider (causes it to always default to max)
1938
1939         Test: fast/forms/slider-mouse-events.html
1940
1941         * page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent):
1942         Since the actual target node of the event can't be a shadow node, set the target node to the capturing node before adjusting it.
1943
1944 2007-04-05  Kevin McCullough  <kmccullough@apple.com>
1945
1946         Reviewed by Darin.
1947
1948         - Added reportLocalLoadFailed to FrameLoader to send an error to the console when
1949         calls to canLoad fail. 
1950
1951         * loader/Cache.cpp:
1952         (WebCore::Cache::requestResource):
1953         * loader/FrameLoader.cpp:
1954         (WebCore::FrameLoader::loadSubframe):
1955         (WebCore::FrameLoader::loadPlugin):
1956         (WebCore::FrameLoader::load):
1957         (WebCore::FrameLoader::reportLocalLoadFailed):
1958         * loader/FrameLoader.h:
1959         * loader/SubresourceLoader.cpp:
1960         (WebCore::SubresourceLoader::create):
1961
1962 2007-04-05  Adele Peterson  <adele@apple.com>
1963
1964         Reviewed by Maciej.
1965
1966         Add text-align: -webkit-auto for form controls.  Buttons already override this property to center their text.
1967
1968         * css/html4.css:
1969
1970 2007-04-05  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1971
1972         Reviewed by rwlbuis.
1973
1974         Coverity fix. Coverity says:
1975         "Event var_deref_model: Variable "page" tracked as NULL was passed to a function that dereferences it."
1976
1977         * platform/Font.cpp:
1978         (WebCore::Font::glyphDataForCharacter):
1979
1980 2007-04-05  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1981
1982         Reviewed by darin.
1983
1984         Coverity fix. Coverity says:
1985         "Event var_deref_model: Variable "unicode" tracked as NULL was passed to a 
1986         function that dereferences it."
1987
1988         * platform/DeprecatedString.cpp:
1989         (WebCore::DeprecatedString::DeprecatedString):
1990
1991 2007-04-05  Adele Peterson  <adele@apple.com>
1992
1993         Reviewed by Hyatt.
1994
1995         Fix for <rdar://problem/5113593> REGRESSION: Search fields in RSS pages don't show ibeam cursor
1996
1997         * css/html4.css: Set the cursor values explicitly for input, textarea (to auto), & select (to default).
1998
1999 2007-04-05  David Hyatt  <hyatt@apple.com>
2000
2001         Fix for <rdar://problem/5078866> tables should only reset text-align
2002         in quirks mode.
2003
2004         Reviewed by beth
2005
2006         * css/html4.css:
2007         * css/quirks.css:
2008
2009 2007-04-05  Adele Peterson  <adele@apple.com>
2010
2011         Fixing typo that's crashing.
2012
2013         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
2014           Use evt instead of null variable k.
2015
2016 2007-04-05  Adele Peterson  <adele@apple.com>
2017
2018         Reviewed by Hyatt.
2019
2020         Fix for <rdar://problem/5021500> Cursor should stay as pointer when slider is being dragged
2021
2022         Don't set the selection ibeam cursor when there's a node that's capturing mouse events.
2023
2024         * page/EventHandler.cpp:
2025         (WebCore::selectCursor):
2026         (WebCore::EventHandler::handleMouseMoveEvent):
2027
2028 2007-04-05  Geoffrey Garen  <ggaren@apple.com>
2029
2030         Reviewed by Beth Dakin.
2031
2032         More clean-up while fixing <rdar://problem/5112273> REGRESSION(TOT): 
2033         Reproducible crash loading an old version of amazon.com as a web archive
2034         
2035         Layout tests pass.
2036         
2037         Removed more superfluous document NULL checks. (Node::document() never 
2038         returns NULL, and it asserts as much.)
2039         
2040         Merged some duplicate editing code into a static inline function.
2041         
2042         * page/mac/WebCoreFrameBridge.mm:
2043         (updateRenderingForBindings): Removed superfluous static_cast.
2044
2045 2007-04-05  Adele Peterson  <adele@apple.com>
2046
2047         Reviewed by Darin.
2048
2049         A little cleanup from my last checkin.  Always check if an Event is really a MouseEvent or a KeyboardEvent
2050         before casting it.
2051
2052         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
2053         * html/HTMLSelectElement.cpp:
2054         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
2055         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
2056         * html/HTMLTextFieldInnerElement.cpp:
2057         (WebCore::HTMLSearchFieldResultsButtonElement::defaultEventHandler):
2058         (WebCore::HTMLSearchFieldCancelButtonElement::defaultEventHandler):
2059         * ksvg2/svg/SVGAElement.cpp: (WebCore::SVGAElement::defaultEventHandler):
2060         * page/ContextMenuController.cpp: (WebCore::ContextMenuController::handleContextMenuEvent):
2061         * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::userResize):
2062         * rendering/RenderSlider.cpp: (WebCore::HTMLSliderThumbElement::defaultEventHandler):
2063
2064 2007-04-05  Geoffrey Garen  <ggaren@apple.com>
2065
2066         Reviewed by Beth Dakin.
2067         
2068         Some clean-up while fixing <rdar://problem/5112273> REGRESSION(TOT): 
2069         Reproducible crash loading an old version of amazon.com as a web archive
2070         
2071         Removed superfluous document NULL checks. (Node::document() never returns
2072         NULL, and it asserts as much.)
2073         
2074         Removed duplicate implementation of displayString.
2075         
2076         Layout tests pass.
2077
2078         * bindings/objc/DOMInternal.h:
2079         * bindings/objc/DOMInternal.mm:
2080         * html/HTMLGenericFormElement.cpp:
2081         (WebCore::HTMLGenericFormElement::supportsFocus):
2082         * html/HTMLPlugInElement.cpp:
2083         (WebCore::HTMLPlugInElement::createNPObject):
2084         * platform/ContextMenu.cpp:
2085         (WebCore::ContextMenu::checkOrEnableIfNeeded):
2086         * rendering/HitTestResult.cpp:
2087         (WebCore::displayString):
2088         * rendering/HitTestResult.h:
2089         * rendering/RenderLayer.cpp:
2090         (WebCore::RenderLayer::updateHoverActiveState):
2091
2092 === Safari-5522.6 ===
2093
2094 2007-04-05  Oliver Hunt  <oliver@apple.com>
2095
2096         Reviewed by Adam.
2097
2098         Fix rdar://problem/5030934 -- landscape PDFs embedded as an image are cut off
2099         also fixes scaling of pdf images
2100
2101         PDFDocumentImage was not accounting for page rotation in a number of places
2102
2103         * platform/graphics/cg/PDFDocumentImage.cpp:
2104         (WebCore::PDFDocumentImage::size):
2105           we need to account for rotation of the pdf image effecting our bounds
2106         (WebCore::PDFDocumentImage::draw):
2107           When compensating for flipped coords we need to use the correct rect for the 
2108           coordinate space.  We can't pass size() to CGContextDrawPDFDocument as it
2109           returns the rotated bounds now -- this is also save the old 
2110           FloatSize -> IntSize -> FloatSize conversions.
2111           
2112 2007-04-04  Alexey Proskuryakov  <ap@webkit.org>
2113
2114         Reviewed by Darin.
2115
2116         http://bugs.webkit.org/show_bug.cgi?id=13278
2117         REGRESSION: cannot change SELECT option
2118
2119         Test: fast/forms/option-change-single-selected.html
2120
2121         * html/HTMLSelectElement.cpp:
2122         (WebCore::HTMLSelectElement::setSelectedIndex): If multiple selection is not allowed, 
2123         be sure to deselect the previous option.
2124
2125 2007-04-04  Adele Peterson  <adele@apple.com>
2126
2127         Reviewed by Oliver.
2128
2129         Fix for <rdar://5105009> Prepare for fix to send mousedown and mouseup (but not click) events when right-clicking
2130
2131         * page/EventHandler.cpp: Don't ever send click events for right-clicks.
2132         (WebCore::EventHandler::handleMouseDoubleClickEvent):
2133         (WebCore::EventHandler::handleMouseReleaseEvent):
2134         
2135         Check that the mousedown and mouseup are not with the right button before performing default behavior.
2136         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
2137         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
2138         * html/HTMLSelectElement.cpp:
2139         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
2140         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
2141         * html/HTMLTextFieldInnerElement.cpp:
2142         (WebCore::HTMLSearchFieldResultsButtonElement::defaultEventHandler):
2143         (WebCore::HTMLSearchFieldCancelButtonElement::defaultEventHandler):
2144         * ksvg2/svg/SVGAElement.cpp:(WebCore::SVGAElement::defaultEventHandler):
2145         * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::userResize):
2146         * rendering/RenderSlider.cpp: (WebCore::HTMLSliderThumbElement::defaultEventHandler):
2147
2148 2007-04-03  Justin Garcia  <justin.garcia@apple.com>
2149
2150         Reviewed by darin
2151         
2152         <rdar://problem/5026848> Can cut/delete ToDo subunits
2153         
2154         We were removing non-editable content during a delete.
2155
2156         * editing/DeleteSelectionCommand.cpp: 
2157         (WebCore::DeleteSelectionCommand::initializePositionData): 
2158         Set m_startRoot and m_endRoot.
2159         (WebCore::DeleteSelectionCommand::removeNode): If a node
2160         is not inside both the start and end roots, remove it only
2161         if it is in editable content.
2162         * editing/DeleteSelectionCommand.h: Added m_startRoot and 
2163         m_endRoot, the editable roots that contain the start and end
2164         of the selection, respectively.  We consult these every
2165         time we remove a node, and don't want to recompute them 
2166         on every call to removeNode().
2167
2168 2007-04-03  David Hyatt  <hyatt@apple.com>
2169
2170         Fix for <rdar://problem/5108896>, make sure the assert for setEncodedSize
2171         deals with the error case.
2172
2173         Reviewed by andersca
2174
2175         * loader/CachedResource.cpp:
2176         (WebCore::CachedResource::setEncodedSize):
2177
2178 2007-04-03  Anders Carlsson  <andersca@apple.com>
2179
2180         Reviewed by Dave Hyatt.
2181
2182         * loader/ImageDocument.cpp:
2183         Don't call error() in stopParsing.
2184
2185 2007-04-03  Justin Garcia  <justin.garcia@apple.com>
2186
2187         Reviewed by darin
2188         
2189         <rdar://problem/5107422> 
2190         TOT REGRESSION: Delete key fails to delete text, and cursor disappears in Mail.app
2191         <rdar://problem/5107413> 
2192         TOT REGRESSION: Crash deleting text in email (infinite recursion in shouldInsertNode)
2193
2194         * editing/CompositeEditCommand.cpp:
2195         (WebCore::CompositeEditCommand::moveParagraphs):
2196         Back out the call to shouldInsert until we
2197         add WebViewInsertActionMoved, because Mail returns
2198         NO from shouldInsert for WebViewInsertActionPasted
2199         to override our Paste operation.
2200
2201 2007-04-03  Anders Carlsson  <andersca@apple.com>
2202
2203         Reviewed by Mitz.
2204
2205         Make window.innerWidth/innerHeight include the size of any present scrollbar to match Firefox.
2206         
2207         Make document.body.clientWidth/clientHeight return the width/height of the visible content when in
2208         quirks mode to match WinIE.
2209         
2210         * bindings/js/kjs_window.cpp:
2211         (KJS::Window::getValueProperty):
2212         Return the width and height of the scroll view, not the visible width and height.
2213         
2214         * dom/Element.cpp:
2215         (WebCore::Element::clientWidth):        
2216         (WebCore::Element::clientHeight):
2217         Return the visible size if the element is the body element and we're in quirks mode.
2218
2219 2007-04-03  Adele Peterson  <adele@apple.com>
2220
2221         Reviewed by Darin.
2222
2223         Updated fix for <rdar://problem/5107095> REGRESSION: disabled text color calculations are slowing down launchtime measurements
2224
2225         * platform/graphics/Color.cpp: Moved optimization for lightening black and darkening white into the Color class.
2226         (WebCore::Color::light):
2227         (WebCore::Color::dark):
2228         * rendering/RenderTextControl.cpp: (WebCore::disabledTextColor): Skip the difference calculation for black text, which will always be lightened.
2229
2230 2007-04-03  Anders Carlsson  <andersca@apple.com>
2231
2232         Reviewed by Tim.
2233
2234         <rdar://problem/4649516> 
2235         Turn off slow script dialog or crank up time that makes it come up
2236         
2237         * bindings/js/kjs_binding.cpp:
2238         (KJS::ScriptInterpreter::ScriptInterpreter):
2239         Increase the timeout to 10 seconds to match Firefox.
2240
2241 2007-04-03  Mitz Pettel  <mitz@webkit.org>
2242
2243         Reviewed by Darin.
2244
2245         - fix http://bugs.webkit.org/show_bug.cgi?id=13251
2246           editing/style/fontsize-1.html fails intermittently when run multiple times on Intel, generates incorrect DOM
2247
2248         Covered by existing editing tests.
2249
2250         * css/CSSPrimitiveValue.cpp:
2251         (WebCore::CSSPrimitiveValue::getFloatValue): Added ASSERTs that the requested conversion
2252         is from a scalar type to a scalar type. The intermittent failures in the test were
2253         the result of trying to convert an identifier type to a scalar type.
2254         * editing/ApplyStyleCommand.cpp:
2255         (WebCore::StyleChange::checkForLegacyHTMLStyleChange): Added a check that the
2256         font-size property value is an absolute length. If it is not (such as in the case
2257         of relative units or keywords like "x-large"), then no corresponding 'size' attribute
2258         will be generated for legacy HTML.
2259
2260 2007-04-03  Mitz Pettel  <mitz@webkit.org>
2261
2262         Reviewed by Darin.
2263
2264         - fix http://bugs.webkit.org/show_bug.cgi?id=13218
2265           <rdar://problem/5095977>
2266           Reproducible crash after call to window.close()
2267
2268         * manual-tests/stale-currentEvent.html: Added.
2269         * page/EventHandler.cpp:
2270         (WebCore::EventHandler::hoverTimerFired): Instead of faking a mouse event,
2271         just hit-test the last mouse event coordinates and update for hover state
2272         changes. This eliminates the use of currentEvent, which can be a non-mouse
2273         event or even a stale event.
2274
2275 2007-04-02  Adele Peterson  <adele@apple.com>
2276
2277         Reviewed by Maciej.
2278
2279         Fix for <rdar://problem/5107095> REGRESSION: disabled text color calculations are slowing down launchtime measurements
2280
2281         Hardcode disabled text colors for the most common cases- black and white.
2282
2283         * rendering/RenderTextControl.cpp: (WebCore::disabledTextColor):
2284
2285 2007-04-02  David Hyatt  <hyatt@apple.com>
2286
2287         Fix for <rdar://problem/5105784>, assertion failure in cache.  Encoded sizes were being set to
2288         garbage by accident because of a mismatch between derived class and base class constructors.  This
2289         patch cleans all of this up and gets rid of expiration date as a concept separate from the response.
2290
2291         Reviewed by anders
2292
2293         * dom/Document.cpp:
2294         (WebCore::Document::processHttpEquiv):
2295         * html/HTMLImageLoader.cpp:
2296         (WebCore::HTMLImageLoader::updateFromElement):
2297         * loader/Cache.cpp:
2298         (WebCore::createResource):
2299         (WebCore::Cache::requestResource):
2300         * loader/Cache.h:
2301         * loader/CachedCSSStyleSheet.cpp:
2302         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
2303         * loader/CachedCSSStyleSheet.h:
2304         * loader/CachedImage.cpp:
2305         (WebCore::CachedImage::CachedImage):
2306         * loader/CachedImage.h:
2307         * loader/CachedResource.cpp:
2308         (WebCore::CachedResource::CachedResource):
2309         (WebCore::CachedResource::finish):
2310         * loader/CachedResource.h:
2311         * loader/CachedScript.cpp:
2312         (WebCore::CachedScript::CachedScript):
2313         * loader/CachedScript.h:
2314         * loader/CachedXBLDocument.cpp:
2315         (WebCore::CachedXBLDocument::CachedXBLDocument):
2316         * loader/CachedXBLDocument.h:
2317         * loader/CachedXSLStyleSheet.cpp:
2318         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
2319         * loader/CachedXSLStyleSheet.h:
2320         * loader/DocLoader.cpp:
2321         (WebCore::DocLoader::DocLoader):
2322         (WebCore::DocLoader::requestResource):
2323         * loader/DocLoader.h:
2324
2325 2007-04-03  Antti Koivisto  <antti@apple.com>
2326
2327         Reviewed by Hyatt.
2328
2329         Render tree memory savings, part 3
2330         
2331         These changes shrink all RenderBlocks by additional 28 bytes. Together with parts 1 and 2
2332         RenderBlock goes from 172 bytes to 128 bytes, a saving of 26%.
2333         
2334         - Pack bitfields together in RenderFlow
2335         - Move top/bottom min/max margin values to a struct that is only allocated in case these
2336           variables have non default values. Usually this is <5% of all blocks. 
2337         - Move rarely used column variables to hash
2338
2339         * rendering/RenderBlock.cpp:
2340         (WebCore::ColumnInfo::ColumnInfo):
2341         (WebCore::RenderBlock::RenderBlock):
2342         (WebCore::RenderBlock::~RenderBlock):
2343         (WebCore::RenderBlock::layoutBlock):
2344         (WebCore::RenderBlock::collapseMargins):
2345         (WebCore::RenderBlock::clearFloatsIfNeeded):
2346         (WebCore::RenderBlock::setCollapsedBottomMargin):
2347         (WebCore::RenderBlock::layoutBlockChildren):
2348         (WebCore::RenderBlock::paintColumns):
2349         (WebCore::RenderBlock::paintObject):
2350         (WebCore::RenderBlock::fillSelectionGaps):
2351         (WebCore::RenderBlock::lowestPosition):
2352         (WebCore::RenderBlock::rightmostPosition):
2353         (WebCore::RenderBlock::leftmostPosition):
2354         (WebCore::RenderBlock::nodeAtPoint):
2355         (WebCore::RenderBlock::hitTestColumns):
2356         (WebCore::RenderBlock::positionForCoordinates):
2357         (WebCore::RenderBlock::availableWidth):
2358         (WebCore::RenderBlock::calcColumnWidth):
2359         (WebCore::RenderBlock::setDesiredColumnCountAndWidth):
2360         (WebCore::RenderBlock::desiredColumnWidth):
2361         (WebCore::RenderBlock::desiredColumnCount):
2362         (WebCore::RenderBlock::columnRects):
2363         (WebCore::RenderBlock::layoutColumns):
2364         (WebCore::RenderBlock::adjustPointToColumnContents):
2365         (WebCore::RenderBlock::adjustRectForColumns):
2366         (WebCore::RenderBlock::setMaxTopMargins):
2367         (WebCore::RenderBlock::setMaxBottomMargins):
2368         * rendering/RenderBlock.h:
2369         (WebCore::RenderBlock::maxTopMargin):
2370         (WebCore::RenderBlock::maxBottomMargin):
2371         (WebCore::RenderBlock::maxTopPosMargin):
2372         (WebCore::RenderBlock::maxTopNegMargin):
2373         (WebCore::RenderBlock::maxBottomPosMargin):
2374         (WebCore::RenderBlock::maxBottomNegMargin):
2375         (WebCore::RenderBlock::initMaxMarginValues):
2376         (WebCore::RenderBlock::MaxMargin::MaxMargin):
2377         (WebCore::RenderBlock::MaxMargin::topPosDefault):
2378         (WebCore::RenderBlock::MaxMargin::topNegDefault):
2379         (WebCore::RenderBlock::MaxMargin::bottomPosDefault):
2380         (WebCore::RenderBlock::MaxMargin::bottomNegDefault):
2381         * rendering/RenderFlexibleBox.cpp:
2382         (WebCore::RenderFlexibleBox::layoutBlock):
2383         * rendering/RenderFlow.h:
2384         (WebCore::RenderFlow::RenderFlow):
2385         (WebCore::RenderFlow::hasColumns):
2386         * rendering/RenderInline.cpp:
2387         (WebCore::RenderInline::RenderInline):
2388         * rendering/RenderInline.h:
2389
2390 2007-04-03  Antti Koivisto  <antti@apple.com>
2391
2392         Reviewed by Hyatt.
2393
2394         Fix asserts, these may also be called for rel positioned elements
2395
2396         * rendering/RenderBox.cpp:
2397         (WebCore::RenderBox::setStaticX):
2398         (WebCore::RenderBox::setStaticY):
2399
2400 2007-04-02  David Hyatt  <hyatt@apple.com>
2401
2402         Throw in an assert to try to track down a problem where an image is being set to a smaller encoded
2403         size.
2404
2405         * loader/CachedResource.cpp:
2406         (WebCore::CachedResource::setEncodedSize):
2407
2408 2007-04-02  Ada Chan  <adachan@apple.com>
2409
2410         Reviewed by Adele.
2411
2412         <rdar://5105331> Missing null check in Editor::execCommand
2413         Added null check.
2414
2415         * editing/Editor.cpp:
2416         (WebCore::Editor::execCommand):
2417
2418 2007-04-02  Justin Garcia  <justin.garcia@apple.com>
2419
2420         Reviewed by darin
2421
2422         <rdar://problem/5058163> 
2423         Hitting return inserts a new line between two To Dos, but caret is position after second ToDo
2424
2425         * editing/InsertParagraphSeparatorCommand.cpp:
2426         (WebCore::InsertParagraphSeparatorCommand::doApply):
2427         Removed refPos, it was unused.
2428         Don't assume that upstream() moves to a different
2429         node.  This assumption caused the line break to
2430         be inserted *after* the caret and a bad position
2431         to be set (added a testcase).
2432         Use isStartOfParagraph instead of checking
2433         for the existence of a br because the line might 
2434         be broken by a newline character in text that 
2435         preserves newlines.  Paragraphs that are created 
2436         in other ways, like with blocks, are handled 
2437         above (added a testcase).
2438
2439  2007-04-02  David Harrison  <harrison@apple.com>
2440
2441         Reviewed by Darin.
2442
2443         <rdar://problem/4906488> text attributes are not working for frame based web page
2444
2445         Attribute handling now treats each WebArea as its own world, rather than sometimes
2446         referring back up to the top WebArea. e.g. getting/setting the selection now
2447         operates on the WebArea containing the WebCoreAXObject that is being messaged (self).
2448         The methods that sit above this and are able to go into arbitrary WebAreas
2449         are accessibilityFocusedUIElement and doAXTextMarkerForPosition, allowing VoiceOver
2450         to navigate between frames.
2451         
2452         * bridge/mac/WebCoreAXObject.mm:
2453         (-[WebCoreAXObject topRenderer]):
2454         (-[WebCoreAXObject frameView]):
2455         (-[WebCoreAXObject topFrameView]):
2456         Removed topDocument, renamed topView to topFrameView, added frameView.
2457         
2458         (-[WebCoreAXObject accessibilityAttributeValue:]):
2459         AXSelectedTextMarkerRange, AXStartTextMarker, and AXEndTextMarker now use
2460         self's WebArea, rather than the top WebArea.
2461         
2462         (-[WebCoreAXObject doAXTextMarkerRangeForLine:]):
2463         Use self's WebArea, rather than the top WebArea.
2464
2465         (-[WebCoreAXObject doAXTextMarkerForPosition:]):
2466         Use renamed methods for accessing top WebArea.
2467          
2468         (-[WebCoreAXObject doAXBoundsForTextMarkerRange:]):
2469         Use renamed methods for accessing self's WebArea.
2470
2471         (AXAttributeStringSetColor):
2472         (AXAttributeStringSetNumber):
2473         (AXAttributeStringSetFont):
2474         (AXAttributeStringSetStyle):
2475         (AXAttributeStringSetElement):
2476         (-[WebCoreAXObject rendererForView:]):
2477         Clean up uses of nil and NULL.
2478         
2479         (-[WebCoreAXObject accessibilityFocusedUIElement]):
2480         Find the focused node on the whole page. If there is no focused node,
2481         return the WebArea for the focused document.
2482         
2483         (-[WebCoreAXObject doSetAXSelectedTextMarkerRange:]):
2484         Use self's WebArea, rather than the top WebArea.
2485
2486 2007-04-02  Antti Koivisto  <antti@apple.com>
2487
2488         Fix build. This one was not supposed to be checked in.
2489
2490         * rendering/RenderFlexibleBox.cpp:
2491         (WebCore::RenderFlexibleBox::layoutBlock):
2492
2493 2007-03-30  Antti Koivisto  <antti@apple.com>
2494
2495         Reviewed by Hyatt.
2496
2497         Render tree memory savings, part 2
2498         
2499         - Move staticX and staticY variables to RenderLayer since they are only
2500           applicable to positioned objects
2501         - Move very rarely used overrideSize variable to hash
2502         
2503         These changes shrink all box types by 12 bytes
2504
2505         * rendering/RenderBox.cpp:
2506         (WebCore::RenderBox::RenderBox):
2507         (WebCore::RenderBox::destroy):
2508         (WebCore::RenderBox::overrideSize):
2509         (WebCore::RenderBox::setOverrideSize):
2510         (WebCore::RenderBox::overrideWidth):
2511         (WebCore::RenderBox::overrideHeight):
2512         (WebCore::RenderBox::position):
2513         (WebCore::RenderBox::calcWidth):
2514         (WebCore::RenderBox::calcHeight):
2515         (WebCore::RenderBox::staticX):
2516         (WebCore::RenderBox::staticY):
2517         (WebCore::RenderBox::setStaticX):
2518         (WebCore::RenderBox::setStaticY):
2519         (WebCore::RenderBox::calcAbsoluteHorizontal):
2520         (WebCore::RenderBox::calcAbsoluteVertical):
2521         (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
2522         (WebCore::RenderBox::calcAbsoluteVerticalReplaced):
2523         * rendering/RenderBox.h:
2524         * rendering/RenderLayer.cpp:
2525         (WebCore::RenderLayer::RenderLayer):
2526         * rendering/RenderLayer.h:
2527         (WebCore::RenderLayer::staticX):
2528         (WebCore::RenderLayer::staticY):
2529         (WebCore::RenderLayer::setStaticX):
2530         (WebCore::RenderLayer::setStaticY):
2531         * rendering/RenderObject.cpp:
2532         (WebCore::RenderObject::RenderObject):
2533         * rendering/RenderObject.h:
2534         (WebCore::):
2535         (WebCore::RenderObject::hasOverrideSize):
2536         (WebCore::RenderObject::setHasOverrideSize):
2537         * rendering/RenderWidget.cpp:
2538         (WebCore::RenderWidget::destroy):
2539
2540 2007-03-31  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2541
2542         Not reviewed - gdk build fix.
2543
2544         * platform/gdk/TemporaryLinkStubs.cpp:
2545         (Font::selectionRectForComplexText):
2546         (Font::drawComplexText):
2547
2548 2007-03-31  Alexey Proskuryakov  <ap@webkit.org>
2549
2550         Reviewed by Darin.
2551
2552         http://bugs.webkit.org/show_bug.cgi?id=12778
2553         REGRESSION: Nightly won't load Curl plugin for full page use
2554
2555         * dom/DOMImplementation.cpp:
2556         (WebCore::DOMImplementation::createDocument): Re-order cases to give more priority to plugins.
2557         This also fixes Adobe SVG Viewer and any plugins that register XML MIME types.
2558         Added a case for XHTML to avoid enumerating plugins.
2559
2560 2007-03-31  David Hyatt  <hyatt@apple.com>
2561
2562         Fix for bug 13234, layout of selected justified text is broken.  Rework TextRuns to avoid having
2563         from/to members.  Let those be passed in only by the functions that need them (drawing and selection rect).
2564
2565         Reviewed by mitz
2566
2567         fast/text/justified-selection-at-edge.html
2568
2569         * platform/Font.cpp:
2570         (WebCore::WidthIterator::WidthIterator):
2571         (WebCore::WidthIterator::advance):
2572         (WebCore::Font::canUseGlyphCache):
2573         (WebCore::Font::drawSimpleText):
2574         (WebCore::Font::drawText):
2575         (WebCore::Font::floatWidth):
2576         (WebCore::Font::floatWidthForSimpleText):
2577         (WebCore::Font::selectionRectForText):
2578         (WebCore::Font::selectionRectForSimpleText):
2579         (WebCore::Font::offsetForPositionForSimpleText):
2580         * platform/Font.h:
2581         (WebCore::TextRun::m_len):
2582         * platform/graphics/GraphicsContext.cpp:
2583         (WebCore::GraphicsContext::drawText):
2584         (WebCore::GraphicsContext::drawHighlightForText):
2585         * platform/graphics/GraphicsContext.h:
2586         * platform/mac/FontMac.mm:
2587         (WebCore::addDirectionalOverride):
2588         (WebCore::overrideLayoutOperation):
2589         (WebCore::ATSULayoutParameters::initialize):
2590         (WebCore::Font::selectionRectForComplexText):
2591         (WebCore::Font::drawComplexText):
2592         (WebCore::Font::floatWidthForComplexText):
2593         (WebCore::Font::offsetForPositionForComplexText):
2594         * platform/qt/FontQt.cpp:
2595         (WebCore::Font::drawComplexText):
2596         (WebCore::Font::floatWidthForComplexText):
2597         * platform/qt/TemporaryLinkStubs.cpp:
2598         (Font::selectionRectForComplexText):
2599         * rendering/EllipsisBox.cpp:
2600         (WebCore::EllipsisBox::paint):
2601         * rendering/InlineTextBox.cpp:
2602         (WebCore::InlineTextBox::selectionRect):
2603         (WebCore::InlineTextBox::paint):
2604         (WebCore::InlineTextBox::paintSelection):
2605         (WebCore::InlineTextBox::paintMarkedTextBackground):
2606         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
2607         (WebCore::InlineTextBox::paintTextMatchMarker):
2608         (WebCore::InlineTextBox::offsetForPosition):
2609         (WebCore::InlineTextBox::positionForOffset):
2610         * rendering/RenderListMarker.cpp:
2611         (WebCore::RenderListMarker::paint):
2612         (WebCore::RenderListMarker::calcMinMaxWidth):
2613         (WebCore::RenderListMarker::getRelativeMarkerRect):
2614         * rendering/RenderMenuList.cpp:
2615         (WebCore::RenderMenuList::updateOptionsWidth):
2616         * rendering/RenderText.cpp:
2617         (WebCore::RenderText::widthFromCache):
2618         (WebCore::RenderText::width):
2619
2620 2007-03-31  Mitz Pettel  <mitz@webkit.org>
2621
2622         Reviewed by Darin.
2623
2624         - fix http://bugs.webkit.org/show_bug.cgi?id=13243
2625               <rdar://problem/5103226>
2626           REGRESSION (r20506): Repro crash/assert when using scroll wheel on a list box taller than its contents
2627
2628         * platform/ScrollBar.cpp:
2629         (WebCore::Scrollbar::setValue): Cleaned up a little.
2630         (WebCore::Scrollbar::scroll): Changed to apply the minimum and maximum constraints
2631         in the right order, and cleaned up a little.
2632
2633 2007-03-31  Mitz Pettel  <mitz@webkit.org>
2634
2635         Reviewed by Darin.
2636
2637         - fix http://bugs.webkit.org/show_bug.cgi?id=13242
2638           REGRESSION: Repro crash when specifying the content property for an image
2639
2640         Test: fast/images/text-content-crash.html
2641
2642         * html/HTMLImageElement.cpp:
2643         (WebCore::HTMLImageElement::parseMappedAttribute): Added a check that the
2644         renderer is an image.
2645         (WebCore::HTMLImageElement::attach): Ditto.
2646
2647 2007-03-31  Mark Rowe  <mrowe@apple.com>
2648
2649         Reviewed by Darin.
2650
2651         A more correct fix for http://bugs.webkit.org/show_bug.cgi?id=13129
2652         Bug 13129: Democracy Player dies in NSException from WebScriptObject on startup
2653
2654         The previous attempt at a fix in r20343 attempted to conditionally expose the 'count'
2655         method.  It did not work which resulted in 'count' always being hidden.  This change
2656         disables -[WebScriptObject count] completely until it can be determined whether it is
2657         needed and how to support it without breaking third-party applications.
2658
2659         * bindings/objc/WebScriptObject.mm:
2660         (-[WebScriptObject count]):
2661         * bindings/objc/WebScriptObjectPrivate.h:
2662
2663 2007-03-31  Nicholas Shanks  <webkit@nickshanks.com>
2664
2665         Reviewed by Adele.
2666
2667         http://bugs.webkit.org/show_bug.cgi?id=13184
2668         HTMLImageElement longdesc should be complete resolved URL
2669
2670         Test: fast/dom/HTMLImageElement/image-longdesc-absolute-url.html
2671
2672         * html/HTMLImageElement.cpp:
2673         (WebCore::HTMLImageElement::longDesc): Return absolute URL.
2674         Behaviour now matches Firefox and Opera.
2675
2676 2007-03-31  Mitz Pettel  <mitz@webkit.org>
2677
2678         Reviewed by Hyatt.
2679
2680         - fix http://bugs.webkit.org/show_bug.cgi?id=13209
2681           REGRESSION (r18756-18765): Incomplete list marker repaint when resizing list item
2682
2683         Test: fast/repaint/list-marker-2.html
2684
2685         A list marker can increase the horizontal overflow after layoutInlineChildren(),
2686         so made that function return only the vertical bounds of the repaint rect. As the
2687         horizontal bounds, made layoutBlock() just use the overflow bounds after layout.
2688
2689         * rendering/RenderBlock.cpp:
2690         (WebCore::RenderBlock::layoutBlock):
2691         * rendering/RenderBlock.h:
2692         * rendering/bidi.cpp:
2693         (WebCore::RenderBlock::layoutInlineChildren):
2694
2695 2007-03-31  Mitz Pettel  <mitz@webkit.org>
2696
2697         Reviewed by Hyatt.
2698
2699         - http://bugs.webkit.org/show_bug.cgi?id=13178
2700           Helvetica zero-width space has non-zero width
2701
2702         Test: fast/text/wide-zero-width-space.html
2703
2704         * platform/FontData.cpp:
2705         (WebCore::FontData::FontData): Force the ZERO WIDTH SPACE glyph to have width
2706         0, unless the SPACE character maps to the same glyph.
2707
2708 2007-03-31  Mitz Pettel  <mitz@webkit.org>
2709
2710         Reviewed by Darin.
2711
2712         - fix http://bugs.webkit.org/show_bug.cgi?id=8016
2713           REPRO: Safari hangs loading 18 MB page (deeply nested DOM tree)
2714
2715         Test: fast/tokenizer/lessthan-terminates-tags-and-attrs.html
2716
2717         * html/HTMLTokenizer.cpp:
2718         (WebCore::HTMLTokenizer::parseTag): Made "<" terminate tag and attribute
2719         names. This matches Firefox.
2720
2721 2007-03-31  Alexey Proskuryakov  <ap@webkit.org>
2722
2723         Debug build fix.
2724
2725         * xml/XPathValue.cpp:
2726         (WebCore::XPath::): Define Value::adopt.
2727
2728 2007-03-30  Alexey Proskuryakov  <ap@webkit.org>
2729
2730         Reviewed by Darin.
2731
2732         http://bugs.webkit.org/show_bug.cgi?id=13021
2733         XPath can be very slow
2734
2735         This patch finally makes us faster than Firefox 2.0 on this test case.
2736
2737         * xml/XPathFunctions.cpp:
2738         (WebCore::XPath::FunConcat::evaluate): Use a Vector buffer for faster appending.
2739         (WebCore::XPath::FunId::evaluate): Move the result NodeSet into Value instead of copying it.
2740         (WebCore::XPath::FunLocalName::evaluate): Cosmetic changes.
2741         (WebCore::XPath::FunNamespaceURI::evaluate): Ditto.
2742         (WebCore::XPath::FunName::evaluate): Ditto.
2743         (WebCore::XPath::FunNormalizeSpace::evaluate): Ditto.
2744
2745         * xml/XPathValue.cpp:
2746         (WebCore::XPath::Value::toNodeSet):
2747         (WebCore::XPath::Value::modifiableNodeSet):
2748         (WebCore::XPath::Value::toBoolean):
2749         (WebCore::XPath::Value::toNumber):
2750         (WebCore::XPath::Value::toString):
2751         * xml/XPathValue.h:
2752         (WebCore::XPath::ValueData::ValueData):
2753         (WebCore::XPath::Value::Value):
2754         Made Value copying faster by putting large data members into a separate refcounted ValueData class.
2755         Added provisions for moving a NodeSet in and out of Value without copying.
2756         Made construction safer by moving bool version to a template constructor.
2757         Removed an (almost) unused default constructor.
2758
2759         * xml/XPathPredicate.h: Store a Value for literal string and number expressions to avoid 
2760         constructing one each time.
2761
2762         * xml/XPathPath.cpp:
2763         (WebCore::XPath::Filter::evaluate):
2764         (WebCore::XPath::LocationPath::evaluate):
2765         (WebCore::XPath::Path::evaluate):
2766         * xml/XPathPath.h:
2767         * xml/XPathPredicate.cpp:
2768         (WebCore::XPath::NumericOp::evaluate):
2769         (WebCore::XPath::Union::evaluate):
2770         * xml/XPathResult.cpp:
2771         (WebCore::XPathResult::snapshotItem):
2772         * xml/XPathStep.cpp:
2773         (WebCore::XPath::Step::evaluate):
2774         (WebCore::XPath::Step::nodesInAxis):
2775         * xml/XPathStep.h:
2776         Got rid of unnecessary NodeSet copying in many cases.
2777
2778 2007-03-30  Justin Garcia  <justin.garcia@apple.com>
2779
2780         Reviewed by john
2781
2782         <rdar://problem/5076323> Only one To Do can be created by a selection in a message
2783
2784         When Mail's ToDoify operation called moveToEndOfDocument: 
2785         with a selection that started just before a ToDo, we'd 
2786         move them to the end of the document, not to the end
2787         of the editable root, because we incorrectly checked
2788         for the editability of positions before ToDos.  Then Mail
2789         would refuse to create a ToDo because the selection was 
2790         outside of the region where they allowed editing.
2791
2792         * editing/SelectionController.cpp:
2793         (WebCore::SelectionController::modifyExtendingRightForward):
2794         Check the position for editability, not the position's node,
2795         since there are editable positions of the form [node, offset]
2796         where node is contenteditable=false.
2797         Re-use pos.  Nothing that happens after it's created can invalidate
2798         it or the position and affinity used to create it.
2799         (WebCore::SelectionController::modifyMovingRightForward): Ditto.
2800         (WebCore::SelectionController::modifyExtendingLeftBackward): Ditto.
2801         (WebCore::SelectionController::modifyMovingLeftBackward): Ditto.
2802         * rendering/RenderBlock.cpp:
2803         (WebCore::RenderBlock::paintCaret): Ditto.
2804
2805 2007-03-30  Adele Peterson  <adele@apple.com>
2806
2807         Reviewed by Darin.
2808
2809         Added DeleteWordBackward and DeleteWordForward to execCommand.
2810
2811         * editing/Editor.cpp:
2812         (WebCore::execDeleteWordBackward):
2813         (WebCore::execDeleteWordForward):
2814         (WebCore::CommandEntry::):
2815
2816 2007-03-30  Simon Hausmann  <hausmann@kde.org>
2817
2818         Reviewed by Zack
2819
2820         * WebCore.pro: Fix release Qt builds.
2821
2822 2007-03-30  Antti Koivisto  <antti@apple.com>
2823
2824         Reviewed by bdash.
2825
2826         Spotted an int that should be float in previous patch.
2827
2828         * platform/Font.cpp:
2829         (WebCore::WidthIterator::advance):
2830
2831 2007-03-30  Antti Koivisto  <antti@apple.com>
2832
2833         Reviewed by Hyatt.
2834
2835         Render tree memory savings, part 1
2836         
2837         - Eliminate caching of monospace char width from RenderText. This optimization is not needed
2838           anymore since Font already caches space width (RenderText -4 bytes)
2839         - Eliminate caching of tab width from RenderBlock. Similary this optimization has become
2840           obsolete (RenderBlock -4 bytes)
2841
2842         * platform/Font.cpp:
2843         (WebCore::WidthIterator::advance):
2844         (WebCore::Font::spaceWidth):
2845         * platform/Font.h:
2846         (WebCore::Font::tabWidth):
2847         * platform/TextStyle.h:
2848         (WebCore::TextStyle::TextStyle):
2849         (WebCore::TextStyle::allowTabs):
2850         * rendering/InlineTextBox.cpp:
2851         (WebCore::InlineTextBox::selectionRect):
2852         (WebCore::InlineTextBox::paint):
2853         (WebCore::InlineTextBox::paintSelection):
2854         (WebCore::InlineTextBox::paintMarkedTextBackground):
2855         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
2856         (WebCore::InlineTextBox::paintTextMatchMarker):
2857         (WebCore::InlineTextBox::offsetForPosition):
2858         (WebCore::InlineTextBox::positionForOffset):
2859         * rendering/RenderBlock.cpp:
2860         (WebCore:::RenderFlow):
2861         (WebCore::RenderBlock::setStyle):
2862         * rendering/RenderBlock.h:
2863         * rendering/RenderObject.cpp:
2864         * rendering/RenderObject.h:
2865         * rendering/RenderText.cpp:
2866         (WebCore::RenderText::RenderText):
2867         (WebCore::RenderText::setStyle):
2868         (WebCore::RenderText::widthFromCache):
2869         (WebCore::RenderText::trimmedMinMaxWidth):
2870         (WebCore::RenderText::calcMinMaxWidthInternal):
2871         (WebCore::RenderText::setTextInternal):
2872         (WebCore::RenderText::width):
2873         * rendering/RenderText.h:
2874         (WebCore::RenderText::allowTabs):
2875         * rendering/bidi.cpp:
2876
2877 2007-03-30  David Hyatt  <hyatt@apple.com>
2878
2879         Fix (take 2) for bug 4334, flickering when floating elements gain/lose transparency.
2880
2881         Reviewed by mitz
2882
2883         * rendering/RenderBlock.cpp:
2884         * rendering/RenderBlock.h:
2885         * rendering/RenderBox.cpp:
2886         (WebCore::RenderBox::setStyle):
2887
2888 2007-03-29  Mitz Pettel  <mitz@webkit.org>
2889
2890         Reviewed by Darin.
2891
2892         - fix http://bugs.webkit.org/show_bug.cgi?id=13166
2893           REGRESSION (2005-10-16 - 2005-10-19): Ampersands showing up in the last column of the Gmail contacts table
2894
2895         Test: fast/tokenizer/write-partial-entity.html
2896
2897         * html/HTMLTokenizer.cpp:
2898         (WebCore::HTMLTokenizer::parseTag): Reordered to avoid resetting the buffer position
2899         after script execution which can write to the buffer.
2900
2901 2007-03-29  Justin Garcia  <justin.garcia@apple.com>
2902
2903         Reviewed by john
2904
2905         <rdar://problem/5099303> Deleting after a ToDo puts the caret in the wrong position
2906         
2907         We were failing to create the correct selection 
2908         for DeleteSelectionCommand because the selection extension 
2909         operations don't skip over non-editable content for editable 
2910         selections.
2911
2912         * editing/SelectionController.cpp:
2913         (WebCore::SelectionController::modifyExtendingRightForward):
2914         When extending an editable selection, don't extend into
2915         non-editable content.
2916         (WebCore::SelectionController::modifyExtendingLeftBackward):
2917         Ditto.
2918
2919 2007-03-29  Patti Hoa  <patti@apple.com>
2920
2921         Reviewed by harrison.
2922
2923         <rdar://problem/4918397> Exception raise inspecting note contents in the background
2924         * WebCore.xcodeproj/project.pbxproj:
2925         * bridge/mac/WebCoreAXObject.mm:
2926         (-[WebCoreAXObject subrole]):
2927         (-[WebCoreAXObject title]):
2928         Check that attachment supports the attribute before requesting it.
2929
2930 2007-03-29  Justin Garcia  <justin.garcia@apple.com>
2931
2932         Reviewed by john
2933
2934         <rdar://problem/5032066> Delete should work between ToDos
2935         
2936         Stop selecting the table when the user attempts to delete
2937         the line break just after it, instead, extend the selection
2938         into the last table cell.
2939         Let deletion merge content into table cells (as long as 
2940         its not from another table cell).  
2941         Start calling shouldInsertNode:replacingDOMRange:givenAction: 
2942         when moving content with moveParagraphs, so that Mail can 
2943         modify content before it is moved into a ToDo during a delete.
2944
2945         * editing/CompositeEditCommand.cpp:
2946         (WebCore::CompositeEditCommand::moveParagraphs): Ask the
2947         delegate before performing the move.  This will let Mail
2948         prevent styles from entering a ToDo.
2949         Added a FIXME about adding a new WebViewInsertAction
2950         * editing/DeleteSelectionCommand.cpp:
2951         (WebCore::DeleteSelectionCommand::initializePositionData):
2952         Allow merging into table cells from content not in a table.
2953         * editing/SelectionController.cpp:
2954         (WebCore::SelectionController::modifyExtendingRightForward):
2955         Don't select the table when extending by character/word from
2956         just before it.  This code was here to make it easier to select
2957         tables in order to delete them, but the deletion UI makes it 
2958         largely unnecessary.
2959         (WebCore::SelectionController::modifyExtendingLeftBackward):
2960         Ditto.
2961         * editing/TypingCommand.cpp:
2962         (WebCore::isFirstPositionAfterTable): Added.
2963         (WebCore::isLastPositionBeforeTable): Ditto.
2964         (WebCore::TypingCommand::deleteKeyPressed): When pressing
2965         the delete key with a caret at the beginning of a paragraph
2966         just after a table, move the paragraph into the last table
2967         cell.
2968         Do not do this if it would mean moving a block table.
2969         Removed some old irrelevant comments.
2970         * editing/htmlediting.cpp: Removed unused functions.
2971         * editing/htmlediting.h:
2972
2973 2007-03-29  Adam Treat  <adam@staikos.net>
2974
2975         Reviewed and committed by George Staikos.
2976
2977         Remove redundant line.
2978
2979         * platform/qt/FontDataQt.cpp:
2980         (WebCore::FontData::platformInit):
2981
2982 2007-03-29  Adam Treat  <adam@staikos.net>
2983
2984         Reviewed by David Hyatt, committed by George Staikos.
2985
2986         Test: fast/text/justified-selection.html
2987
2988         Take into account the entire run length to get a proper selection.
2989
2990         * platform/Font.cpp:
2991         (WebCore::WidthIterator::WidthIterator):
2992
2993 2007-03-29  David Hyatt  <hyatt@apple.com>
2994
2995         Fix for <rdar://problem/4545060>, technorati and arstechnica fail because of getComputedStyle not
2996         reporting display:none properly when it is set.  This is bugzilla bug 13103.
2997
2998         Reviewed by mitz
2999
3000         * css/CSSComputedStyleDeclaration.cpp:
3001         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
3002
3003 2007-03-28  Oliver Hunt  <oliver@apple.com>
3004
3005         Reviewed by Hyatt.
3006
3007         Rename DocLoader::setPasteInProgress, etc to more generic 
3008         setAllowStaleResources, etc
3009
3010         * editing/Editor.cpp:
3011         (WebCore::Editor::paste):
3012         * loader/DocLoader.cpp:
3013         (WebCore::DocLoader::DocLoader):
3014         (WebCore::DocLoader::checkForReload):
3015         * loader/DocLoader.h:
3016         (WebCore::DocLoader::setAllowStaleResources):
3017         * page/DragController.cpp:
3018         (WebCore::DragController::concludeDrag):
3019
3020 2007-03-28  Oliver Hunt  <oliver@apple.com>
3021
3022         Reviewed by Anders and Steve.
3023
3024         Add a flag to DocLoader to prevent it from reloading 
3025         when performing a paste or drop operation.
3026         
3027         Remove m_cachePolicy from CachedResource as it is never used
3028         
3029         Fixes rdar://problem/5044366 : REGRESSION: Repro ASSERT failures 
3030         dragging image into GMail message in _web_writeImage and 
3031         documentFragmentFromDragData
3032
3033         * editing/Editor.cpp:
3034         (WebCore::Editor::paste):
3035           prevent the docloader from reloading resources on paste
3036         * html/HTMLImageLoader.cpp:
3037         (WebCore::HTMLImageLoader::updateFromElement):
3038         * loader/Cache.cpp:
3039         (WebCore::createResource):
3040         * loader/CachedCSSStyleSheet.cpp:
3041         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
3042         * loader/CachedCSSStyleSheet.h:
3043         * loader/CachedImage.cpp:
3044         (WebCore::CachedImage::CachedImage):
3045         * loader/CachedImage.h:
3046         * loader/CachedResource.cpp:
3047         (WebCore::CachedResource::CachedResource):
3048         * loader/CachedResource.h:
3049         * loader/CachedScript.cpp:
3050         (WebCore::CachedScript::CachedScript):
3051         * loader/CachedScript.h:
3052         * loader/CachedXBLDocument.cpp:
3053         (WebCore::CachedXBLDocument::CachedXBLDocument):
3054         * loader/CachedXBLDocument.h:
3055         * loader/CachedXSLStyleSheet.cpp:
3056         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
3057         * loader/CachedXSLStyleSheet.h:
3058         * loader/DocLoader.cpp:
3059         (WebCore::DocLoader::DocLoader):
3060            Tidy up constructor initialise new field
3061         (WebCore::DocLoader::checkForReload):
3062            Prevent reload when pasting
3063         * loader/DocLoader.h:
3064         (WebCore::DocLoader::setPasteInProgress):
3065           new field and setter
3066         * page/DragController.cpp:
3067         (WebCore::DragController::concludeDrag):
3068           prevent the docloader from reloading resources on drop
3069
3070 2007-03-27  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3071
3072         Not reviewed - fix typo in gdk build.
3073
3074         * platform/gdk/ScrollViewGdk.cpp:
3075         (WebCore::ScrollView::contentsToWindow):
3076
3077 2007-03-28  Maciej Stachowiak  <mjs@apple.com>
3078         
3079         Reviewed by Darin.
3080         
3081         - fixed <rdar://problem/4820817> Autoscroll is broken in Mail.app (message jumps around when trying to select text)
3082                 
3083         Handle scrolling external scrollviews around the webview during
3084         autoscroll or when scrolling into view.
3085         
3086         This should also restore performance on BenchJS test 6 lost due to Tim's partial fix.
3087
3088         * page/FrameView.cpp:
3089         (WebCore::FrameView::scrollRectIntoViewRecursively):
3090         * page/FrameView.h:
3091         * platform/ScrollView.h:
3092         * platform/gdk/ScrollViewGdk.cpp:
3093         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
3094         (WebCore::ScrollView::scrollRectIntoViewRecursively):
3095         * platform/mac/ScrollViewMac.mm:
3096         (WebCore::ScrollView::visibleContentRect):
3097         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
3098         (WebCore::ScrollView::scrollRectIntoViewRecursively):
3099         (WebCore::ScrollView::updateContents):
3100         * platform/qt/ScrollViewQt.cpp:
3101         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
3102         (WebCore::ScrollView::scrollRectIntoViewRecursively):
3103         * platform/win/ScrollViewWin.cpp:
3104         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
3105         * platform/win/TemporaryLinkStubs.cpp:
3106         (WebCore::ScrollView::scrollRectIntoViewRecursively):
3107         * rendering/RenderLayer.cpp:
3108         (WebCore::RenderLayer::scrollRectToVisible):
3109        
3110 2007-03-28  Jungshik Shin  <jungshik.shin@gmail.com>
3111
3112         Reviewed  and landed by Darin
3113
3114         Get rid of some misuses of |islower| and |tolower| for non-ASCII characters.
3115         http://bugs.webkit.org/show_bug.cgi?id=13138
3116
3117         * platform/StringImpl.cpp:
3118         (WebCore::StringImpl::isLower):
3119         (WebCore::StringImpl::lower):
3120         (WebCore::StringImpl::equalIgnoringCase):
3121
3122 2007-03-28  Antti Koivisto  <antti@apple.com>
3123
3124         Reviewed by Hyatt.
3125
3126         Fix <rdar://problem/5092653>
3127         REGRESSION: Image decoding making scrolling slow
3128         
3129         If decoder gave back a null frame (which I think happens regularly if you don't have full frame 
3130         data yet for image that does not decode incrementally) m_decodedSize was incremented anyway. This
3131         led to massive growth in calculated image size and eventually made cache prune constantly. 
3132         
3133         No test, I don't know how to make one for this.
3134
3135         * platform/graphics/BitmapImage.cpp:
3136         (WebCore::BitmapImage::cacheFrame):
3137
3138 2007-03-28  Adele Peterson  <adele@apple.com>
3139
3140         Reviewed by Kevin M.
3141
3142         WebCore part of fix for <rdar://problem/5095515> VitalSource Bookshelf should not pass return statements into stringByEvaluatingJavaScriptFromString
3143
3144         * page/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
3145         Convert return value to a string.  This matches the behavior in Safari 2.0.
3146
3147 2007-03-28  Alexey Proskuryakov  <ap@webkit.org>
3148
3149         Reviewed by Darin.
3150
3151         http://bugs.webkit.org/show_bug.cgi?id=13190
3152         XPath incorrectly handles namespaces on attributes
3153
3154         * xml/XPathStep.cpp:
3155         (WebCore::XPath::Step::nodesInAxis): Added a special case for faster attribute lookup; gives a slight but 
3156         measurable performance improvement for bug 13021.
3157         (WebCore::XPath::Step::nodeMatches): Fixed NameTest for attribute nodes.
3158
3159         * xml/XPathStep.h:
3160         (WebCore::XPath::Step::NodeTest::NodeTest):
3161         (WebCore::XPath::Step::NodeTest::namespaceURI):
3162         (WebCore::XPath::Step::nodeTest):
3163         (WebCore::XPath::Step::setNodeTest):
3164         Move m_namespaceURI to NodeTest, where it belongs. Removed unused m_nodeTestData (oops!).
3165
3166         * xml/XPathGrammar.y:
3167         * xml/XPathPath.cpp:
3168         (WebCore::XPath::LocationPath::optimizeStepPair):
3169         Accounted for the above change.
3170
3171 2007-03-28  Oliver Hunt  <oliver@apple.com>
3172
3173         rs=Hyatt.
3174
3175         Rollout local changes :-/
3176
3177         * loader/Cache.cpp:
3178         (WebCore::Cache::pruneAllResources):
3179         (WebCore::Cache::remove):
3180
3181 2007-03-28  Oliver Hunt  <oliver@apple.com>
3182
3183         Reviewed by Hyatt.
3184
3185         Roll out r20511 due to incredible badness
3186
3187         * loader/Cache.cpp:
3188         (WebCore::Cache::pruneAllResources):
3189         (WebCore::Cache::remove):
3190
3191 2007-03-27  Oliver Hunt  <oliver@apple.com>
3192
3193         Reviewed by Adam.
3194
3195         Don't enforce text-selection drag delay when we are
3196         going to drag an image anyway.
3197
3198         Fixes rdar://problem/4668935
3199
3200         * page/EventHandler.cpp:
3201         (WebCore::EventHandler::handleDrag):
3202
3203 2007-03-27  Justin Garcia  <justin.garcia@apple.com>
3204
3205         Build fix
3206         
3207         * editing/markup.cpp:
3208         (WebCore::startMarkup):
3209
3210 2007-03-27  Justin Garcia  <justin.garcia@apple.com>
3211
3212         Reviewed by darin
3213         
3214         <rdar://problem/5091898> REGRESSION: GMail Editor: A line of underlined text copied with Select All pastes with wrong font family
3215         
3216         createMarkup skipped elements if they were blocks
3217         when called from moveParagraphs (because that function 
3218         must receive only inline content).  This patch adds 
3219         code to inline these blocks instead of skipping them 
3220         so that we don't lose any of the style that they 
3221         contribute to the copied markup.
3222
3223         * editing/markup.cpp:
3224         (WebCore::startMarkup): Add an inlineBlocks option.
3225         Make sure to overwrite display:block coming from
3226         a style sheet or the inline style declaration.
3227         (WebCore::createMarkup): Don't refuse to include a 
3228         specialCommonAncestor that's a block if we were asked 
3229         to include only inline content, since we can now inline 
3230         block elements in startMarkup.
3231
3232 2007-03-27  Adele Peterson  <adele@apple.com>
3233
3234         Reviewed by Hyatt.
3235
3236         Fix for <rdar://problem/5026141> REGRESSION: Aperture Viewer Flashes when switching from Index Page to Detail page in Web Gallery
3237
3238         This disables the paint that occurs after WebCore finishes loading the document.  We should reenable this when we
3239         move the dispatchDidFinishLoad delegate callback to happen around the same time as the JS onload call.  See <rdar://problem/5092361>.
3240
3241         * dom/Document.cpp: (WebCore::Document::implicitClose):
3242
3243 2007-03-26  Justin Garcia  <justin.garcia@apple.com>
3244
3245         Reviewed by darin
3246         
3247         <rdar://problem/5065910> REGRESSION: In Mail and GMail, Can't apply color to pasted line of text
3248         <rdar://problem/5084241> After deleting a paragraph of colored text, can't change text color
3249         <rdar://problem/5065605> REGRESSION: Text copied with Select All + Copy loses color on Paste
3250         <rdar://problem/4916887> GMAIL: Can't apply color to text once it becomes indented
3251
3252         * css/CSSComputedStyleDeclaration.cpp:
3253         (WebCore::CSSComputedStyleDeclaration::copyInheritableProperties):
3254         If a node's text fill color is invalid, then its children use 
3255         their font-color as their text fill color (they don't inherit 
3256         it).  Likewise for stroke color.
3257
3258 2007-03-27  Anders Carlsson  <acarlsson@apple.com>
3259
3260         * platform/ScrollBar.h:
3261         Use wtf/MathExtras.h instead of math.h
3262
3263 2007-03-27  Zack Rusin  <zrusin@trolltech.com>
3264
3265         Fix the compile - when using math.h functions
3266         actually include the header with them.
3267
3268         * platform/ScrollBar.h:
3269
3270 2007-03-27  Oliver Hunt  <oliver@apple.com>
3271
3272         Reviewed by Maciej.
3273
3274         The WebArchiver needs all the subresources of a document to be accessible
3275         through the DocLoader, so we can't remove a CachedResource simultaneously
3276         from the global Cache and all DocLoaders, just because it needs to be 
3277         reloaded in one.
3278
3279         Fixes rdar://problem/5044366
3280
3281         * loader/Cache.cpp:
3282         (WebCore::Cache::remove):
3283            Don't evict the resource from all DocLoaders
3284         * manual-tests/test-iframes-loading-the-same-resource.html: Added.
3285            Alas it wasn't possible to make a nice layout test, even this manual test
3286            is not entirely deterministic
3287
3288 2007-03-27  Mark Rowe  <mrowe@apple.com>
3289
3290         Build fix.
3291
3292         * platform/GlyphBuffer.h:
3293         (WebCore::GlyphBuffer::clear):
3294
3295 2007-03-27  Dave Hyatt  <hyatt@apple.com>
3296
3297         Add support for glyph offsets to the GlyphBuffer.
3298        
3299         Reviewed by olliej
3300
3301         * platform/Font.cpp:
3302         (WebCore::Font::drawGlyphBuffer):
3303         * platform/GlyphBuffer.h:
3304         (WebCore::GlyphBuffer::clear):
3305         (WebCore::GlyphBuffer::swap):
3306         (WebCore::GlyphBuffer::offsetAt):
3307         (WebCore::GlyphBuffer::add):
3308
3309 2007-03-27  Antti Koivisto  <antti@apple.com>
3310
3311         Keep buildbot happy.
3312
3313         * platform/mac/PlatformScrollBarMac.mm:
3314         (WebCore::PlatformScrollbar::scrollbarHit):
3315
3316 2007-03-26  Antti Koivisto  <antti@apple.com>
3317
3318         Reviewed by Darin.
3319         
3320         On Mac, support fine grained wheel events generated by trackpad and Mighty Mouse.
3321         http://bugs.webkit.org/show_bug.cgi?id=13134
3322         <rdar://problem/5076249?
3323
3324         * WebCore.exp:
3325             Export _wkGetWheelEventDeltas
3326         * page/EventHandler.cpp:
3327         (WebCore::EventHandler::handleWheelEvent):
3328             Remove (0, 0) scroll event hack, it is not needed anymore.
3329             Do per-pixel scrolling for fine grained events.
3330         * platform/PlatformWheelEvent.h:
3331         (WebCore::PlatformWheelEvent::isContinuous):
3332             Add new m_isContinuous boolean to indicate fine grained wheel events.
3333         * platform/ScrollBar.cpp:
3334         (WebCore::Scrollbar::Scrollbar):
3335         (WebCore::Scrollbar::setValue):
3336         (WebCore::Scrollbar::setSteps):
3337         (WebCore::Scrollbar::scroll):
3338         * platform/ScrollBar.h:
3339         (WebCore::Scrollbar::value):
3340             Use float to represent current position to support finer grained scrolling.
3341             Add ScrollByPixel, remove ScrollByWheel (which was same as ScrollByLine anyway)
3342         * platform/ScrollTypes.h:
3343         (WebCore::):
3344         * platform/gdk/WheelEventGdk.cpp:
3345         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3346             Initalize m_isContinuous
3347         * platform/mac/WebCoreSystemInterface.h:
3348         * platform/mac/WebCoreSystemInterface.mm:
3349             Add wkGetWheelEventDeltas for getting fine grained wheel events
3350         * platform/mac/WheelEventMac.mm:
3351         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3352             Get the wheel deltas using new wkGetWheelEventDeltas interface
3353         * platform/qt/WheelEventQt.cpp:
3354         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3355             Initalize m_isContinuous
3356         * rendering/RenderListBox.cpp:
3357         (WebCore::RenderListBox::calcHeight):
3358             Pass item height to scrollbar
3359
3360 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
3361
3362         Reviewed by Darin Adler.
3363
3364         Fixed <rdar://problem/5088234> REGRESSION: Crash occurs at WebCore::Node::
3365         createRendererIfNeeded() when changing map views with MS Virtual Earth 
3366         (http://www.ziprealty.com/)
3367         
3368         The cause of the crash was the insertion of a <script> element whose
3369         script removed it from the document. The <script> element would then be 
3370         garbage when the insertion routine went on to attach() it.
3371         
3372         The solution here is to check that an element is still your child before
3373         trying to attach() it. This matches the style of checks we do elsewhere
3374         in the node insertion and removal code.
3375
3376         * dom/ContainerNode.cpp:
3377         (WebCore::ContainerNode::insertBefore):
3378         (WebCore::ContainerNode::replaceChild):
3379         (WebCore::ContainerNode::appendChild):
3380
3381 2007-03-26  David Carson  <dacarson@gmail.com>
3382
3383         Reviewed by Darin, landed by Anders.
3384
3385         Manual test case for: REGRESSION (r19559): Java applet crash
3386         http://bugs.webkit.org/show_bug.cgi?id=13142
3387         <rdar://problem/5080340>
3388
3389         * manual-tests/liveconnect-applet-get-boolean.html: Added.
3390         * manual-tests/resources/CheckerApplet.class: Added.
3391         * manual-tests/resources/CheckerApplet.java: Added.
3392
3393 2007-03-26  Mitz Pettel  <mitz@webkit.org>
3394
3395         Reviewed and landed by Darin.
3396
3397         - fix http://bugs.webkit.org/show_bug.cgi?id=13194
3398           <rdar://problem/5087738>
3399           REGRESSION: Selection rects are wrong for images in search results from images.google.com
3400
3401         Test: fast/replaced/selection-rect-in-table-cell.html
3402
3403         * rendering/RenderReplaced.cpp:
3404         (WebCore::RenderReplaced::selectionRect):
3405
3406 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
3407
3408         Removed now-stale #includes of <assert.h>.
3409         
3410         * WebCorePrefix.h:
3411         * config.h:
3412         * css/CSSGrammar.y:
3413         * platform/Arena.cpp:
3414         * platform/KURL.cpp:
3415         * platform/SegmentedString.h:
3416         * rendering/DataRef.h:
3417         * rendering/RenderArena.cpp:
3418
3419 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
3420
3421         Reviewed by Kevin McCulough.
3422
3423         Global replace of "assert(" with "ASSERT(" to assist debugging. Removed
3424         one instance of commented-out code containing "assert(" instead of replacing it.
3425
3426 2007-03-25  Antti Koivisto  <antti@apple.com>
3427
3428         Reviewed by Adam.
3429
3430         Fix <rdar://problem/5049842>
3431         Gmail Editor: Dragging message text in the message body results in a crash at WebCore::Frame::eventHandler()
3432
3433         Null check frame in m_dragTarget, it might be gone already.
3434
3435         * page/EventHandler.cpp:
3436         (WebCore::EventHandler::updateDragAndDrop):
3437         (WebCore::EventHandler::cancelDragAndDrop):
3438         (WebCore::EventHandler::performDragAndDrop):
3439
3440 2007-03-25  Alexey Proskuryakov  <ap@webkit.org>
3441
3442         Reviewed by Darin.
3443
3444         A partial fix for http://bugs.webkit.org/show_bug.cgi?id=13021
3445         XPath can be very slow
3446
3447         * xml/XPathExpression.cpp:
3448         (WebCore::XPathExpression::evaluate): Reset a reference to the context node, as this may prevent the whole document
3449         from being destroyed in time.
3450
3451         * dom/Attr.cpp:
3452         (WebCore::Attr::createTextChild): Instead of calling appendChild(), just do the few operations it really needs to perform.
3453         * dom/ContainerNode.h:
3454         (WebCore::ContainerNode::fastSetFirstChild):
3455         (WebCore::ContainerNode::fastSetLastChild):
3456         Added operations that let Attr hack internal ContainerNode data (evil, but fast!).
3457
3458         * xml/XPathStep.cpp:
3459         (WebCore::XPath::Step::evaluate):
3460         (WebCore::XPath::Step::nodesInAxis):
3461         (WebCore::XPath::Step::nodeMatches):
3462         * xml/XPathStep.h:
3463         Merged node testing into axis enumeration. This saves a lot of Vector resizing and passing, and is necessary for future 
3464         optimizations (sometimes, we can just pick the single result node instead of enumerating and filtering the whole axis).
3465
3466 2007-03-24  Mitz Pettel  <mitz@webkit.org>
3467
3468         Reviewed by Darin.
3469
3470         - fix http://bugs.webkit.org/show_bug.cgi?id=13156
3471           REGRESSION (r19621): Pasting breakable content where wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar
3472
3473         Test: fast/text/midword-break-after-breakable-char.html
3474
3475         Breaking in the middle of the word
3476         is allowed only if no breaking opportunity between words has occurred yet. The
3477         first position on the line should not be considered "between words" even if
3478         it is a breaking opportunity.
3479         
3480         * rendering/bidi.cpp:
3481         (WebCore::RenderBlock::findNextLineBreak): Changed according to the above. Also
3482         cleaned up a couple of lines.
3483
3484 2007-03-24  David Hyatt  <hyatt@apple.com>
3485
3486         Fix for bugzilla bug 13187, place a hard limit on the amount of decoded data that WebCore will keep
3487         around even on live pages (pages being displayed in tabs/windows or in the back/forward cache).
3488         Images will decode to paint and once the decoded data exceeds the cache size, the decoded data will be
3489         tossed.
3490
3491         Refine the flushing algorithm to apply the two-pass decode/evict model to each LRU-SP queue individually, rather
3492         than to all the lists at once.  This allows the cache to evict large encoded resources before flushing small
3493         or frequently accessed decoded onces.
3494
3495         Added information on live/decoded data to the cache statistics.
3496
3497         Reviewed by darin
3498
3499         * loader/Cache.cpp:
3500         (WebCore::Cache::Cache):
3501         (WebCore::Cache::pruneLiveResources):
3502         (WebCore::Cache::pruneAllResources):
3503         (WebCore::Cache::setMaximumSize):
3504         (WebCore::Cache::remove):
3505         (WebCore::Cache::lruListFor):
3506         (WebCore::Cache::removeFromLRUList):
3507         (WebCore::Cache::insertInLRUList):
3508         (WebCore::Cache::liveLRUListFor):
3509         (WebCore::Cache::removeFromLiveResourcesList):
3510         (WebCore::Cache::insertInLiveResourcesList):
3511         (WebCore::Cache::addToLiveResourcesSize):
3512         (WebCore::Cache::removeFromLiveResourcesSize):
3513         (WebCore::Cache::adjustSize):
3514         (WebCore::Cache::getStatistics):
3515         * loader/Cache.h:
3516         (WebCore::Cache::TypeStatistic::TypeStatistic):
3517         * loader/CachedImage.cpp:
3518         (WebCore::CachedImage::decodedSizeWillChange):
3519         (WebCore::CachedImage::decodedSizeChanged):
3520         * loader/CachedImage.h:
3521         * loader/CachedResource.cpp:
3522         (WebCore::CachedResource::CachedResource):
3523         (WebCore::CachedResource::ref):
3524         (WebCore::CachedResource::deref):
3525         (WebCore::CachedResource::setEncodedSize):
3526         (WebCore::CachedResource::liveResourceAccessed):
3527         * loader/CachedResource.h:
3528         (WebCore::CachedResource::liveAccessCount):
3529         (WebCore::CachedResource::resetLiveAccessCount):
3530         (WebCore::CachedResource::increaseLiveAccessCount):
3531         * platform/graphics/BitmapImage.cpp:
3532         (WebCore::BitmapImage::destroyDecodedData):
3533         (WebCore::BitmapImage::cacheFrame):
3534         * platform/graphics/ImageObserver.h:
3535         * rendering/RenderBox.cpp:
3536         (WebCore::RenderBox::paintBackgroundExtended):
3537         * rendering/RenderImage.cpp:
3538         (WebCore::RenderImage::paint):
3539         * rendering/RenderListMarker.cpp:
3540         (WebCore::RenderListMarker::paint):
3541         * rendering/RenderObject.cpp:
3542         (WebCore::RenderObject::paintBorderImage):
3543
3544 2007-03-24  Darin Adler  <darin@apple.com>
3545
3546         Reviewed by Mitz.
3547
3548         - fix http://bugs.webkit.org/show_bug.cgi?id=13123
3549           CSS selectors that use :lang, :not, and namespaces do not serialize correctly
3550
3551         Test: fast/css/css-selector-text.html
3552
3553         * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText): Add the namespace
3554         prefix for tag or attribute names, the sub-selector for :not, and the argument
3555         for :lang.
3556
3557 2007-03-24  Brady Eidson  <beidson@apple.com>
3558
3559         Reviewed by Adam
3560
3561         <rdar://problem/5086210> - Move RetainPtr to WTF