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