Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(838)

Side by Side Diff: Source/core/html/HTMLBodyElement.cpp

Issue 202893002: Replace elementHasLegalLinkAttribute() helper with virtual function (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take tkent's feedback into consideration Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLBodyElement.h ('k') | Source/core/html/HTMLFormElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann (hausmann@kde.org) 4 * (C) 2000 Simon Hausmann (hausmann@kde.org)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 } 173 }
174 return InsertionDone; 174 return InsertionDone;
175 } 175 }
176 176
177 bool HTMLBodyElement::isURLAttribute(const Attribute& attribute) const 177 bool HTMLBodyElement::isURLAttribute(const Attribute& attribute) const
178 { 178 {
179 return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(att ribute); 179 return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(att ribute);
180 } 180 }
181 181
182 bool HTMLBodyElement::hasLegalLinkAttribute(const QualifiedName& name) const
183 {
184 return name == backgroundAttr || HTMLElement::hasLegalLinkAttribute(name);
185 }
186
182 bool HTMLBodyElement::supportsFocus() const 187 bool HTMLBodyElement::supportsFocus() const
183 { 188 {
184 // This override is needed because the inherited method bails if the parent is editable. 189 // This override is needed because the inherited method bails if the parent is editable.
185 // The <body> should be focusable even if <html> is editable. 190 // The <body> should be focusable even if <html> is editable.
186 return rendererIsEditable() || HTMLElement::supportsFocus(); 191 return rendererIsEditable() || HTMLElement::supportsFocus();
187 } 192 }
188 193
189 static int adjustForZoom(int value, Document* document) 194 static int adjustForZoom(int value, Document* document)
190 { 195 {
191 LocalFrame* frame = document->frame(); 196 LocalFrame* frame = document->frame();
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 int HTMLBodyElement::scrollWidth() 318 int HTMLBodyElement::scrollWidth()
314 { 319 {
315 // Update the document's layout. 320 // Update the document's layout.
316 Document& document = this->document(); 321 Document& document = this->document();
317 document.updateLayoutIgnorePendingStylesheets(); 322 document.updateLayoutIgnorePendingStylesheets();
318 FrameView* view = document.view(); 323 FrameView* view = document.view();
319 return view ? adjustForZoom(view->contentsWidth(), &document) : 0; 324 return view ? adjustForZoom(view->contentsWidth(), &document) : 0;
320 } 325 }
321 326
322 } // namespace WebCore 327 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLBodyElement.h ('k') | Source/core/html/HTMLFormElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698