~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/bindings/js/JSHTMLFrameElementCustom.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include "CSSHelper.h"
33
33
#include "Document.h"
34
34
#include "HTMLFrameElement.h"
 
35
#include "HTMLNames.h"
35
36
#include "JSDOMBinding.h"
36
37
 
37
38
using namespace JSC;
38
39
 
39
40
namespace WebCore {
40
41
 
 
42
using namespace HTMLNames;
 
43
 
41
44
static inline bool allowSettingJavascriptURL(ExecState* exec, HTMLFrameElement* imp, const String& value)
42
45
{
43
 
    if (protocolIs(parseURL(value), "javascript")) {
44
 
        if (!checkNodeSecurity(exec, imp->contentDocument()))
 
46
    if (protocolIsJavaScript(deprecatedParseURL(value))) {
 
47
        Document* contentDocument = imp->contentDocument();
 
48
        if (contentDocument && !checkNodeSecurity(exec, contentDocument))
45
49
            return false;
46
50
    }
47
51
    return true;
48
52
}
49
53
 
50
 
void JSHTMLFrameElement::setSrc(ExecState* exec, JSValuePtr value)
 
54
void JSHTMLFrameElement::setSrc(ExecState* exec, JSValue value)
51
55
{
52
56
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
53
57
    String srcValue = valueToStringWithNullCheck(exec, value);
55
59
    if (!allowSettingJavascriptURL(exec, imp, srcValue))
56
60
        return;
57
61
 
58
 
    imp->setSrc(srcValue);
59
 
    return;
 
62
    imp->setAttribute(srcAttr, srcValue);
60
63
}
61
64
 
62
 
void JSHTMLFrameElement::setLocation(ExecState* exec, JSValuePtr value)
 
65
void JSHTMLFrameElement::setLocation(ExecState* exec, JSValue value)
63
66
{
64
67
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
65
68
    String locationValue = valueToStringWithNullCheck(exec, value);
68
71
        return;
69
72
 
70
73
    imp->setLocation(locationValue);
71
 
    return;
72
74
}
73
75
 
74
76
} // namespace WebCore