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

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

Issue 321023002: Avoid branching in createAttributeEventListener (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 6 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
« no previous file with comments | « Source/core/html/HTMLFormElement.cpp ('k') | Source/core/html/HTMLFrameSetElement.cpp » ('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, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // FIXME: If we are already attached, this has no effect. 120 // FIXME: If we are already attached, this has no effect.
121 } else if (name == scrollingAttr) { 121 } else if (name == scrollingAttr) {
122 // Auto and yes both simply mean "allow scrolling." No means "don't allo w scrolling." 122 // Auto and yes both simply mean "allow scrolling." No means "don't allo w scrolling."
123 if (equalIgnoringCase(value, "auto") || equalIgnoringCase(value, "yes")) 123 if (equalIgnoringCase(value, "auto") || equalIgnoringCase(value, "yes"))
124 m_scrolling = ScrollbarAuto; 124 m_scrolling = ScrollbarAuto;
125 else if (equalIgnoringCase(value, "no")) 125 else if (equalIgnoringCase(value, "no"))
126 m_scrolling = ScrollbarAlwaysOff; 126 m_scrolling = ScrollbarAlwaysOff;
127 // FIXME: If we are already attached, this has no effect. 127 // FIXME: If we are already attached, this has no effect.
128 } else if (name == onbeforeunloadAttr) { 128 } else if (name == onbeforeunloadAttr) {
129 // FIXME: should <frame> elements have beforeunload handlers? 129 // FIXME: should <frame> elements have beforeunload handlers?
130 setAttributeEventListener(EventTypeNames::beforeunload, createAttributeE ventListener(this, name, value)); 130 setAttributeEventListener(EventTypeNames::beforeunload, createAttributeE ventListener(this, name, value, eventParameterName()));
131 } else 131 } else
132 HTMLFrameOwnerElement::parseAttribute(name, value); 132 HTMLFrameOwnerElement::parseAttribute(name, value);
133 } 133 }
134 134
135 void HTMLFrameElementBase::setNameAndOpenURL() 135 void HTMLFrameElementBase::setNameAndOpenURL()
136 { 136 {
137 m_frameName = getNameAttribute(); 137 m_frameName = getNameAttribute();
138 openURL(); 138 openURL();
139 } 139 }
140 140
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 void HTMLFrameElementBase::defaultEventHandler(Event* event) 228 void HTMLFrameElementBase::defaultEventHandler(Event* event)
229 { 229 {
230 if (contentFrame() && contentFrame()->isRemoteFrameTemporary()) { 230 if (contentFrame() && contentFrame()->isRemoteFrameTemporary()) {
231 contentFrame()->chromeClient().forwardInputEvent(contentFrame(), event); 231 contentFrame()->chromeClient().forwardInputEvent(contentFrame(), event);
232 return; 232 return;
233 } 233 }
234 HTMLFrameOwnerElement::defaultEventHandler(event); 234 HTMLFrameOwnerElement::defaultEventHandler(event);
235 } 235 }
236 236
237 } // namespace WebCore 237 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFormElement.cpp ('k') | Source/core/html/HTMLFrameSetElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698