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

Unified Diff: third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp

Issue 2507023002: Support script modify iframe scrolling, marginWidth and marginHeight attr (Closed)
Patch Set: remove using namespace Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/web/WebFrame.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
index eb81d639c4de017fbb4adf4c46265078a85c0f43..d1e42eb9aad4ce904481e85729876682cac745d1 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
@@ -141,16 +141,10 @@ void HTMLFrameElementBase::parseAttribute(const QualifiedName& name,
m_frameName = value;
} else if (name == nameAttr) {
m_frameName = value;
- // FIXME: If we are already attached, this doesn't actually change the
- // frame's name.
- // FIXME: If we are already attached, this doesn't check for frame name
- // conflicts and generate a unique frame name.
} else if (name == marginwidthAttr) {
setMarginWidth(value.toInt());
- // FIXME: If we are already attached, this has no effect.
} else if (name == marginheightAttr) {
setMarginHeight(value.toInt());
- // FIXME: If we are already attached, this has no effect.
} else if (name == scrollingAttr) {
// Auto and yes both simply mean "allow scrolling." No means "don't allow
// scrolling."
@@ -158,7 +152,6 @@ void HTMLFrameElementBase::parseAttribute(const QualifiedName& name,
setScrollingMode(ScrollbarAuto);
else if (equalIgnoringCase(value, "no"))
setScrollingMode(ScrollbarAlwaysOff);
- // FIXME: If we are already attached, this has no effect.
} else if (name == onbeforeunloadAttr) {
// FIXME: should <frame> elements have beforeunload handlers?
setAttributeEventListener(
@@ -253,16 +246,37 @@ void HTMLFrameElementBase::defaultEventHandler(Event* event) {
}
void HTMLFrameElementBase::setScrollingMode(ScrollbarMode scrollbarMode) {
+ if (m_scrollingMode == scrollbarMode)
+ return;
+
+ if (contentDocument()) {
+ contentDocument()->willChangeFrameOwnerProperties(
+ m_marginWidth, m_marginHeight, scrollbarMode);
+ }
m_scrollingMode = scrollbarMode;
frameOwnerPropertiesChanged();
}
void HTMLFrameElementBase::setMarginWidth(int marginWidth) {
+ if (m_marginWidth == marginWidth)
+ return;
+
+ if (contentDocument()) {
+ contentDocument()->willChangeFrameOwnerProperties(
+ marginWidth, m_marginHeight, m_scrollingMode);
+ }
m_marginWidth = marginWidth;
frameOwnerPropertiesChanged();
}
void HTMLFrameElementBase::setMarginHeight(int marginHeight) {
+ if (m_marginHeight == marginHeight)
+ return;
+
+ if (contentDocument()) {
+ contentDocument()->willChangeFrameOwnerProperties(
+ m_marginWidth, marginHeight, m_scrollingMode);
+ }
m_marginHeight = marginHeight;
frameOwnerPropertiesChanged();
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/web/WebFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698