+2006-09-06 Darin Adler <darin@apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ - http://bugzilla.opendarwin.org/show_bug.cgi?id=10675
+ tweak font-related headers and convert lists to vectors
+
+ One major change was to greatly reduce the number of files that include Font.h.
+ Another was to convert many uses of DeprecatedPtrList/DeprecatedValueList to Vector.
+
+ * WebCore.xcodeproj/project.pbxproj: Added TextStyle.h.
+
+ * bindings/objc/DOM.mm: (-[DOMElement _font]): Changed to not depend on
+ Font::getNSFont since a WebCore::Font represents more than one NSFont.
+
+ * bindings/objc/DOMNode.mm: (-[DOMNode lineBoxRects]): Updated to use Vector.
+ * bridge/mac/FormDataMac.mm: (WebCore::arrayFromFormData): Ditto.
+ * bridge/mac/FrameViewMac.mm: (WebCore::FrameView::updateDashboardRegions): Ditto.
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Ditto.
+ * dom/Document.cpp:
+ (WebCore::Document::dashboardRegions): Ditto.
+ (WebCore::Document::setDashboardRegions): Ditto.
+ * dom/Document.h: Ditto.
+ * editing/ReplaceSelectionCommand.cpp:
+ (WebCore::ReplacementFragment::removeUnrenderedNodes): Ditto.
+ * html/FormDataList.h: Ditto.
+ * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::isFocusable): Ditto.
+ * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::formData): Ditto.
+ * kcanvas/RenderPath.cpp: (WebCore::RenderPath::absoluteRects): Ditto.
+ * kcanvas/RenderPath.h: Ditto.
+ * kcanvas/RenderSVGImage.cpp: (WebCore::RenderSVGImage::absoluteRects): Ditto.
+ * kcanvas/RenderSVGImage.h: Ditto.
+ * kcanvas/RenderSVGText.cpp: (WebCore::RenderSVGText::absoluteRects): Ditto.
+ * kcanvas/RenderSVGText.h: Ditto.
+ * loader/FormData.cpp:
+ (WebCore::FormData::flatten): Ditto.
+ (WebCore::FormData::flattenToString): Ditto.
+ * loader/FormData.h: (WebCore::FormData::elements): Ditto.
+ * loader/mac/LoaderFunctionsMac.mm: (WebCore::ServeSynchronousRequest): Ditto.
+ * page/Frame.cpp: (WebCore::Frame::markedTextUnderlines): Ditto.
+ * page/Frame.h: Ditto.
+ * page/FramePrivate.h: Ditto.
+ * platform/mac/ResourceLoaderMac.mm: (WebCore::ResourceLoader::start): Ditto.
+ * rendering/InlineTextBox.h: Ditto.
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paint): Ditto.
+ (WebCore::InlineTextBox::paintMarkedTextUnderline): Ditto.
+ * rendering/RenderContainer.h: Ditto.
+ * rendering/RenderContainer.cpp: (WebCore::RenderContainer::lineBoxRects): Ditto.
+ * rendering/RenderInline.h: Ditto.
+ * rendering/RenderInline.cpp: (WebCore::RenderInline::absoluteRects): Ditto.
+ * rendering/RenderObject.h: Ditto.
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::lineBoxRects): Ditto.
+ (WebCore::RenderObject::absoluteRects): Ditto.
+ (WebCore::RenderObject::absoluteBoundingBoxRect): Ditto.
+ (WebCore::RenderObject::addDashboardRegions): Ditto.
+ (WebCore::RenderObject::collectDashboardRegions): Ditto.
+ * rendering/RenderStyle.h: Ditto.
+ * rendering/RenderStyle.cpp:
+ (WebCore::RenderStyle::initialDashboardRegions): Ditto.
+ (WebCore::RenderStyle::noneDashboardRegions): Ditto.
+ * rendering/RenderText.h: Ditto.
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::absoluteRects): Ditto.
+ (WebCore::RenderText::lineBoxRects): Ditto.
+ * rendering/RenderView.h: Ditto.
+ * rendering/RenderView.cpp: (WebCore::RenderView::absoluteRects): Ditto.
+
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::attributedString): Updated to use Vector and changed to not
+ depend on getNSFont on a Font.
+ (WebCore::FrameMac::fontForSelection): Changed to not depend on Font::getNSFont.
+ (WebCore::FrameMac::fontAttributesForSelectionStart): Ditto.
+ (WebCore::convertAttributesToUnderlines): Updated to use Vector.
+ (WebCore::FrameMac::setMarkedTextRange): Ditto.
+ (WebCore::FrameMac::dashboardRegionsDictionary): Ditto.
+
+ * bridge/mac/WebCoreAXObject.mm:
+ (boundingBoxRect): Updated to use Vector.
+ (AXAttributeStringSetStyle): Changed to not depend on Font::getNSFont.
+
+ * bridge/mac/WebCoreStringTruncator.mm: Updated includes.
+ * page/Settings.h: Ditto.
+ * platform/mac/WebCoreTextRenderer.mm: Ditto.
+ * rendering/EllipsisBox.cpp: Ditto.
+
+ * editing/BreakBlockquoteCommand.cpp: (WebCore::BreakBlockquoteCommand::doApply):
+ Updated to use a Vector that we iterate in reverse order instead of a linked list
+ that we reverse by prepending elements instead of adding to the end.
+ * editing/InsertParagraphSeparatorCommand.cpp:
+ (WebCore::InsertParagraphSeparatorCommand::doApply): Ditto.
+
+ * loader/DocLoader.h: Removed unneeded include of DeprecatedPtrList.h.
+
+ * platform/Font.h: Moved TextStyle to a separate header. Removed Font::getNSFont.
+ * platform/Font.cpp: Changed to use const instead of #define.
+ (WebCore::Font::width): Overloaded this so we don't have a default parameter, which
+ eliminates the need to have TextStyle defined to compiler the Font.h header.
+
+ * platform/TextStyle.h: Added.
+
+ * platform/FontData.h: Added a forward declaration of ATSUStyle so this header
+ can stand alone.
+
+ * platform/FontFallbackList.h: Tweaks.
+ * platform/FontFallbackList.cpp: Tweaks.
+
+ * platform/FontFamily.h: Removed unneeded NSString declaration. Simplified class by
+ using Shared and RefPtr, which resulted in removing many explicit functions.
+ * platform/FontFamily.cpp: More of the same.
+
+ * platform/GlyphBuffer.h: Removed unneeded MAX_GLYPH_EXPANSION and GLYPH_BUFFER_SIZE
+ macros.
+
+ * platform/GlyphMap.h: Removed unneeded include of GlyphBuffer.h, which was included
+ only for the typedef of Glyph; there's no reason to not just repeat that typedef here
+ since C++ allows multiple typedefs if they match. Renamed the cGlyphPageSize constant
+ to GlyphPage::size.
+ * platform/GlyphMap.cpp: Changed NO_BREAK_SPACE and ZERO_WIDTH_SPACE macros into
+ constants. Updated for cGlyphPageSize change.
+ * platform/mac/GlyphMapMac.cpp: Updated for cGlyphPageSize change.
+
+ * platform/GlyphWidthMap.h: Removed unneeded include of GlyphBuffer.h, which was included
+ only for the typedef of Glyph; there's no reason to not just repeat that typedef here
+ since C++ allows multiple typedefs if they match. Renamed the cGlyphWidthPageSize constant
+ to GlyphWidthPage::size.
+ * platform/GlyphWidthMap.cpp: Updated for cGlyphWidthPageSize change.
+
+ * platform/GraphicsContext.h: Removed unneeded include of Font.h. Changed drawText
+ function to use overloading instead of default parameters to allow TextStyle to be optional.
+ This cuts the dependency on TextStyle.
+ * platform/GraphicsContext.cpp: (WebCore::GraphicsContext::drawText): Added overload.
+
+ * platform/Image.h: Removed unneeded forward declaration of IntSize.
+
+ * platform/mac/FontCacheMac.mm: (WebCore::FontCache::getFontDataForCharacters):
+ Changed to not depend on Font::getNSFont.
+ * platform/mac/ListBoxMac.mm: (-[WebCoreTableView fontChanged]): Ditto.
+ * platform/mac/TextFieldMac.mm: (-[NSSearchFieldCell _addStringToRecentSearches:]):
+ Ditto.
+ * rendering/RenderPopupMenuMac.mm:
+ (WebCore::RenderPopupMenuMac::showPopup): Ditto.
+ (WebCore::RenderPopupMenuMac::addGroupLabel): Ditto.
+ (WebCore::RenderPopupMenuMac::addOption): Ditto.
+
+ * platform/mac/FontDataMac.mm: Fixed includes. Converted a bunch of macros to be
+ constants and inline functions instead.
+
+ * platform/mac/FontMac.mm: Fixed includes.
+ * platform/mac/PopUpButtonMac.mm: Ditto.
+ * rendering/RenderMenuList.cpp: Ditto.
+ * rendering/RenderTextControl.cpp: Ditto.
+
+ * platform/mac/WebCoreSystemInterface.h: Fixes so this header stands alone and is
+ compatible with all 4 of C, ObjC, C++, ObjC++.
+
2006-09-05 MorganL <morlmor@yahoocom>
Reviewed/landed by aroben.
939885C408B7E3D100E707C4 /* EventNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 939885C208B7E3D100E707C4 /* EventNames.h */; };
93A1EAA00A5634C9006960A0 /* ImageDocumentMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93A1EA9F0A5634C9006960A0 /* ImageDocumentMac.mm */; };
93A1EAA80A563508006960A0 /* ImageDocumentMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 93A1EAA70A563508006960A0 /* ImageDocumentMac.h */; };
+ 93AC8DE10A955FAC00239794 /* TextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AC8DE00A955FAC00239794 /* TextStyle.h */; };
93AE23180AAB51E500CD8A35 /* TextEncodingRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AE23170AAB51E500CD8A35 /* TextEncodingRegistry.h */; };
93AE23210AAB521B00CD8A35 /* TextEncodingRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AE23200AAB521B00CD8A35 /* TextEncodingRegistry.cpp */; };
93B0FD8A0A759BED0080AD44 /* StringImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93B0FD880A759BED0080AD44 /* StringImplMac.mm */; };
93A1EAA70A563508006960A0 /* ImageDocumentMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageDocumentMac.h; sourceTree = "<group>"; };
93ABCE5D06E1A42E0085925B /* FormData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormData.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
93ABCE5E06E1A42E0085925B /* FormData.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = FormData.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 93AC8DE00A955FAC00239794 /* TextStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextStyle.h; path = platform/TextStyle.h; sourceTree = "<group>"; };
93AE23170AAB51E500CD8A35 /* TextEncodingRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEncodingRegistry.h; sourceTree = "<group>"; };
93AE23200AAB521B00CD8A35 /* TextEncodingRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextEncodingRegistry.cpp; sourceTree = "<group>"; };
93B0FD880A759BED0080AD44 /* StringImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = StringImplMac.mm; sourceTree = "<group>"; };
089C1665FE841158C02AAC07 /* Resources */,
0867D69AFE84028FC02AAC07 /* Frameworks */,
034768DFFF38A50411DB9C8B /* Products */,
+ 93AC8DE00A955FAC00239794 /* TextStyle.h */,
);
name = WebKit;
sourceTree = "<group>";
1ACE53F70A8D19470022947D /* JSXMLSerializer.h in Headers */,
1A750D5D0A90DEE1000FF215 /* JSTreeWalker.h in Headers */,
1A750D8E0A90E521000FF215 /* JSNodeIterator.h in Headers */,
+ 93AC8DE10A955FAC00239794 /* TextStyle.h in Headers */,
85089CD70A98C42800A275AA /* DOMCDATASection.h in Headers */,
85089CD90A98C42800A275AA /* DOMComment.h in Headers */,
85089CDB0A98C42800A275AA /* DOMDocumentFragment.h in Headers */,
mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
- projectRoot = "";
targets = (
93F198A508245E59001E9ABC /* WebCore */,
DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
#import "EntityReference.h"
#import "Event.h"
#import "EventListener.h"
+#import "FontData.h"
#import "FoundationExtras.h"
#import "FrameMac.h"
#import "HTMLDocument.h"
- (NSFont *)_font
{
RenderObject *renderer = [self _element]->renderer();
- if (renderer) {
- return renderer->style()->font().getNSFont();
- }
+ if (renderer)
+ return renderer->style()->font().primaryFont()->getNSFont();
return nil;
}
{
WebCore::RenderObject *renderer = [self _node]->renderer();
if (renderer) {
- NSMutableArray *results = [[NSMutableArray alloc] init];
- WebCore::DeprecatedValueList<WebCore::IntRect> rects = renderer->lineBoxRects();
- if (!rects.isEmpty()) {
- for (WebCore::DeprecatedValueList<WebCore::IntRect>::ConstIterator it = rects.begin(); it != rects.end(); ++it)
- [results addObject:[NSValue valueWithRect:*it]];
- }
- return [results autorelease];
+ Vector<WebCore::IntRect> rects;
+ renderer->lineBoxRects(rects);
+ size_t size = rects.size();
+ NSMutableArray *results = [NSMutableArray arrayWithCapacity:size];
+ for (size_t i = 0; i < size; ++i)
+ [results addObject:[NSValue valueWithRect:rects[i]]];
+ return results;
}
return nil;
}
NSArray *arrayFromFormData(const FormData &d)
{
- NSMutableArray *a = [NSMutableArray arrayWithCapacity:d.count()];
- for (DeprecatedValueListConstIterator<FormDataElement> it = d.begin(); it != d.end(); ++it) {
- const FormDataElement &e = *it;
- if (e.m_type == FormDataElement::data) {
+ size_t n = d.elements().size();
+ NSMutableArray *a = [NSMutableArray arrayWithCapacity:n];
+ for (size_t i = 0; i < n; ++i) {
+ const FormDataElement& e = d.elements()[i];
+ if (e.m_type == FormDataElement::data)
[a addObject:[NSData dataWithBytes:e.m_data.data() length:e.m_data.size()]];
- } else {
+ else {
ASSERT(e.m_type == FormDataElement::encodedFile);
[a addObject:e.m_filename];
}
#import "Event.h"
#import "EventNames.h"
#import "FloatRect.h"
+#import "FontData.h"
#import "FoundationExtras.h"
#import "FramePrivate.h"
#import "GraphicsContext.h"
bool hasParagraphBreak = true;
const Element *linkStartNode = 0;
unsigned linkStartLocation = 0;
- DeprecatedPtrList<Element> listItems;
- DeprecatedValueList<ListItemInfo> listItemLocations;
+ Vector<Element*> listItems;
+ Vector<ListItemInfo> listItemLocations;
float maxMarkerWidth = 0;
Node *n = _startNode;
RenderObject *renderer = n->renderer();
if (renderer) {
RenderStyle *style = renderer->style();
- NSFont *font = style->font().getNSFont();
+ NSFont *font = style->font().primaryFont()->getNSFont();
bool needSpace = pendingStyledSpace != nil;
if (n->isTextNode()) {
if (hasNewLine) {
hasNewLine = true;
} else if (n->hasTagName(liTag)) {
- int i, count = listItems.count();
+ int i, count = listItems.size();
for (i = 0; i < count; i++){
- if (listItems.at(i) == n){
+ if (listItems[i] == n){
listItemLocations[i].end = [result length];
break;
}
// Apply paragraph styles from outside in. This ensures that nested lists correctly
// override their parent's paragraph style.
{
- unsigned i, count = listItems.count();
+ unsigned i, count = listItems.size();
Element *e;
#ifdef POSITION_LIST
#endif
for (i = 0; i < count; i++){
- e = listItems.at(i);
+ e = listItems[i];
info = listItemLocations[i];
if (info.end < info.start)
RenderStyle *style = r->style();
int rx;
- NSFont *font = style->font().getNSFont();
+ NSFont *font = style->font().primaryFont()->getNSFont();
float pointSize = [font pointSize];
#ifdef POSITION_LIST
NSFont *result = 0;
if (style)
- result = style->font().getNSFont();
+ result = style->font().primaryFont()->getNSFont();
if (nodeToRemove) {
ExceptionCode ec;
if (!renderer)
continue;
// FIXME: Are there any node types that have renderers, but that we should be skipping?
- NSFont *f = renderer->style()->font().getNSFont();
+ NSFont *f = renderer->style()->font().primaryFont()->getNSFont();
if (!font) {
font = f;
if (!hasMultipleFonts)
if (style->backgroundColor().isValid() && style->backgroundColor().alpha() != 0)
[result setObject:nsColor(style->backgroundColor()) forKey:NSBackgroundColorAttributeName];
- if (style->font().getNSFont())
- [result setObject:style->font().getNSFont() forKey:NSFontAttributeName];
+ if (style->font().primaryFont()->getNSFont())
+ [result setObject:style->font().primaryFont()->getNSFont() forKey:NSFontAttributeName];
if (style->color().isValid() && style->color() != Color::black)
[result setObject:nsColor(style->color()) forKey:NSForegroundColorAttributeName];
return IsSecureEventInputEnabled();
}
-static DeprecatedValueList<MarkedTextUnderline> convertAttributesToUnderlines(const Range *markedTextRange, NSArray *attributes, NSArray *ranges)
+static void convertAttributesToUnderlines(Vector<MarkedTextUnderline>& result, const Range *markedTextRange, NSArray *attributes, NSArray *ranges)
{
- DeprecatedValueList<MarkedTextUnderline> result;
-
int exception = 0;
int baseOffset = markedTextRange->startOffset(exception);
qColor,
[style intValue] > 1));
}
-
- return result;
}
void FrameMac::setMarkedTextRange(const Range *range, NSArray *attributes, NSArray *ranges)
ASSERT(!range || range->startContainer(exception) == range->endContainer(exception));
ASSERT(!range || range->collapsed(exception) || range->startContainer(exception)->isTextNode());
- if (attributes == nil) {
+ d->m_markedTextUnderlines.clear();
+ if (attributes == nil)
d->m_markedTextUsesUnderlines = false;
- d->m_markedTextUnderlines.clear();
- } else {
+ else {
d->m_markedTextUsesUnderlines = true;
- d->m_markedTextUnderlines = convertAttributesToUnderlines(range, attributes, ranges);
+ convertAttributesToUnderlines(d->m_markedTextUnderlines, range, attributes, ranges);
}
if (m_markedTextRange.get() && document() && m_markedTextRange->startContainer(exception)->renderer())
if (!doc)
return nil;
- const DeprecatedValueList<DashboardRegionValue> regions = doc->dashboardRegions();
- unsigned i, count = regions.count();
+ const Vector<DashboardRegionValue>& regions = doc->dashboardRegions();
+ size_t n = regions.size();
// Convert the DeprecatedValueList<DashboardRegionValue> into a NSDictionary of WebDashboardRegions
- NSMutableDictionary *webRegions = [[[NSMutableDictionary alloc] initWithCapacity:count] autorelease];
- for (i = 0; i < count; i++) {
- DashboardRegionValue region = regions[i];
+ NSMutableDictionary *webRegions = [NSMutableDictionary dictionaryWithCapacity:n];
+ for (size_t i = 0; i < n; i++) {
+ const DashboardRegionValue& region = regions[i];
if (region.type == StyleDashboardRegion::None)
continue;
type = WebDashboardRegionTypeRectangle;
NSMutableArray *regionValues = [webRegions objectForKey:label];
if (!regionValues) {
- regionValues = [NSMutableArray array];
+ regionValues = [[NSMutableArray alloc] initWithCapacity:1];
[webRegions setObject:regionValues forKey:label];
+ [regionValues release];
}
- WebDashboardRegion *webRegion = [[[WebDashboardRegion alloc] initWithRect:region.bounds clip:region.clip type:type] autorelease];
+ WebDashboardRegion *webRegion = [[WebDashboardRegion alloc] initWithRect:region.bounds clip:region.clip type:type];
[regionValues addObject:webRegion];
+ [webRegion release];
}
return webRegions;
{
Document* doc = m_frame->document();
if (doc->hasDashboardRegions()) {
- DeprecatedValueList<DashboardRegionValue> newRegions = doc->renderer()->computeDashboardRegions();
- DeprecatedValueList<DashboardRegionValue> currentRegions = doc->dashboardRegions();
+ Vector<DashboardRegionValue> newRegions;
+ doc->renderer()->collectDashboardRegions(newRegions);
doc->setDashboardRegions(newRegions);
Mac(m_frame.get())->dashboardRegionsChanged();
}
#import "DOMInternal.h"
#import "Document.h"
#import "EventNames.h"
+#import "FontData.h"
#import "FoundationExtras.h"
#import "FrameMac.h"
#import "HTMLAreaElement.h"
if (obj) {
if (obj->isInlineContinuation())
obj = obj->element()->renderer();
- DeprecatedValueList<IntRect> rects;
- int x = 0, y = 0;
+ Vector<IntRect> rects;
+ int x, y;
obj->absolutePosition(x, y);
obj->absoluteRects(rects, x, y);
- for (DeprecatedValueList<IntRect>::ConstIterator it = rects.begin(); it != rects.end(); ++it) {
- IntRect r = *it;
+ const size_t n = rects.size();
+ for (size_t i = 0; i < n; ++i) {
+ IntRect r = rects[i];
if (!r.isEmpty()) {
if (obj->style()->hasAppearance())
theme()->adjustRepaintRect(obj, r);
- if (rect.isEmpty())
- rect = r;
- else
- rect.unite(r);
+ rect.unite(r);
}
}
}
RenderStyle* style = renderer->style();
// set basic font info
- AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style->font().getNSFont(), range);
+ AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style->font().primaryFont()->getNSFont(), range);
// set basic colors
AXAttributeStringSetColor(attrString, NSAccessibilityForegroundColorTextAttribute, nsColor(style->color()), range);
#import "config.h"
#import "WebCoreStringTruncator.h"
-#import <wtf/Assertions.h>
#import "Font.h"
+#import "FontPlatformData.h"
+#import "TextStyle.h"
+#import <wtf/Assertions.h>
#define STRING_BUFFER_SIZE 2048
#define ELLIPSIS_CHARACTER 0x2026
break;
#if __APPLE__
case CSS_PROP__WEBKIT_DASHBOARD_REGION: {
- DeprecatedValueList<StyleDashboardRegion> regions = style->dashboardRegions();
- unsigned count = regions.count();
+ const Vector<StyleDashboardRegion>& regions = style->dashboardRegions();
+ unsigned count = regions.size();
if (count == 1 && regions[0].type == StyleDashboardRegion::None)
return new CSSPrimitiveValue(CSS_VAL_NONE);
}
#if __APPLE__
-const DeprecatedValueList<DashboardRegionValue> & Document::dashboardRegions() const
+const Vector<DashboardRegionValue>& Document::dashboardRegions() const
{
return m_dashboardRegions;
}
-void Document::setDashboardRegions (const DeprecatedValueList<DashboardRegionValue>& regions)
+void Document::setDashboardRegions(const Vector<DashboardRegionValue>& regions)
{
m_dashboardRegions = regions;
- setDashboardRegionsDirty (false);
+ setDashboardRegionsDirty(false);
}
#endif
bool dashboardRegionsDirty() const { return m_dashboardRegionsDirty; }
bool hasDashboardRegions () const { return m_hasDashboardRegions; }
void setHasDashboardRegions (bool f) { m_hasDashboardRegions = f; }
- const DeprecatedValueList<DashboardRegionValue> & dashboardRegions() const;
- void setDashboardRegions (const DeprecatedValueList<DashboardRegionValue>& regions);
+ const Vector<DashboardRegionValue>& dashboardRegions() const;
+ void setDashboardRegions(const Vector<DashboardRegionValue>&);
#endif
void removeAllEventListenersFromAllNodes();
#endif
#if __APPLE__
- DeprecatedValueList<DashboardRegionValue> m_dashboardRegions;
+ Vector<DashboardRegionValue> m_dashboardRegions;
bool m_hasDashboardRegions;
bool m_dashboardRegionsDirty;
#endif
void BreakBlockquoteCommand::doApply()
{
- DeprecatedPtrList<Node> ancestors;
-
Selection selection = endingSelection();
if (selection.isNone())
return;
}
// Build up list of ancestors in between the start node and the top blockquote.
- for (Node *node = startNode->parentNode(); node != topBlockquote; node = node->parentNode())
- ancestors.prepend(node);
+ Vector<Node*> ancestors;
+ for (Node* node = startNode->parentNode(); node != topBlockquote; node = node->parentNode())
+ ancestors.append(node);
// Insert a clone of the top blockquote after the break.
RefPtr<Node> clonedBlockquote = topBlockquote->cloneNode(false);
// that was cloned (i.e. the clone of either ancestors.last()
// or clonedBlockquote if ancestors is empty).
RefPtr<Node> clonedAncestor = clonedBlockquote;
- for (DeprecatedPtrListIterator<Node> it(ancestors); it.current(); ++it) {
- RefPtr<Node> clonedChild = it.current()->cloneNode(false); // shallow clone
+ for (size_t i = ancestors.size(); i != 0; --i) {
+ RefPtr<Node> clonedChild = ancestors[i - 1]->cloneNode(false); // shallow clone
appendNode(clonedChild.get(), clonedAncestor.get());
clonedAncestor = clonedChild;
}
}
// Hold open startNode's original parent if we emptied it
- addBlockPlaceholderIfNeeded(ancestors.last());
+ addBlockPlaceholderIfNeeded(ancestors[0]);
// Split the tree up the ancestor chain until the topBlockquote
// Throughout this loop, clonedParent is the clone of ancestor's parent.
// This is so we can clone ancestor's siblings and place the clones
// into the clone corresponding to the ancestor's parent.
- Node *ancestor, *clonedParent;
- for (ancestor = ancestors.last(), clonedParent = clonedAncestor->parentNode();
+ Node* ancestor;
+ Node* clonedParent;
+ for (ancestor = ancestors[0], clonedParent = clonedAncestor->parentNode();
ancestor && ancestor != topBlockquote;
ancestor = ancestor->parentNode(), clonedParent = clonedParent->parentNode()) {
moveNode = ancestor->nextSibling();
startNode = pos.node();
// Build up list of ancestors in between the start node and the start block.
- DeprecatedPtrList<Node> ancestors;
+ Vector<Node*> ancestors;
if (startNode != startBlock) {
- for (Node *n = startNode->parentNode(); n && n != startBlock; n = n->parentNode())
- ancestors.prepend(n);
+ for (Node* n = startNode->parentNode(); n && n != startBlock; n = n->parentNode())
+ ancestors.append(n);
}
// Make sure we do not cause a rendered space to become unrendered.
// Make clones of ancestors in between the start node and the start block.
RefPtr<Node> parent = blockToInsert;
- for (DeprecatedPtrListIterator<Node> it(ancestors); it.current(); ++it) {
- RefPtr<Node> child = it.current()->cloneNode(false); // shallow clone
+ for (size_t i = ancestors.size(); i != 0; --i) {
+ RefPtr<Node> child = ancestors[i - 1]->cloneNode(false); // shallow clone
appendNode(child.get(), parent.get());
parent = child.release();
}
}
// Move everything after the start node.
- Node *leftParent = ancestors.last();
+ Node* leftParent = ancestors[0];
while (leftParent && leftParent != startBlock) {
parent = parent->parentNode();
Node *n = leftParent->nextSibling();
}
}
-void ReplacementFragment::removeUnrenderedNodes(Node *holder)
+void ReplacementFragment::removeUnrenderedNodes(Node* holder)
{
- DeprecatedPtrList<Node> unrendered;
+ Vector<Node*> unrendered;
- for (Node *node = holder->firstChild(); node; node = node->traverseNextNode(holder)) {
+ for (Node* node = holder->firstChild(); node; node = node->traverseNextNode(holder))
if (!isNodeRendered(node) && !isTableStructureNode(node))
unrendered.append(node);
- }
- for (DeprecatedPtrListIterator<Node> it(unrendered); it.current(); ++it)
- removeNode(it.current());
+ size_t n = unrendered.size();
+ for (size_t i = 0; i < n; ++i)
+ removeNode(unrendered[i]);
}
ReplaceSelectionCommand::ReplaceSelectionCommand(Document* document, PassRefPtr<DocumentFragment> fragment,
#define HTML_FormDataList_h
#include "CString.h"
-#include "DeprecatedValueList.h"
#include "PlatformString.h"
#include "TextEncoding.h"
+#include <wtf/Vector.h>
namespace WebCore {
struct FormDataListItem {
+ FormDataListItem() { }
FormDataListItem(const CString& data) : m_data(data) { }
FormDataListItem(const String& path) : m_path(path) { }
{ appendString(key); appendString(String::number(value)); }
void appendFile(const String& key, const String& filename);
- DeprecatedValueListConstIterator<FormDataListItem> begin() const
- { return m_list.begin(); }
- DeprecatedValueListConstIterator<FormDataListItem> end() const
- { return m_list.end(); }
+ const Vector<FormDataListItem>& list() const { return m_list; }
private:
void appendString(const CString&);
void appendString(const String&);
TextEncoding m_encoding;
- DeprecatedValueList<FormDataListItem> m_list;
+ Vector<FormDataListItem> m_list;
};
} // namespace WebCore
if (r->width() > 0 && r->height() > 0)
return true;
- DeprecatedValueList<IntRect> rects;
- int x = 0, y = 0;
+ Vector<IntRect> rects;
+ int x, y;
renderer()->absolutePosition(x, y);
renderer()->absoluteRects(rects, x, y);
- for (DeprecatedValueList<IntRect>::ConstIterator it = rects.begin(); it != rects.end(); ++it)
- if (!(*it).isEmpty())
+ size_t n = rects.size();
+ for (size_t i = 0; i < n; ++i)
+ if (!rects[i].isEmpty())
return true;
return false;
FormDataList lst(encoding);
if (!current->disabled() && current->appendFormData(lst, m_multipart)) {
- for (DeprecatedValueListConstIterator<FormDataListItem> it = lst.begin(); it != lst.end(); ++it) {
+ size_t ln = lst.list().size();
+ for (size_t j = 0; j < ln; ++j) {
+ const FormDataListItem& item = lst.list()[j];
if (!m_multipart) {
// handle ISINDEX / <input name=isindex> special
// but only if its the first entry
- if ( enc_string.isEmpty() && (*it).m_data == "isindex" ) {
- ++it;
- enc_string += encodeCString((*it).m_data);
- }
- else {
- if(!enc_string.isEmpty())
+ if (enc_string.isEmpty() && item.m_data == "isindex") {
+ enc_string += encodeCString(lst.list()[j + 1].m_data);
+ ++j;
+ } else {
+ if (!enc_string.isEmpty())
enc_string += '&';
- enc_string += encodeCString((*it).m_data);
+ enc_string += encodeCString(item.m_data);
enc_string += "=";
- ++it;
- enc_string += encodeCString((*it).m_data);
+ enc_string += encodeCString(lst.list()[j + 1].m_data);
+ ++j;
}
}
else
hstr += m_boundary.deprecatedString().latin1();
hstr += "\r\n";
hstr += "Content-Disposition: form-data; name=\"";
- hstr += (*it).m_data.data();
+ hstr += item.m_data.data();
hstr += "\"";
// if the current type is FILE, then we also need to
}
hstr += "\r\n\r\n";
- ++it;
// append body
result.appendData(hstr.data(), hstr.length());
- const FormDataListItem& item = *it;
+ const FormDataListItem& item = lst.list()[j + 1];
if (size_t dataSize = item.m_data.length())
result.appendData(item.m_data, dataSize);
else if (!item.m_path.isEmpty())
result.appendFile(item.m_path);
result.appendData("\r\n", 2);
+
+ ++j;
}
}
}
}
}
-void RenderPath::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderPath::absoluteRects(Vector<IntRect>& rects, int _tx, int _ty)
{
rects.append(getAbsoluteRepaintRect());
}
virtual short baselinePosition(bool b, bool isRootLineBox = false) const;
virtual void paint(PaintInfo&, int parentX, int parentY);
- virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int tx, int ty);
+ virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual bool nodeAtPoint(NodeInfo&, int x, int y, int tx, int ty, HitTestAction);
return enclosingIntRect(repaintRect);
}
-void RenderSVGImage::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderSVGImage::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
{
rects.append(getAbsoluteRepaintRect());
}
virtual FloatRect relativeBBox(bool includeStroke = true) const;
virtual IntRect getAbsoluteRepaintRect();
- virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int tx, int ty);
+ virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void imageChanged(CachedImage*);
void adjustRectsForAspectRatio(FloatRect& destRect, FloatRect& srcRect, SVGPreserveAspectRatio *aspectRatio);
return RenderBlock::nodeAtPoint(info, (int)localX, (int)localY, _tx, _ty, hitTestAction);
}
-void RenderSVGText::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderSVGText::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
{
AffineTransform mat = translationForAttributes();
mat *= translationTopToBaseline();
virtual AffineTransform localTransform() const { return m_transform; }
virtual void setLocalTransform(const AffineTransform& transform) { m_transform = transform; }
- virtual bool nodeAtPoint(NodeInfo&, int _x, int _y, int _tx, int _ty, HitTestAction);
+ virtual bool nodeAtPoint(NodeInfo&, int x, int y, int tx, int ty, HitTestAction);
- virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int tx, int ty);
+ virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void computeAbsoluteRepaintRect(IntRect& r, bool f);
virtual bool requiresLayer();
#define DocLoader_h
#include "CachePolicy.h"
-#include "DeprecatedPtrList.h"
#include "DeprecatedStringList.h"
#include "Settings.h"
#include "StringHash.h"
m_elements.append(filename);
}
-void FormData::flatten(Vector<char>& a) const
+void FormData::flatten(Vector<char>& data) const
{
// Concatenate all the byte arrays, but omit any files.
- a.clear();
- size_t size = a.size();
- for (DeprecatedValueListConstIterator<FormDataElement> it = m_elements.begin(); it != m_elements.end(); ++it) {
- const FormDataElement& e = *it;
+ data.clear();
+ size_t n = m_elements.size();
+ for (size_t i = 0; i < n; ++i) {
+ const FormDataElement& e = m_elements[i];
if (e.m_type == FormDataElement::data) {
+ size_t oldSize = data.size();
size_t delta = e.m_data.size();
- a.resize(size + delta);
- memcpy(a.data() + size, e.m_data.data(), delta);
- size += delta;
+ data.resize(oldSize + delta);
+ memcpy(data.data() + oldSize, e.m_data.data(), delta);
}
}
}
-/* This file is part of the KDE project
- *
- * Copyright (C) 2004 Apple Computer, Inc.
+/*
+ * Copyright (C) 2004, 2006 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
void flatten(Vector<char>&) const; // omits files
String flattenToString() const; // omits files
- size_t count() const { return m_elements.count(); }
- DeprecatedValueListConstIterator<FormDataElement> begin() const { return m_elements.begin(); }
- DeprecatedValueListConstIterator<FormDataElement> end() const { return m_elements.end(); }
+ const Vector<FormDataElement>& elements() const { return m_elements; }
private:
- DeprecatedValueList<FormDataElement> m_elements;
+ Vector<FormDataElement> m_elements;
};
} // namespace WebCore
headerDict = [[NSDictionary _webcore_dictionaryWithHeaderString:headerString] retain];
NSArray *postData = nil;
- if (job->postData().count() > 0)
+ if (!job->postData().elements().isEmpty())
postData = arrayFromFormData(job->postData());
NSURL *finalNSURL = nil;
return d->m_markedTextUsesUnderlines;
}
-DeprecatedValueList<MarkedTextUnderline> Frame::markedTextUnderlines() const
+const Vector<MarkedTextUnderline>& Frame::markedTextUnderlines() const
{
return d->m_markedTextUnderlines;
}
template <typename T> class Timer;
struct MarkedTextUnderline {
+ MarkedTextUnderline()
+ : startOffset(0), endOffset(0), thick(false) { }
MarkedTextUnderline(unsigned s, unsigned e, const Color& c, bool t)
: startOffset(s), endOffset(e), color(c), thick(t) { }
unsigned startOffset;
UChar backslashAsCurrencySymbol() const;
- DeprecatedValueList<MarkedTextUnderline> markedTextUnderlines() const;
+ const Vector<MarkedTextUnderline>& markedTextUnderlines() const;
bool markedTextUsesUnderlines() const;
unsigned markAllMatchesForText(const String&, bool caseFlag);
KURL m_submittedFormURL;
bool m_markedTextUsesUnderlines;
- DeprecatedValueList<MarkedTextUnderline> m_markedTextUnderlines;
+ Vector<MarkedTextUnderline> m_markedTextUnderlines;
bool m_highlightTextMatches;
bool m_windowHasFocus;
/*
- * Copyright (C) 2003 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#ifndef WebCoreSettings_H
#define WebCoreSettings_H
-#include "Font.h"
+#include "AtomicString.h"
#include "KURL.h"
namespace WebCore {
#include "config.h"
#include "Font.h"
-#include "FontData.h"
+#include "FloatRect.h"
#include "FontFallbackList.h"
-#include "GraphicsContext.h"
-#include "Settings.h"
-
+#include "IntPoint.h"
#include "GlyphBuffer.h"
-
+#include "TextStyle.h"
+#include <unicode/uchar.h>
#include <unicode/umachine.h>
#include <unicode/unorm.h>
-
#include <wtf/MathExtras.h>
namespace WebCore {
// According to http://www.unicode.org/Public/UNIDATA/UCD.html#Canonical_Combining_Class_Values
-#define HIRAGANA_KATAKANA_VOICING_MARKS 8
+const uint8_t hiraganaKatakanaVoicingMarksCombiningClass = 8;
const uint8_t Font::gRoundingHackCharacterTable[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*\t*/, 1 /*\n*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
WidthIterator::WidthIterator(const Font* font, const TextRun& run, const TextStyle& style, const FontData* substituteFontData)
-:m_font(font), m_run(run), m_end(style.rtl() ? run.length() : run.to()), m_style(style), m_substituteFontData(substituteFontData),
- m_currentCharacter(run.from()), m_runWidthSoFar(0), m_finalRoundingWidth(0)
+ : m_font(font)
+ , m_run(run)
+ , m_end(style.rtl() ? run.length() : run.to())
+ , m_style(style)
+ , m_substituteFontData(substituteFontData)
+ , m_currentCharacter(run.from())
+ , m_runWidthSoFar(0)
+ , m_finalRoundingWidth(0)
{
// If the padding is non-zero, count the number of spaces in the run
// and divide that by the padding for per space addition.
UChar32 WidthIterator::normalizeVoicingMarks(int currentCharacter)
{
if (currentCharacter + 1 < m_end) {
- if (u_getCombiningClass(m_run[currentCharacter + 1]) == HIRAGANA_KATAKANA_VOICING_MARKS) {
+ if (u_getCombiningClass(m_run[currentCharacter + 1]) == hiraganaKatakanaVoicingMarksCombiningClass) {
// Normalize into composed form using 3.2 rules.
UChar normalizedCharacters[2] = { 0, 0 };
UErrorCode uStatus = U_ZERO_ERROR;
m_fontList->invalidate();
}
+int Font::width(const TextRun& run) const
+{
+ return width(run, TextStyle());
+}
+
int Font::width(const TextRun& run, const TextStyle& style) const
{
return lroundf(floatWidth(run, style));
#ifndef FONT_H
#define FONT_H
-#include "Color.h"
#include "FontDescription.h"
-#include "FontData.h"
-#include "TextDirection.h"
-#include "GlyphBuffer.h"
#if PLATFORM(QT)
class QFont;
namespace WebCore {
+class FloatPoint;
+class FloatRect;
+class FontData;
class FontFallbackList;
+class FontPlatformData;
+class GlyphBuffer;
class GraphicsContext;
class IntPoint;
-class IntRect;
-class FloatRect;
-class FloatPoint;
+class TextStyle;
-class TextRun
-{
+class TextRun {
public:
TextRun(const UChar* c, int len)
:m_characters(c), m_len(len), m_from(0), m_to(len)
int m_to;
};
-class TextStyle
-{
-public:
- TextStyle(int tabWidth = 0, int xpos = 0, int padding = 0, bool rtl = false, bool directionalOverride = false,
- bool applyRunRounding = true, bool applyWordRounding = true, bool attemptFontSubstitution = true)
- :m_tabWidth(tabWidth), m_xpos(xpos), m_padding(padding), m_rtl(rtl), m_directionalOverride(directionalOverride),
- m_applyRunRounding(applyRunRounding), m_applyWordRounding(applyWordRounding), m_attemptFontSubstitution(attemptFontSubstitution)
- {}
-
- int tabWidth() const { return m_tabWidth; }
- int xPos() const { return m_xpos; }
- int padding() const { return m_padding; }
- bool rtl() const { return m_rtl; }
- bool ltr() const { return !m_rtl; }
- bool directionalOverride() const { return m_directionalOverride; }
- bool applyRunRounding() const { return m_applyRunRounding; }
- bool applyWordRounding() const { return m_applyWordRounding; }
- bool attemptFontSubstitution() const { return m_attemptFontSubstitution; }
-
- void disableRoundingHacks() { m_applyRunRounding = m_applyWordRounding = false; }
- void setRTL(bool b) { m_rtl = b; }
-
-private:
- int m_tabWidth;
- int m_xpos;
- int m_padding;
- bool m_rtl;
- bool m_directionalOverride;
- bool m_applyRunRounding;
- bool m_applyWordRounding;
- bool m_attemptFontSubstitution;
-};
-
class Font {
public:
Font();
Font(const FontDescription&, short letterSpacing, short wordSpacing);
#if PLATFORM(MAC)
- Font(const FontPlatformData& fontPlatformData); // This constructor is only used by Mac-specific code that already has a native font.
+ Font(const FontPlatformData&); // This constructor is only used by Mac-specific code that already has a native font.
#endif
~Font();
void drawText(GraphicsContext*, const TextRun&, const TextStyle&, const FloatPoint&) const;
- int width(const TextRun&, const TextStyle& = TextStyle()) const;
- float floatWidth(const TextRun&, const TextStyle& = TextStyle()) const;
+ int width(const TextRun&, const TextStyle&) const;
+ int width(const TextRun&) const;
+ float floatWidth(const TextRun&, const TextStyle&) const;
+ float floatWidth(const TextRun&) const;
int offsetForPosition(const TextRun&, const TextStyle&, int position, bool includePartialGlyphs) const;
FloatRect selectionRectForText(const TextRun&, const TextStyle&, const IntPoint&, int h) const;
unsigned weight() const { return m_fontDescription.weight(); }
bool bold() const { return m_fontDescription.bold(); }
-#if PLATFORM(MAC)
- NSFont* getNSFont() const { return primaryFont()->getNSFont(); }
-#endif
-
#if PLATFORM(QT)
operator QFont() const;
#endif
/*
- * This file is part of the internal font implementation. It should not be included by anyone other than
- * FontMac.cpp, FontWin.cpp and Font.cpp.
+ * This file is part of the internal font implementation.
*
* Copyright (C) 2006 Apple Computer, Inc.
*
// FIXME: Temporary. Only needed to support API that's going to move.
#include <unicode/umachine.h>
+#if PLATFORM(MAC)
+typedef struct OpaqueATSUStyle* ATSUStyle;
+#endif
+
namespace WebCore {
class FontDescription;
*/
#include "config.h"
-#include "Font.h"
#include "FontFallbackList.h"
+
+#include "Font.h"
#include "FontCache.h"
-namespace WebCore
-{
+namespace WebCore {
FontFallbackList::FontFallbackList()
-:m_familyIndex(0), m_pitch(UnknownPitch)
-{
-}
-
-FontFallbackList::~FontFallbackList()
+ : m_familyIndex(0), m_pitch(UnknownPitch)
{
}
// This file has no guards on purpose in order to detect redundant includes. This is a private header
// and so this should catch anyone trying to include this file in public cpp files.
+#include "FontData.h"
+#include "Shared.h"
#include <wtf/Noncopyable.h>
#include <wtf/Vector.h>
-#include <Shared.h>
-#include "FontData.h"
namespace WebCore {
class Font;
class GraphicsContext;
class IntRect;
-class FontData;
class FontDescription;
class FontPlatformData;
class FontFallbackList : public Shared<FontFallbackList>, Noncopyable {
public:
FontFallbackList();
- ~FontFallbackList();
void invalidate();
namespace WebCore {
-FontFamily::FontFamily()
- : m_next(0)
- , m_refCnt(0)
-{
-}
-
FontFamily::FontFamily(const FontFamily& other)
- : m_family(other.m_family)
+ : Shared<FontFamily>()
+ , m_family(other.m_family)
, m_next(other.m_next)
- , m_refCnt(0)
{
- if (m_next)
- m_next->ref();
}
-FontFamily::~FontFamily()
-{
- if (m_next)
- m_next->deref();
-}
-
FontFamily& FontFamily::operator=(const FontFamily& other)
{
- if (other.m_next)
- other.m_next->ref();
- if (m_next)
- m_next->deref();
m_family = other.m_family;
m_next = other.m_next;
return *this;
}
-void FontFamily::setFamily(const AtomicString &family)
-{
- m_family = family;
-}
-
bool FontFamily::operator==(const FontFamily &compareFontFamily) const
{
if ((!m_next && compareFontFamily.m_next) ||
/*
- * Copyright (C) 2003 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#define FONT_FAMILY_H
#include "AtomicString.h"
-
-#if __APPLE__
-#ifdef __OBJC__
-@class NSString;
-#else
-class NSString;
-#endif
-#endif
+#include "Shared.h"
+#include <wtf/RefPtr.h>
namespace WebCore {
-class FontFamily {
+class FontFamily : public Shared<FontFamily> {
public:
- FontFamily();
- ~FontFamily();
+ FontFamily() { }
- FontFamily(const FontFamily &);
- FontFamily &operator=(const FontFamily &);
-
- void setFamily(const AtomicString &);
+ FontFamily(const FontFamily&);
+ FontFamily& operator=(const FontFamily&);
+
+ void setFamily(const AtomicString& family) { m_family = family; }
const AtomicString& family() const { return m_family; }
bool familyIsEmpty() const { return m_family.isEmpty(); }
- FontFamily *next() { return m_next; }
- const FontFamily *next() const { return m_next; }
+ FontFamily* next() { return m_next.get(); }
+ const FontFamily* next() const { return m_next.get(); }
- void appendFamily(FontFamily *family)
- {
- if (family)
- family->ref();
- if (m_next)
- m_next->deref();
- m_next = family;
- }
-
- bool operator==(const FontFamily &) const;
- bool operator!=(const FontFamily &x) const { return !(*this == x); }
-
- void ref() { m_refCnt++; }
- void deref() { m_refCnt--; if (m_refCnt == 0) delete this; }
+ void appendFamily(PassRefPtr<FontFamily> family) { m_next = family; }
+
+ bool operator==(const FontFamily&) const;
+ bool operator!=(const FontFamily& x) const { return !(*this == x); }
private:
AtomicString m_family;
- FontFamily* m_next;
- int m_refCnt;
+ RefPtr<FontFamily> m_next;
};
}
#ifndef GLYPH_BUFFER_H
#define GLYPH_BUFFER_H
-// MAX_GLYPH_EXPANSION is the maximum numbers of glyphs that may be
-// use to represent a single Unicode code point.
-#define MAX_GLYPH_EXPANSION 4
-#define GLYPH_BUFFER_SIZE 2048
-
#if PLATFORM(CG)
#include <ApplicationServices/ApplicationServices.h>
#elif PLATFORM(CAIRO)
#include <wtf/Vector.h>
-namespace WebCore
-{
+namespace WebCore {
+
typedef unsigned short Glyph;
class FontData;
typedef FloatSize GlyphBufferAdvance;
#endif
-class GlyphBuffer
-{
+class GlyphBuffer {
public:
- GlyphBuffer() {};
-
bool isEmpty() const { return m_fontData.isEmpty(); }
int size() const { return m_fontData.size(); }
m_advances.clear();
}
- GlyphBufferGlyph* glyphs(int from) const { return ((GlyphBufferGlyph*)m_glyphs.data()) + from; }
- GlyphBufferAdvance* advances(int from) const { return ((GlyphBufferAdvance*)m_advances.data()) + from; }
+ GlyphBufferGlyph* glyphs(int from) { return m_glyphs.data() + from; }
+ GlyphBufferAdvance* advances(int from) { return m_advances.data() + from; }
+ const GlyphBufferGlyph* glyphs(int from) const { return m_glyphs.data() + from; }
+ const GlyphBufferAdvance* advances(int from) const { return m_advances.data() + from; }
const FontData* fontDataAt(int index) const { return m_fontData[index]; }
}
private:
- Vector<const FontData*, GLYPH_BUFFER_SIZE> m_fontData;
- Vector<GlyphBufferGlyph, GLYPH_BUFFER_SIZE> m_glyphs;
- Vector<GlyphBufferAdvance, GLYPH_BUFFER_SIZE> m_advances;
+ Vector<const FontData*, 2048> m_fontData;
+ Vector<GlyphBufferGlyph, 2048> m_glyphs;
+ Vector<GlyphBufferAdvance, 2048> m_advances;
};
}
#include "config.h"
#include "GlyphMap.h"
-#include "FontData.h"
+#include "FontData.h"
#include <unicode/uchar.h>
-#define NO_BREAK_SPACE 0x00A0
-#define ZERO_WIDTH_SPACE 0x200B
+namespace WebCore {
-namespace WebCore
-{
+const UChar nonBreakingSpace = 0x00A0;
+const UChar zeroWidthSpace = 0x200B;
GlyphData GlyphMap::glyphDataForCharacter(UChar32 c, const FontData* fontData)
{
- unsigned pageNumber = (c / cGlyphPageSize);
+ unsigned pageNumber = (c / GlyphPage::size);
GlyphPage* page = locatePage(pageNumber, fontData);
if (page)
return page->glyphDataForCharacter(c);
void GlyphMap::setGlyphDataForCharacter(UChar32 c, Glyph glyph, const FontData* fontData)
{
- unsigned pageNumber = (c / cGlyphPageSize);
+ unsigned pageNumber = (c / GlyphPage::size);
GlyphPage* page = locatePage(pageNumber, fontData);
if (page)
page->setGlyphDataForCharacter(c, glyph, fontData);
page = new GlyphPage;
}
- unsigned start = pageNumber * cGlyphPageSize;
- UChar buffer[cGlyphPageSize * 2 + 2];
+ unsigned start = pageNumber * GlyphPage::size;
+ UChar buffer[GlyphPage::size * 2 + 2];
unsigned bufferLength;
unsigned i;
// Fill in a buffer with the entire "page" of characters that we want to look up glyphs for.
if (start < 0x10000) {
- bufferLength = cGlyphPageSize;
- for (i = 0; i < cGlyphPageSize; i++)
+ bufferLength = GlyphPage::size;
+ for (i = 0; i < GlyphPage::size; i++)
buffer[i] = start + i;
if (start == 0) {
// Control characters must not render at all.
for (i = 0; i < 0x20; ++i)
- buffer[i] = ZERO_WIDTH_SPACE;
+ buffer[i] = zeroWidthSpace;
for (i = 0x7F; i < 0xA0; i++)
- buffer[i] = ZERO_WIDTH_SPACE;
+ buffer[i] = zeroWidthSpace;
// \n, \t, and nonbreaking space must render as a space.
buffer[(int)'\n'] = ' ';
buffer[(int)'\t'] = ' ';
- buffer[NO_BREAK_SPACE] = ' ';
+ buffer[nonBreakingSpace] = ' ';
}
} else {
- bufferLength = cGlyphPageSize * 2;
- for (i = 0; i < cGlyphPageSize; i++) {
+ bufferLength = GlyphPage::size * 2;
+ for (i = 0; i < GlyphPage::size; i++) {
int c = i + start;
buffer[i * 2] = U16_LEAD(c);
buffer[i * 2 + 1] = U16_TRAIL(c);
#define GLYPH_MAP_H
#include <unicode/umachine.h>
-#include "GlyphBuffer.h"
#include <wtf/Noncopyable.h>
#include <wtf/HashMap.h>
namespace WebCore {
-// Covers Latin-1.
-const unsigned cGlyphPageSize = 256;
-
class FontData;
-struct GlyphData
-{
+typedef unsigned short Glyph;
+
+struct GlyphData {
Glyph glyph;
const FontData* fontData;
};
-class GlyphMap : Noncopyable
-{
+class GlyphMap : Noncopyable {
public:
GlyphMap() : m_filledPrimaryPage(false), m_pages(0) {}
~GlyphMap() { if (m_pages) { deleteAllValues(*m_pages); delete m_pages; } }
GlyphData glyphDataForCharacter(UChar32, const FontData*);
void setGlyphDataForCharacter(UChar32, Glyph, const FontData*);
-
+
private:
struct GlyphPage {
- GlyphData m_glyphs[cGlyphPageSize];
+ static const size_t size = 256; // Covers Latin-1 in a single page.
+ GlyphData m_glyphs[size];
- const GlyphData& glyphDataForCharacter(UChar32 c) const { return m_glyphs[c % cGlyphPageSize]; }
+ const GlyphData& glyphDataForCharacter(UChar32 c) const { return m_glyphs[c % size]; }
void setGlyphDataForCharacter(UChar32 c, Glyph g, const FontData* f)
{
- setGlyphDataForIndex(c % cGlyphPageSize, g, f);
+ setGlyphDataForIndex(c % size, g, f);
}
-
- void setGlyphDataForIndex(unsigned index, Glyph g, const FontData* f) {
+ void setGlyphDataForIndex(unsigned index, Glyph g, const FontData* f)
+ {
m_glyphs[index].glyph = g;
m_glyphs[index].fontData = f;
}
};
-
+
GlyphPage* locatePage(unsigned page, const FontData* fontData);
bool fillPage(GlyphPage*, UChar* characterBuffer, unsigned bufferLength, const FontData* fontData);
-
+
bool m_filledPrimaryPage;
- GlyphPage m_primaryPage; // We optimize for the page that contains Latin1.
+ GlyphPage m_primaryPage; // We optimize for the page that contains Latin-1.
HashMap<int, GlyphPage*>* m_pages;
};
}
+
#endif
float GlyphWidthMap::widthForGlyph(Glyph g)
{
- unsigned pageNumber = (g / cGlyphWidthPageSize);
+ unsigned pageNumber = (g / GlyphWidthPage::size);
GlyphWidthPage* page = locatePage(pageNumber);
if (page)
return page->widthForGlyph(g);
void GlyphWidthMap::setWidthForGlyph(Glyph glyph, float width)
{
- unsigned pageNumber = (glyph / cGlyphWidthPageSize);
+ unsigned pageNumber = (glyph / GlyphWidthPage::size);
GlyphWidthPage* page = locatePage(pageNumber);
if (page)
page->setWidthForGlyph(glyph, width);
}
// Fill in the whole page with the unknown glyph width value.
- for (unsigned i = 0; i < cGlyphWidthPageSize; i++)
+ for (unsigned i = 0; i < GlyphWidthPage::size; i++)
page->setWidthForIndex(i, cGlyphWidthUnknown);
return page;
#define GLYPH_WIDTH_MAP_H
#include <unicode/umachine.h>
-#include "GlyphBuffer.h"
#include <wtf/Noncopyable.h>
#include <wtf/HashMap.h>
namespace WebCore {
-// Covers Latin-1.
-const unsigned cGlyphWidthPageSize = 256;
-const float cGlyphWidthUnknown = -1;
+typedef unsigned short Glyph;
-class FontData;
+const float cGlyphWidthUnknown = -1;
-class GlyphWidthMap : Noncopyable
-{
+class GlyphWidthMap : Noncopyable {
public:
GlyphWidthMap() : m_filledPrimaryPage(false), m_pages(0) {}
~GlyphWidthMap() { if (m_pages) { deleteAllValues(*m_pages); delete m_pages; } }
- float widthForGlyph(Glyph g);
- void setWidthForGlyph(Glyph g, float f);
+ float widthForGlyph(Glyph);
+ void setWidthForGlyph(Glyph, float);
private:
struct GlyphWidthPage {
- float m_widths[cGlyphWidthPageSize];
+ static const size_t size = 256; // Usually covers Latin-1 in a single page.
+ float m_widths[size];
- float widthForGlyph(Glyph g) const { return m_widths[g % cGlyphWidthPageSize]; }
- void setWidthForGlyph(Glyph g, float f)
+ float widthForGlyph(Glyph g) const { return m_widths[g % size]; }
+ void setWidthForGlyph(Glyph g, float w)
{
- setWidthForIndex(g % cGlyphWidthPageSize, f);
+ setWidthForIndex(g % size, w);
}
-
- void setWidthForIndex(unsigned index, float f) {
- m_widths[index] = f;
+ void setWidthForIndex(unsigned index, float w)
+ {
+ m_widths[index] = w;
}
};
#include "GraphicsContext.h"
#include "Font.h"
+#include "TextStyle.h"
using namespace std;
drawImage(image, FloatRect(dest), srcRect, op);
}
+void GraphicsContext::drawText(const TextRun& run, const IntPoint& point)
+{
+ drawText(run, point, TextStyle());
+}
+
void GraphicsContext::drawText(const TextRun& run, const IntPoint& point, const TextStyle& style)
{
if (paintingDisabled())
#define GraphicsContext_h
#include "FloatRect.h"
-#include "Font.h"
#include "Image.h"
#include "IntRect.h"
#include "Pen.h"
class GraphicsContextPrivate;
class GraphicsContextPlatformPrivate;
class Path;
+ class TextRun;
+ class TextStyle;
#ifdef SVG_SUPPORT
class KRenderingDeviceContext;
void setFocusRingClip(const IntRect&);
void clearFocusRingClip();
- void drawText(const TextRun&, const IntPoint&, const TextStyle& = TextStyle());
+ void drawText(const TextRun&, const IntPoint&);
+ void drawText(const TextRun&, const IntPoint&, const TextStyle&);
void drawHighlightForText(const TextRun&, const IntPoint&, int h, const TextStyle&, const Color& backgroundColor);
FloatRect roundToDevicePixels(const FloatRect&);
class FloatRect;
class GraphicsContext;
class IntRect;
-class IntSize;
class PDFDocumentImage;
class String;
#include "PlatformString.h"
#include "TextCodecLatin1.h"
#include "TextCodecUTF16.h"
+#include <ctype.h>
#include <wtf/Assertions.h>
#include <wtf/HashMap.h>
#if PLATFORM(MAC)
#include "StreamingTextDecoderMac.h"
#endif
-#if PLATFORM(WIN)
-#include <ctype.h>
-#endif
namespace WebCore {
--- /dev/null
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef TextStyle_h
+#define TextStyle_h
+
+namespace WebCore {
+
+class TextStyle {
+public:
+ TextStyle(int tabWidth = 0, int xpos = 0, int padding = 0, bool rtl = false, bool directionalOverride = false,
+ bool applyRunRounding = true, bool applyWordRounding = true, bool attemptFontSubstitution = true)
+ : m_tabWidth(tabWidth)
+ , m_xpos(xpos)
+ , m_padding(padding)
+ , m_rtl(rtl)
+ , m_directionalOverride(directionalOverride)
+ , m_applyRunRounding(applyRunRounding)
+ , m_applyWordRounding(applyWordRounding)
+ , m_attemptFontSubstitution(attemptFontSubstitution)
+ {
+ }
+
+ int tabWidth() const { return m_tabWidth; }
+ int xPos() const { return m_xpos; }
+ int padding() const { return m_padding; }
+ bool rtl() const { return m_rtl; }
+ bool ltr() const { return !m_rtl; }
+ bool directionalOverride() const { return m_directionalOverride; }
+ bool applyRunRounding() const { return m_applyRunRounding; }
+ bool applyWordRounding() const { return m_applyWordRounding; }
+ bool attemptFontSubstitution() const { return m_attemptFontSubstitution; }
+
+ void disableRoundingHacks() { m_applyRunRounding = m_applyWordRounding = false; }
+ void setRTL(bool b) { m_rtl = b; }
+
+private:
+ int m_tabWidth;
+ int m_xpos;
+ int m_padding;
+ bool m_rtl;
+ bool m_directionalOverride;
+ bool m_applyRunRounding;
+ bool m_applyWordRounding;
+ bool m_attemptFontSubstitution;
+};
+
+}
+
+#endif
#if PLATFORM(CG)
-#include <ApplicationServices/ApplicationServices.h>
#include "FloatRect.h"
#include "GraphicsContext.h"
#include "PDFDocumentImage.h"
#include "PlatformString.h"
+#include <ApplicationServices/ApplicationServices.h>
+
#if PLATFORM(MAC)
#include "WebCoreSystemInterface.h"
#endif
#import "FontCache.h"
#import "Font.h"
+#import "FontData.h"
#import "FontPlatformData.h"
#import "ListBox.h"
#import "WebCoreStringTruncator.h"
const FontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
{
- NSFont* nsFont = font.getNSFont();
+ NSFont* nsFont = font.primaryFont()->getNSFont();
NSString *string = [[NSString alloc] initWithCharactersNoCopy:(UniChar*)characters length:length freeWhenDone:NO];
NSFont* substituteFont = wkGetFontInLanguageForRange(nsFont, string, NSMakeRange(0, [string length]));
if (!substituteFont && [string length] == 1)
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2006 Alexey Proskuryakov
*
* Redistribution and use in source and binary forms, with or without
*/
#import "config.h"
-#import "Font.h"
#import "FontData.h"
-#import "Color.h"
-
-#import <wtf/Assertions.h>
-
-#import <ApplicationServices/ApplicationServices.h>
-
-#import "FontCache.h"
-
-#import "WebCoreSystemInterface.h"
+#import "Color.h"
#import "FloatRect.h"
+#import "Font.h"
+#import "FontCache.h"
#import "FontDescription.h"
-
+#import "WebCoreSystemInterface.h"
+#import <ApplicationServices/ApplicationServices.h>
#import <float.h>
-
#import <unicode/uchar.h>
-
-// FIXME: Just temporary for the #defines of constants that we will eventually stop using.
-#import "GlyphBuffer.h"
+#import <wtf/Assertions.h>
@interface NSFont (WebAppKitSecretAPI)
- (BOOL)_isFakeFixedPitch;
@end
-namespace WebCore
-{
-
-#define SMALLCAPS_FONTSIZE_MULTIPLIER 0.7f
-#define SPACE 0x0020
-#define CONTEXT_DPI (72.0)
-#define SCALE_EM_TO_UNITS(X, U_PER_EM) (X * ((1.0 * CONTEXT_DPI) / (CONTEXT_DPI * U_PER_EM)))
+namespace WebCore {
+
+const float smallCapsFontSizeMultiplier = 0.7f;
+const float contextDPI = 72.0f;
+static inline float scaleEmToUnits(float x, unsigned unitsPerEm) { return x * (contextDPI / (contextDPI * unitsPerEm)); }
bool initFontData(FontData* fontData)
{
unsigned unitsPerEm;
wkGetFontMetrics(m_font.font, &iAscent, &iDescent, &iLineGap, &unitsPerEm);
float pointSize = [m_font.font pointSize];
- float fAscent = SCALE_EM_TO_UNITS(iAscent, unitsPerEm) * pointSize;
- float fDescent = -SCALE_EM_TO_UNITS(iDescent, unitsPerEm) * pointSize;
- float fLineGap = SCALE_EM_TO_UNITS(iLineGap, unitsPerEm) * pointSize;
+ float fAscent = scaleEmToUnits(iAscent, unitsPerEm) * pointSize;
+ float fDescent = -scaleEmToUnits(iDescent, unitsPerEm) * pointSize;
+ float fLineGap = scaleEmToUnits(iLineGap, unitsPerEm) * pointSize;
// We need to adjust Times, Helvetica, and Courier to closely match the
// vertical metrics of their Microsoft counterparts that are the de facto
{
if (!m_smallCapsFontData) {
NS_DURING
- float size = [m_font.font pointSize] * SMALLCAPS_FONTSIZE_MULTIPLIER;
+ float size = [m_font.font pointSize] * smallCapsFontSizeMultiplier;
FontPlatformData smallCapsFont([[NSFontManager sharedFontManager] convertFont:m_font.font toSize:size]);
// AppKit resets the type information (screen/printer) when you convert a font to a different size.
#import "config.h"
#import "Font.h"
-#import "Logging.h"
#import "BlockExceptions.h"
-#import "FoundationExtras.h"
-
+#import "FontData.h"
#import "FontFallbackList.h"
+#import "FoundationExtras.h"
+#import "GlyphBuffer.h"
#import "GraphicsContext.h"
-#import "Settings.h"
-
-#import "FontData.h"
-
#import "IntRect.h"
-
+#import "Logging.h"
+#import "Settings.h"
+#import "TextStyle.h"
#import "WebCoreSystemInterface.h"
#import "WebCoreTextRenderer.h"
#include "FontData.h"
#include "WebCoreSystemInterface.h"
+#include <ApplicationServices/ApplicationServices.h>
namespace WebCore {
// Use an array of long so we get good enough alignment.
long glyphVector[(GLYPH_VECTOR_SIZE + sizeof(long) - 1) / sizeof(long)];
- OSStatus status = wkInitializeGlyphVector(cGlyphPageSize, &glyphVector);
+ OSStatus status = wkInitializeGlyphVector(GlyphPage::size, &glyphVector);
if (status != noErr)
// This should never happen, perhaps indicates a bad font! If it does the
// font substitution code will find an alternate font.
wkConvertCharToGlyphs(fontData->m_styleGroup, buffer, bufferLength, &glyphVector);
unsigned numGlyphs = wkGetGlyphVectorNumGlyphs(&glyphVector);
- if (numGlyphs != cGlyphPageSize) {
+ if (numGlyphs != GlyphPage::size) {
// This should never happen, perhaps indicates a bad font?
// If it does happen, the font substitution code will find an alternate font.
wkClearGlyphVector(&glyphVector);
}
ATSLayoutRecord* glyphRecord = (ATSLayoutRecord*)wkGetGlyphVectorFirstRecord(glyphVector);
- for (unsigned i = 0; i < cGlyphPageSize; i++) {
+ for (unsigned i = 0; i < GlyphPage::size; i++) {
page->setGlyphDataForIndex(i, glyphRecord->glyphID, fontData);
glyphRecord = (ATSLayoutRecord *)((char *)glyphRecord + wkGetGlyphVectorRecordSize(glyphVector));
}
#import "ListBox.h"
#import "BlockExceptions.h"
-#import "FrameMac.h"
-#import "WebCoreFrameBridge.h"
#import "FontData.h"
+#import "FrameMac.h"
+#import "GraphicsContext.h"
#import "RenderView.h"
#import "RenderWidget.h"
+#import "TextStyle.h"
+#import "WebCoreFrameBridge.h"
#import "WebCoreWidgetHolder.h"
#import "WidgetClient.h"
#import <wtf/Assertions.h>
-#import "GraphicsContext.h"
-
using namespace WebCore;
const int minLines = 4; /* ensures we have a scroll bar */
- (void)fontChanged
{
- NSFont *font = _box->font().getNSFont();
+ NSFont *font = _box->font().primaryFont()->getNSFont();
isSystemFont = [[font fontName] isEqualToString:[itemFont() fontName]] && [font pointSize] == [itemFont() pointSize];
[self setRowHeight:ceilf([font ascender] - [font descender] + bottomMargin)];
[self setNeedsDisplay:YES];
#import "PopUpButton.h"
#import "BlockExceptions.h"
+#import "Font.h"
+#import "FontData.h"
#import "FoundationExtras.h"
#import "FrameMac.h"
-#import "TextField.h"
-#import "WebCoreFrameBridge.h"
-#import "FontData.h"
#import "RenderView.h"
#import "RenderWidget.h"
+#import "TextField.h"
+#import "TextStyle.h"
+#import "WebCoreFrameBridge.h"
#import "WebCoreWidgetHolder.h"
#import "WidgetClient.h"
-#import "Font.h"
using namespace WebCore;
if (!headerString.isEmpty())
headerDict = [NSDictionary _webcore_dictionaryWithHeaderString:headerString];
- if (postData().count() > 0)
+ if (!postData().elements().isEmpty())
handle = [bridge startLoadingResource:resourceLoader withMethod:method() URL:url().getNSURL() customHeaders:headerDict postData:arrayFromFormData(postData())];
else
handle = [bridge startLoadingResource:resourceLoader withMethod:method() URL:url().getNSURL() customHeaders:headerDict];
#import "config.h"
#import "TextField.h"
-#import "Color.h"
-#import "IntSize.h"
#import "BlockExceptions.h"
+#import "Color.h"
#import "Font.h"
-#import "Logging.h"
-#import "WebCoreTextField.h"
-#import "WebCoreFrameBridge.h"
#import "FontData.h"
+#import "IntSize.h"
+#import "Logging.h"
#import "RenderView.h"
#import "RenderWidget.h"
+#import "TextStyle.h"
+#import "WebCoreFrameBridge.h"
+#import "WebCoreTextField.h"
#import "WebCoreViewFactory.h"
#import "WidgetClient.h"
else {
NSTextField *textField = (NSTextField *)getView();
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- [textField setFont:font.getNSFont()];
+ [textField setFont:font.primaryFont()->getNSFont()];
END_BLOCK_OBJC_EXCEPTIONS;
}
}
#ifndef WebCoreSystemInterface_h
#define WebCoreSystemInterface_h
-typedef signed char BOOL;
+#include <ApplicationServices/ApplicationServices.h>
+#include <objc/objc.h>
-#ifndef CGGEOMETRY_H_
-typedef struct CGRect CGRect;
-#endif
+typedef struct _NSRange NSRange;
#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+typedef struct CGPoint NSPoint;
typedef struct CGRect NSRect;
#else
+typedef struct _NSPoint NSPoint;
typedef struct _NSRect NSRect;
#endif
-#ifndef CGGEOMETRY_H_
-typedef struct CGPoint CGPoint;
-#endif
-
-#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
-typedef struct CGPoint NSPoint;
+#ifdef __OBJC__
+@class NSFont;
#else
-typedef struct _NSPoint NSPoint;
-#endif
-
-typedef struct _NSRange NSRange;
-
-#ifndef __OBJC__
-class NSImage;
-class NSMenu;
-class NSString;
-class NSView;
-class NSURLConnection;
+typedef struct NSFont NSFont;
+typedef struct NSImage NSImage;
+typedef struct NSMenu NSMenu;
+typedef struct NSString NSString;
+typedef struct NSURLConnection NSURLConnection;
+typedef struct NSView NSView;
+typedef struct objc_object *id;
#endif
#ifdef __cplusplus
extern BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
extern void (*wkClearGlyphVector)(void* glyphs);
+extern CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *),
+ void (*formFinalize)(CFReadStreamRef, void *),
+ Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
+ CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
+ Boolean (*formCanRead)(CFReadStreamRef, void *),
+ void (*formClose)(CFReadStreamRef, void *),
+ void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
+ void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
+ void *context);
extern OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
+extern id (*wkCreateNSURLConnectionDelegateProxy)(void);
extern void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
extern void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
extern void (*wkDrawFocusRing)(CGContextRef, CGRect clipRect, CGColorRef, int radius);
extern void (*wkReleaseStyleGroup)(void* group);
extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
-extern void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
+extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
+extern void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint);
extern void (*wkSetUpFontCache)(size_t);
extern void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
-extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
extern void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
-extern CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *),
- void (*formFinalize)(CFReadStreamRef, void *),
- Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
- CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
- Boolean (*formCanRead)(CFReadStreamRef, void *),
- void (*formClose)(CFReadStreamRef, void *),
- void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
- void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
- void *context);
-extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
-extern id (*wkCreateNSURLConnectionDelegateProxy)(void);
+extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
#ifdef __cplusplus
}
#import "Font.h"
#import "FontData.h"
-#import "WebFontCache.h"
-#import "IntPoint.h"
#import "GraphicsContext.h"
+#import "IntPoint.h"
+#import "TextStyle.h"
+#import "WebFontCache.h"
using namespace WebCore;
#include "EllipsisBox.h"
#include "GraphicsContext.h"
+#include "TextStyle.h"
namespace WebCore {
#include "Document.h"
#include "Frame.h"
#include "GraphicsContext.h"
-#include "RenderBlock.h"
-#include "break_lines.h"
#include "Range.h"
#include "RenderArena.h"
+#include "RenderBlock.h"
+#include "TextStyle.h"
+#include "break_lines.h"
#include <wtf/AlwaysInline.h>
#if PLATFORM(MAC)
// 2. Now paint the foreground, including text and decorations like underline/overline (in quirks mode only).
if (m_len <= 0) return;
- DeprecatedValueList<MarkedTextUnderline> underlines;
+ const Vector<MarkedTextUnderline>* underlines = 0;
+ size_t numUnderlines = 0;
if (haveMarkedText && markedTextUsesUnderlines) {
- underlines = object()->document()->frame()->markedTextUnderlines();
+ underlines = &object()->document()->frame()->markedTextUnderlines();
+ numUnderlines = underlines->size();
}
- DeprecatedValueListIterator<MarkedTextUnderline> underlineIt = underlines.begin();
Color textColor;
if (i.phase != PaintPhaseSelection) {
paintAllMarkersOfType(i.p, tx, ty, DocumentMarker::Spelling, styleToUse, font);
- for ( ; underlineIt != underlines.end(); underlineIt++) {
- MarkedTextUnderline underline = *underlineIt;
+ for (size_t index = 0; index < numUnderlines; ++index) {
+ const MarkedTextUnderline& underline = (*underlines)[index];
if (underline.endOffset <= start())
// underline is completely before this run. This might be an underline that sits
}
-void InlineTextBox::paintMarkedTextUnderline(GraphicsContext* pt, int _tx, int _ty, MarkedTextUnderline& underline)
+void InlineTextBox::paintMarkedTextUnderline(GraphicsContext* pt, int _tx, int _ty, const MarkedTextUnderline& underline)
{
_tx += m_x;
_ty += m_y;
void paintAllMarkersOfType(GraphicsContext*, int tx, int ty, DocumentMarker::MarkerType, RenderStyle*, const Font*);
void paintSpellingMarker(GraphicsContext*, int tx, int ty, DocumentMarker);
void paintTextMatchMarker(GraphicsContext*, int tx, int ty, DocumentMarker, RenderStyle*, const Font*);
- void paintMarkedTextUnderline(GraphicsContext*, int tx, int ty, MarkedTextUnderline&);
+ void paintMarkedTextUnderline(GraphicsContext*, int tx, int ty, const MarkedTextUnderline&);
#if PLATFORM(MAC)
void paintCustomHighlight(int tx, int ty, const AtomicString& type);
#endif
return VisiblePosition(element(), 0, DOWNSTREAM);
}
-DeprecatedValueList<IntRect> RenderContainer::lineBoxRects()
+void RenderContainer::lineBoxRects(Vector<IntRect>& rects)
{
if (!firstChild() && (isInline() || isAnonymousBlock())) {
- DeprecatedValueList<IntRect> rects;
- int x = 0, y = 0;
+ int x, y;
absolutePositionForContent(x, y);
absoluteRects(rects, x, y);
- return rects;
+ return;
}
if (!firstChild())
- return DeprecatedValueList<IntRect>();
+ return;
- DeprecatedValueList<IntRect> rects;
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
if (child->isText() || child->isInline() || child->isAnonymousBlock()) {
- int x = 0, y = 0;
+ int x, y;
child->absolutePositionForContent(x, y);
child->absoluteRects(rects, x, y);
}
}
-
- return rects;
}
#undef DEBUG_LAYOUT
virtual VisiblePosition positionForCoordinates(int x, int y);
- virtual DeprecatedValueList<IntRect> lineBoxRects();
+ virtual void lineBoxRects(Vector<IntRect>&);
protected:
- void setFirstChild(RenderObject *first) { m_first = first; }
- void setLastChild(RenderObject *last) { m_last = last; }
+ void setFirstChild(RenderObject* first) { m_first = first; }
+ void setLastChild(RenderObject* last) { m_last = last; }
protected:
RenderObject *m_first;
paintLines(i, _tx, _ty);
}
-void RenderInline::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderInline::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
{
for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
- rects.append(IntRect(_tx + curr->xPos(), _ty + curr->yPos(), curr->width(), curr->height()));
+ rects.append(IntRect(tx + curr->xPos(), ty + curr->yPos(), curr->width(), curr->height()));
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
if (!curr->isText())
- curr->absoluteRects(rects, _tx + curr->xPos(), _ty + curr->yPos());
+ curr->absoluteRects(rects, tx + curr->xPos(), ty + curr->yPos());
if (continuation())
continuation()->absoluteRects(rects,
- _tx - containingBlock()->xPos() + continuation()->xPos(),
- _ty - containingBlock()->yPos() + continuation()->yPos());
+ tx - containingBlock()->xPos() + continuation()->xPos(),
+ ty - containingBlock()->yPos() + continuation()->yPos());
}
void RenderInline::calcMinMaxWidth()
virtual int offsetLeft() const;
virtual int offsetTop() const;
- void absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty);
+ void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual VisiblePosition positionForCoordinates(int x, int y);
#include "RenderPopupMenu.h"
#include "RenderText.h"
#include "RenderTheme.h"
+#include "TextStyle.h"
#include <math.h>
using namespace std;
p->restore(); // Undo the clip.
}
-DeprecatedValueList<IntRect> RenderObject::lineBoxRects()
+void RenderObject::lineBoxRects(Vector<IntRect>&)
{
- return DeprecatedValueList<IntRect>();
}
-void RenderObject::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderObject::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
{
// For blocks inside inlines, we go ahead and include margins so that we run right up to the
// inline boxes above and below us (thus getting merged with them to form a single irregular
// shape).
if (continuation()) {
- rects.append(IntRect(_tx, _ty - collapsedMarginTop(),
+ rects.append(IntRect(tx, ty - collapsedMarginTop(),
width(), height()+collapsedMarginTop()+collapsedMarginBottom()));
continuation()->absoluteRects(rects,
- _tx - xPos() + continuation()->containingBlock()->xPos(),
- _ty - yPos() + continuation()->containingBlock()->yPos());
+ tx - xPos() + continuation()->containingBlock()->xPos(),
+ ty - yPos() + continuation()->containingBlock()->yPos());
}
else
- rects.append(IntRect(_tx, _ty, width(), height() + borderTopExtra() + borderBottomExtra()));
+ rects.append(IntRect(tx, ty, width(), height() + borderTopExtra() + borderBottomExtra()));
}
IntRect RenderObject::absoluteBoundingBoxRect()
{
- int x = 0, y = 0;
+ int x, y;
absolutePosition(x, y);
- DeprecatedValueList<IntRect> rects;
+ Vector<IntRect> rects;
absoluteRects(rects, x, y);
- if (rects.isEmpty())
+ size_t n = rects.size();
+ if (!n)
return IntRect();
- DeprecatedValueList<IntRect>::ConstIterator it = rects.begin();
- IntRect result = *it;
- while (++it != rects.end())
- result.unite(*it);
+ IntRect result = rects[0];
+ for (size_t i = 1; i < n; ++i)
+ result.unite(rects[i]);
return result;
}
{
}
-DeprecatedValueList<DashboardRegionValue> RenderObject::computeDashboardRegions()
-{
- DeprecatedValueList<DashboardRegionValue> regions;
- collectDashboardRegions(regions);
- return regions;
-}
-
-void RenderObject::addDashboardRegions (DeprecatedValueList<DashboardRegionValue>& regions)
+void RenderObject::addDashboardRegions(Vector<DashboardRegionValue>& regions)
{
// Convert the style regions to absolute coordinates.
if (style()->visibility() != VISIBLE)
return;
- DeprecatedValueList<StyleDashboardRegion> styleRegions = style()->dashboardRegions();
- if (styleRegions.count() > 0) {
- unsigned i, count = styleRegions.count();
- for (i = 0; i < count; i++){
- StyleDashboardRegion styleRegion = styleRegions[i];
-
- int w = width();
- int h = height();
-
- DashboardRegionValue region;
- region.label = styleRegion.label;
- region.bounds = IntRect (
- styleRegion.offset.left.value(),
- styleRegion.offset.top.value(),
- w - styleRegion.offset.left.value() - styleRegion.offset.right.value(),
- h - styleRegion.offset.top.value() - styleRegion.offset.bottom.value());
- region.type = styleRegion.type;
-
- region.clip = region.bounds;
- computeAbsoluteRepaintRect(region.clip);
- if (region.clip.height() < 0) {
- region.clip.setHeight(0);
- region.clip.setWidth(0);
- }
+ const Vector<StyleDashboardRegion>& styleRegions = style()->dashboardRegions();
+ unsigned i, count = styleRegions.size();
+ for (i = 0; i < count; i++){
+ StyleDashboardRegion styleRegion = styleRegions[i];
+
+ int w = width();
+ int h = height();
+
+ DashboardRegionValue region;
+ region.label = styleRegion.label;
+ region.bounds = IntRect (
+ styleRegion.offset.left.value(),
+ styleRegion.offset.top.value(),
+ w - styleRegion.offset.left.value() - styleRegion.offset.right.value(),
+ h - styleRegion.offset.top.value() - styleRegion.offset.bottom.value());
+ region.type = styleRegion.type;
+
+ region.clip = region.bounds;
+ computeAbsoluteRepaintRect(region.clip);
+ if (region.clip.height() < 0) {
+ region.clip.setHeight(0);
+ region.clip.setWidth(0);
+ }
- int x, y;
- absolutePosition(x, y);
- region.bounds.setX(x + styleRegion.offset.left.value());
- region.bounds.setY(y + styleRegion.offset.top.value());
-
- float pageScaleFactor = document()->frame() ? scaleFactor(document()->frame()->page()) : 1.0f;
+ int x, y;
+ absolutePosition(x, y);
+ region.bounds.setX(x + styleRegion.offset.left.value());
+ region.bounds.setY(y + styleRegion.offset.top.value());
+
+ if (document()->frame()) {
+ float pageScaleFactor = scaleFactor(document()->frame()->page());
if (pageScaleFactor != 1.0f) {
region.bounds.scale(pageScaleFactor);
region.clip.scale(pageScaleFactor);
}
-
- regions.append(region);
}
+
+ regions.append(region);
}
}
-void RenderObject::collectDashboardRegions (DeprecatedValueList<DashboardRegionValue>& regions)
+void RenderObject::collectDashboardRegions(Vector<DashboardRegionValue>& regions)
{
// RenderTexts don't have their own style, they just use their parent's style,
// so we don't want to include them.
if (isText())
return;
- addDashboardRegions (regions);
- for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
+ addDashboardRegions(regions);
+ for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
curr->collectDashboardRegions(regions);
- }
}
#define RenderObject_h
#include "CachedResourceClient.h"
+#include "DeprecatedValueList.h"
#include "RenderStyle.h"
#include "ScrollBar.h"
#include "VisiblePosition.h"
virtual void updateWidgetPosition();
- DeprecatedValueList<DashboardRegionValue> computeDashboardRegions();
- void addDashboardRegions (DeprecatedValueList<DashboardRegionValue>& regions);
- void collectDashboardRegions (DeprecatedValueList<DashboardRegionValue>& regions);
+ void addDashboardRegions(Vector<DashboardRegionValue>&);
+ void collectDashboardRegions(Vector<DashboardRegionValue>&);
// does a query on the rendertree and finds the innernode
// and overURL for the given position
// if readonly == false, it will recalc hover styles accordingly
- class NodeInfo
- {
- friend class RenderLayer;
- friend class RenderImage;
- friend class RenderText;
- friend class RenderInline;
- friend class RenderObject;
- friend class RenderFrameSet;
- friend class HTMLAreaElement;
+ class NodeInfo {
public:
NodeInfo(bool readonly, bool active, bool mouseMove = false)
: m_innerNode(0), m_innerNonSharedNode(0), m_innerURLElement(0), m_readonly(readonly), m_active(active), m_mouseMove(mouseMove)
virtual int borderLeft() const { return style()->borderLeftWidth(); }
virtual int borderRight() const { return style()->borderRightWidth(); }
- virtual DeprecatedValueList<IntRect> lineBoxRects();
+ virtual void lineBoxRects(Vector<IntRect>&);
- virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int tx, int ty);
+ virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
IntRect absoluteBoundingBoxRect();
// the rect that will be painted if this object is passed as the paintingRoot
virtual void setTable(RenderTable*) {};
// Used by collapsed border tables.
- virtual void collectBorders(DeprecatedValueList<CollapsedBorderValue>& borderStyles);
+ virtual void collectBorders(DeprecatedValueList<CollapsedBorderValue>&);
// Repaint the entire object. Called when, e.g., the color of a border changes, or when a border
// style changes.
#import "config.h"
#import "RenderPopupMenuMac.h"
+#import "FontData.h"
#import "FrameMac.h"
#import "FrameView.h"
#import "HTMLNames.h"
[popup attachPopUpWithFrame:r inView:view];
[popup selectItemAtIndex:index];
- NSFont* font = style()->font().getNSFont();
+ NSFont* font = style()->font().primaryFont()->getNSFont();
NSRect titleFrame = [popup titleRectForBounds:r];
if (titleFrame.size.width <= 0 || titleFrame.size.height <= 0)
NSMutableDictionary* attributes = [[NSMutableDictionary alloc] init];
if (s->font() != Font())
- [attributes setObject:s->font().getNSFont() forKey:NSFontAttributeName];
+ [attributes setObject:s->font().primaryFont()->getNSFont() forKey:NSFontAttributeName];
// FIXME: Add support for styling the foreground and background colors.
NSAttributedString* string = [[NSAttributedString alloc] initWithString:text attributes:attributes];
[attributes release];
NSMutableDictionary* attributes = [[NSMutableDictionary alloc] init];
if (s->font() != Font())
- [attributes setObject:s->font().getNSFont() forKey:NSFontAttributeName];
+ [attributes setObject:s->font().primaryFont()->getNSFont() forKey:NSFontAttributeName];
// FIXME: Add support for styling the foreground and background colors.
// FIXME: Find a way to customize text color when an item is highlighted.
NSAttributedString* string = [[NSAttributedString alloc] initWithString:text attributes:attributes];
return x == o.x && y == o.y && blur == o.blur && color == o.color;
}
-const DeprecatedValueList<StyleDashboardRegion>& RenderStyle::initialDashboardRegions()
+const Vector<StyleDashboardRegion>& RenderStyle::initialDashboardRegions()
{
- static DeprecatedValueList<StyleDashboardRegion> emptyList;
+ static Vector<StyleDashboardRegion> emptyList;
return emptyList;
}
-const DeprecatedValueList<StyleDashboardRegion>& RenderStyle::noneDashboardRegions()
+const Vector<StyleDashboardRegion>& RenderStyle::noneDashboardRegions()
{
- static DeprecatedValueList<StyleDashboardRegion> noneList;
+ static Vector<StyleDashboardRegion> noneList;
static bool noneListInitialized = false;
if (!noneListInitialized) {
#include "IntRect.h"
#include "Length.h"
#include "Shared.h"
-#include "DeprecatedValueList.h"
+#include "TextDirection.h"
+#include <wtf/Vector.h>
#ifdef SVG_SUPPORT
#include "SVGRenderStyle.h"
}
int lineClamp; // An Apple extension. Not really CSS3 but not worth making a new struct over.
- DeprecatedValueList<StyleDashboardRegion> m_dashboardRegions;
+ Vector<StyleDashboardRegion> m_dashboardRegions;
float opacity; // Whether or not we're transparent.
DataRef<StyleFlexibleBoxData> flexibleBox; // Flexible box properties
DataRef<StyleMarqueeData> marquee; // Marquee properties
void setMinHeight(Length v) { SET_VAR(box,min_height,v) }
void setMaxHeight(Length v) { SET_VAR(box,max_height,v) }
- DeprecatedValueList<StyleDashboardRegion> dashboardRegions() const { return css3NonInheritedData->m_dashboardRegions; }
- void setDashboardRegions(DeprecatedValueList<StyleDashboardRegion> regions) { SET_VAR(css3NonInheritedData,m_dashboardRegions,regions); }
+ Vector<StyleDashboardRegion> dashboardRegions() const { return css3NonInheritedData->m_dashboardRegions; }
+ void setDashboardRegions(Vector<StyleDashboardRegion> regions) { SET_VAR(css3NonInheritedData,m_dashboardRegions,regions); }
void setDashboardRegion(int type, const String& label, Length t, Length r, Length b, Length l, bool append) {
StyleDashboardRegion region;
region.label = label;
static int initialLineClamp() { return -1; }
static bool initialTextSizeAdjust() { return true; }
static ETextSecurity initialTextSecurity() { return TSNONE; }
- static const DeprecatedValueList<StyleDashboardRegion>& initialDashboardRegions();
- static const DeprecatedValueList<StyleDashboardRegion>& noneDashboardRegions();
+ static const Vector<StyleDashboardRegion>& initialDashboardRegions();
+ static const Vector<StyleDashboardRegion>& noneDashboardRegions();
};
} // namespace WebCore
#include "Range.h"
#include "RenderArena.h"
#include "RenderBlock.h"
+#include "TextStyle.h"
#include "break_lines.h"
#include <unicode/ubrk.h>
#include <wtf/AlwaysInline.h>
return element() ? element()->string() : 0;
}
-void RenderText::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderText::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
{
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
- rects.append(IntRect(_tx + box->xPos(),
- _ty + box->yPos(),
- box->width(),
- box->height()));
+ rects.append(IntRect(tx + box->xPos(), ty + box->yPos(), box->width(), box->height()));
}
-DeprecatedValueList<IntRect> RenderText::lineBoxRects()
+void RenderText::lineBoxRects(Vector<IntRect>& rects)
{
- DeprecatedValueList<IntRect> rects;
- int x = 0, y = 0;
+ int x, y;
absolutePositionForContent(x, y);
absoluteRects(rects, x, y);
- return rects;
}
InlineTextBox* RenderText::findNextInlineTextBox(int offset, int &pos) const
virtual void paint(PaintInfo& i, int tx, int ty) { assert(false); }
virtual void layout() { assert(false); }
- virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty,
- HitTestAction hitTestAction) { assert(false); return false; }
+ virtual bool nodeAtPoint(NodeInfo&, int, int, int, int, HitTestAction) { assert(false); return false; }
- virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty);
- virtual DeprecatedValueList<IntRect> lineBoxRects();
+ virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
+ virtual void lineBoxRects(Vector<IntRect>&);
virtual VisiblePosition positionForCoordinates(int x, int y);
#include "RenderTheme.h"
#include "SelectionController.h"
#include "TextIterator.h"
+#include "TextStyle.h"
#include "htmlediting.h"
#include "visible_units.h"
#include <math.h>
r.move(m_frameView->contentsX(), m_frameView->contentsY());
}
-void RenderView::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderView::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
{
- rects.append(IntRect(_tx, _ty, m_layer->width(), m_layer->height()));
+ rects.append(IntRect(tx, ty, m_layer->width(), m_layer->height()));
}
RenderObject* rendererAfterPosition(RenderObject* object, unsigned offset)
public:
int truncatedAt() const { return m_truncatedAt; }
- virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty);
+ virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
IntRect selectionRect() const;