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