493e08e3886cf636d53e674acf1eb04bbdb189b7
[WebKit-https.git] / WebCore / ChangeLog
1 2006-05-11  Anders Carlsson  <acarlsson@apple.com>
2
3         Reviewed by Darin.
4
5         http://bugzilla.opendarwin.org/show_bug.cgi?id=7838
6         Add support for mozilla-style node constructors as properties of the window object
7         
8         * DerivedSources.make:
9         * WebCore.xcodeproj/project.pbxproj:
10         Add new generated files.
11         
12         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
13         (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
14         * bindings/js/JSHTMLElementWrapperFactory.cpp:
15         (WebCore::createJSWrapper):
16         Specify the KJS namespace for JSHTMLElmement.
17                 
18         * bindings/js/kjs_dom.cpp:
19         (KJS::toJS):
20         Create a WebCore::JSHTMLDocument for document nodes. Also, create
21         JSDocumentFragments for document fragments (instead of plain node objects).
22         
23         * bindings/js/kjs_html.cpp:
24         (KJS::JSHTMLDocumentProtoFunc::callAsFunction):
25         (KJS::JSHTMLDocument::JSHTMLDocument):
26         (KJS::JSHTMLDocument::getOwnPropertySlot):
27         Add a prototype for JSHTMLDocument and move all functions there.
28         
29         (KJS::JSHTMLElement::JSHTMLElement):
30         (KJS::JSHTMLElement::getOwnPropertySlot):
31         Update since JSHTMLElement now inherits from WebCore::JSHTMLElement.
32         
33         (KJS::JSHTMLElement::getValueProperty):
34         (KJS::JSHTMLElement::putValueProperty):
35         Remove title setter and getter. Those are autogenerated now.
36         
37         * bindings/js/kjs_html.h:
38         (KJS::JSHTMLElement::):
39         Inherit from WebCore::JSHTMLElement. Clarify the inheritance chain.
40         
41         * bindings/scripts/CodeGeneratorJS.pm:
42         Always generate a prototype object, regardless of whether the object has any functions or
43         constants.
44         
45         Use the type of generator attributes to determine what constructor to use. This is useful for
46         the XMLDocument property in DOMWindow.idl, since that's just an alias for the Document constructor.
47         
48         * dom/DocumentFragment.idl: Added.        
49         * html/HTMLDocument.idl: Added.
50         * html/HTMLElement.idl: Added.
51         
52         * page/DOMWindow.idl:
53         Add constructors for DocumentFragment, HTMLElement, HTMLDocument and XMLDocument. XMLDocument is just
54         an alias for the Document constructor.
55         
56 2006-05-11  David Hyatt  <hyatt@apple.com>
57
58         Bug 8845.  Define a TextRun (similar to the old WebCoreTextRun) and
59         make it the new API for Font and GraphicsContext when drawing/measuring
60         text.
61
62         Reviewed by andersca
63
64         * platform/Font.cpp:
65         (WebCore::m_finalRoundingWidth):
66         (WebCore::WidthIterator::advance):
67         (WebCore::WidthIterator::normalizeVoicingMarks):
68         (WebCore::Font::width):
69         (WebCore::Font::canUseGlyphCache):
70         (WebCore::Font::drawSimpleText):
71         (WebCore::Font::drawText):
72         (WebCore::Font::floatWidth):
73         (WebCore::Font::floatWidthForSimpleText):
74         * platform/Font.h:
75         (WebCore::TextRun::m_to):
76         (WebCore::TextRun::operator[]):
77         (WebCore::TextRun::data):
78         (WebCore::TextRun::adjustFrom):
79         (WebCore::TextRun::adjustTo):
80         (WebCore::TextRun::characters):
81         (WebCore::TextRun::length):
82         (WebCore::TextRun::from):
83         (WebCore::TextRun::to):
84         * platform/GraphicsContext.cpp:
85         (WebCore::GraphicsContext::drawText):
86         (WebCore::GraphicsContext::drawHighlightForText):
87         * platform/GraphicsContext.h:
88         * platform/mac/FontMac.mm:
89         (WebCore::addDirectionalOverride):
90         (WebCore::overrideLayoutOperation):
91         (WebCore::ATSULayoutParameters::initialize):
92         (WebCore::Font::selectionRectForText):
93         (WebCore::Font::drawComplexText):
94         (WebCore::Font::drawHighlightForText):
95         (WebCore::Font::floatWidthForComplexText):
96         (WebCore::Font::checkSelectionPoint):
97         * platform/win/FontWin.cpp:
98         (WebCore::hackishExtentForString):
99         (WebCore::Font::floatWidth):
100         (WebCore::Font::drawText):
101         (WebCore::Font::drawHighlightForText):
102         (WebCore::Font::selectionRectForText):
103         (WebCore::Font::checkSelectionPoint):
104         * rendering/InlineTextBox.cpp:
105         (WebCore::InlineTextBox::selectionRect):
106         (WebCore::InlineTextBox::paint):
107         (WebCore::InlineTextBox::paintSelection):
108         (WebCore::InlineTextBox::paintMarkedTextBackground):
109         (WebCore::InlineTextBox::paintTextMatchMarker):
110         (WebCore::InlineTextBox::offsetForPosition):
111         (WebCore::InlineTextBox::positionForOffset):
112         * rendering/RenderBlock.cpp:
113         (WebCore::stripTrailingSpace):
114         * rendering/RenderFlexibleBox.cpp:
115         (WebCore::RenderFlexibleBox::layoutVerticalBox):
116         * rendering/RenderImage.cpp:
117         (WebCore::RenderImage::imageChanged):
118         (WebCore::RenderImage::paint):
119         * rendering/RenderText.cpp:
120         (WebCore::RenderText::cacheWidths):
121         (WebCore::RenderText::widthFromCache):
122         (WebCore::RenderText::trimmedMinMaxWidth):
123         (WebCore::RenderText::calcMinMaxWidth):
124         (WebCore::RenderText::width):
125         * rendering/RenderTextField.cpp:
126         (WebCore::RenderTextField::calcMinMaxWidth):
127         * rendering/bidi.cpp:
128         (WebCore::RenderBlock::tabWidth):
129         (WebCore::RenderBlock::checkLinesForTextOverflow):
130         * rendering/render_line.cpp:
131         (WebCore::EllipsisBox::paint):
132         * rendering/render_list.cpp:
133         (WebCore::RenderListMarker::paint):
134         (WebCore::RenderListMarker::calcMinMaxWidth):
135         (WebCore::RenderListMarker::getRelativeMarkerRect):
136
137 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
138
139         Reviewed by darin
140
141         * editing/ReplaceSelectionCommand.cpp:
142         (WebCore::ReplaceSelectionCommand::doApply):
143         Removed the code to find out if we must later add smart replace whitespace.  We can 
144         wait until we've done the insertion to figure it out, and the position sampled (startPos)
145         to make the decision about trailing whitespace was wrong.
146         Changed the order that work is done during a paste: 1) Insert everything 2) Do one of
147         the following: a) handle a trailing interchange newline, b) uncollapse the last incoming
148         br if it has been collapsed because of quirks mode, c) do an end merge 3) Add smart replace
149         whitespace (2 and 3 were reversed because the end merge must happen before we can know
150         whether or not we need to add a trailing space).
151         Don't do an end merge if the last node inserted was a br because the end merge will 
152         clobber it.
153         
154         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
155         brs where [br, 0] is at the end of a block and not at the start of the paragraph
156         are the ones that are collapsed because of quirks mode.
157
158 2006-05-10  David Hyatt  <hyatt@apple.com>
159
160         Rename isSpace to treatAsSpace.  Move it and the rounding hack function into
161         Font and make them static methods (inlined in the header).  Make the rounding
162         hack character table a static member as well.  Remove the redundant space/rounding
163         functions from FontData.mm.
164
165         Reviewed by darin
166
167         * platform/Font.cpp:
168         (WebCore::):
169         (WebCore::m_finalRoundingWidth):
170         (WebCore::WidthIterator::advance):
171         * platform/Font.h:
172         (WebCore::Font::treatAsSpace):
173         (WebCore::Font::isRoundingHackCharacter):
174         * platform/mac/FontData.mm:
175         (WebCore::overrideLayoutOperation):
176         (WebCore::createATSULayoutParameters):
177         (WebCore::initializeWidthIterator):
178         (WebCore::advanceWidthIterator):
179         * platform/mac/FontMac.mm:
180         (WebCore::overrideLayoutOperation):
181         (WebCore::ATSULayoutParameters::initialize):
182
183 2006-05-10  Darin Adler  <darin@apple.com>
184
185         * WebCore: Removed an extra WebCore subtree that somehow got checked in.
186
187 >>>>>>> .r14297
188 2006-05-10  David Carson <dacarson@gmail.com>
189
190         - Fix for bug 8833. Removed inline keyword from functions declared
191         in .mm and .cpp files. inline function code needs to reside in the
192         header file for the linker to find the code. 
193         http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7
194
195         Reviewed by Darin, landed by Timothy.
196
197         * platform/Font.cpp:
198         (WebCore::isSpace):
199         * platform/mac/FontData.mm:
200         (WebCore::widthForGlyph):
201         (WebCore::isRoundingHackCharacter):
202         (WebCore::glyphForCharacter):
203
204 2006-05-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
205
206         Reviewed and landed by Anders.
207
208         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8830
209           REGRESSION: Words render on top of each other when fallback font is used
210
211         Already covered by several pixel tests in fast/text
212
213         * platform/Font.cpp:
214         (WebCore::Font::drawSimpleText):
215
216 2006-05-10  David Hyatt  <hyatt@apple.com>
217
218         Fix for bug 8809, lift the Mac-specific WebTextRenderer code for
219         drawing and measuring of runs up into the Font class.  The fast code
220         path is in Font.cpp and is designed to be mostly cross-platform.  The
221         slow code path is in FontMac.cpp and is Mac-specific.
222
223         Reviewed by darin
224
225         * WebCore.xcodeproj/project.pbxproj:
226         * platform/Font.cpp:
227         (WebCore::isSpace):
228         (WebCore::):
229         (WebCore::isRoundingHackCharacter):
230         (WebCore::m_finalRoundingWidth):
231         (WebCore::WidthIterator::advance):
232         (WebCore::WidthIterator::normalizeVoicingMarks):
233         (WebCore::Font::primaryFont):
234         (WebCore::Font::setAlwaysUseComplexPath):
235         (WebCore::Font::canUseGlyphCache):
236         (WebCore::Font::drawSimpleText):
237         (WebCore::Font::drawText):
238         (WebCore::Font::floatWidth):
239         (WebCore::Font::floatWidthForSimpleText):
240         * platform/Font.h:
241         * platform/FontData.h:
242         (WebCore::FontData::platformData):
243         * platform/GlyphBuffer.h: Added.
244         (WebCore::GlyphBuffer::GlyphBuffer):
245         (WebCore::GlyphBuffer::isEmpty):
246         (WebCore::GlyphBuffer::size):
247         (WebCore::GlyphBuffer::glyphs):
248         (WebCore::GlyphBuffer::advances):
249         (WebCore::GlyphBuffer::fontDataAt):
250         (WebCore::GlyphBuffer::swap):
251         (WebCore::GlyphBuffer::glyphAt):
252         (WebCore::GlyphBuffer::advanceAt):
253         (WebCore::GlyphBuffer::add):
254         * platform/mac/FontData.mm:
255         (WebCore::isSpace):
256         (WebCore::isRoundingHackCharacter):
257         (WebCore::FontData::widthForGlyph):
258         (WebCore::m_ATSUMirrors):
259         (WebCore::FontData::xHeight):
260         (WebCore::FontData::smallCapsFontData):
261         (WebCore::findSubstituteFont):
262         (WebCore::rendererForAlternateFont):
263         (WebCore::findSubstituteRenderer):
264         (WebCore::FontData::findSubstituteFontData):
265         (WebCore::computeWidthForSpace):
266         (WebCore::FontData::updateGlyphMapEntry):
267         (WebCore::extendGlyphMap):
268         (WebCore::extendWidthMap):
269         (WebCore::createATSULayoutParameters):
270         (WebCore::FontData::glyphForCharacter):
271         (WebCore::advanceWidthIterator):
272         (WebCore::shouldUseATSU):
273         * platform/mac/FontMac.mm:
274         (WebCore::ATSULayoutParameters::m_padPerSpace):
275         (WebCore::addDirectionalOverride):
276         (WebCore::initializeATSUStyle):
277         (WebCore::overrideLayoutOperation):
278         (WebCore::ATSULayoutParameters::initialize):
279         (WebCore::disposeATSULayoutParameters):
280         (WebCore::Font::drawComplexText):
281         (WebCore::Font::floatWidthForComplexText):
282         (WebCore::Font::drawGlyphs):
283         * platform/mac/WebCoreTextRenderer.mm:
284         (WebCoreSetAlwaysUseATSU):
285
286 2006-05-10  Darin Adler  <darin@apple.com>
287
288         - another try at fixing the Windows build
289
290         * platform/win/FontWin.cpp: (WebCore::getFontData): Use characters()
291         instead of unicode().
292
293 == Rolled over to ChangeLog-2006-05-10 ==