From 3c644144b15e3b65161068df0a3bbe674d317ac9 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Thu, 13 Mar 2025 11:02:47 +0100 Subject: [PATCH 01/14] Rust: Extract data flow node and content into separate files --- rust/ql/lib/codeql/rust/dataflow/DataFlow.qll | 7 +- .../codeql/rust/dataflow/internal/Content.qll | 240 ++++++ .../dataflow/internal/DataFlowConsistency.qll | 1 + .../rust/dataflow/internal/DataFlowImpl.qll | 807 ++---------------- .../dataflow/internal/FlowSummaryImpl.qll | 1 + .../codeql/rust/dataflow/internal/Node.qll | 486 +++++++++++ .../dataflow/internal/TaintTrackingImpl.qll | 2 + .../lib/codeql/rust/internal/CachedStages.qll | 6 + .../WeakSensitiveDataHashingExtensions.qll | 2 +- rust/ql/lib/utils/test/InlineFlowTest.qll | 1 + .../security/CWE-312/CleartextLogging.ql | 2 +- .../modelgenerator/internal/CaptureModels.qll | 2 + .../dataflow/local/DataFlowStep.ql | 2 +- .../dataflow/taint/TaintFlowStep.ql | 2 +- 14 files changed, 800 insertions(+), 761 deletions(-) create mode 100644 rust/ql/lib/codeql/rust/dataflow/internal/Content.qll create mode 100644 rust/ql/lib/codeql/rust/dataflow/internal/Node.qll diff --git a/rust/ql/lib/codeql/rust/dataflow/DataFlow.qll b/rust/ql/lib/codeql/rust/dataflow/DataFlow.qll index a384f9e5c37..53392ec6865 100644 --- a/rust/ql/lib/codeql/rust/dataflow/DataFlow.qll +++ b/rust/ql/lib/codeql/rust/dataflow/DataFlow.qll @@ -6,7 +6,8 @@ private import rust private import codeql.dataflow.DataFlow private import internal.DataFlowImpl as DataFlowImpl -private import DataFlowImpl::Node as Node +private import internal.Node as Node +private import internal.Content as Content /** * Provides classes for performing local (intra-procedural) and global @@ -23,9 +24,9 @@ module DataFlow { final class PostUpdateNode = Node::PostUpdateNodePublic; - final class Content = DataFlowImpl::Content; + final class Content = Content::Content; - final class ContentSet = DataFlowImpl::ContentSet; + final class ContentSet = Content::ContentSet; /** * Holds if data flows from `nodeFrom` to `nodeTo` in exactly one local diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/Content.qll b/rust/ql/lib/codeql/rust/dataflow/internal/Content.qll new file mode 100644 index 00000000000..8523e7de59c --- /dev/null +++ b/rust/ql/lib/codeql/rust/dataflow/internal/Content.qll @@ -0,0 +1,240 @@ +/** + * Provides the `Content` class and subclasses thereof. + */ + +private import rust +private import codeql.rust.controlflow.CfgNodes +private import DataFlowImpl + +/** + * A path to a value contained in an object. For example a field name of a struct. + */ +abstract class Content extends TContent { + /** Gets a textual representation of this content. */ + abstract string toString(); + + /** Gets the location of this content. */ + abstract Location getLocation(); +} + +/** A field belonging to either a variant or a struct. */ +abstract class FieldContent extends Content { + /** Gets an access to this field. */ + pragma[nomagic] + abstract FieldExprCfgNode getAnAccess(); +} + +/** A tuple field belonging to either a variant or a struct. */ +class TupleFieldContent extends FieldContent, TTupleFieldContent { + private TupleField field; + + TupleFieldContent() { this = TTupleFieldContent(field) } + + predicate isVariantField(Variant v, int pos) { field.isVariantField(v, pos) } + + predicate isStructField(Struct s, int pos) { field.isStructField(s, pos) } + + override FieldExprCfgNode getAnAccess() { none() } // TODO + + final override string toString() { + exists(Variant v, int pos, string vname | + this.isVariantField(v, pos) and + vname = v.getName().getText() and + // only print indices when the arity is > 1 + if exists(v.getTupleField(1)) then result = vname + "(" + pos + ")" else result = vname + ) + or + exists(Struct s, int pos, string sname | + this.isStructField(s, pos) and + sname = s.getName().getText() and + // only print indices when the arity is > 1 + if exists(s.getTupleField(1)) then result = sname + "(" + pos + ")" else result = sname + ) + } + + final override Location getLocation() { result = field.getLocation() } +} + +/** A record field belonging to either a variant or a struct. */ +class RecordFieldContent extends FieldContent, TRecordFieldContent { + private RecordField field; + + RecordFieldContent() { this = TRecordFieldContent(field) } + + predicate isVariantField(Variant v, string name) { field.isVariantField(v, name) } + + predicate isStructField(Struct s, string name) { field.isStructField(s, name) } + + override FieldExprCfgNode getAnAccess() { none() } // TODO + + final override string toString() { + exists(Variant v, string name, string vname | + this.isVariantField(v, name) and + vname = v.getName().getText() and + // only print field when the arity is > 1 + if strictcount(v.getRecordField(_)) > 1 then result = vname + "." + name else result = vname + ) + or + exists(Struct s, string name, string sname | + this.isStructField(s, name) and + sname = s.getName().getText() and + // only print field when the arity is > 1 + if strictcount(s.getRecordField(_)) > 1 then result = sname + "." + name else result = sname + ) + } + + final override Location getLocation() { result = field.getLocation() } +} + +/** A captured variable. */ +final class CapturedVariableContent extends Content, TCapturedVariableContent { + private Variable v; + + CapturedVariableContent() { this = TCapturedVariableContent(v) } + + /** Gets the captured variable. */ + Variable getVariable() { result = v } + + override string toString() { result = "captured " + v } + + override Location getLocation() { result = v.getLocation() } +} + +/** A value referred to by a reference. */ +final class ReferenceContent extends Content, TReferenceContent { + override string toString() { result = "&ref" } + + override Location getLocation() { result instanceof EmptyLocation } +} + +/** + * An element in a collection where we do not track the specific collection + * type nor the placement of the element in the collection. Therefore the + * collection should be one where the elements are reasonably homogeneous, + * i.e., if one is tainted all elements are considered tainted. + * + * Examples include the elements of a set, array, vector, or stack. + */ +final class ElementContent extends Content, TElementContent { + override string toString() { result = "element" } + + override Location getLocation() { result instanceof EmptyLocation } +} + +/** + * A value that a future resolves to. + */ +final class FutureContent extends Content, TFutureContent { + override string toString() { result = "future" } + + override Location getLocation() { result instanceof EmptyLocation } +} + +/** + * Content stored at a position in a tuple. + * + * NOTE: Unlike `struct`s and `enum`s tuples are structural and not nominal, + * hence we don't store a canonical path for them. + */ +final class TuplePositionContent extends FieldContent, TTuplePositionContent { + private int pos; + + TuplePositionContent() { this = TTuplePositionContent(pos) } + + int getPosition() { result = pos } + + override FieldExprCfgNode getAnAccess() { + // TODO: limit to tuple types + result.getNameRef().getText().toInt() = pos + } + + override string toString() { result = "tuple." + pos.toString() } + + override Location getLocation() { result instanceof EmptyLocation } +} + +/** + * A content for the index of an argument to at function call. + * + * Used by the model generator to create flow summaries for higher-order + * functions. + */ +final class FunctionCallArgumentContent extends Content, TFunctionCallArgumentContent { + private int pos; + + FunctionCallArgumentContent() { this = TFunctionCallArgumentContent(pos) } + + int getPosition() { result = pos } + + override string toString() { result = "function argument at " + pos } + + override Location getLocation() { result instanceof EmptyLocation } +} + +/** + * A content for the return value of function call. + * + * Used by the model generator to create flow summaries for higher-order + * functions. + */ +final class FunctionCallReturnContent extends Content, TFunctionCallReturnContent { + override string toString() { result = "function return" } + + override Location getLocation() { result instanceof EmptyLocation } +} + +/** A value that represents a set of `Content`s. */ +abstract class ContentSet extends TContentSet { + /** Gets a textual representation of this element. */ + abstract string toString(); + + /** Gets a content that may be stored into when storing into this set. */ + abstract Content getAStoreContent(); + + /** Gets a content that may be read from when reading from this set. */ + abstract Content getAReadContent(); +} + +final class SingletonContentSet extends ContentSet, TSingletonContentSet { + private Content c; + + SingletonContentSet() { this = TSingletonContentSet(c) } + + Content getContent() { result = c } + + override string toString() { result = c.toString() } + + override Content getAStoreContent() { result = c } + + override Content getAReadContent() { result = c } +} + +/** A collection of cached types and predicates to be evaluated in the same stage. */ +cached +private module Cached { + private import codeql.rust.internal.CachedStages + + cached + newtype TContent = + TTupleFieldContent(TupleField field) { Stages::DataFlowStage::ref() } or + TRecordFieldContent(RecordField field) or + // TODO: Remove once library types are extracted + TVariantInLibTupleFieldContent(VariantInLib::VariantInLib v, int pos) { pos = v.getAPosition() } or + TElementContent() or + TFutureContent() or + TTuplePositionContent(int pos) { + pos in [0 .. max([ + any(TuplePat pat).getNumberOfFields(), + any(FieldExpr access).getNameRef().getText().toInt() + ] + )] + } or + TFunctionCallReturnContent() or + TFunctionCallArgumentContent(int pos) { + pos in [0 .. any(CallExpr c).getArgList().getNumberOfArgs() - 1] + } or + TCapturedVariableContent(VariableCapture::CapturedVariable v) or + TReferenceContent() +} + +import Cached diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowConsistency.qll b/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowConsistency.qll index 0cabde4ba1f..9202985a852 100644 --- a/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowConsistency.qll +++ b/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowConsistency.qll @@ -1,6 +1,7 @@ import codeql.rust.dataflow.DataFlow::DataFlow as DataFlow private import rust private import codeql.rust.dataflow.internal.DataFlowImpl +private import codeql.rust.dataflow.internal.Node as Node private import codeql.rust.dataflow.internal.TaintTrackingImpl private import codeql.dataflow.internal.DataFlowImplConsistency diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll b/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll index 6c2d2a4db01..8af525b37d5 100644 --- a/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll +++ b/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll @@ -15,6 +15,8 @@ private import codeql.rust.controlflow.ControlFlowGraph private import codeql.rust.controlflow.CfgNodes private import codeql.rust.dataflow.Ssa private import codeql.rust.dataflow.FlowSummary +private import Node +private import Content private import FlowSummaryImpl as FlowSummaryImpl /** @@ -139,7 +141,7 @@ private predicate callToMethod(CallExpr call) { * Note that this does not hold for the receiever expression of a method call * as the synthetic `ReceiverNode` is the argument for the `self` parameter. */ -private predicate isArgumentForCall(ExprCfgNode arg, CallExprBaseCfgNode call, ParameterPosition pos) { +predicate isArgumentForCall(ExprCfgNode arg, CallExprBaseCfgNode call, ParameterPosition pos) { if callToMethod(call.(CallExprCfgNode).getCallExpr()) then // The first argument is for the `self` parameter @@ -150,450 +152,12 @@ private predicate isArgumentForCall(ExprCfgNode arg, CallExprBaseCfgNode call, P else arg = call.getArgument(pos.getPosition()) } -/** - * Provides the `Node` class and subclasses thereof. - * - * Classes with names ending in `Public` are exposed as `final` aliases in the - * public `DataFlow` API, so they should not expose internal implementation details. - */ -module Node { - /** An element, viewed as a node in a data flow graph. */ - abstract class NodePublic extends TNode { - /** Gets the location of this node. */ - abstract Location getLocation(); - - /** Gets a textual representation of this node. */ - abstract string toString(); - - /** - * Gets the expression that corresponds to this node, if any. - */ - ExprCfgNode asExpr() { none() } - - /** - * Gets the parameter that corresponds to this node, if any. - */ - ParamBase asParameter() { result = this.(SourceParameterNode).getParameter().getParamBase() } - - /** - * Gets the pattern that corresponds to this node, if any. - */ - PatCfgNode asPat() { none() } - } - - abstract class Node extends NodePublic { - /** Gets the enclosing callable. */ - DataFlowCallable getEnclosingCallable() { result = TCfgScope(this.getCfgScope()) } - - /** Do not call: use `getEnclosingCallable()` instead. */ - abstract CfgScope getCfgScope(); - - /** - * Gets the control flow node that corresponds to this data flow node. - */ - CfgNode getCfgNode() { none() } - } - - /** A node type that is not implemented. */ - final class NaNode extends Node { - NaNode() { none() } - - override CfgScope getCfgScope() { none() } - - override string toString() { result = "N/A" } - - override Location getLocation() { none() } - } - - /** A data flow node used to model flow summaries. */ - class FlowSummaryNode extends Node, TFlowSummaryNode { - FlowSummaryImpl::Private::SummaryNode getSummaryNode() { this = TFlowSummaryNode(result) } - - /** Gets the summarized callable that this node belongs to, if any. */ - FlowSummaryImpl::Public::SummarizedCallable getSummarizedCallable() { - result = this.getSummaryNode().getSummarizedCallable() - } - - /** Gets the AST source node that this node belongs to, if any */ - FlowSummaryImpl::Public::SourceElement getSourceElement() { - result = this.getSummaryNode().getSourceElement() - } - - /** Gets the AST sink node that this node belongs to, if any */ - FlowSummaryImpl::Public::SinkElement getSinkElement() { - result = this.getSummaryNode().getSinkElement() - } - - /** Holds is this node is a source node of kind `kind`. */ - predicate isSource(string kind, string model) { - this.getSummaryNode().(FlowSummaryImpl::Private::SourceOutputNode).isEntry(kind, model) - } - - /** Holds is this node is a sink node of kind `kind`. */ - predicate isSink(string kind, string model) { - this.getSummaryNode().(FlowSummaryImpl::Private::SinkInputNode).isExit(kind, model) - } - - override CfgScope getCfgScope() { - result = this.getSummaryNode().getSourceElement().getEnclosingCfgScope() - or - result = this.getSummaryNode().getSinkElement().getEnclosingCfgScope() - } - - override DataFlowCallable getEnclosingCallable() { - result.asLibraryCallable() = this.getSummarizedCallable() - or - result.asCfgScope() = this.getCfgScope() - } - - override Location getLocation() { - exists(this.getSummarizedCallable()) and - result instanceof EmptyLocation - or - result = this.getSourceElement().getLocation() - or - result = this.getSinkElement().getLocation() - } - - override string toString() { result = this.getSummaryNode().toString() } - } - - /** A data flow node that corresponds directly to a CFG node for an AST node. */ - abstract class AstCfgFlowNode extends Node { - AstCfgNode n; - - final override CfgNode getCfgNode() { result = n } - - final override CfgScope getCfgScope() { result = n.getAstNode().getEnclosingCfgScope() } - - final override Location getLocation() { result = n.getAstNode().getLocation() } - - final override string toString() { result = n.getAstNode().toString() } - } - - /** - * A node in the data flow graph that corresponds to an expression in the - * AST. - * - * Note that because of control flow splitting, one `Expr` may correspond - * to multiple `ExprNode`s, just like it may correspond to multiple - * `ControlFlow::Node`s. - */ - class ExprNode extends AstCfgFlowNode, TExprNode { - override ExprCfgNode n; - - ExprNode() { this = TExprNode(n) } - - override ExprCfgNode asExpr() { result = n } - } - - final class PatNode extends AstCfgFlowNode, TPatNode { - override PatCfgNode n; - - PatNode() { this = TPatNode(n) } - - override PatCfgNode asPat() { result = n } - } - - /** A data flow node that corresponds to a name node in the CFG. */ - final class NameNode extends AstCfgFlowNode, TNameNode { - override NameCfgNode n; - - NameNode() { this = TNameNode(n) } - - NameCfgNode asName() { result = n } - } - - /** - * The value of a parameter at function entry, viewed as a node in a data - * flow graph. - */ - abstract class ParameterNode extends Node { - /** Holds if this node is a parameter of `c` at position `pos`. */ - abstract predicate isParameterOf(DataFlowCallable c, ParameterPosition pos); - } - - final class SourceParameterNode extends AstCfgFlowNode, ParameterNode, TSourceParameterNode { - override ParamBaseCfgNode n; - - SourceParameterNode() { this = TSourceParameterNode(n) } - - override predicate isParameterOf(DataFlowCallable c, ParameterPosition pos) { - n.getAstNode() = pos.getParameterIn(c.asCfgScope().(Callable).getParamList()) - } - - /** Get the parameter position of this parameter. */ - ParameterPosition getPosition() { this.isParameterOf(_, result) } - - /** Gets the parameter in the CFG that this node corresponds to. */ - ParamBaseCfgNode getParameter() { result = n } - } - - /** A parameter for a library callable with a flow summary. */ - final class SummaryParameterNode extends ParameterNode, FlowSummaryNode { - private ParameterPosition pos_; - - SummaryParameterNode() { - FlowSummaryImpl::Private::summaryParameterNode(this.getSummaryNode(), pos_) - } - - override predicate isParameterOf(DataFlowCallable c, ParameterPosition pos) { - this.getSummarizedCallable() = c.asLibraryCallable() and pos = pos_ - } - } - - /** - * The run-time representation of a closure itself at function entry, viewed - * as a node in a data flow graph. - */ - final class ClosureParameterNode extends ParameterNode, TClosureSelfReferenceNode { - private CfgScope cfgScope; - - ClosureParameterNode() { this = TClosureSelfReferenceNode(cfgScope) } - - final override CfgScope getCfgScope() { result = cfgScope } - - override predicate isParameterOf(DataFlowCallable c, ParameterPosition pos) { - cfgScope = c.asCfgScope() and pos.isClosureSelf() - } - - override Location getLocation() { result = cfgScope.getLocation() } - - override string toString() { result = "closure self in " + cfgScope } - } - - abstract class ArgumentNode extends Node { - abstract predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos); - } - - final class ExprArgumentNode extends ArgumentNode, ExprNode { - private CallExprBaseCfgNode call_; - private RustDataFlow::ArgumentPosition pos_; - - ExprArgumentNode() { isArgumentForCall(n, call_, pos_) } - - override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) { - call.asCallBaseExprCfgNode() = call_ and pos = pos_ - } - } - - /** - * The receiver of a method call _after_ any implicit borrow or dereferencing - * has taken place. - */ - final class ReceiverNode extends ArgumentNode, TReceiverNode { - private MethodCallExprCfgNode n; - - ReceiverNode() { this = TReceiverNode(n, false) } - - ExprCfgNode getReceiver() { result = n.getReceiver() } - - MethodCallExprCfgNode getMethodCall() { result = n } - - override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) { - call.asMethodCallExprCfgNode() = n and pos = TSelfParameterPosition() - } - - override CfgScope getCfgScope() { result = n.getAstNode().getEnclosingCfgScope() } - - override Location getLocation() { result = this.getReceiver().getLocation() } - - override string toString() { result = "receiver for " + this.getReceiver() } - } - - final class SummaryArgumentNode extends FlowSummaryNode, ArgumentNode { - private FlowSummaryImpl::Private::SummaryNode receiver; - private RustDataFlow::ArgumentPosition pos_; - - SummaryArgumentNode() { - FlowSummaryImpl::Private::summaryArgumentNode(receiver, this.getSummaryNode(), pos_) - } - - override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) { - call.isSummaryCall(_, receiver) and pos = pos_ - } - } - - /** - * A data flow node that represents the run-time representation of a closure - * passed into the closure body at an invocation. - */ - final class ClosureArgumentNode extends ArgumentNode, ExprNode { - private CallExprCfgNode call_; - - ClosureArgumentNode() { lambdaCallExpr(call_, _, this.asExpr()) } - - override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) { - call.asCallExprCfgNode() = call_ and - pos.isClosureSelf() - } - } - - /** An SSA node. */ - class SsaNode extends Node, TSsaNode { - SsaImpl::DataFlowIntegration::SsaNode node; - - SsaNode() { this = TSsaNode(node) } - - override CfgScope getCfgScope() { result = node.getBasicBlock().getScope() } - - /** Gets the definition this node corresponds to, if any. */ - SsaImpl::Definition asDefinition() { - result = node.(SsaImpl::DataFlowIntegration::SsaDefinitionNode).getDefinition() - } - - override Location getLocation() { result = node.getLocation() } - - override string toString() { result = "[SSA] " + node.toString() } - } - - /** A data flow node that represents a value returned by a callable. */ - abstract class ReturnNode extends Node { - abstract ReturnKind getKind(); - } - - final class ExprReturnNode extends ExprNode, ReturnNode { - ExprReturnNode() { this.getCfgNode().getASuccessor() instanceof AnnotatedExitCfgNode } - - override ReturnKind getKind() { result = TNormalReturnKind() } - } - - final class SummaryReturnNode extends FlowSummaryNode, ReturnNode { - private ReturnKind rk; - - SummaryReturnNode() { FlowSummaryImpl::Private::summaryReturnNode(this.getSummaryNode(), rk) } - - override ReturnKind getKind() { result = rk } - } - - /** A data flow node that represents the output of a call. */ - abstract class OutNode extends Node { - /** Gets the underlying call for this node. */ - abstract DataFlowCall getCall(ReturnKind kind); - } - - final private class ExprOutNode extends ExprNode, OutNode { - ExprOutNode() { this.asExpr() instanceof CallExprBaseCfgNode } - - /** Gets the underlying call CFG node that includes this out node. */ - override DataFlowCall getCall(ReturnKind kind) { - result.asCallBaseExprCfgNode() = this.getCfgNode() and - kind = TNormalReturnKind() - } - } - - final class SummaryOutNode extends FlowSummaryNode, OutNode { - private DataFlowCall call; - private ReturnKind kind_; - - SummaryOutNode() { - exists(FlowSummaryImpl::Private::SummaryNode receiver | - call.isSummaryCall(_, receiver) and - FlowSummaryImpl::Private::summaryOutNode(receiver, this.getSummaryNode(), kind_) - ) - } - - override DataFlowCall getCall(ReturnKind kind) { result = call and kind = kind_ } - } - - /** - * A synthesized data flow node representing a closure object that tracks - * captured variables. - */ - class CaptureNode extends Node, TCaptureNode { - private VariableCapture::Flow::SynthesizedCaptureNode cn; - - CaptureNode() { this = TCaptureNode(cn) } - - VariableCapture::Flow::SynthesizedCaptureNode getSynthesizedCaptureNode() { result = cn } - - override CfgScope getCfgScope() { result = cn.getEnclosingCallable() } - - override Location getLocation() { result = cn.getLocation() } - - override string toString() { result = cn.toString() } - } - - /** - * A node associated with an object after an operation that might have - * changed its state. - * - * This can be either the argument to a callable after the callable returns - * (which might have mutated the argument), or the qualifier of a field after - * an update to the field. - * - * Nodes corresponding to AST elements, for example `ExprNode`, usually refer - * to the value before the update. - */ - abstract class PostUpdateNodePublic extends NodePublic { - /** Gets the node before the state update. */ - abstract NodePublic getPreUpdateNode(); - } - - abstract class PostUpdateNode extends PostUpdateNodePublic, Node { - override string toString() { result = "[post] " + this.getPreUpdateNode().toString() } - } - - final class ExprPostUpdateNode extends PostUpdateNode, TExprPostUpdateNode { - private ExprCfgNode n; - - ExprPostUpdateNode() { this = TExprPostUpdateNode(n) } - - override Node getPreUpdateNode() { result = TExprNode(n) } - - override CfgScope getCfgScope() { result = n.getScope() } - - override Location getLocation() { result = n.getLocation() } - } - - final class ReceiverPostUpdateNode extends PostUpdateNode, TReceiverNode { - private MethodCallExprCfgNode n; - - ReceiverPostUpdateNode() { this = TReceiverNode(n, true) } - - override Node getPreUpdateNode() { result = TReceiverNode(n, false) } - - override CfgScope getCfgScope() { result = n.getAstNode().getEnclosingCfgScope() } - - override Location getLocation() { result = n.getReceiver().getLocation() } - } - - final class SummaryPostUpdateNode extends FlowSummaryNode, PostUpdateNode { - private FlowSummaryNode pre; - - SummaryPostUpdateNode() { - FlowSummaryImpl::Private::summaryPostUpdateNode(this.getSummaryNode(), pre.getSummaryNode()) - } - - override Node getPreUpdateNode() { result = pre } - - final override string toString() { result = PostUpdateNode.super.toString() } - } - - private class CapturePostUpdateNode extends PostUpdateNode, CaptureNode { - private CaptureNode pre; - - CapturePostUpdateNode() { - VariableCapture::Flow::capturePostUpdateNode(this.getSynthesizedCaptureNode(), - pre.getSynthesizedCaptureNode()) - } - - override Node getPreUpdateNode() { result = pre } - - final override string toString() { result = PostUpdateNode.super.toString() } - } - - final class CastNode = NaNode; -} - -final class Node = Node::Node; - /** Provides logic related to SSA. */ module SsaFlow { private module SsaFlow = SsaImpl::DataFlowIntegration; - private Node::ParameterNode toParameterNode(ParamCfgNode p) { - result.(Node::SourceParameterNode).getParameter() = p + private ParameterNode toParameterNode(ParamCfgNode p) { + result.(SourceParameterNode).getParameter() = p } /** Converts a control flow node into an SSA control flow node. */ @@ -602,8 +166,7 @@ module SsaFlow { or result.(SsaFlow::ExprNode).getExpr() = n.asExpr() or - result.(SsaFlow::ExprPostUpdateNode).getExpr() = - n.(Node::PostUpdateNode).getPreUpdateNode().asExpr() + result.(SsaFlow::ExprPostUpdateNode).getExpr() = n.(PostUpdateNode).getPreUpdateNode().asExpr() or n = toParameterNode(result.(SsaFlow::ParameterNode).getParameter()) } @@ -637,18 +200,16 @@ private ExprCfgNode getALastEvalNode(ExprCfgNode e) { module LocalFlow { predicate flowSummaryLocalStep(Node nodeFrom, Node nodeTo, string model) { exists(FlowSummaryImpl::Public::SummarizedCallable c | - FlowSummaryImpl::Private::Steps::summaryLocalStep(nodeFrom - .(Node::FlowSummaryNode) - .getSummaryNode(), nodeTo.(Node::FlowSummaryNode).getSummaryNode(), true, model) and - c = nodeFrom.(Node::FlowSummaryNode).getSummarizedCallable() + FlowSummaryImpl::Private::Steps::summaryLocalStep(nodeFrom.(FlowSummaryNode).getSummaryNode(), + nodeTo.(FlowSummaryNode).getSummaryNode(), true, model) and + c = nodeFrom.(FlowSummaryNode).getSummarizedCallable() ) or - FlowSummaryImpl::Private::Steps::sourceLocalStep(nodeFrom - .(Node::FlowSummaryNode) - .getSummaryNode(), nodeTo, model) + FlowSummaryImpl::Private::Steps::sourceLocalStep(nodeFrom.(FlowSummaryNode).getSummaryNode(), + nodeTo, model) or FlowSummaryImpl::Private::Steps::sinkLocalStep(nodeFrom, - nodeTo.(Node::FlowSummaryNode).getSummaryNode(), model) + nodeTo.(FlowSummaryNode).getSummaryNode(), model) } pragma[nomagic] @@ -673,10 +234,10 @@ module LocalFlow { ) or // An edge from a pattern/expression to its corresponding SSA definition. - nodeFrom.(Node::AstCfgFlowNode).getCfgNode() = - nodeTo.(Node::SsaNode).asDefinition().(Ssa::WriteDefinition).getControlFlowNode() + nodeFrom.(AstCfgFlowNode).getCfgNode() = + nodeTo.(SsaNode).asDefinition().(Ssa::WriteDefinition).getControlFlowNode() or - nodeFrom.(Node::SourceParameterNode).getParameter().(ParamCfgNode).getPat() = nodeTo.asPat() + nodeFrom.(SourceParameterNode).getParameter().(ParamCfgNode).getPat() = nodeTo.asPat() or exists(AssignmentExprCfgNode a | a.getRhs() = nodeFrom.getCfgNode() and @@ -692,11 +253,11 @@ module LocalFlow { or // Simple value step from receiver expression to receiver node, in case // there is no implicit deref or borrow operation. - nodeFrom.asExpr() = nodeTo.(Node::ReceiverNode).getReceiver() + nodeFrom.asExpr() = nodeTo.(ReceiverNode).getReceiver() or // The dual step of the above, for the post-update nodes. - nodeFrom.(Node::PostUpdateNode).getPreUpdateNode().(Node::ReceiverNode).getReceiver() = - nodeTo.(Node::PostUpdateNode).getPreUpdateNode().asExpr() + nodeFrom.(PostUpdateNode).getPreUpdateNode().(ReceiverNode).getReceiver() = + nodeTo.(PostUpdateNode).getPreUpdateNode().asExpr() } } @@ -706,7 +267,7 @@ module LocalFlow { * * TODO: Remove once library code is extracted. */ -private module VariantInLib { +module VariantInLib { private import codeql.util.Option private class CrateOrigin extends string { @@ -819,213 +380,10 @@ private module VariantInLib { class VariantInLibTupleFieldContent = VariantInLib::VariantInLibTupleFieldContent; -/** - * A path to a value contained in an object. For example a field name of a struct. - */ -abstract class Content extends TContent { - /** Gets a textual representation of this content. */ - abstract string toString(); - - /** Gets the location of this content. */ - abstract Location getLocation(); -} - -/** A field belonging to either a variant or a struct. */ -abstract class FieldContent extends Content { - /** Gets an access to this field. */ - pragma[nomagic] - abstract FieldExprCfgNode getAnAccess(); -} - -/** A tuple field belonging to either a variant or a struct. */ -class TupleFieldContent extends FieldContent, TTupleFieldContent { - private TupleField field; - - TupleFieldContent() { this = TTupleFieldContent(field) } - - predicate isVariantField(Variant v, int pos) { field.isVariantField(v, pos) } - - predicate isStructField(Struct s, int pos) { field.isStructField(s, pos) } - - override FieldExprCfgNode getAnAccess() { none() } // TODO - - final override string toString() { - exists(Variant v, int pos, string vname | - this.isVariantField(v, pos) and - vname = v.getName().getText() and - // only print indices when the arity is > 1 - if exists(v.getTupleField(1)) then result = vname + "(" + pos + ")" else result = vname - ) - or - exists(Struct s, int pos, string sname | - this.isStructField(s, pos) and - sname = s.getName().getText() and - // only print indices when the arity is > 1 - if exists(s.getTupleField(1)) then result = sname + "(" + pos + ")" else result = sname - ) - } - - final override Location getLocation() { result = field.getLocation() } -} - -/** A record field belonging to either a variant or a struct. */ -class RecordFieldContent extends FieldContent, TRecordFieldContent { - private RecordField field; - - RecordFieldContent() { this = TRecordFieldContent(field) } - - predicate isVariantField(Variant v, string name) { field.isVariantField(v, name) } - - predicate isStructField(Struct s, string name) { field.isStructField(s, name) } - - override FieldExprCfgNode getAnAccess() { none() } // TODO - - final override string toString() { - exists(Variant v, string name, string vname | - this.isVariantField(v, name) and - vname = v.getName().getText() and - // only print field when the arity is > 1 - if strictcount(v.getRecordField(_)) > 1 then result = vname + "." + name else result = vname - ) - or - exists(Struct s, string name, string sname | - this.isStructField(s, name) and - sname = s.getName().getText() and - // only print field when the arity is > 1 - if strictcount(s.getRecordField(_)) > 1 then result = sname + "." + name else result = sname - ) - } - - final override Location getLocation() { result = field.getLocation() } -} - -/** A captured variable. */ -private class CapturedVariableContent extends Content, TCapturedVariableContent { - private Variable v; - - CapturedVariableContent() { this = TCapturedVariableContent(v) } - - /** Gets the captured variable. */ - Variable getVariable() { result = v } - - override string toString() { result = "captured " + v } - - override Location getLocation() { result = v.getLocation() } -} - -/** A value referred to by a reference. */ -final class ReferenceContent extends Content, TReferenceContent { - override string toString() { result = "&ref" } - - override Location getLocation() { result instanceof EmptyLocation } -} - -/** - * An element in a collection where we do not track the specific collection - * type nor the placement of the element in the collection. Therefore the - * collection should be one where the elements are reasonably homogeneous, - * i.e., if one is tainted all elements are considered tainted. - * - * Examples include the elements of a set, array, vector, or stack. - */ -final class ElementContent extends Content, TElementContent { - override string toString() { result = "element" } - - override Location getLocation() { result instanceof EmptyLocation } -} - -/** - * A value that a future resolves to. - */ -final class FutureContent extends Content, TFutureContent { - override string toString() { result = "future" } - - override Location getLocation() { result instanceof EmptyLocation } -} - -/** - * Content stored at a position in a tuple. - * - * NOTE: Unlike `struct`s and `enum`s tuples are structural and not nominal, - * hence we don't store a canonical path for them. - */ -final class TuplePositionContent extends FieldContent, TTuplePositionContent { - private int pos; - - TuplePositionContent() { this = TTuplePositionContent(pos) } - - int getPosition() { result = pos } - - override FieldExprCfgNode getAnAccess() { - // TODO: limit to tuple types - result.getNameRef().getText().toInt() = pos - } - - override string toString() { result = "tuple." + pos.toString() } - - override Location getLocation() { result instanceof EmptyLocation } -} - -/** - * A content for the index of an argument to at function call. - * - * Used by the model generator to create flow summaries for higher-order - * functions. - */ -final class FunctionCallArgumentContent extends Content, TFunctionCallArgumentContent { - private int pos; - - FunctionCallArgumentContent() { this = TFunctionCallArgumentContent(pos) } - - int getPosition() { result = pos } - - override string toString() { result = "function argument at " + pos } - - override Location getLocation() { result instanceof EmptyLocation } -} - -/** - * A content for the return value of function call. - * - * Used by the model generator to create flow summaries for higher-order - * functions. - */ -final class FunctionCallReturnContent extends Content, TFunctionCallReturnContent { - override string toString() { result = "function return" } - - override Location getLocation() { result instanceof EmptyLocation } -} - -/** A value that represents a set of `Content`s. */ -abstract class ContentSet extends TContentSet { - /** Gets a textual representation of this element. */ - abstract string toString(); - - /** Gets a content that may be stored into when storing into this set. */ - abstract Content getAStoreContent(); - - /** Gets a content that may be read from when reading from this set. */ - abstract Content getAReadContent(); -} - -final class SingletonContentSet extends ContentSet, TSingletonContentSet { - private Content c; - - SingletonContentSet() { this = TSingletonContentSet(c) } - - Content getContent() { result = c } - - override string toString() { result = c.toString() } - - override Content getAStoreContent() { result = c } - - override Content getAReadContent() { result = c } -} - class LambdaCallKind = Unit; /** Holds if `creation` is an expression that creates a lambda of kind `kind`. */ -private predicate lambdaCreationExpr(Expr creation, LambdaCallKind kind) { +predicate lambdaCreationExpr(Expr creation, LambdaCallKind kind) { ( creation instanceof ClosureExpr or @@ -1084,6 +442,7 @@ private module Aliases { module RustDataFlow implements InputSig { private import Aliases private import codeql.rust.dataflow.DataFlow + private import Node as Node /** * An element, viewed as a node in a data flow graph. Either an expression @@ -1101,7 +460,7 @@ module RustDataFlow implements InputSig { class PostUpdateNode = DataFlow::PostUpdateNode; - final class CastNode = Node::NaNode; + final class CastNode = Node::CastNode; /** Holds if `p` is a parameter of `c` at the position `pos`. */ predicate isParameterNode(ParameterNode p, DataFlowCallable c, ParameterPosition pos) { @@ -1120,12 +479,12 @@ module RustDataFlow implements InputSig { DataFlowType getNodeType(Node node) { any() } predicate nodeIsHidden(Node node) { - node instanceof Node::SsaNode or - node.(Node::FlowSummaryNode).getSummaryNode().isHidden() or - node instanceof Node::CaptureNode or - node instanceof Node::ClosureParameterNode or - node instanceof Node::ReceiverNode or - node instanceof Node::ReceiverPostUpdateNode + node instanceof SsaNode or + node.(FlowSummaryNode).getSummaryNode().isHidden() or + node instanceof CaptureNode or + node instanceof ClosureParameterNode or + node instanceof ReceiverNode or + node instanceof ReceiverPostUpdateNode } predicate neverSkipInPathGraph(Node node) { @@ -1230,21 +589,19 @@ module RustDataFlow implements InputSig { * variable. */ predicate jumpStep(Node node1, Node node2) { - FlowSummaryImpl::Private::Steps::summaryJumpStep(node1.(Node::FlowSummaryNode).getSummaryNode(), - node2.(Node::FlowSummaryNode).getSummaryNode()) + FlowSummaryImpl::Private::Steps::summaryJumpStep(node1.(FlowSummaryNode).getSummaryNode(), + node2.(FlowSummaryNode).getSummaryNode()) } pragma[nomagic] - private predicate implicitDerefToReceiver(Node node1, Node::ReceiverNode node2, ReferenceContent c) { + private predicate implicitDerefToReceiver(Node node1, ReceiverNode node2, ReferenceContent c) { node1.asExpr() = node2.getReceiver() and implicitDeref(node2.getMethodCall().getMethodCallExpr()) and exists(c) } pragma[nomagic] - private predicate implicitBorrowToReceiver( - Node node1, Node::ReceiverNode node2, ReferenceContent c - ) { + private predicate implicitBorrowToReceiver(Node node1, ReceiverNode node2, ReferenceContent c) { node1.asExpr() = node2.getReceiver() and implicitBorrow(node2.getMethodCall().getMethodCallExpr()) and exists(c) @@ -1352,8 +709,8 @@ module RustDataFlow implements InputSig { VariableCapture::readStep(node1, c, node2) ) or - FlowSummaryImpl::Private::Steps::summaryReadStep(node1.(Node::FlowSummaryNode).getSummaryNode(), - cs, node2.(Node::FlowSummaryNode).getSummaryNode()) + FlowSummaryImpl::Private::Steps::summaryReadStep(node1.(FlowSummaryNode).getSummaryNode(), cs, + node2.(FlowSummaryNode).getSummaryNode()) } pragma[nomagic] @@ -1411,7 +768,7 @@ module RustDataFlow implements InputSig { c instanceof ReferenceContent and p.isRef() and node1.asPat() = p and - node2.(Node::NameNode).asName() = p.getName() + node2.(NameNode).asName() = p.getName() ) or fieldAssignment(node1, node2.(PostUpdateNode).getPreUpdateNode(), c) @@ -1449,8 +806,8 @@ module RustDataFlow implements InputSig { predicate storeStep(Node node1, ContentSet cs, Node node2) { storeContentStep(node1, cs.(SingletonContentSet).getContent(), node2) or - FlowSummaryImpl::Private::Steps::summaryStoreStep(node1.(Node::FlowSummaryNode).getSummaryNode(), - cs, node2.(Node::FlowSummaryNode).getSummaryNode()) + FlowSummaryImpl::Private::Steps::summaryStoreStep(node1.(FlowSummaryNode).getSummaryNode(), cs, + node2.(FlowSummaryNode).getSummaryNode()) } /** @@ -1463,8 +820,7 @@ module RustDataFlow implements InputSig { or referenceAssignment(_, n, cs.(SingletonContentSet).getContent()) or - FlowSummaryImpl::Private::Steps::summaryClearsContent(n.(Node::FlowSummaryNode).getSummaryNode(), - cs) + FlowSummaryImpl::Private::Steps::summaryClearsContent(n.(FlowSummaryNode).getSummaryNode(), cs) or VariableCapture::clearsContent(n, cs.(SingletonContentSet).getContent()) } @@ -1474,8 +830,7 @@ module RustDataFlow implements InputSig { * at node `n`. */ predicate expectsContent(Node n, ContentSet cs) { - FlowSummaryImpl::Private::Steps::summaryExpectsContent(n.(Node::FlowSummaryNode) - .getSummaryNode(), cs) + FlowSummaryImpl::Private::Steps::summaryExpectsContent(n.(FlowSummaryNode).getSummaryNode(), cs) } class NodeRegion instanceof Void { @@ -1502,7 +857,7 @@ module RustDataFlow implements InputSig { FlowSummaryImpl::Private::summaryAllowParameterReturnInSelf(c.asLibraryCallable(), pos) ) or - VariableCapture::Flow::heuristicAllowInstanceParameterReturnInSelf(p.(Node::ClosureParameterNode) + VariableCapture::Flow::heuristicAllowInstanceParameterReturnInSelf(p.(ClosureParameterNode) .getCfgScope()) } @@ -1519,8 +874,8 @@ module RustDataFlow implements InputSig { SsaFlow::localMustFlowStep(node1, node2) or FlowSummaryImpl::Private::Steps::summaryLocalMustFlowStep(node1 - .(Node::FlowSummaryNode) - .getSummaryNode(), node2.(Node::FlowSummaryNode).getSummaryNode()) + .(FlowSummaryNode) + .getSummaryNode(), node2.(FlowSummaryNode).getSummaryNode()) } /** Holds if `creation` is an expression that creates a lambda of kind `kind` for `c`. */ @@ -1542,7 +897,7 @@ module RustDataFlow implements InputSig { f instanceof PathExpr implies f = any(Variable v).getAnAccess() ) or - call.isSummaryCall(_, receiver.(Node::FlowSummaryNode).getSummaryNode()) + call.isSummaryCall(_, receiver.(FlowSummaryNode).getSummaryNode()) ) and exists(kind) } @@ -1551,12 +906,10 @@ module RustDataFlow implements InputSig { predicate additionalLambdaFlowStep(Node nodeFrom, Node nodeTo, boolean preservesValue) { none() } predicate knownSourceModel(Node source, string model) { - source.(Node::FlowSummaryNode).isSource(_, model) + source.(FlowSummaryNode).isSource(_, model) } - predicate knownSinkModel(Node sink, string model) { - sink.(Node::FlowSummaryNode).isSink(_, model) - } + predicate knownSinkModel(Node sink, string model) { sink.(FlowSummaryNode).isSink(_, model) } class DataFlowSecondLevelScope = Void; } @@ -1602,7 +955,7 @@ module VariableCapture { CapturedParameter() { p = this.getParameter() } - Node::SourceParameterNode getParameterNode() { result.getParameter().getParamBase() = p } + SourceParameterNode getParameterNode() { result.getParameter().getParamBase() = p } } class Expr extends CfgNode { @@ -1661,18 +1014,17 @@ module VariableCapture { module Flow = SharedVariableCapture::Flow; private Flow::ClosureNode asClosureNode(Node n) { - result = n.(Node::CaptureNode).getSynthesizedCaptureNode() + result = n.(CaptureNode).getSynthesizedCaptureNode() or result.(Flow::ExprNode).getExpr() = n.asExpr() or result.(Flow::VariableWriteSourceNode).getVariableWrite().getSource() = n.asExpr() or - result.(Flow::ExprPostUpdateNode).getExpr() = - n.(Node::PostUpdateNode).getPreUpdateNode().asExpr() + result.(Flow::ExprPostUpdateNode).getExpr() = n.(PostUpdateNode).getPreUpdateNode().asExpr() or result.(Flow::ParameterNode).getParameter().getParameterNode() = n or - result.(Flow::ThisParameterNode).getCallable() = n.(Node::ClosureParameterNode).getCfgScope() + result.(Flow::ThisParameterNode).getCallable() = n.(ClosureParameterNode).getCfgScope() } predicate storeStep(Node node1, CapturedVariableContent c, Node node2) { @@ -1699,40 +1051,9 @@ cached private module Cached { private import codeql.rust.internal.CachedStages - cached - newtype TNode = - TExprNode(ExprCfgNode n) { Stages::DataFlowStage::ref() } or - TSourceParameterNode(ParamBaseCfgNode p) or - TPatNode(PatCfgNode p) or - TNameNode(NameCfgNode n) { n.getName() = any(Variable v).getName() } or - TExprPostUpdateNode(ExprCfgNode e) { - isArgumentForCall(e, _, _) - or - lambdaCallExpr(_, _, e) - or - lambdaCreationExpr(e.getExpr(), _) - or - // Whenever `&mut e` has a post-update node we also create one for `e`. - // E.g., for `e` in `f(..., &mut e, ...)` or `*(&mut e) = ...`. - e = any(RefExprCfgNode ref | ref.isMut() and exists(TExprPostUpdateNode(ref))).getExpr() - or - e = - [ - any(IndexExprCfgNode i).getBase(), any(FieldExprCfgNode access).getExpr(), - any(TryExprCfgNode try).getExpr(), - any(PrefixExprCfgNode pe | pe.getOperatorName() = "*").getExpr(), - any(AwaitExprCfgNode a).getExpr(), any(MethodCallExprCfgNode mc).getReceiver() - ] - } or - TReceiverNode(MethodCallExprCfgNode mc, Boolean isPost) or - TSsaNode(SsaImpl::DataFlowIntegration::SsaNode node) or - TFlowSummaryNode(FlowSummaryImpl::Private::SummaryNode sn) or - TClosureSelfReferenceNode(CfgScope c) { lambdaCreationExpr(c, _) } or - TCaptureNode(VariableCapture::Flow::SynthesizedCaptureNode cn) - cached newtype TDataFlowCall = - TCall(CallExprBaseCfgNode c) or + TCall(CallExprBaseCfgNode c) { Stages::DataFlowStage::ref() } or TSummaryCall( FlowSummaryImpl::Public::SummarizedCallable c, FlowSummaryImpl::Private::SummaryNode receiver ) { @@ -1746,7 +1067,7 @@ private module Cached { /** This is the local flow predicate that is exposed. */ cached - predicate localFlowStepImpl(Node::Node nodeFrom, Node::Node nodeTo) { + predicate localFlowStepImpl(Node nodeFrom, Node nodeTo) { LocalFlow::localFlowStepCommon(nodeFrom, nodeTo) or SsaFlow::localFlowStep(_, nodeFrom, nodeTo, _) @@ -1771,38 +1092,16 @@ private module Cached { cached newtype TReturnKind = TNormalReturnKind() - cached - newtype TContent = - TTupleFieldContent(TupleField field) or - TRecordFieldContent(RecordField field) or - // TODO: Remove once library types are extracted - TVariantInLibTupleFieldContent(VariantInLib::VariantInLib v, int pos) { pos = v.getAPosition() } or - TElementContent() or - TFutureContent() or - TTuplePositionContent(int pos) { - pos in [0 .. max([ - any(TuplePat pat).getNumberOfFields(), - any(FieldExpr access).getNameRef().getText().toInt() - ] - )] - } or - TFunctionCallReturnContent() or - TFunctionCallArgumentContent(int pos) { - pos in [0 .. any(CallExpr c).getArgList().getNumberOfArgs() - 1] - } or - TCapturedVariableContent(VariableCapture::CapturedVariable v) or - TReferenceContent() - cached newtype TContentSet = TSingletonContentSet(Content c) /** Holds if `n` is a flow source of kind `kind`. */ cached - predicate sourceNode(Node n, string kind) { n.(Node::FlowSummaryNode).isSource(kind, _) } + predicate sourceNode(Node n, string kind) { n.(FlowSummaryNode).isSource(kind, _) } /** Holds if `n` is a flow sink of kind `kind`. */ cached - predicate sinkNode(Node n, string kind) { n.(Node::FlowSummaryNode).isSink(kind, _) } + predicate sinkNode(Node n, string kind) { n.(FlowSummaryNode).isSink(kind, _) } } import Cached diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/FlowSummaryImpl.qll b/rust/ql/lib/codeql/rust/dataflow/internal/FlowSummaryImpl.qll index 0fd457a80d5..31c5b5b01aa 100644 --- a/rust/ql/lib/codeql/rust/dataflow/internal/FlowSummaryImpl.qll +++ b/rust/ql/lib/codeql/rust/dataflow/internal/FlowSummaryImpl.qll @@ -7,6 +7,7 @@ private import codeql.dataflow.internal.FlowSummaryImpl private import codeql.dataflow.internal.AccessPathSyntax as AccessPath private import codeql.rust.dataflow.internal.DataFlowImpl private import codeql.rust.dataflow.FlowSummary +private import Content module Input implements InputSig { private import codeql.rust.elements.internal.CallExprBaseImpl::Impl as CallExprBaseImpl diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/Node.qll b/rust/ql/lib/codeql/rust/dataflow/internal/Node.qll new file mode 100644 index 00000000000..fd1da37295a --- /dev/null +++ b/rust/ql/lib/codeql/rust/dataflow/internal/Node.qll @@ -0,0 +1,486 @@ +/** + * Provides the `Node` class and subclasses thereof. + * + * Classes with names ending in `Public` are exposed as `final` aliases in the + * public `DataFlow` API, so they should not expose internal implementation details. + */ + +private import codeql.util.Boolean +private import codeql.dataflow.DataFlow +private import codeql.dataflow.internal.DataFlowImpl +private import rust +private import SsaImpl as SsaImpl +private import codeql.rust.controlflow.ControlFlowGraph +private import codeql.rust.controlflow.CfgNodes +private import codeql.rust.dataflow.Ssa +private import codeql.rust.dataflow.FlowSummary +private import Node as Node +private import DataFlowImpl +private import FlowSummaryImpl as FlowSummaryImpl + +/** An element, viewed as a node in a data flow graph. */ +abstract class NodePublic extends TNode { + /** Gets the location of this node. */ + abstract Location getLocation(); + + /** Gets a textual representation of this node. */ + abstract string toString(); + + /** + * Gets the expression that corresponds to this node, if any. + */ + ExprCfgNode asExpr() { none() } + + /** + * Gets the parameter that corresponds to this node, if any. + */ + ParamBase asParameter() { result = this.(SourceParameterNode).getParameter().getParamBase() } + + /** + * Gets the pattern that corresponds to this node, if any. + */ + PatCfgNode asPat() { none() } +} + +abstract class Node extends NodePublic { + /** Gets the enclosing callable. */ + DataFlowCallable getEnclosingCallable() { result = TCfgScope(this.getCfgScope()) } + + /** Do not call: use `getEnclosingCallable()` instead. */ + abstract CfgScope getCfgScope(); + + /** + * Gets the control flow node that corresponds to this data flow node. + */ + CfgNode getCfgNode() { none() } +} + +/** A node type that is not implemented. */ +final class NaNode extends Node { + NaNode() { none() } + + override CfgScope getCfgScope() { none() } + + override string toString() { result = "N/A" } + + override Location getLocation() { none() } +} + +/** A data flow node used to model flow summaries. */ +class FlowSummaryNode extends Node, TFlowSummaryNode { + FlowSummaryImpl::Private::SummaryNode getSummaryNode() { this = TFlowSummaryNode(result) } + + /** Gets the summarized callable that this node belongs to, if any. */ + FlowSummaryImpl::Public::SummarizedCallable getSummarizedCallable() { + result = this.getSummaryNode().getSummarizedCallable() + } + + /** Gets the AST source node that this node belongs to, if any */ + FlowSummaryImpl::Public::SourceElement getSourceElement() { + result = this.getSummaryNode().getSourceElement() + } + + /** Gets the AST sink node that this node belongs to, if any */ + FlowSummaryImpl::Public::SinkElement getSinkElement() { + result = this.getSummaryNode().getSinkElement() + } + + /** Holds is this node is a source node of kind `kind`. */ + predicate isSource(string kind, string model) { + this.getSummaryNode().(FlowSummaryImpl::Private::SourceOutputNode).isEntry(kind, model) + } + + /** Holds is this node is a sink node of kind `kind`. */ + predicate isSink(string kind, string model) { + this.getSummaryNode().(FlowSummaryImpl::Private::SinkInputNode).isExit(kind, model) + } + + override CfgScope getCfgScope() { + result = this.getSummaryNode().getSourceElement().getEnclosingCfgScope() + or + result = this.getSummaryNode().getSinkElement().getEnclosingCfgScope() + } + + override DataFlowCallable getEnclosingCallable() { + result.asLibraryCallable() = this.getSummarizedCallable() + or + result.asCfgScope() = this.getCfgScope() + } + + override Location getLocation() { + exists(this.getSummarizedCallable()) and + result instanceof EmptyLocation + or + result = this.getSourceElement().getLocation() + or + result = this.getSinkElement().getLocation() + } + + override string toString() { result = this.getSummaryNode().toString() } +} + +/** A data flow node that corresponds directly to a CFG node for an AST node. */ +abstract class AstCfgFlowNode extends Node { + AstCfgNode n; + + final override CfgNode getCfgNode() { result = n } + + final override CfgScope getCfgScope() { result = n.getAstNode().getEnclosingCfgScope() } + + final override Location getLocation() { result = n.getAstNode().getLocation() } + + final override string toString() { result = n.getAstNode().toString() } +} + +/** + * A node in the data flow graph that corresponds to an expression in the + * AST. + * + * Note that because of control flow splitting, one `Expr` may correspond + * to multiple `ExprNode`s, just like it may correspond to multiple + * `ControlFlow::Node`s. + */ +class ExprNode extends AstCfgFlowNode, TExprNode { + override ExprCfgNode n; + + ExprNode() { this = TExprNode(n) } + + override ExprCfgNode asExpr() { result = n } +} + +final class PatNode extends AstCfgFlowNode, TPatNode { + override PatCfgNode n; + + PatNode() { this = TPatNode(n) } + + override PatCfgNode asPat() { result = n } +} + +/** A data flow node that corresponds to a name node in the CFG. */ +final class NameNode extends AstCfgFlowNode, TNameNode { + override NameCfgNode n; + + NameNode() { this = TNameNode(n) } + + NameCfgNode asName() { result = n } +} + +/** + * The value of a parameter at function entry, viewed as a node in a data + * flow graph. + */ +abstract class ParameterNode extends Node { + /** Holds if this node is a parameter of `c` at position `pos`. */ + abstract predicate isParameterOf(DataFlowCallable c, ParameterPosition pos); +} + +final class SourceParameterNode extends AstCfgFlowNode, ParameterNode, TSourceParameterNode { + override ParamBaseCfgNode n; + + SourceParameterNode() { this = TSourceParameterNode(n) } + + override predicate isParameterOf(DataFlowCallable c, ParameterPosition pos) { + n.getAstNode() = pos.getParameterIn(c.asCfgScope().(Callable).getParamList()) + } + + /** Get the parameter position of this parameter. */ + ParameterPosition getPosition() { this.isParameterOf(_, result) } + + /** Gets the parameter in the CFG that this node corresponds to. */ + ParamBaseCfgNode getParameter() { result = n } +} + +/** A parameter for a library callable with a flow summary. */ +final class SummaryParameterNode extends ParameterNode, FlowSummaryNode { + private ParameterPosition pos_; + + SummaryParameterNode() { + FlowSummaryImpl::Private::summaryParameterNode(this.getSummaryNode(), pos_) + } + + override predicate isParameterOf(DataFlowCallable c, ParameterPosition pos) { + this.getSummarizedCallable() = c.asLibraryCallable() and pos = pos_ + } +} + +/** + * The run-time representation of a closure itself at function entry, viewed + * as a node in a data flow graph. + */ +final class ClosureParameterNode extends ParameterNode, TClosureSelfReferenceNode { + private CfgScope cfgScope; + + ClosureParameterNode() { this = TClosureSelfReferenceNode(cfgScope) } + + final override CfgScope getCfgScope() { result = cfgScope } + + override predicate isParameterOf(DataFlowCallable c, ParameterPosition pos) { + cfgScope = c.asCfgScope() and pos.isClosureSelf() + } + + override Location getLocation() { result = cfgScope.getLocation() } + + override string toString() { result = "closure self in " + cfgScope } +} + +abstract class ArgumentNode extends Node { + abstract predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos); +} + +final class ExprArgumentNode extends ArgumentNode, ExprNode { + private CallExprBaseCfgNode call_; + private RustDataFlow::ArgumentPosition pos_; + + ExprArgumentNode() { isArgumentForCall(n, call_, pos_) } + + override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) { + call.asCallBaseExprCfgNode() = call_ and pos = pos_ + } +} + +/** + * The receiver of a method call _after_ any implicit borrow or dereferencing + * has taken place. + */ +final class ReceiverNode extends ArgumentNode, TReceiverNode { + private MethodCallExprCfgNode n; + + ReceiverNode() { this = TReceiverNode(n, false) } + + ExprCfgNode getReceiver() { result = n.getReceiver() } + + MethodCallExprCfgNode getMethodCall() { result = n } + + override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) { + call.asMethodCallExprCfgNode() = n and pos = TSelfParameterPosition() + } + + override CfgScope getCfgScope() { result = n.getAstNode().getEnclosingCfgScope() } + + override Location getLocation() { result = this.getReceiver().getLocation() } + + override string toString() { result = "receiver for " + this.getReceiver() } +} + +final class SummaryArgumentNode extends FlowSummaryNode, ArgumentNode { + private FlowSummaryImpl::Private::SummaryNode receiver; + private RustDataFlow::ArgumentPosition pos_; + + SummaryArgumentNode() { + FlowSummaryImpl::Private::summaryArgumentNode(receiver, this.getSummaryNode(), pos_) + } + + override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) { + call.isSummaryCall(_, receiver) and pos = pos_ + } +} + +/** + * A data flow node that represents the run-time representation of a closure + * passed into the closure body at an invocation. + */ +final class ClosureArgumentNode extends ArgumentNode, ExprNode { + private CallExprCfgNode call_; + + ClosureArgumentNode() { lambdaCallExpr(call_, _, this.asExpr()) } + + override predicate isArgumentOf(DataFlowCall call, RustDataFlow::ArgumentPosition pos) { + call.asCallExprCfgNode() = call_ and + pos.isClosureSelf() + } +} + +/** An SSA node. */ +class SsaNode extends Node, TSsaNode { + SsaImpl::DataFlowIntegration::SsaNode node; + + SsaNode() { this = TSsaNode(node) } + + override CfgScope getCfgScope() { result = node.getBasicBlock().getScope() } + + /** Gets the definition this node corresponds to, if any. */ + SsaImpl::Definition asDefinition() { + result = node.(SsaImpl::DataFlowIntegration::SsaDefinitionNode).getDefinition() + } + + override Location getLocation() { result = node.getLocation() } + + override string toString() { result = "[SSA] " + node.toString() } +} + +/** A data flow node that represents a value returned by a callable. */ +abstract class ReturnNode extends Node { + abstract ReturnKind getKind(); +} + +final class ExprReturnNode extends ExprNode, ReturnNode { + ExprReturnNode() { this.getCfgNode().getASuccessor() instanceof AnnotatedExitCfgNode } + + override ReturnKind getKind() { result = TNormalReturnKind() } +} + +final class SummaryReturnNode extends FlowSummaryNode, ReturnNode { + private ReturnKind rk; + + SummaryReturnNode() { FlowSummaryImpl::Private::summaryReturnNode(this.getSummaryNode(), rk) } + + override ReturnKind getKind() { result = rk } +} + +/** A data flow node that represents the output of a call. */ +abstract class OutNode extends Node { + /** Gets the underlying call for this node. */ + abstract DataFlowCall getCall(ReturnKind kind); +} + +final private class ExprOutNode extends ExprNode, OutNode { + ExprOutNode() { this.asExpr() instanceof CallExprBaseCfgNode } + + /** Gets the underlying call CFG node that includes this out node. */ + override DataFlowCall getCall(ReturnKind kind) { + result.asCallBaseExprCfgNode() = this.getCfgNode() and + kind = TNormalReturnKind() + } +} + +final class SummaryOutNode extends FlowSummaryNode, OutNode { + private DataFlowCall call; + private ReturnKind kind_; + + SummaryOutNode() { + exists(FlowSummaryImpl::Private::SummaryNode receiver | + call.isSummaryCall(_, receiver) and + FlowSummaryImpl::Private::summaryOutNode(receiver, this.getSummaryNode(), kind_) + ) + } + + override DataFlowCall getCall(ReturnKind kind) { result = call and kind = kind_ } +} + +/** + * A synthesized data flow node representing a closure object that tracks + * captured variables. + */ +class CaptureNode extends Node, TCaptureNode { + private VariableCapture::Flow::SynthesizedCaptureNode cn; + + CaptureNode() { this = TCaptureNode(cn) } + + VariableCapture::Flow::SynthesizedCaptureNode getSynthesizedCaptureNode() { result = cn } + + override CfgScope getCfgScope() { result = cn.getEnclosingCallable() } + + override Location getLocation() { result = cn.getLocation() } + + override string toString() { result = cn.toString() } +} + +/** + * A node associated with an object after an operation that might have + * changed its state. + * + * This can be either the argument to a callable after the callable returns + * (which might have mutated the argument), or the qualifier of a field after + * an update to the field. + * + * Nodes corresponding to AST elements, for example `ExprNode`, usually refer + * to the value before the update. + */ +abstract class PostUpdateNodePublic extends NodePublic { + /** Gets the node before the state update. */ + abstract NodePublic getPreUpdateNode(); +} + +abstract class PostUpdateNode extends PostUpdateNodePublic, Node { + override string toString() { result = "[post] " + this.getPreUpdateNode().toString() } +} + +final class ExprPostUpdateNode extends PostUpdateNode, TExprPostUpdateNode { + private ExprCfgNode n; + + ExprPostUpdateNode() { this = TExprPostUpdateNode(n) } + + override Node getPreUpdateNode() { result = TExprNode(n) } + + override CfgScope getCfgScope() { result = n.getScope() } + + override Location getLocation() { result = n.getLocation() } +} + +final class ReceiverPostUpdateNode extends PostUpdateNode, TReceiverNode { + private MethodCallExprCfgNode n; + + ReceiverPostUpdateNode() { this = TReceiverNode(n, true) } + + override Node getPreUpdateNode() { result = TReceiverNode(n, false) } + + override CfgScope getCfgScope() { result = n.getAstNode().getEnclosingCfgScope() } + + override Location getLocation() { result = n.getReceiver().getLocation() } +} + +final class SummaryPostUpdateNode extends FlowSummaryNode, PostUpdateNode { + private FlowSummaryNode pre; + + SummaryPostUpdateNode() { + FlowSummaryImpl::Private::summaryPostUpdateNode(this.getSummaryNode(), pre.getSummaryNode()) + } + + override Node getPreUpdateNode() { result = pre } + + final override string toString() { result = PostUpdateNode.super.toString() } +} + +private class CapturePostUpdateNode extends PostUpdateNode, CaptureNode { + private CaptureNode pre; + + CapturePostUpdateNode() { + VariableCapture::Flow::capturePostUpdateNode(this.getSynthesizedCaptureNode(), + pre.getSynthesizedCaptureNode()) + } + + override Node getPreUpdateNode() { result = pre } + + final override string toString() { result = PostUpdateNode.super.toString() } +} + +final class CastNode = NaNode; + +/** A collection of cached types and predicates to be evaluated in the same stage. */ +cached +private module Cached { + private import codeql.rust.internal.CachedStages + + cached + newtype TNode = + TExprNode(ExprCfgNode n) { Stages::DataFlowStage::ref() } or + TSourceParameterNode(ParamBaseCfgNode p) or + TPatNode(PatCfgNode p) or + TNameNode(NameCfgNode n) { n.getName() = any(Variable v).getName() } or + TExprPostUpdateNode(ExprCfgNode e) { + isArgumentForCall(e, _, _) + or + lambdaCallExpr(_, _, e) + or + lambdaCreationExpr(e.getExpr(), _) + or + // Whenever `&mut e` has a post-update node we also create one for `e`. + // E.g., for `e` in `f(..., &mut e, ...)` or `*(&mut e) = ...`. + e = any(RefExprCfgNode ref | ref.isMut() and exists(TExprPostUpdateNode(ref))).getExpr() + or + e = + [ + any(IndexExprCfgNode i).getBase(), any(FieldExprCfgNode access).getExpr(), + any(TryExprCfgNode try).getExpr(), + any(PrefixExprCfgNode pe | pe.getOperatorName() = "*").getExpr(), + any(AwaitExprCfgNode a).getExpr(), any(MethodCallExprCfgNode mc).getReceiver() + ] + } or + TReceiverNode(MethodCallExprCfgNode mc, Boolean isPost) or + TSsaNode(SsaImpl::DataFlowIntegration::SsaNode node) or + TFlowSummaryNode(FlowSummaryImpl::Private::SummaryNode sn) or + TClosureSelfReferenceNode(CfgScope c) { lambdaCreationExpr(c, _) } or + TCaptureNode(VariableCapture::Flow::SynthesizedCaptureNode cn) +} + +import Cached diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/TaintTrackingImpl.qll b/rust/ql/lib/codeql/rust/dataflow/internal/TaintTrackingImpl.qll index 4d71297660a..7cef3b58f55 100644 --- a/rust/ql/lib/codeql/rust/dataflow/internal/TaintTrackingImpl.qll +++ b/rust/ql/lib/codeql/rust/dataflow/internal/TaintTrackingImpl.qll @@ -4,6 +4,8 @@ private import codeql.rust.controlflow.CfgNodes private import codeql.rust.dataflow.DataFlow private import codeql.rust.dataflow.FlowSummary private import DataFlowImpl +private import Node as Node +private import Content private import FlowSummaryImpl as FlowSummaryImpl private import codeql.rust.internal.CachedStages diff --git a/rust/ql/lib/codeql/rust/internal/CachedStages.qll b/rust/ql/lib/codeql/rust/internal/CachedStages.qll index 0cf3c32921e..a5894400f1b 100644 --- a/rust/ql/lib/codeql/rust/internal/CachedStages.qll +++ b/rust/ql/lib/codeql/rust/internal/CachedStages.qll @@ -101,6 +101,8 @@ module Stages { cached module DataFlowStage { private import codeql.rust.dataflow.internal.DataFlowImpl + private import codeql.rust.dataflow.internal.Node + private import codeql.rust.dataflow.internal.Content private import codeql.rust.dataflow.internal.TaintTrackingImpl /** @@ -122,6 +124,10 @@ module Stages { exists(Node n) or RustTaintTracking::defaultAdditionalTaintStep(_, _, _) + or + exists(DataFlowCall call) + or + exists(Content content) } } } diff --git a/rust/ql/lib/codeql/rust/security/WeakSensitiveDataHashingExtensions.qll b/rust/ql/lib/codeql/rust/security/WeakSensitiveDataHashingExtensions.qll index 45aa03b5805..3f5c81bd118 100644 --- a/rust/ql/lib/codeql/rust/security/WeakSensitiveDataHashingExtensions.qll +++ b/rust/ql/lib/codeql/rust/security/WeakSensitiveDataHashingExtensions.qll @@ -14,7 +14,7 @@ private import codeql.rust.security.SensitiveData private import codeql.rust.dataflow.DataFlow private import codeql.rust.dataflow.FlowSource private import codeql.rust.dataflow.FlowSink -private import codeql.rust.dataflow.internal.DataFlowImpl +private import codeql.rust.dataflow.internal.Node as Node /** * Provides default sources, sinks and sanitizers for detecting "use of a broken or weak diff --git a/rust/ql/lib/utils/test/InlineFlowTest.qll b/rust/ql/lib/utils/test/InlineFlowTest.qll index 3fe1e5f2e62..80abf21e1f5 100644 --- a/rust/ql/lib/utils/test/InlineFlowTest.qll +++ b/rust/ql/lib/utils/test/InlineFlowTest.qll @@ -8,6 +8,7 @@ private import codeql.dataflow.test.InlineFlowTest private import codeql.rust.controlflow.CfgNodes private import codeql.rust.dataflow.DataFlow private import codeql.rust.dataflow.internal.DataFlowImpl +private import codeql.rust.dataflow.internal.Node as Node private import codeql.rust.dataflow.internal.TaintTrackingImpl private import codeql.rust.dataflow.internal.ModelsAsData as MaD private import internal.InlineExpectationsTestImpl as InlineExpectationsTestImpl diff --git a/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql b/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql index 223ea141c13..2f4c4f2bbfa 100644 --- a/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql +++ b/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql @@ -17,7 +17,7 @@ import rust import codeql.rust.security.CleartextLoggingExtensions import codeql.rust.dataflow.DataFlow import codeql.rust.dataflow.TaintTracking -import codeql.rust.dataflow.internal.DataFlowImpl +import codeql.rust.dataflow.internal.Content /** * A taint-tracking configuration for cleartext logging vulnerabilities. diff --git a/rust/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/rust/ql/src/utils/modelgenerator/internal/CaptureModels.qll index 99cc2407358..3a14f6a4a48 100644 --- a/rust/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/rust/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -3,6 +3,8 @@ private import rust private import rust as R private import codeql.rust.dataflow.DataFlow private import codeql.rust.dataflow.internal.DataFlowImpl +private import codeql.rust.dataflow.internal.Node as Node +private import codeql.rust.dataflow.internal.Content private import codeql.rust.dataflow.FlowSource as FlowSource private import codeql.rust.dataflow.FlowSink as FlowSink private import codeql.rust.dataflow.internal.TaintTrackingImpl diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql index b082800864c..6d81896d229 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql @@ -8,7 +8,7 @@ private module Tm = TranslateModels; query predicate models = Tm::models/2; -query predicate localStep(Node nodeFrom, Node nodeTo) { +query predicate localStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) { // Local flow steps that don't originate from a flow summary. RustDataFlow::simpleLocalFlowStep(nodeFrom, nodeTo, "") } diff --git a/rust/ql/test/library-tests/dataflow/taint/TaintFlowStep.ql b/rust/ql/test/library-tests/dataflow/taint/TaintFlowStep.ql index f049d77fe07..62a77b5b66b 100644 --- a/rust/ql/test/library-tests/dataflow/taint/TaintFlowStep.ql +++ b/rust/ql/test/library-tests/dataflow/taint/TaintFlowStep.ql @@ -1,5 +1,5 @@ import codeql.rust.dataflow.DataFlow -import codeql.rust.dataflow.internal.DataFlowImpl +import codeql.rust.dataflow.internal.Node as Node import codeql.rust.dataflow.internal.TaintTrackingImpl import utils.test.TranslateModels From aed51644ba49f3582d6583028acaab618bde505c Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Sat, 1 Mar 2025 21:22:26 +0000 Subject: [PATCH 02/14] Convert to inline expectations test --- .../CWE-367/semmle/tests/TOCTOURace.qlref | 3 +- .../security/CWE-367/semmle/tests/Test.java | 38 +++++++++---------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/java/ql/test/query-tests/security/CWE-367/semmle/tests/TOCTOURace.qlref b/java/ql/test/query-tests/security/CWE-367/semmle/tests/TOCTOURace.qlref index 243a5641935..b278242dea6 100644 --- a/java/ql/test/query-tests/security/CWE-367/semmle/tests/TOCTOURace.qlref +++ b/java/ql/test/query-tests/security/CWE-367/semmle/tests/TOCTOURace.qlref @@ -1 +1,2 @@ -Security/CWE/CWE-367/TOCTOURace.ql \ No newline at end of file +query: Security/CWE/CWE-367/TOCTOURace.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test/query-tests/security/CWE-367/semmle/tests/Test.java b/java/ql/test/query-tests/security/CWE-367/semmle/tests/Test.java index c25a699001a..11287896bbe 100644 --- a/java/ql/test/query-tests/security/CWE-367/semmle/tests/Test.java +++ b/java/ql/test/query-tests/security/CWE-367/semmle/tests/Test.java @@ -4,27 +4,27 @@ package test.cwe367.semmle.tests; class Test { public final Object lock = new Object(); - + public volatile boolean aField = true; - + public synchronized void bad1(Resource r) { // probably used concurrently due to synchronization if (r.getState()) { - r.act(); + r.act(); // $ Alert } } public synchronized void bad2(Resource2 r) { // probably used concurrently due to synchronization if (r.getState()) { - r.act(); + r.act(); // $ Alert } } public void bad3(Resource r) { // probably used concurrently due to use of volatile field if (r.getState() && aField) { - r.act(); + r.act(); // $ Alert } } @@ -32,11 +32,11 @@ class Test { // probably used concurrently due to synchronization synchronized(this) { if (r.getState() && aField) { - r.act(); + r.act(); // $ Alert } } } - + public void good1(Resource r) { // synchronizes on the same monitor as the called methods synchronized(r) { @@ -45,15 +45,15 @@ class Test { } } } - + public Resource rField = new Resource(); - + public void someOtherMethod() { synchronized(lock) { rField.act(); } } - + public void good2() { // r is always guarded with the same lock, so okay synchronized(lock) { @@ -77,43 +77,43 @@ class Test { r.act(); } } - + class Resource { boolean state; - + public synchronized void setState(boolean newState) { this.state = newState; } - + public synchronized boolean getState() { return state; } - + public synchronized void act() { if (state) sideEffect(); else sideEffect(); } - + public void sideEffect() { } } class Resource2 { boolean state; - + public void setState(boolean newState) { synchronized(this) { this.state = newState; } } - + public boolean getState() { synchronized(this) { return state; } } - + public void act() { synchronized(this) { if (state) @@ -122,7 +122,7 @@ class Test { sideEffect(); } } - + public void sideEffect() { } } } From dc2cbf74020f7c80c2f4638f5a2a3c7649f64bec Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 13 Mar 2025 15:02:26 +0000 Subject: [PATCH 03/14] Add tests for always-locked fields --- .../semmle/tests/FieldAlwaysLocked.java | 24 ++++++++++++++++ .../semmle/tests/FieldNotAlwaysLocked.java | 28 +++++++++++++++++++ .../CWE-367/semmle/tests/TOCTOURace.expected | 4 +++ 3 files changed, 56 insertions(+) create mode 100644 java/ql/test/query-tests/security/CWE-367/semmle/tests/FieldAlwaysLocked.java create mode 100644 java/ql/test/query-tests/security/CWE-367/semmle/tests/FieldNotAlwaysLocked.java diff --git a/java/ql/test/query-tests/security/CWE-367/semmle/tests/FieldAlwaysLocked.java b/java/ql/test/query-tests/security/CWE-367/semmle/tests/FieldAlwaysLocked.java new file mode 100644 index 00000000000..7f676650dcf --- /dev/null +++ b/java/ql/test/query-tests/security/CWE-367/semmle/tests/FieldAlwaysLocked.java @@ -0,0 +1,24 @@ +package test.cwe367.semmle.tests; + +import java.util.Enumeration; +import java.util.Hashtable; + +class FieldAlwaysLocked { + + Hashtable field; + + public FieldAlwaysLocked() { + field = new Hashtable(); + } + + protected synchronized void checkOut() { + Object o; + if (field.size() > 0) { + Enumeration e = field.keys(); // $ SPURIOUS: Alert + while (e.hasMoreElements()) { + o = e.nextElement(); + field.remove(o); // $ SPURIOUS: Alert + } + } + } +} diff --git a/java/ql/test/query-tests/security/CWE-367/semmle/tests/FieldNotAlwaysLocked.java b/java/ql/test/query-tests/security/CWE-367/semmle/tests/FieldNotAlwaysLocked.java new file mode 100644 index 00000000000..cdae7f924e5 --- /dev/null +++ b/java/ql/test/query-tests/security/CWE-367/semmle/tests/FieldNotAlwaysLocked.java @@ -0,0 +1,28 @@ +package test.cwe367.semmle.tests; + +import java.util.Enumeration; +import java.util.Hashtable; + +class FieldNotAlwaysLocked { + + Hashtable field; + + public FieldNotAlwaysLocked() { + field = new Hashtable(); + } + + protected synchronized void checkOut() { + Object o; + if (field.size() > 0) { + Enumeration e = field.keys(); // $ Alert + while (e.hasMoreElements()) { + o = e.nextElement(); + field.remove(o); // $ Alert + } + } + } + + protected void modifyUnlocked() { + field = new Hashtable(); + } +} diff --git a/java/ql/test/query-tests/security/CWE-367/semmle/tests/TOCTOURace.expected b/java/ql/test/query-tests/security/CWE-367/semmle/tests/TOCTOURace.expected index f6882038540..e1cd7942ebe 100644 --- a/java/ql/test/query-tests/security/CWE-367/semmle/tests/TOCTOURace.expected +++ b/java/ql/test/query-tests/security/CWE-367/semmle/tests/TOCTOURace.expected @@ -1,3 +1,7 @@ +| FieldAlwaysLocked.java:17:41:17:52 | keys(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | FieldAlwaysLocked.java:8:19:8:23 | field | field | FieldAlwaysLocked.java:16:21:16:32 | size(...) | is checked at a previous call | +| FieldAlwaysLocked.java:20:33:20:47 | remove(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | FieldAlwaysLocked.java:8:19:8:23 | field | field | FieldAlwaysLocked.java:16:21:16:32 | size(...) | is checked at a previous call | +| FieldNotAlwaysLocked.java:17:41:17:52 | keys(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | FieldNotAlwaysLocked.java:8:19:8:23 | field | field | FieldNotAlwaysLocked.java:16:21:16:32 | size(...) | is checked at a previous call | +| FieldNotAlwaysLocked.java:20:33:20:47 | remove(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | FieldNotAlwaysLocked.java:8:19:8:23 | field | field | FieldNotAlwaysLocked.java:16:21:16:32 | size(...) | is checked at a previous call | | Test.java:13:4:13:10 | act(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | Test.java:10:32:10:41 | r | r | Test.java:12:7:12:18 | getState(...) | is checked at a previous call | | Test.java:20:4:20:10 | act(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | Test.java:17:32:17:42 | r | r | Test.java:19:7:19:18 | getState(...) | is checked at a previous call | | Test.java:27:4:27:10 | act(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | Test.java:24:19:24:28 | r | r | Test.java:26:7:26:18 | getState(...) | is checked at a previous call | From a8e993c942aa1ce90634af053a470701df354766 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 13 Mar 2025 15:03:32 +0000 Subject: [PATCH 04/14] Fix FP for always-locked fields --- java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql | 4 +++- .../security/CWE-367/semmle/tests/FieldAlwaysLocked.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql b/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql index ca2c948867f..4c71e106607 100644 --- a/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql +++ b/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql @@ -68,7 +68,9 @@ predicate alwaysLocked(Field f) { or exists(RefType thisType | forex(VarAccess access | - access = f.getAnAccess() and not access.getEnclosingCallable() instanceof InitializerMethod + access = f.getAnAccess() and + not access.getEnclosingCallable() instanceof Constructor and + not access.getEnclosingCallable() instanceof InitializerMethod | locallySynchronizedOnThis(access, thisType) ) diff --git a/java/ql/test/query-tests/security/CWE-367/semmle/tests/FieldAlwaysLocked.java b/java/ql/test/query-tests/security/CWE-367/semmle/tests/FieldAlwaysLocked.java index 7f676650dcf..71a463364b8 100644 --- a/java/ql/test/query-tests/security/CWE-367/semmle/tests/FieldAlwaysLocked.java +++ b/java/ql/test/query-tests/security/CWE-367/semmle/tests/FieldAlwaysLocked.java @@ -14,10 +14,10 @@ class FieldAlwaysLocked { protected synchronized void checkOut() { Object o; if (field.size() > 0) { - Enumeration e = field.keys(); // $ SPURIOUS: Alert + Enumeration e = field.keys(); while (e.hasMoreElements()) { o = e.nextElement(); - field.remove(o); // $ SPURIOUS: Alert + field.remove(o); } } } From 6ca9a1ff9ad38edb60e36caa592f654e682e0272 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 13 Mar 2025 15:05:32 +0000 Subject: [PATCH 05/14] Add change note --- .../src/change-notes/2025-03-13-fix-toctou-false-positive.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 java/ql/src/change-notes/2025-03-13-fix-toctou-false-positive.md diff --git a/java/ql/src/change-notes/2025-03-13-fix-toctou-false-positive.md b/java/ql/src/change-notes/2025-03-13-fix-toctou-false-positive.md new file mode 100644 index 00000000000..fb6fcfaaf1b --- /dev/null +++ b/java/ql/src/change-notes/2025-03-13-fix-toctou-false-positive.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Fixed a false positive in "Time-of-check time-of-use race condition" (`java/toctou-race-condition`) where a field of a non-static class was not considered always-locked if it was accessed in a constructor. From c534f89e931c15df72aef06af7ef2784f266cbcb Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Thu, 13 Mar 2025 13:30:51 -0700 Subject: [PATCH 06/14] Code scanning config: Exclude actions test directory These are test cases for the GitHub Actions analysis. Exclude them when running code scanning against this repo, to avoid noisy alerts. Test workflow files in this directory are safe from execution, because Actions only executes workflows that live directly in the .github/workflows top-level directory. `action.yml` files in this directory can in theory be executed as a step in a workflow; for now exclude them. --- .github/codeql/codeql-config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml index 78c213fe2c1..652e19dd4d0 100644 --- a/.github/codeql/codeql-config.yml +++ b/.github/codeql/codeql-config.yml @@ -4,6 +4,7 @@ queries: - uses: security-and-quality paths-ignore: + - '/actions/ql/test' - '/cpp/' - '/java/' - '/python/' From 5c7588822d21e972ad09dec8e16887e06344c3fb Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 14 Mar 2025 11:39:50 +0000 Subject: [PATCH 07/14] Fix test output --- .../security/CWE-367/semmle/tests/TOCTOURace.expected | 2 -- 1 file changed, 2 deletions(-) diff --git a/java/ql/test/query-tests/security/CWE-367/semmle/tests/TOCTOURace.expected b/java/ql/test/query-tests/security/CWE-367/semmle/tests/TOCTOURace.expected index e1cd7942ebe..f2dc9f8aa95 100644 --- a/java/ql/test/query-tests/security/CWE-367/semmle/tests/TOCTOURace.expected +++ b/java/ql/test/query-tests/security/CWE-367/semmle/tests/TOCTOURace.expected @@ -1,5 +1,3 @@ -| FieldAlwaysLocked.java:17:41:17:52 | keys(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | FieldAlwaysLocked.java:8:19:8:23 | field | field | FieldAlwaysLocked.java:16:21:16:32 | size(...) | is checked at a previous call | -| FieldAlwaysLocked.java:20:33:20:47 | remove(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | FieldAlwaysLocked.java:8:19:8:23 | field | field | FieldAlwaysLocked.java:16:21:16:32 | size(...) | is checked at a previous call | | FieldNotAlwaysLocked.java:17:41:17:52 | keys(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | FieldNotAlwaysLocked.java:8:19:8:23 | field | field | FieldNotAlwaysLocked.java:16:21:16:32 | size(...) | is checked at a previous call | | FieldNotAlwaysLocked.java:20:33:20:47 | remove(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | FieldNotAlwaysLocked.java:8:19:8:23 | field | field | FieldNotAlwaysLocked.java:16:21:16:32 | size(...) | is checked at a previous call | | Test.java:13:4:13:10 | act(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | Test.java:10:32:10:41 | r | r | Test.java:12:7:12:18 | getState(...) | is checked at a previous call | From 7702e9da7d5555c0908f8bbfd59ff4e6c74efb89 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 14 Mar 2025 11:36:43 +0000 Subject: [PATCH 08/14] Address review comments --- .../ql/src/Security/CWE/CWE-367/TOCTOURace.ql | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql b/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql index 4c71e106607..86808552433 100644 --- a/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql +++ b/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql @@ -54,32 +54,34 @@ class PossiblyConcurrentCallable extends Callable { } } +private VarAccess getANonInitializationAccess(Field f) { + result = f.getAnAccess() and + exists(Callable c | c = result.getEnclosingCallable() | + not ( + c = f.getDeclaringType().getACallable() and + (c instanceof Constructor or c instanceof InitializerMethod) + ) + ) +} + /** * Holds if all accesses to `v` (outside of initializers) are locked in the same way. */ predicate alwaysLocked(Field f) { exists(Variable lock | - forex(VarAccess access | - access = f.getAnAccess() and not access.getEnclosingCallable() instanceof InitializerMethod - | + forex(VarAccess access | access = getANonInitializationAccess(f) | locallySynchronizedOn(access, _, lock) ) ) or exists(RefType thisType | - forex(VarAccess access | - access = f.getAnAccess() and - not access.getEnclosingCallable() instanceof Constructor and - not access.getEnclosingCallable() instanceof InitializerMethod - | + forex(VarAccess access | access = getANonInitializationAccess(f) | locallySynchronizedOnThis(access, thisType) ) ) or exists(RefType classType | - forex(VarAccess access | - access = f.getAnAccess() and not access.getEnclosingCallable() instanceof InitializerMethod - | + forex(VarAccess access | access = getANonInitializationAccess(f) | locallySynchronizedOnClass(access, classType) ) ) From 0dd59cbb25907f69eacf997b3d46b033a2c1fb24 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 14 Mar 2025 11:55:33 +0100 Subject: [PATCH 09/14] Rust: Make `Crate` a sub class of `Locatable` --- rust/extractor/src/generated/.generated.list | 2 +- rust/extractor/src/generated/top.rs | 105 ++++++++++-------- rust/ql/.generated.list | 10 +- rust/ql/lib/codeql/rust/elements/Crate.qll | 2 +- .../rust/elements/internal/CrateImpl.qll | 4 + .../elements/internal/generated/Crate.qll | 4 +- .../internal/generated/ParentChild.qll | 30 ++--- .../rust/elements/internal/generated/Raw.qll | 64 +++++------ .../elements/internal/generated/Synth.qll | 10 +- rust/ql/lib/rust.dbscheme | 76 ++++++------- .../crate_graph/crates.expected | 6 +- .../extractor-tests/crate_graph/crates.ql | 9 +- rust/schema/prelude.py | 2 +- 13 files changed, 172 insertions(+), 152 deletions(-) diff --git a/rust/extractor/src/generated/.generated.list b/rust/extractor/src/generated/.generated.list index e70681ab2aa..641f5c67fce 100644 --- a/rust/extractor/src/generated/.generated.list +++ b/rust/extractor/src/generated/.generated.list @@ -1,2 +1,2 @@ mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 -top.rs 4b7dee6ebdbb2f8bd2f387cbb71e0481475de0a94c0baaac4699f19551256d65 4b7dee6ebdbb2f8bd2f387cbb71e0481475de0a94c0baaac4699f19551256d65 +top.rs 413fd08f7bc22169688be065bd89fa80f924fcbf88ce41e6a9db6872b2a6a84e 413fd08f7bc22169688be065bd89fa80f924fcbf88ce41e6a9db6872b2a6a84e diff --git a/rust/extractor/src/generated/top.rs b/rust/extractor/src/generated/top.rs index 7df57c79bf6..0cdc1886420 100644 --- a/rust/extractor/src/generated/top.rs +++ b/rust/extractor/src/generated/top.rs @@ -22,54 +22,6 @@ impl trap::TrapClass for Element { fn class_name() -> &'static str { "Element" } } -#[derive(Debug)] -pub struct Crate { - pub id: trap::TrapId, - pub name: Option, - pub version: Option, - pub module: Option>, - pub cfg_options: Vec, - pub dependencies: Vec>, -} - -impl trap::TrapEntry for Crate { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("crates", vec![id.into()]); - if let Some(v) = self.name { - out.add_tuple("crate_names", vec![id.into(), v.into()]); - } - if let Some(v) = self.version { - out.add_tuple("crate_versions", vec![id.into(), v.into()]); - } - if let Some(v) = self.module { - out.add_tuple("crate_modules", vec![id.into(), v.into()]); - } - for (i, v) in self.cfg_options.into_iter().enumerate() { - out.add_tuple("crate_cfg_options", vec![id.into(), i.into(), v.into()]); - } - for (i, v) in self.dependencies.into_iter().enumerate() { - out.add_tuple("crate_dependencies", vec![id.into(), i.into(), v.into()]); - } - } -} - -impl trap::TrapClass for Crate { - fn class_name() -> &'static str { "Crate" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Crate is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct ExtractorStep { pub id: trap::TrapId, @@ -167,6 +119,63 @@ impl From> for trap::Label { } } +#[derive(Debug)] +pub struct Crate { + pub id: trap::TrapId, + pub name: Option, + pub version: Option, + pub module: Option>, + pub cfg_options: Vec, + pub dependencies: Vec>, +} + +impl trap::TrapEntry for Crate { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("crates", vec![id.into()]); + if let Some(v) = self.name { + out.add_tuple("crate_names", vec![id.into(), v.into()]); + } + if let Some(v) = self.version { + out.add_tuple("crate_versions", vec![id.into(), v.into()]); + } + if let Some(v) = self.module { + out.add_tuple("crate_modules", vec![id.into(), v.into()]); + } + for (i, v) in self.cfg_options.into_iter().enumerate() { + out.add_tuple("crate_cfg_options", vec![id.into(), i.into(), v.into()]); + } + for (i, v) in self.dependencies.into_iter().enumerate() { + out.add_tuple("crate_dependencies", vec![id.into(), i.into(), v.into()]); + } + } +} + +impl trap::TrapClass for Crate { + fn class_name() -> &'static str { "Crate" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Crate is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Crate is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + #[derive(Debug)] pub struct Missing { pub id: trap::TrapId, diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 0ebf3ad1230..f51d0a81973 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -43,7 +43,7 @@ lib/codeql/rust/elements/ConstArg.qll f37b34417503bbd2f3ce09b3211d8fa71f6a954970 lib/codeql/rust/elements/ConstBlockPat.qll a25f42b84dbeb33e10955735ef53b8bb7e3258522d6d1a9068f19adaf1af89d9 eeb816d2b54db77a1e7bb70e90b68d040a0cd44e9d44455a223311c3615c5e6e lib/codeql/rust/elements/ConstParam.qll 248db1e3abef6943326c42478a15f148f8cdaa25649ef5578064b15924c53351 28babba3aea28a65c3fe3b3db6cb9c86f70d7391e9d6ef9188eb2e4513072f9f lib/codeql/rust/elements/ContinueExpr.qll 9f27c5d5c819ad0ebc5bd10967ba8d33a9dc95b9aae278fcfb1fcf9216bda79c 0dc061445a6b89854fdce92aaf022fdc76b724511a50bb777496ce75c9ecb262 -lib/codeql/rust/elements/Crate.qll 67a3b953a04244e2fcebe7a18be13bc7fdb8781669819e473823a9168f3f5412 aef65281efbc8c7e7b3747693626718ca25b3d9a90aa42221de00998eca44efe +lib/codeql/rust/elements/Crate.qll 5e3fb55fee69b98253f7293306384011fd4a6121e10a59c1c945b34c28db5973 69459c56308f8b0fcf92cfba09a3bd238af6cf51f5c06208316a956833098e5f lib/codeql/rust/elements/DynTraitTypeRepr.qll 5953263ec1e77613170c13b5259b22a71c206a7e08841d2fa1a0b373b4014483 d4380c6cc460687dcd8598df27cad954ef4f508f1117a82460d15d295a7b64ab lib/codeql/rust/elements/Element.qll 0b62d139fef54ed2cf2e2334806aa9bfbc036c9c2085d558f15a42cc3fa84c48 24b999b93df79383ef27ede46e38da752868c88a07fe35fcff5d526684ba7294 lib/codeql/rust/elements/Enum.qll 2f122b042519d55e221fceac72fce24b30d4caf1947b25e9b68ee4a2095deb11 83a47445145e4fda8c3631db602a42dbb7a431f259eddf5c09dccd86f6abdd0e @@ -502,7 +502,7 @@ lib/codeql/rust/elements/internal/generated/ConstArg.qll e2451cac6ee464f5b64883d lib/codeql/rust/elements/internal/generated/ConstBlockPat.qll 7526d83ee9565d74776f42db58b1a2efff6fb324cfc7137f51f2206fee815d79 0ab3c22908ff790e7092e576a5df3837db33c32a7922a513a0f5e495729c1ac5 lib/codeql/rust/elements/internal/generated/ConstParam.qll 310342603959a4d521418caec45b585b97e3a5bf79368769c7150f52596a7266 a5dd92f0b24d7dbdaea2daedba3c8d5f700ec7d3ace81ca368600da2ad610082 lib/codeql/rust/elements/internal/generated/ContinueExpr.qll e2010feb14fb6edeb83a991d9357e50edb770172ddfde2e8670b0d3e68169f28 48d09d661e1443002f6d22b8710e22c9c36d9daa9cde09c6366a61e960d717cb -lib/codeql/rust/elements/internal/generated/Crate.qll 6d28f07d4ddaf077119590a007a8cfad0c86cf0efabbde689fb4092577b883df d43013163916aa83f281314a72d02d7566e1f505aa36cfd8060a760b06b02683 +lib/codeql/rust/elements/internal/generated/Crate.qll 2d7124b095738cb13dca8e1c402986ae575062f19104c331a6928dd86f8f01e6 8cd20d12e3a5f9202a12c81479fb9d2741109eb0b74c1541c6aa4258501b0478 lib/codeql/rust/elements/internal/generated/DynTraitTypeRepr.qll a9d540717af1f00dbea1c683fd6b846cddfb2968c7f3e021863276f123337787 1972efb9bca7aae9a9708ca6dcf398e5e8c6d2416a07d525dba1649b80fbe4d1 lib/codeql/rust/elements/internal/generated/Element.qll fb483b636180c699181c8aff83bc471b2c416206694f7028c671015918547663 542d1b9ae80c997974c94db3655887186df3921a8fa3f565eaf292dcfdac3c4c lib/codeql/rust/elements/internal/generated/Enum.qll 4f4cbc9cd758c20d476bc767b916c62ba434d1750067d0ffb63e0821bb95ec86 3da735d54022add50cec0217bbf8ec4cf29b47f4851ee327628bcdd6454989d0 @@ -576,7 +576,7 @@ lib/codeql/rust/elements/internal/generated/ParamList.qll c808c9d84dd7800573832b lib/codeql/rust/elements/internal/generated/ParenExpr.qll bc0731505bfe88516205ec360582a4222d2681d11342c93e15258590ddee82f2 d4bd6e0c80cf1d63746c88d4bcb3a01d4c75732e5da09e3ebd9437ced227fb60 lib/codeql/rust/elements/internal/generated/ParenPat.qll 4f168ef5d5bb87a903251cc31b2e44a759b099ec69c90af31783fbb15778c940 0e34f94a45a13396fd57d94c245dc64d1adde2ab0e22b56946f7e94c04e297fc lib/codeql/rust/elements/internal/generated/ParenTypeRepr.qll 40ab5c592e7699c621787793743e33988de71ff42ca27599f5ab3ddb70e3f7d8 12c0a6eed2202ee3e892f61da3b3ce77ac3190854cdf3097e8d2be98aa3cb91d -lib/codeql/rust/elements/internal/generated/ParentChild.qll eec4e7672ef5f07752044348d45882f0a849b295dfb17169e910ed0bfca3c162 29a9cc9b2870b1c6240cc53a9a70c4623381219a8f88ea1656b6828d16ef51c7 +lib/codeql/rust/elements/internal/generated/ParentChild.qll 17bad59de9a8b6d3845ad00ac55c5bcddac8d187f17764d9b164451d2221af3f 6fbd842f262bbcb105045aa90da7549ce51e0fb5599fc1e9ffae907108ba1f4a lib/codeql/rust/elements/internal/generated/ParenthesizedArgList.qll c5fa328ea60d3a3333d7c7bb3480969c1873166c7ac8ebb9d0afad7a8099d1a8 2dbbb6200d96f7db7dea4a55bdeab8d67b14d39a43e0bd54ada019f7e466f163 lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4 lib/codeql/rust/elements/internal/generated/Path.qll 8e47e91aff3f8c60f1ee8cb3887b8e4936c38e4665d052f2c92a939a969aac29 2c28beb89cabd7c7c91a5bc65c874f414cb96bbefde37b25811b61089a8a0053 @@ -591,7 +591,7 @@ lib/codeql/rust/elements/internal/generated/PtrTypeRepr.qll 51d1e9e683fc79dddbff lib/codeql/rust/elements/internal/generated/PureSynthConstructors.qll e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f lib/codeql/rust/elements/internal/generated/RangeExpr.qll 23cca03bf43535f33b22a38894f70d669787be4e4f5b8fe5c8f7b964d30e9027 18624cef6c6b679eeace2a98737e472432e0ead354cca02192b4d45330f047c9 lib/codeql/rust/elements/internal/generated/RangePat.qll 80826a6a6868a803aa2372e31c52a03e1811a3f1f2abdb469f91ca0bfdd9ecb6 34ee1e208c1690cba505dff2c588837c0cd91e185e2a87d1fe673191962276a9 -lib/codeql/rust/elements/internal/generated/Raw.qll 4b60a7c36b770156d3710d811247bc1607c851a926d1546271f166af5b68c01f f65ba77cb2135b4a0d37d8c3e19e49f368426b14c7e48730f3fb9e65f9d7b9c5 +lib/codeql/rust/elements/internal/generated/Raw.qll 961cd311a08aa3a3de2761a8f87d422f2d75e9debea466543d5803e24b6b4315 ee699aa5d61fe3331a747de9b84c2edef6b8ee04644b84506544cb88f93902a3 lib/codeql/rust/elements/internal/generated/RecordExpr.qll 2131b2cb336caa76170082e69776011bf02576bbfdd34ba68ca84af24209250a 39a2e3ec32352b594c43cc1295e0e8b3f9808173322d3d73cb7d48ef969d5565 lib/codeql/rust/elements/internal/generated/RecordExprField.qll 7e9f8663d3b74ebbc9603b10c9912f082febba6bd73d344b100bbd3edf837802 fbe6b578e7fd5d5a6f21bbb8c388957ab7210a6a249ec71510a50fb35b319ea1 lib/codeql/rust/elements/internal/generated/RecordExprFieldList.qll 179a97211fe7aa6265085d4d54115cdbc0e1cd7c9b2135591e8f36d6432f13d3 dd44bbbc1e83a1ed3a587afb729d7debf7aeb7b63245de181726af13090e50c0 @@ -617,7 +617,7 @@ lib/codeql/rust/elements/internal/generated/Static.qll 0b336767104d2b852b9acd234 lib/codeql/rust/elements/internal/generated/Stmt.qll 8473ff532dd5cc9d7decaddcd174b94d610f6ca0aec8e473cc051dad9f3db917 6ef7d2b5237c2dbdcacbf7d8b39109d4dc100229f2b28b5c9e3e4fbf673ba72b lib/codeql/rust/elements/internal/generated/StmtList.qll a667193e32341e17400867c6e359878c4e645ef9f5f4d97676afc0283a33a026 a320ed678ee359302e2fc1b70a9476705cd616fcfa44a499d32f0c7715627f73 lib/codeql/rust/elements/internal/generated/Struct.qll 4d57f0db12dc7ad3e31e750a24172ef1505406b4dab16386af0674bd18bf8f4b 1a73c83df926b996f629316f74c61ea775be04532ab61b56af904223354f033e -lib/codeql/rust/elements/internal/generated/Synth.qll 554d5979ddb7afa42aa4d373cafcffd086e017104130f4a661264ee1c7b54653 059fa863ddab905050e1bbb4669722a14721b40b193bb91f1642da9a36d09018 +lib/codeql/rust/elements/internal/generated/Synth.qll b1428cbc752be287540c58a3931ebcc033f961e5d6883d6260189310901f1663 3001eb4a1b9a050d7b0abb875fea2e26b29522ecb8d2719ebf6b68f347fee5da lib/codeql/rust/elements/internal/generated/SynthConstructors.qll f6321ef2a74bb3c869cb3d3fc7753ec90d03bf2c620597f7f1fea636309a3575 f6321ef2a74bb3c869cb3d3fc7753ec90d03bf2c620597f7f1fea636309a3575 lib/codeql/rust/elements/internal/generated/Token.qll 77a91a25ca5669703cf3a4353b591cef4d72caa6b0b9db07bb9e005d69c848d1 2fdffc4882ed3a6ca9ac6d1fb5f1ac5a471ca703e2ffdc642885fa558d6e373b lib/codeql/rust/elements/internal/generated/TokenTree.qll 8577c2b097c1be2f0f7daa5acfcf146f78674a424d99563e08a84dd3e6d91b46 d2f30764e84dbfc0a6a5d3d8a5f935cd432413688cb32da9c94e420fbc10665c diff --git a/rust/ql/lib/codeql/rust/elements/Crate.qll b/rust/ql/lib/codeql/rust/elements/Crate.qll index fc2f137c49e..79c39648f98 100644 --- a/rust/ql/lib/codeql/rust/elements/Crate.qll +++ b/rust/ql/lib/codeql/rust/elements/Crate.qll @@ -4,7 +4,7 @@ */ private import internal.CrateImpl -import codeql.rust.elements.Element +import codeql.rust.elements.Locatable import codeql.rust.elements.Module final class Crate = Impl::Crate; diff --git a/rust/ql/lib/codeql/rust/elements/internal/CrateImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/CrateImpl.qll index d03aca69d33..085c472dce1 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/CrateImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/CrateImpl.qll @@ -11,6 +11,8 @@ private import codeql.rust.elements.internal.generated.Crate * be referenced directly. */ module Impl { + private import rust + class Crate extends Generated::Crate { override string toString() { result = strictconcat(int i | | this.toStringPart(i) order by i) } @@ -25,5 +27,7 @@ module Impl { or i = 4 and result = ")" } + + override Location getLocation() { result = this.getModule().getLocation() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Crate.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Crate.qll index 0bac8d8380d..5024893eb64 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Crate.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Crate.qll @@ -7,7 +7,7 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.Crate -import codeql.rust.elements.internal.ElementImpl::Impl as ElementImpl +import codeql.rust.elements.internal.LocatableImpl::Impl as LocatableImpl import codeql.rust.elements.Module private class CrateAlias = Crate; @@ -21,7 +21,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Crate` class directly. * Use the subclass `Crate`, where the following predicates are available. */ - class Crate extends Synth::TCrate, ElementImpl::Element { + class Crate extends Synth::TCrate, LocatableImpl::Locatable { override string getAPrimaryQlClass() { result = "Crate" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll index ff3883de8ce..da81c697388 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll @@ -12,19 +12,6 @@ private module Impl { none() } - private Element getImmediateChildOfCrate(Crate e, int index, string partialPredicateCall) { - exists(int b, int bElement, int n | - b = 0 and - bElement = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfElement(e, i, _)) | i) and - n = bElement and - ( - none() - or - result = getImmediateChildOfElement(e, index - b, partialPredicateCall) - ) - ) - } - private Element getImmediateChildOfExtractorStep( ExtractorStep e, int index, string partialPredicateCall ) { @@ -81,6 +68,19 @@ private module Impl { ) } + private Element getImmediateChildOfCrate(Crate e, int index, string partialPredicateCall) { + exists(int b, int bLocatable, int n | + b = 0 and + bLocatable = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLocatable(e, i, _)) | i) and + n = bLocatable and + ( + none() + or + result = getImmediateChildOfLocatable(e, index - b, partialPredicateCall) + ) + ) + } + private Element getImmediateChildOfFormat(Format e, int index, string partialPredicateCall) { exists( int b, int bLocatable, int n, int nArgumentRef, int nWidthArgument, int nPrecisionArgument @@ -4063,10 +4063,10 @@ private module Impl { // * none() simplifies generation, as we can append `or ...` without a special case for the first item none() or - result = getImmediateChildOfCrate(e, index, partialAccessor) - or result = getImmediateChildOfExtractorStep(e, index, partialAccessor) or + result = getImmediateChildOfCrate(e, index, partialAccessor) + or result = getImmediateChildOfFormat(e, index, partialAccessor) or result = getImmediateChildOfFormatArgument(e, index, partialAccessor) diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll index 96ef2a3701c..dc4f3f7c273 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -12,38 +12,6 @@ module Raw { string toString() { none() } } - /** - * INTERNAL: Do not use. - */ - class Crate extends @crate, Element { - override string toString() { result = "Crate" } - - /** - * Gets the name of this crate, if it exists. - */ - string getName() { crate_names(this, result) } - - /** - * Gets the version of this crate, if it exists. - */ - string getVersion() { crate_versions(this, result) } - - /** - * Gets the module of this crate, if it exists. - */ - Module getModule() { crate_modules(this, result) } - - /** - * Gets the `index`th cfg option of this crate (0-based). - */ - string getCfgOption(int index) { crate_cfg_options(this, index, result) } - - /** - * Gets the `index`th dependency of this crate (0-based). - */ - Crate getDependency(int index) { crate_dependencies(this, index, result) } - } - /** * INTERNAL: Do not use. */ @@ -85,6 +53,38 @@ module Raw { */ class AstNode extends @ast_node, Locatable { } + /** + * INTERNAL: Do not use. + */ + class Crate extends @crate, Locatable { + override string toString() { result = "Crate" } + + /** + * Gets the name of this crate, if it exists. + */ + string getName() { crate_names(this, result) } + + /** + * Gets the version of this crate, if it exists. + */ + string getVersion() { crate_versions(this, result) } + + /** + * Gets the module of this crate, if it exists. + */ + Module getModule() { crate_modules(this, result) } + + /** + * Gets the `index`th cfg option of this crate (0-based). + */ + string getCfgOption(int index) { crate_cfg_options(this, index, result) } + + /** + * Gets the `index`th dependency of this crate (0-based). + */ + Crate getDependency(int index) { crate_dependencies(this, index, result) } + } + /** * INTERNAL: Do not use. * The base class marking errors during parsing or resolution. diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll index d7a423aaf2e..275344e1369 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll @@ -778,7 +778,7 @@ module Synth { /** * INTERNAL: Do not use. */ - class TLocatable = TAstNode or TFormat or TFormatArgument; + class TLocatable = TAstNode or TCrate or TFormat or TFormatArgument; /** * INTERNAL: Do not use. @@ -2060,8 +2060,6 @@ module Synth { * Converts a raw DB element to a synthesized `TElement`, if possible. */ TElement convertElementFromRaw(Raw::Element e) { - result = convertCrateFromRaw(e) - or result = convertExtractorStepFromRaw(e) or result = convertLocatableFromRaw(e) @@ -2248,6 +2246,8 @@ module Synth { TLocatable convertLocatableFromRaw(Raw::Element e) { result = convertAstNodeFromRaw(e) or + result = convertCrateFromRaw(e) + or result = convertFormatFromRaw(e) or result = convertFormatArgumentFromRaw(e) @@ -3638,8 +3638,6 @@ module Synth { * Converts a synthesized `TElement` to a raw DB element, if possible. */ Raw::Element convertElementToRaw(TElement e) { - result = convertCrateToRaw(e) - or result = convertExtractorStepToRaw(e) or result = convertLocatableToRaw(e) @@ -3826,6 +3824,8 @@ module Synth { Raw::Element convertLocatableToRaw(TLocatable e) { result = convertAstNodeToRaw(e) or + result = convertCrateToRaw(e) + or result = convertFormatToRaw(e) or result = convertFormatArgumentToRaw(e) diff --git a/rust/ql/lib/rust.dbscheme b/rust/ql/lib/rust.dbscheme index 2791dade011..f3f8ee936b1 100644 --- a/rust/ql/lib/rust.dbscheme +++ b/rust/ql/lib/rust.dbscheme @@ -120,48 +120,11 @@ locatable_locations( // from schema @element = - @crate -| @extractor_step + @extractor_step | @locatable | @unextracted ; -crates( - unique int id: @crate -); - -#keyset[id] -crate_names( - int id: @crate ref, - string name: string ref -); - -#keyset[id] -crate_versions( - int id: @crate ref, - string version: string ref -); - -#keyset[id] -crate_modules( - int id: @crate ref, - int module: @module ref -); - -#keyset[id, index] -crate_cfg_options( - int id: @crate ref, - int index: int ref, - string cfg_option: string ref -); - -#keyset[id, index] -crate_dependencies( - int id: @crate ref, - int index: int ref, - int dependency: @crate ref -); - extractor_steps( unique int id: @extractor_step, string action: string ref, @@ -176,6 +139,7 @@ extractor_step_files( @locatable = @ast_node +| @crate ; @unextracted = @@ -251,6 +215,42 @@ extractor_step_files( | @where_pred ; +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id] +crate_modules( + int id: @crate ref, + int module: @module ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_dependencies( + int id: @crate ref, + int index: int ref, + int dependency: @crate ref +); + missings( unique int id: @missing ); diff --git a/rust/ql/test/extractor-tests/crate_graph/crates.expected b/rust/ql/test/extractor-tests/crate_graph/crates.expected index d3e9347973f..9948f6405e3 100644 --- a/rust/ql/test/extractor-tests/crate_graph/crates.expected +++ b/rust/ql/test/extractor-tests/crate_graph/crates.expected @@ -101,14 +101,16 @@ #-----| -> Crate(getopts@0.2.21) #-----| -> Crate(libc@0.2.169) -#-----| Crate(test@0.0.1) +lib.rs: +# 0| Crate(test@0.0.1) #-----| -> Crate(core@0.0.0) #-----| -> Crate(std@0.0.0) #-----| -> Crate(alloc@0.0.0) #-----| -> Crate(proc_macro@0.0.0) #-----| -> Crate(test@0.0.0) -#-----| Crate(main@0.0.1) +main.rs: +# 0| Crate(main@0.0.1) #-----| -> Crate(core@0.0.0) #-----| -> Crate(std@0.0.0) #-----| -> Crate(alloc@0.0.0) diff --git a/rust/ql/test/extractor-tests/crate_graph/crates.ql b/rust/ql/test/extractor-tests/crate_graph/crates.ql index f5475c015e1..c843a1af0a8 100644 --- a/rust/ql/test/extractor-tests/crate_graph/crates.ql +++ b/rust/ql/test/extractor-tests/crate_graph/crates.ql @@ -6,6 +6,11 @@ import rust -query predicate nodes(Crate c) { any() } +class MyCrate extends Crate { + // avoid printing locations for crates outside of the test folder + Location getLocation() { result = super.getLocation() and this.fromSource() } +} -query predicate edges(Crate c1, Crate c2) { c1.getADependency() = c2 } +query predicate nodes(MyCrate c) { any() } + +query predicate edges(MyCrate c1, MyCrate c2) { c1.getADependency() = c2 } diff --git a/rust/schema/prelude.py b/rust/schema/prelude.py index e332de1f5a7..c2579d57781 100644 --- a/rust/schema/prelude.py +++ b/rust/schema/prelude.py @@ -113,7 +113,7 @@ class ExtractorStep(Element): duration_ms: int -class Crate(Element): +class Crate(Locatable): name: optional[string] version: optional[string] module: optional["Module"] From a96a5fc737c4662ea401231c7d8b0b74cf6c8525 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Fri, 14 Mar 2025 13:24:16 +0100 Subject: [PATCH 10/14] Rust: Address PR comments --- rust/ql/lib/codeql/rust/dataflow/DataFlow.qll | 14 ++++ .../codeql/rust/dataflow/internal/Content.qll | 50 ++++++-------- .../codeql/rust/dataflow/internal/Node.qll | 68 +++++++++---------- .../security/CWE-312/CleartextLogging.ql | 3 +- 4 files changed, 68 insertions(+), 67 deletions(-) diff --git a/rust/ql/lib/codeql/rust/dataflow/DataFlow.qll b/rust/ql/lib/codeql/rust/dataflow/DataFlow.qll index 53392ec6865..3cb4dd9a982 100644 --- a/rust/ql/lib/codeql/rust/dataflow/DataFlow.qll +++ b/rust/ql/lib/codeql/rust/dataflow/DataFlow.qll @@ -26,6 +26,20 @@ module DataFlow { final class Content = Content::Content; + final class FieldContent = Content::FieldContent; + + final class TuplePositionContent = Content::TuplePositionContent; + + final class TupleFieldContent = Content::TupleFieldContent; + + final class RecordFieldContent = Content::RecordFieldContent; + + final class ReferenceContent = Content::ReferenceContent; + + final class ElementContent = Content::ElementContent; + + final class FutureContent = Content::FutureContent; + final class ContentSet = Content::ContentSet; /** diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/Content.qll b/rust/ql/lib/codeql/rust/dataflow/internal/Content.qll index f781022d283..f4aee14cdb2 100644 --- a/rust/ql/lib/codeql/rust/dataflow/internal/Content.qll +++ b/rust/ql/lib/codeql/rust/dataflow/internal/Content.qll @@ -209,32 +209,26 @@ final class SingletonContentSet extends ContentSet, TSingletonContentSet { override Content getAReadContent() { result = c } } -/** A collection of cached types and predicates to be evaluated in the same stage. */ +private import codeql.rust.internal.CachedStages + cached -private module Cached { - private import codeql.rust.internal.CachedStages - - cached - newtype TContent = - TTupleFieldContent(TupleField field) { Stages::DataFlowStage::ref() } or - TRecordFieldContent(RecordField field) or - // TODO: Remove once library types are extracted - TVariantInLibTupleFieldContent(VariantInLib::VariantInLib v, int pos) { pos = v.getAPosition() } or - TElementContent() or - TFutureContent() or - TTuplePositionContent(int pos) { - pos in [0 .. max([ - any(TuplePat pat).getNumberOfFields(), - any(FieldExpr access).getNameRef().getText().toInt() - ] - )] - } or - TFunctionCallReturnContent() or - TFunctionCallArgumentContent(int pos) { - pos in [0 .. any(CallExpr c).getArgList().getNumberOfArgs() - 1] - } or - TCapturedVariableContent(VariableCapture::CapturedVariable v) or - TReferenceContent() -} - -import Cached +newtype TContent = + TTupleFieldContent(TupleField field) { Stages::DataFlowStage::ref() } or + TRecordFieldContent(RecordField field) or + // TODO: Remove once library types are extracted + TVariantInLibTupleFieldContent(VariantInLib::VariantInLib v, int pos) { pos = v.getAPosition() } or + TElementContent() or + TFutureContent() or + TTuplePositionContent(int pos) { + pos in [0 .. max([ + any(TuplePat pat).getNumberOfFields(), + any(FieldExpr access).getNameRef().getText().toInt() + ] + )] + } or + TFunctionCallReturnContent() or + TFunctionCallArgumentContent(int pos) { + pos in [0 .. any(CallExpr c).getArgList().getNumberOfArgs() - 1] + } or + TCapturedVariableContent(VariableCapture::CapturedVariable v) or + TReferenceContent() diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/Node.qll b/rust/ql/lib/codeql/rust/dataflow/internal/Node.qll index fd1da37295a..c84da6712bb 100644 --- a/rust/ql/lib/codeql/rust/dataflow/internal/Node.qll +++ b/rust/ql/lib/codeql/rust/dataflow/internal/Node.qll @@ -446,41 +446,35 @@ private class CapturePostUpdateNode extends PostUpdateNode, CaptureNode { final class CastNode = NaNode; -/** A collection of cached types and predicates to be evaluated in the same stage. */ +private import codeql.rust.internal.CachedStages + cached -private module Cached { - private import codeql.rust.internal.CachedStages - - cached - newtype TNode = - TExprNode(ExprCfgNode n) { Stages::DataFlowStage::ref() } or - TSourceParameterNode(ParamBaseCfgNode p) or - TPatNode(PatCfgNode p) or - TNameNode(NameCfgNode n) { n.getName() = any(Variable v).getName() } or - TExprPostUpdateNode(ExprCfgNode e) { - isArgumentForCall(e, _, _) - or - lambdaCallExpr(_, _, e) - or - lambdaCreationExpr(e.getExpr(), _) - or - // Whenever `&mut e` has a post-update node we also create one for `e`. - // E.g., for `e` in `f(..., &mut e, ...)` or `*(&mut e) = ...`. - e = any(RefExprCfgNode ref | ref.isMut() and exists(TExprPostUpdateNode(ref))).getExpr() - or - e = - [ - any(IndexExprCfgNode i).getBase(), any(FieldExprCfgNode access).getExpr(), - any(TryExprCfgNode try).getExpr(), - any(PrefixExprCfgNode pe | pe.getOperatorName() = "*").getExpr(), - any(AwaitExprCfgNode a).getExpr(), any(MethodCallExprCfgNode mc).getReceiver() - ] - } or - TReceiverNode(MethodCallExprCfgNode mc, Boolean isPost) or - TSsaNode(SsaImpl::DataFlowIntegration::SsaNode node) or - TFlowSummaryNode(FlowSummaryImpl::Private::SummaryNode sn) or - TClosureSelfReferenceNode(CfgScope c) { lambdaCreationExpr(c, _) } or - TCaptureNode(VariableCapture::Flow::SynthesizedCaptureNode cn) -} - -import Cached +newtype TNode = + TExprNode(ExprCfgNode n) { Stages::DataFlowStage::ref() } or + TSourceParameterNode(ParamBaseCfgNode p) or + TPatNode(PatCfgNode p) or + TNameNode(NameCfgNode n) { n.getName() = any(Variable v).getName() } or + TExprPostUpdateNode(ExprCfgNode e) { + isArgumentForCall(e, _, _) + or + lambdaCallExpr(_, _, e) + or + lambdaCreationExpr(e.getExpr(), _) + or + // Whenever `&mut e` has a post-update node we also create one for `e`. + // E.g., for `e` in `f(..., &mut e, ...)` or `*(&mut e) = ...`. + e = any(RefExprCfgNode ref | ref.isMut() and exists(TExprPostUpdateNode(ref))).getExpr() + or + e = + [ + any(IndexExprCfgNode i).getBase(), any(FieldExprCfgNode access).getExpr(), + any(TryExprCfgNode try).getExpr(), + any(PrefixExprCfgNode pe | pe.getOperatorName() = "*").getExpr(), + any(AwaitExprCfgNode a).getExpr(), any(MethodCallExprCfgNode mc).getReceiver() + ] + } or + TReceiverNode(MethodCallExprCfgNode mc, Boolean isPost) or + TSsaNode(SsaImpl::DataFlowIntegration::SsaNode node) or + TFlowSummaryNode(FlowSummaryImpl::Private::SummaryNode sn) or + TClosureSelfReferenceNode(CfgScope c) { lambdaCreationExpr(c, _) } or + TCaptureNode(VariableCapture::Flow::SynthesizedCaptureNode cn) diff --git a/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql b/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql index 2f4c4f2bbfa..fd6d538f13f 100644 --- a/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql +++ b/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql @@ -17,7 +17,6 @@ import rust import codeql.rust.security.CleartextLoggingExtensions import codeql.rust.dataflow.DataFlow import codeql.rust.dataflow.TaintTracking -import codeql.rust.dataflow.internal.Content /** * A taint-tracking configuration for cleartext logging vulnerabilities. @@ -44,7 +43,7 @@ module CleartextLoggingConfig implements DataFlow::ConfigSig { predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet c) { // flow out from tuple content at sinks. isSink(node) and - c.getAReadContent() instanceof TuplePositionContent + c.getAReadContent() instanceof DataFlow::TuplePositionContent } } From 5a3bf90b1f5fea5305e6c8687142e2bf691630d7 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Fri, 14 Mar 2025 13:28:09 +0100 Subject: [PATCH 11/14] Rust: Add qldoc comments --- rust/ql/lib/codeql/rust/dataflow/internal/Content.qll | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/Content.qll b/rust/ql/lib/codeql/rust/dataflow/internal/Content.qll index f4aee14cdb2..f9ad0a02cb7 100644 --- a/rust/ql/lib/codeql/rust/dataflow/internal/Content.qll +++ b/rust/ql/lib/codeql/rust/dataflow/internal/Content.qll @@ -30,8 +30,10 @@ class TupleFieldContent extends FieldContent, TTupleFieldContent { TupleFieldContent() { this = TTupleFieldContent(field) } + /** Holds if this field belongs to an enum variant. */ predicate isVariantField(Variant v, int pos) { field.isVariantField(v, pos) } + /** Holds if this field belongs to a struct. */ predicate isStructField(Struct s, int pos) { field.isStructField(s, pos) } override FieldExprCfgNode getAnAccess() { field = result.getFieldExpr().getTupleField() } @@ -61,8 +63,10 @@ class RecordFieldContent extends FieldContent, TRecordFieldContent { RecordFieldContent() { this = TRecordFieldContent(field) } + /** Holds if this field belongs to an enum variant. */ predicate isVariantField(Variant v, string name) { field.isVariantField(v, name) } + /** Holds if this field belongs to a struct. */ predicate isStructField(Struct s, string name) { field.isStructField(s, name) } override FieldExprCfgNode getAnAccess() { field = result.getFieldExpr().getRecordField() } @@ -141,6 +145,7 @@ final class TuplePositionContent extends FieldContent, TTuplePositionContent { TuplePositionContent() { this = TTuplePositionContent(pos) } + /** Gets the index of this tuple position. */ int getPosition() { result = pos } override FieldExprCfgNode getAnAccess() { From 1468e81c55e5d4f3e372fcd317dda14f1e2bd16d Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 14 Mar 2025 08:44:37 +0100 Subject: [PATCH 12/14] Ensure interface extends valid expr. --- .../com/semmle/js/ast/MemberExpression.java | 5 + .../com/semmle/ts/ast/ITypeExpression.java | 4 +- .../ts/extractor/TypeScriptASTConverter.java | 2 +- .../tests/ts/input/invalidExtends.ts | 6 + .../ts/output/trap/invalidExtends.ts.trap | 451 ++++++++++++++++++ .../TypeScript/Types/printAst.expected | 9 - .../TypeScript/Types/tests.expected | 2 - 7 files changed, 466 insertions(+), 13 deletions(-) create mode 100644 javascript/extractor/tests/ts/input/invalidExtends.ts create mode 100644 javascript/extractor/tests/ts/output/trap/invalidExtends.ts.trap diff --git a/javascript/extractor/src/com/semmle/js/ast/MemberExpression.java b/javascript/extractor/src/com/semmle/js/ast/MemberExpression.java index 5d90a70f04f..4a1ac65ad33 100644 --- a/javascript/extractor/src/com/semmle/js/ast/MemberExpression.java +++ b/javascript/extractor/src/com/semmle/js/ast/MemberExpression.java @@ -69,4 +69,9 @@ public class MemberExpression extends Expression public void setSymbol(int symbol) { this.symbol = symbol; } + + @Override + public boolean isValidExpression() { + return object instanceof ITypeExpression || object instanceof DynamicImport; + } } diff --git a/javascript/extractor/src/com/semmle/ts/ast/ITypeExpression.java b/javascript/extractor/src/com/semmle/ts/ast/ITypeExpression.java index 71185a7f92c..f82592c61f4 100644 --- a/javascript/extractor/src/com/semmle/ts/ast/ITypeExpression.java +++ b/javascript/extractor/src/com/semmle/ts/ast/ITypeExpression.java @@ -10,4 +10,6 @@ import com.semmle.js.ast.Literal; * however, some expressions such as {@link Literal} type may occur in a type annotation because the * TypeScript AST does not distinguish null literals from the null type. */ -public interface ITypeExpression extends INode, ITypedAstNode {} +public interface ITypeExpression extends INode, ITypedAstNode { + public default boolean isValidExpression() { return true; } +} diff --git a/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java b/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java index dfc15e4e4aa..3ada785c4f2 100644 --- a/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java +++ b/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java @@ -1907,7 +1907,7 @@ public class TypeScriptASTConverter { } private ITypeExpression asType(Node node) { - return node instanceof ITypeExpression ? (ITypeExpression) node : null; + return node instanceof ITypeExpression && ((ITypeExpression)node).isValidExpression() ? (ITypeExpression) node : null; } private List convertChildrenAsTypes(JsonObject node, String child) diff --git a/javascript/extractor/tests/ts/input/invalidExtends.ts b/javascript/extractor/tests/ts/input/invalidExtends.ts new file mode 100644 index 00000000000..d31eba1dae6 --- /dev/null +++ b/javascript/extractor/tests/ts/input/invalidExtends.ts @@ -0,0 +1,6 @@ +interface Invalid extends (foo.bar) {} +interface Invalid extends (foo).bar {} +interface Invalid extends foo[bar] {} +interface Invalid extends foo?.bar {} +interface Invalid extends foo!.bar {} +interface Invalid extends foo() {} diff --git a/javascript/extractor/tests/ts/output/trap/invalidExtends.ts.trap b/javascript/extractor/tests/ts/output/trap/invalidExtends.ts.trap new file mode 100644 index 00000000000..ec1ddb444ef --- /dev/null +++ b/javascript/extractor/tests/ts/output/trap/invalidExtends.ts.trap @@ -0,0 +1,451 @@ +#10000=@"/invalidExtends.ts;sourcefile" +files(#10000,"/invalidExtends.ts") +#10001=@"/;folder" +folders(#10001,"/") +containerparent(#10001,#10000) +#10002=@"loc,{#10000},0,0,0,0" +locations_default(#10002,#10000,0,0,0,0) +hasLocation(#10000,#10002) +#20000=@"global_scope" +scopes(#20000,0) +#20001=@"script;{#10000},1,1" +#20002=* +lines(#20002,#20001,"interface Invalid extends (foo.bar) {}"," +") +#20003=@"loc,{#10000},1,1,1,38" +locations_default(#20003,#10000,1,1,1,38) +hasLocation(#20002,#20003) +#20004=* +lines(#20004,#20001,"interface Invalid extends (foo).bar {}"," +") +#20005=@"loc,{#10000},2,1,2,38" +locations_default(#20005,#10000,2,1,2,38) +hasLocation(#20004,#20005) +#20006=* +lines(#20006,#20001,"interface Invalid extends foo[bar] {}"," +") +#20007=@"loc,{#10000},3,1,3,37" +locations_default(#20007,#10000,3,1,3,37) +hasLocation(#20006,#20007) +#20008=* +lines(#20008,#20001,"interface Invalid extends foo?.bar {}"," +") +#20009=@"loc,{#10000},4,1,4,37" +locations_default(#20009,#10000,4,1,4,37) +hasLocation(#20008,#20009) +#20010=* +lines(#20010,#20001,"interface Invalid extends foo!.bar {}"," +") +#20011=@"loc,{#10000},5,1,5,37" +locations_default(#20011,#10000,5,1,5,37) +hasLocation(#20010,#20011) +#20012=* +lines(#20012,#20001,"interface Invalid extends foo() {}"," +") +#20013=@"loc,{#10000},6,1,6,34" +locations_default(#20013,#10000,6,1,6,34) +hasLocation(#20012,#20013) +numlines(#20001,6,6,0) +#20014=* +tokeninfo(#20014,7,#20001,0,"interface") +#20015=@"loc,{#10000},1,1,1,9" +locations_default(#20015,#10000,1,1,1,9) +hasLocation(#20014,#20015) +#20016=* +tokeninfo(#20016,6,#20001,1,"Invalid") +#20017=@"loc,{#10000},1,11,1,17" +locations_default(#20017,#10000,1,11,1,17) +hasLocation(#20016,#20017) +#20018=* +tokeninfo(#20018,7,#20001,2,"extends") +#20019=@"loc,{#10000},1,19,1,25" +locations_default(#20019,#10000,1,19,1,25) +hasLocation(#20018,#20019) +#20020=* +tokeninfo(#20020,8,#20001,3,"(") +#20021=@"loc,{#10000},1,27,1,27" +locations_default(#20021,#10000,1,27,1,27) +hasLocation(#20020,#20021) +#20022=* +tokeninfo(#20022,6,#20001,4,"foo") +#20023=@"loc,{#10000},1,28,1,30" +locations_default(#20023,#10000,1,28,1,30) +hasLocation(#20022,#20023) +#20024=* +tokeninfo(#20024,8,#20001,5,".") +#20025=@"loc,{#10000},1,31,1,31" +locations_default(#20025,#10000,1,31,1,31) +hasLocation(#20024,#20025) +#20026=* +tokeninfo(#20026,6,#20001,6,"bar") +#20027=@"loc,{#10000},1,32,1,34" +locations_default(#20027,#10000,1,32,1,34) +hasLocation(#20026,#20027) +#20028=* +tokeninfo(#20028,8,#20001,7,")") +#20029=@"loc,{#10000},1,35,1,35" +locations_default(#20029,#10000,1,35,1,35) +hasLocation(#20028,#20029) +#20030=* +tokeninfo(#20030,8,#20001,8,"{") +#20031=@"loc,{#10000},1,37,1,37" +locations_default(#20031,#10000,1,37,1,37) +hasLocation(#20030,#20031) +#20032=* +tokeninfo(#20032,8,#20001,9,"}") +#20033=@"loc,{#10000},1,38,1,38" +locations_default(#20033,#10000,1,38,1,38) +hasLocation(#20032,#20033) +#20034=* +tokeninfo(#20034,7,#20001,10,"interface") +#20035=@"loc,{#10000},2,1,2,9" +locations_default(#20035,#10000,2,1,2,9) +hasLocation(#20034,#20035) +#20036=* +tokeninfo(#20036,6,#20001,11,"Invalid") +#20037=@"loc,{#10000},2,11,2,17" +locations_default(#20037,#10000,2,11,2,17) +hasLocation(#20036,#20037) +#20038=* +tokeninfo(#20038,7,#20001,12,"extends") +#20039=@"loc,{#10000},2,19,2,25" +locations_default(#20039,#10000,2,19,2,25) +hasLocation(#20038,#20039) +#20040=* +tokeninfo(#20040,8,#20001,13,"(") +#20041=@"loc,{#10000},2,27,2,27" +locations_default(#20041,#10000,2,27,2,27) +hasLocation(#20040,#20041) +#20042=* +tokeninfo(#20042,6,#20001,14,"foo") +#20043=@"loc,{#10000},2,28,2,30" +locations_default(#20043,#10000,2,28,2,30) +hasLocation(#20042,#20043) +#20044=* +tokeninfo(#20044,8,#20001,15,")") +#20045=@"loc,{#10000},2,31,2,31" +locations_default(#20045,#10000,2,31,2,31) +hasLocation(#20044,#20045) +#20046=* +tokeninfo(#20046,8,#20001,16,".") +#20047=@"loc,{#10000},2,32,2,32" +locations_default(#20047,#10000,2,32,2,32) +hasLocation(#20046,#20047) +#20048=* +tokeninfo(#20048,6,#20001,17,"bar") +#20049=@"loc,{#10000},2,33,2,35" +locations_default(#20049,#10000,2,33,2,35) +hasLocation(#20048,#20049) +#20050=* +tokeninfo(#20050,8,#20001,18,"{") +#20051=@"loc,{#10000},2,37,2,37" +locations_default(#20051,#10000,2,37,2,37) +hasLocation(#20050,#20051) +#20052=* +tokeninfo(#20052,8,#20001,19,"}") +#20053=@"loc,{#10000},2,38,2,38" +locations_default(#20053,#10000,2,38,2,38) +hasLocation(#20052,#20053) +#20054=* +tokeninfo(#20054,7,#20001,20,"interface") +#20055=@"loc,{#10000},3,1,3,9" +locations_default(#20055,#10000,3,1,3,9) +hasLocation(#20054,#20055) +#20056=* +tokeninfo(#20056,6,#20001,21,"Invalid") +#20057=@"loc,{#10000},3,11,3,17" +locations_default(#20057,#10000,3,11,3,17) +hasLocation(#20056,#20057) +#20058=* +tokeninfo(#20058,7,#20001,22,"extends") +#20059=@"loc,{#10000},3,19,3,25" +locations_default(#20059,#10000,3,19,3,25) +hasLocation(#20058,#20059) +#20060=* +tokeninfo(#20060,6,#20001,23,"foo") +#20061=@"loc,{#10000},3,27,3,29" +locations_default(#20061,#10000,3,27,3,29) +hasLocation(#20060,#20061) +#20062=* +tokeninfo(#20062,8,#20001,24,"[") +#20063=@"loc,{#10000},3,30,3,30" +locations_default(#20063,#10000,3,30,3,30) +hasLocation(#20062,#20063) +#20064=* +tokeninfo(#20064,6,#20001,25,"bar") +#20065=@"loc,{#10000},3,31,3,33" +locations_default(#20065,#10000,3,31,3,33) +hasLocation(#20064,#20065) +#20066=* +tokeninfo(#20066,8,#20001,26,"]") +#20067=@"loc,{#10000},3,34,3,34" +locations_default(#20067,#10000,3,34,3,34) +hasLocation(#20066,#20067) +#20068=* +tokeninfo(#20068,8,#20001,27,"{") +#20069=@"loc,{#10000},3,36,3,36" +locations_default(#20069,#10000,3,36,3,36) +hasLocation(#20068,#20069) +#20070=* +tokeninfo(#20070,8,#20001,28,"}") +#20071=@"loc,{#10000},3,37,3,37" +locations_default(#20071,#10000,3,37,3,37) +hasLocation(#20070,#20071) +#20072=* +tokeninfo(#20072,7,#20001,29,"interface") +#20073=@"loc,{#10000},4,1,4,9" +locations_default(#20073,#10000,4,1,4,9) +hasLocation(#20072,#20073) +#20074=* +tokeninfo(#20074,6,#20001,30,"Invalid") +#20075=@"loc,{#10000},4,11,4,17" +locations_default(#20075,#10000,4,11,4,17) +hasLocation(#20074,#20075) +#20076=* +tokeninfo(#20076,7,#20001,31,"extends") +#20077=@"loc,{#10000},4,19,4,25" +locations_default(#20077,#10000,4,19,4,25) +hasLocation(#20076,#20077) +#20078=* +tokeninfo(#20078,6,#20001,32,"foo") +#20079=@"loc,{#10000},4,27,4,29" +locations_default(#20079,#10000,4,27,4,29) +hasLocation(#20078,#20079) +#20080=* +tokeninfo(#20080,8,#20001,33,"?.") +#20081=@"loc,{#10000},4,30,4,31" +locations_default(#20081,#10000,4,30,4,31) +hasLocation(#20080,#20081) +#20082=* +tokeninfo(#20082,6,#20001,34,"bar") +#20083=@"loc,{#10000},4,32,4,34" +locations_default(#20083,#10000,4,32,4,34) +hasLocation(#20082,#20083) +#20084=* +tokeninfo(#20084,8,#20001,35,"{") +#20085=@"loc,{#10000},4,36,4,36" +locations_default(#20085,#10000,4,36,4,36) +hasLocation(#20084,#20085) +#20086=* +tokeninfo(#20086,8,#20001,36,"}") +#20087=@"loc,{#10000},4,37,4,37" +locations_default(#20087,#10000,4,37,4,37) +hasLocation(#20086,#20087) +#20088=* +tokeninfo(#20088,7,#20001,37,"interface") +#20089=@"loc,{#10000},5,1,5,9" +locations_default(#20089,#10000,5,1,5,9) +hasLocation(#20088,#20089) +#20090=* +tokeninfo(#20090,6,#20001,38,"Invalid") +#20091=@"loc,{#10000},5,11,5,17" +locations_default(#20091,#10000,5,11,5,17) +hasLocation(#20090,#20091) +#20092=* +tokeninfo(#20092,7,#20001,39,"extends") +#20093=@"loc,{#10000},5,19,5,25" +locations_default(#20093,#10000,5,19,5,25) +hasLocation(#20092,#20093) +#20094=* +tokeninfo(#20094,6,#20001,40,"foo") +#20095=@"loc,{#10000},5,27,5,29" +locations_default(#20095,#10000,5,27,5,29) +hasLocation(#20094,#20095) +#20096=* +tokeninfo(#20096,8,#20001,41,"!") +#20097=@"loc,{#10000},5,30,5,30" +locations_default(#20097,#10000,5,30,5,30) +hasLocation(#20096,#20097) +#20098=* +tokeninfo(#20098,8,#20001,42,".") +#20099=@"loc,{#10000},5,31,5,31" +locations_default(#20099,#10000,5,31,5,31) +hasLocation(#20098,#20099) +#20100=* +tokeninfo(#20100,6,#20001,43,"bar") +#20101=@"loc,{#10000},5,32,5,34" +locations_default(#20101,#10000,5,32,5,34) +hasLocation(#20100,#20101) +#20102=* +tokeninfo(#20102,8,#20001,44,"{") +#20103=@"loc,{#10000},5,36,5,36" +locations_default(#20103,#10000,5,36,5,36) +hasLocation(#20102,#20103) +#20104=* +tokeninfo(#20104,8,#20001,45,"}") +#20105=@"loc,{#10000},5,37,5,37" +locations_default(#20105,#10000,5,37,5,37) +hasLocation(#20104,#20105) +#20106=* +tokeninfo(#20106,7,#20001,46,"interface") +#20107=@"loc,{#10000},6,1,6,9" +locations_default(#20107,#10000,6,1,6,9) +hasLocation(#20106,#20107) +#20108=* +tokeninfo(#20108,6,#20001,47,"Invalid") +#20109=@"loc,{#10000},6,11,6,17" +locations_default(#20109,#10000,6,11,6,17) +hasLocation(#20108,#20109) +#20110=* +tokeninfo(#20110,7,#20001,48,"extends") +#20111=@"loc,{#10000},6,19,6,25" +locations_default(#20111,#10000,6,19,6,25) +hasLocation(#20110,#20111) +#20112=* +tokeninfo(#20112,6,#20001,49,"foo") +#20113=@"loc,{#10000},6,27,6,29" +locations_default(#20113,#10000,6,27,6,29) +hasLocation(#20112,#20113) +#20114=* +tokeninfo(#20114,8,#20001,50,"(") +#20115=@"loc,{#10000},6,30,6,30" +locations_default(#20115,#10000,6,30,6,30) +hasLocation(#20114,#20115) +#20116=* +tokeninfo(#20116,8,#20001,51,")") +#20117=@"loc,{#10000},6,31,6,31" +locations_default(#20117,#10000,6,31,6,31) +hasLocation(#20116,#20117) +#20118=* +tokeninfo(#20118,8,#20001,52,"{") +#20119=@"loc,{#10000},6,33,6,33" +locations_default(#20119,#10000,6,33,6,33) +hasLocation(#20118,#20119) +#20120=* +tokeninfo(#20120,8,#20001,53,"}") +#20121=@"loc,{#10000},6,34,6,34" +locations_default(#20121,#10000,6,34,6,34) +hasLocation(#20120,#20121) +#20122=* +tokeninfo(#20122,0,#20001,54,"") +#20123=@"loc,{#10000},7,1,7,0" +locations_default(#20123,#10000,7,1,7,0) +hasLocation(#20122,#20123) +toplevels(#20001,0) +#20124=@"loc,{#10000},1,1,7,0" +locations_default(#20124,#10000,1,1,7,0) +hasLocation(#20001,#20124) +#20125=@"local_type_name;{Invalid};{#20000}" +local_type_names(#20125,"Invalid",#20000) +#20126=* +stmts(#20126,34,#20001,0,"interfa ... bar) {}") +hasLocation(#20126,#20003) +stmt_containers(#20126,#20001) +#20127=* +typeexprs(#20127,1,#20126,0,"Invalid") +hasLocation(#20127,#20017) +enclosing_stmt(#20127,#20126) +expr_containers(#20127,#20001) +literals("Invalid","Invalid",#20127) +typedecl(#20127,#20125) +#20128=* +stmts(#20128,34,#20001,1,"interfa ... .bar {}") +hasLocation(#20128,#20005) +stmt_containers(#20128,#20001) +#20129=* +typeexprs(#20129,1,#20128,0,"Invalid") +hasLocation(#20129,#20037) +enclosing_stmt(#20129,#20128) +expr_containers(#20129,#20001) +literals("Invalid","Invalid",#20129) +typedecl(#20129,#20125) +#20130=* +stmts(#20130,34,#20001,2,"interfa ... bar] {}") +hasLocation(#20130,#20007) +stmt_containers(#20130,#20001) +#20131=* +typeexprs(#20131,13,#20130,-1,"foo[bar]") +#20132=@"loc,{#10000},3,27,3,34" +locations_default(#20132,#10000,3,27,3,34) +hasLocation(#20131,#20132) +enclosing_stmt(#20131,#20130) +expr_containers(#20131,#20001) +#20133=* +typeexprs(#20133,25,#20131,0,"foo") +hasLocation(#20133,#20061) +enclosing_stmt(#20133,#20130) +expr_containers(#20133,#20001) +literals("foo","foo",#20133) +#20134=* +typeexprs(#20134,15,#20131,1,"bar") +hasLocation(#20134,#20065) +enclosing_stmt(#20134,#20130) +expr_containers(#20134,#20001) +literals("bar","bar",#20134) +#20135=* +typeexprs(#20135,1,#20130,0,"Invalid") +hasLocation(#20135,#20057) +enclosing_stmt(#20135,#20130) +expr_containers(#20135,#20001) +literals("Invalid","Invalid",#20135) +typedecl(#20135,#20125) +#20136=* +stmts(#20136,34,#20001,3,"interfa ... .bar {}") +hasLocation(#20136,#20009) +stmt_containers(#20136,#20001) +#20137=* +typeexprs(#20137,13,#20136,-1,"foo?.bar") +#20138=@"loc,{#10000},4,27,4,34" +locations_default(#20138,#10000,4,27,4,34) +hasLocation(#20137,#20138) +enclosing_stmt(#20137,#20136) +expr_containers(#20137,#20001) +#20139=* +typeexprs(#20139,25,#20137,0,"foo") +hasLocation(#20139,#20079) +enclosing_stmt(#20139,#20136) +expr_containers(#20139,#20001) +literals("foo","foo",#20139) +#20140=* +typeexprs(#20140,15,#20137,1,"bar") +hasLocation(#20140,#20083) +enclosing_stmt(#20140,#20136) +expr_containers(#20140,#20001) +literals("bar","bar",#20140) +isOptionalChaining(#20137) +#20141=* +typeexprs(#20141,1,#20136,0,"Invalid") +hasLocation(#20141,#20075) +enclosing_stmt(#20141,#20136) +expr_containers(#20141,#20001) +literals("Invalid","Invalid",#20141) +typedecl(#20141,#20125) +#20142=* +stmts(#20142,34,#20001,4,"interfa ... .bar {}") +hasLocation(#20142,#20011) +stmt_containers(#20142,#20001) +#20143=* +typeexprs(#20143,1,#20142,0,"Invalid") +hasLocation(#20143,#20091) +enclosing_stmt(#20143,#20142) +expr_containers(#20143,#20001) +literals("Invalid","Invalid",#20143) +typedecl(#20143,#20125) +#20144=* +stmts(#20144,34,#20001,5,"interfa ... oo() {}") +hasLocation(#20144,#20013) +stmt_containers(#20144,#20001) +#20145=* +typeexprs(#20145,1,#20144,0,"Invalid") +hasLocation(#20145,#20109) +enclosing_stmt(#20145,#20144) +expr_containers(#20145,#20001) +literals("Invalid","Invalid",#20145) +typedecl(#20145,#20125) +#20146=* +entry_cfg_node(#20146,#20001) +#20147=@"loc,{#10000},1,1,1,0" +locations_default(#20147,#10000,1,1,1,0) +hasLocation(#20146,#20147) +#20148=* +exit_cfg_node(#20148,#20001) +hasLocation(#20148,#20123) +successor(#20144,#20148) +successor(#20142,#20144) +successor(#20136,#20142) +successor(#20130,#20136) +successor(#20128,#20130) +successor(#20126,#20128) +successor(#20146,#20126) +numlines(#10000,6,6,0) +filetype(#10000,"typescript") diff --git a/javascript/ql/test/library-tests/TypeScript/Types/printAst.expected b/javascript/ql/test/library-tests/TypeScript/Types/printAst.expected index df304b899bb..04d6e6247ff 100644 --- a/javascript/ql/test/library-tests/TypeScript/Types/printAst.expected +++ b/javascript/ql/test/library-tests/TypeScript/Types/printAst.expected @@ -2,9 +2,6 @@ nodes | badTypes.ts:5:1:5:29 | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | semmle.label | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | | badTypes.ts:5:1:5:29 | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | semmle.order | 1 | | badTypes.ts:5:11:5:11 | [Identifier] A | semmle.label | [Identifier] A | -| badTypes.ts:5:21:5:24 | [ThisVarTypeAccess] this | semmle.label | [ThisVarTypeAccess] this | -| badTypes.ts:5:21:5:26 | [TypeAccess] this.B | semmle.label | [TypeAccess] this.B | -| badTypes.ts:5:26:5:26 | [Identifier] B | semmle.label | [Identifier] B | | badTypes.ts:6:1:6:24 | [TypeAliasDeclaration,TypeDefinition] type T ... ar.bar; | semmle.label | [TypeAliasDeclaration,TypeDefinition] type T ... ar.bar; | | badTypes.ts:6:1:6:24 | [TypeAliasDeclaration,TypeDefinition] type T ... ar.bar; | semmle.order | 2 | | badTypes.ts:6:6:6:6 | [Identifier] T | semmle.label | [Identifier] T | @@ -2171,12 +2168,6 @@ nodes edges | badTypes.ts:5:1:5:29 | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | badTypes.ts:5:11:5:11 | [Identifier] A | semmle.label | 1 | | badTypes.ts:5:1:5:29 | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | badTypes.ts:5:11:5:11 | [Identifier] A | semmle.order | 1 | -| badTypes.ts:5:1:5:29 | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | badTypes.ts:5:21:5:26 | [TypeAccess] this.B | semmle.label | 2 | -| badTypes.ts:5:1:5:29 | [InterfaceDeclaration,TypeDefinition] interfa ... is.B {} | badTypes.ts:5:21:5:26 | [TypeAccess] this.B | semmle.order | 2 | -| badTypes.ts:5:21:5:26 | [TypeAccess] this.B | badTypes.ts:5:21:5:24 | [ThisVarTypeAccess] this | semmle.label | 1 | -| badTypes.ts:5:21:5:26 | [TypeAccess] this.B | badTypes.ts:5:21:5:24 | [ThisVarTypeAccess] this | semmle.order | 1 | -| badTypes.ts:5:21:5:26 | [TypeAccess] this.B | badTypes.ts:5:26:5:26 | [Identifier] B | semmle.label | 2 | -| badTypes.ts:5:21:5:26 | [TypeAccess] this.B | badTypes.ts:5:26:5:26 | [Identifier] B | semmle.order | 2 | | badTypes.ts:6:1:6:24 | [TypeAliasDeclaration,TypeDefinition] type T ... ar.bar; | badTypes.ts:6:6:6:6 | [Identifier] T | semmle.label | 1 | | badTypes.ts:6:1:6:24 | [TypeAliasDeclaration,TypeDefinition] type T ... ar.bar; | badTypes.ts:6:6:6:6 | [Identifier] T | semmle.order | 1 | | badTypes.ts:6:1:6:24 | [TypeAliasDeclaration,TypeDefinition] type T ... ar.bar; | badTypes.ts:6:10:6:23 | [TypeofTypeExpr] typeof var.bar | semmle.label | 2 | diff --git a/javascript/ql/test/library-tests/TypeScript/Types/tests.expected b/javascript/ql/test/library-tests/TypeScript/Types/tests.expected index 150ce186724..b9e11cfa92f 100644 --- a/javascript/ql/test/library-tests/TypeScript/Types/tests.expected +++ b/javascript/ql/test/library-tests/TypeScript/Types/tests.expected @@ -864,8 +864,6 @@ getTypeDefinitionType | type_definitions.ts:21:1:21:20 | type Alias = T[]; | Alias | getTypeExprType | badTypes.ts:5:11:5:11 | A | A | -| badTypes.ts:5:21:5:26 | this.B | any | -| badTypes.ts:5:26:5:26 | B | any | | badTypes.ts:6:6:6:6 | T | any | | badTypes.ts:6:10:6:23 | typeof var.bar | any | | badTypes.ts:6:17:6:19 | var | any | From c93be70053106e50f5fae4f971614de758572761 Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 14 Mar 2025 14:58:27 +0100 Subject: [PATCH 13/14] Rename validation methods for type expressions and added recursive call for type validation. Co-authored-by: Asgerf --- .../extractor/src/com/semmle/js/ast/MemberExpression.java | 4 ++-- .../extractor/src/com/semmle/ts/ast/ITypeExpression.java | 2 +- .../src/com/semmle/ts/extractor/TypeScriptASTConverter.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/javascript/extractor/src/com/semmle/js/ast/MemberExpression.java b/javascript/extractor/src/com/semmle/js/ast/MemberExpression.java index 4a1ac65ad33..b540decd48e 100644 --- a/javascript/extractor/src/com/semmle/js/ast/MemberExpression.java +++ b/javascript/extractor/src/com/semmle/js/ast/MemberExpression.java @@ -71,7 +71,7 @@ public class MemberExpression extends Expression } @Override - public boolean isValidExpression() { - return object instanceof ITypeExpression || object instanceof DynamicImport; + public boolean isValidTypeExpression() { + return object instanceof ITypeExpression && ((ITypeExpression)object).isValidTypeExpression() || object instanceof DynamicImport; } } diff --git a/javascript/extractor/src/com/semmle/ts/ast/ITypeExpression.java b/javascript/extractor/src/com/semmle/ts/ast/ITypeExpression.java index f82592c61f4..4372eba125f 100644 --- a/javascript/extractor/src/com/semmle/ts/ast/ITypeExpression.java +++ b/javascript/extractor/src/com/semmle/ts/ast/ITypeExpression.java @@ -11,5 +11,5 @@ import com.semmle.js.ast.Literal; * TypeScript AST does not distinguish null literals from the null type. */ public interface ITypeExpression extends INode, ITypedAstNode { - public default boolean isValidExpression() { return true; } + public default boolean isValidTypeExpression() { return true; } } diff --git a/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java b/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java index 3ada785c4f2..a3e031845a2 100644 --- a/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java +++ b/javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java @@ -1907,7 +1907,7 @@ public class TypeScriptASTConverter { } private ITypeExpression asType(Node node) { - return node instanceof ITypeExpression && ((ITypeExpression)node).isValidExpression() ? (ITypeExpression) node : null; + return node instanceof ITypeExpression && ((ITypeExpression)node).isValidTypeExpression() ? (ITypeExpression) node : null; } private List convertChildrenAsTypes(JsonObject node, String child) From 9e8a3145ac6dd0d5892d3d4ff276aa499eacc08d Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Fri, 14 Mar 2025 15:16:59 -0700 Subject: [PATCH 14/14] Docs: Remove old CodeQL training slide template The slide contents (images and RST) remain. Remove the HTML/JS/CSS templates since we're not maintaining them, and this creates unnecessary burden keeping the JS libraries up to date with security patches. --- .../slides-semmle-2/end_slide.html | 5 - .../slides-semmle-2/layout.html | 182 -- .../slides-semmle-2/slide.html | 19 - .../slides-semmle-2/static/config.rb | 24 - .../slides-semmle-2/static/js/hammer.js | 586 ------ .../static/js/modernizr.custom.45394.js | 4 - .../slides-semmle-2/static/js/order.js | 8 - .../static/js/polyfills/classList.min.js | 2 - .../static/js/polyfills/dataset.min.js | 2 - .../static/js/polyfills/history.min.js | 1 - .../static/js/prettify/lang-apollo.js | 2 - .../static/js/prettify/lang-clj.js | 18 - .../static/js/prettify/lang-css.js | 2 - .../static/js/prettify/lang-go.js | 1 - .../static/js/prettify/lang-hs.js | 2 - .../static/js/prettify/lang-lisp.js | 3 - .../static/js/prettify/lang-lua.js | 2 - .../static/js/prettify/lang-ml.js | 2 - .../static/js/prettify/lang-n.js | 4 - .../static/js/prettify/lang-proto.js | 1 - .../static/js/prettify/lang-scala.js | 2 - .../static/js/prettify/lang-sql.js | 2 - .../static/js/prettify/lang-tex.js | 1 - .../static/js/prettify/lang-vb.js | 2 - .../static/js/prettify/lang-vhdl.js | 3 - .../static/js/prettify/lang-wiki.js | 2 - .../static/js/prettify/lang-xq.js | 3 - .../static/js/prettify/lang-yaml.js | 2 - .../static/js/prettify/prettify.css | 1 - .../static/js/prettify/prettify.js | 28 - .../static/js/require-1.0.8.min.js | 33 - .../static/js/slide-controller.js | 109 - .../static/js/slide-deck-instantiate.js | 13 - .../slides-semmle-2/static/js/slide-deck.js | 897 --------- .../static/js/slide-testing.js | 6 - .../slides-semmle-2/static/js/slides.js | 6 - .../slides-semmle-2/static/slide_config.js | 40 - .../slides-semmle-2/static/slide_config.js_t | 27 - .../static/theme/css/default.css | 1794 ----------------- .../static/theme/css/hieroglyph.css | 84 - .../static/theme/css/io2013.css | 55 - .../static/theme/css/phone.css | 26 - .../static/theme/scss/_base.scss | 139 -- .../static/theme/scss/_variables.scss | 34 - .../static/theme/scss/default.scss | 1047 ---------- .../static/theme/scss/hieroglyph.scss | 100 - .../static/theme/scss/io2013.scss | 51 - .../static/theme/scss/phone.scss | 35 - .../slides-semmle-2/theme.conf | 15 - .../slides-semmle-2/title_slide.html | 0 50 files changed, 5427 deletions(-) delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/end_slide.html delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/layout.html delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/slide.html delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/config.rb delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/hammer.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/modernizr.custom.45394.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/order.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/polyfills/classList.min.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/polyfills/dataset.min.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/polyfills/history.min.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-apollo.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-clj.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-css.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-go.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-hs.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-lisp.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-lua.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-ml.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-n.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-proto.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-scala.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-sql.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-tex.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-vb.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-vhdl.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-wiki.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-xq.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-yaml.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/prettify.css delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/prettify.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/require-1.0.8.min.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-controller.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-deck-instantiate.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-deck.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-testing.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slides.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/slide_config.js delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/slide_config.js_t delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/default.css delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/hieroglyph.css delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/io2013.css delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/phone.css delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/_base.scss delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/_variables.scss delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/default.scss delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/hieroglyph.scss delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/io2013.scss delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/phone.scss delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/theme.conf delete mode 100644 docs/codeql/ql-training/_static-training/slides-semmle-2/title_slide.html diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/end_slide.html b/docs/codeql/ql-training/_static-training/slides-semmle-2/end_slide.html deleted file mode 100644 index dd35aec615c..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/end_slide.html +++ /dev/null @@ -1,5 +0,0 @@ - -
-
-
- \ No newline at end of file diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/layout.html b/docs/codeql/ql-training/_static-training/slides-semmle-2/layout.html deleted file mode 100644 index fb5d7a28416..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/layout.html +++ /dev/null @@ -1,182 +0,0 @@ - -{%- block doctype -%} - -{%- endblock %} - -{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} -{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} -{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and - (sidebars != []) %} -{%- set url_root = pathto('', 1) %} -{# XXX necessary? #} -{%- if url_root == '#' %}{% set url_root = '' %}{% endif %} -{%- if not embedded and docstitle %} - {%- set titlesuffix = " — "|safe + docstitle|e %} -{%- else %} - {%- set titlesuffix = "" %} -{%- endif %} - -{%- macro relbar() %} -{%- endmacro %} - -{%- macro sidebar() %} -{%- endmacro %} - -{%- macro script() %} - - - - - {%- for scriptfile in script_files %} - - {%- endfor %} - {% if theme_custom_js %} - - {% endif %} - -{%- endmacro %} - -{%- macro css() %} - - - - - - {% if theme_custom_css %} - - {% endif %} - - {%- for cssfile in css_files %} - - {%- endfor %} -{%- endmacro %} - - - - {%- block htmltitle %} - {{ title|striptags|e }}{{ titlesuffix }} - {%- endblock %} - - {{ metatags }} - - - - - - - - - - - - - - {{ css() }} - - {%- if not embedded %} - {{ script() }} - {%- if use_opensearch %} - - {%- endif %} - {%- if favicon %} - - {%- endif %} - {%- endif %} -{%- block linktags %} - {%- if hasdoc('about') %} - - {%- endif %} - {%- if hasdoc('genindex') %} - - {%- endif %} - {%- if hasdoc('search') %} - - {%- endif %} - {%- if hasdoc('copyright') %} - - {%- endif %} - - {%- if parents %} - - {%- endif %} - {%- if next %} - - {%- endif %} - {%- if prev %} - - {%- endif %} -{%- endblock %} -{%- block extrahead %} - - -{% endblock %} - - - - - - - - {% block body %}{% endblock %} - - {% include "end_slide.html" %} - - - - - - - - - - - - diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/slide.html b/docs/codeql/ql-training/_static-training/slides-semmle-2/slide.html deleted file mode 100644 index e304d958099..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/slide.html +++ /dev/null @@ -1,19 +0,0 @@ - - -
- {{ title }} -
- -
- - {{ content }} - - -{% if config.slide_numbers %} -
{{ slide_number }}
-{% endif %} -{% if config.slide_footer %} - -{% endif %} -
-
diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/config.rb b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/config.rb deleted file mode 100644 index e435e43a0bb..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/config.rb +++ /dev/null @@ -1,24 +0,0 @@ -# Require any additional compass plugins here. - -# Set this to the root of your project when deployed: -http_path = "/" -css_dir = "theme/css" -sass_dir = "theme/scss" -images_dir = "images" -javascripts_dir = "js" - -# You can select your preferred output style here (can be overridden via the command line): -output_style = :expanded #:expanded or :nested or :compact or :compressed - -# To enable relative paths to assets via compass helper functions. Uncomment: -# relative_assets = true - -# To disable debugging comments that display the original location of your selectors. Uncomment: -# line_comments = false - - -# If you prefer the indented syntax, you might want to regenerate this -# project again passing --syntax sass, or you can uncomment this: -# preferred_syntax = :sass -# and then run: -# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/hammer.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/hammer.js deleted file mode 100644 index 44a5802e56b..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/hammer.js +++ /dev/null @@ -1,586 +0,0 @@ -/* - * Hammer.JS - * version 0.4 - * author: Eight Media - * https://github.com/EightMedia/hammer.js - */ -function Hammer(element, options, undefined) -{ - var self = this; - - var defaults = { - // prevent the default event or not... might be buggy when false - prevent_default : false, - css_hacks : true, - - drag : true, - drag_vertical : true, - drag_horizontal : true, - // minimum distance before the drag event starts - drag_min_distance : 20, // pixels - - // pinch zoom and rotation - transform : true, - scale_treshold : 0.1, - rotation_treshold : 15, // degrees - - tap : true, - tap_double : true, - tap_max_interval : 300, - tap_double_distance: 20, - - hold : true, - hold_timeout : 500 - }; - options = mergeObject(defaults, options); - - // some css hacks - (function() { - if(!options.css_hacks) { - return false; - } - - var vendors = ['webkit','moz','ms','o','']; - var css_props = { - "userSelect": "none", - "touchCallout": "none", - "userDrag": "none", - "tapHighlightColor": "rgba(0,0,0,0)" - }; - - var prop = ''; - for(var i = 0; i < vendors.length; i++) { - for(var p in css_props) { - prop = p; - if(vendors[i]) { - prop = vendors[i] + prop.substring(0, 1).toUpperCase() + prop.substring(1); - } - element.style[ prop ] = css_props[p]; - } - } - })(); - - // holds the distance that has been moved - var _distance = 0; - - // holds the exact angle that has been moved - var _angle = 0; - - // holds the diraction that has been moved - var _direction = 0; - - // holds position movement for sliding - var _pos = { }; - - // how many fingers are on the screen - var _fingers = 0; - - var _first = false; - - var _gesture = null; - var _prev_gesture = null; - - var _touch_start_time = null; - var _prev_tap_pos = {x: 0, y: 0}; - var _prev_tap_end_time = null; - - var _hold_timer = null; - - var _offset = {}; - - // keep track of the mouse status - var _mousedown = false; - - var _event_start; - var _event_move; - var _event_end; - - - /** - * angle to direction define - * @param float angle - * @return string direction - */ - this.getDirectionFromAngle = function( angle ) - { - var directions = { - down: angle >= 45 && angle < 135, //90 - left: angle >= 135 || angle <= -135, //180 - up: angle < -45 && angle > -135, //270 - right: angle >= -45 && angle <= 45 //0 - }; - - var direction, key; - for(key in directions){ - if(directions[key]){ - direction = key; - break; - } - } - return direction; - }; - - - /** - * count the number of fingers in the event - * when no fingers are detected, one finger is returned (mouse pointer) - * @param event - * @return int fingers - */ - function countFingers( event ) - { - // there is a bug on android (until v4?) that touches is always 1, - // so no multitouch is supported, e.g. no, zoom and rotation... - return event.touches ? event.touches.length : 1; - } - - - /** - * get the x and y positions from the event object - * @param event - * @return array [{ x: int, y: int }] - */ - function getXYfromEvent( event ) - { - event = event || window.event; - - // no touches, use the event pageX and pageY - if(!event.touches) { - var doc = document, - body = doc.body; - - return [{ - x: event.pageX || event.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && doc.clientLeft || 0 ), - y: event.pageY || event.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && doc.clientTop || 0 ) - }]; - } - // multitouch, return array with positions - else { - var pos = [], src; - for(var t=0, len=event.touches.length; t options.drag_min_distance) || _gesture == 'drag') { - // calculate the angle - _angle = getAngle(_pos.start[0], _pos.move[0]); - _direction = self.getDirectionFromAngle(_angle); - - // check the movement and stop if we go in the wrong direction - var is_vertical = (_direction == 'up' || _direction == 'down'); - if(((is_vertical && !options.drag_vertical) || (!is_vertical && !options.drag_horizontal)) - && (_distance > options.drag_min_distance)) { - return; - } - - _gesture = 'drag'; - - var position = { x: _pos.move[0].x - _offset.left, - y: _pos.move[0].y - _offset.top }; - - var event_obj = { - originalEvent : event, - position : position, - direction : _direction, - distance : _distance, - distanceX : _distance_x, - distanceY : _distance_y, - angle : _angle - }; - - // on the first time trigger the start event - if(_first) { - triggerEvent("dragstart", event_obj); - - _first = false; - } - - // normal slide event - triggerEvent("drag", event_obj); - - cancelEvent(event); - } - }, - - - // transform gesture - // fired on touchmove - transform : function(event) - { - if(options.transform) { - var scale = event.scale || 1; - var rotation = event.rotation || 0; - - if(countFingers(event) != 2) { - return false; - } - - if(_gesture != 'drag' && - (_gesture == 'transform' || Math.abs(1-scale) > options.scale_treshold - || Math.abs(rotation) > options.rotation_treshold)) { - _gesture = 'transform'; - - _pos.center = { x: ((_pos.move[0].x + _pos.move[1].x) / 2) - _offset.left, - y: ((_pos.move[0].y + _pos.move[1].y) / 2) - _offset.top }; - - var event_obj = { - originalEvent : event, - position : _pos.center, - scale : scale, - rotation : rotation - }; - - // on the first time trigger the start event - if(_first) { - triggerEvent("transformstart", event_obj); - _first = false; - } - - triggerEvent("transform", event_obj); - - cancelEvent(event); - - return true; - } - } - - return false; - }, - - - // tap and double tap gesture - // fired on touchend - tap : function(event) - { - // compare the kind of gesture by time - var now = new Date().getTime(); - var touch_time = now - _touch_start_time; - - // dont fire when hold is fired - if(options.hold && !(options.hold && options.hold_timeout > touch_time)) { - return; - } - - // when previous event was tap and the tap was max_interval ms ago - var is_double_tap = (function(){ - if (_prev_tap_pos && options.tap_double && _prev_gesture == 'tap' && (_touch_start_time - _prev_tap_end_time) < options.tap_max_interval) { - var x_distance = Math.abs(_prev_tap_pos[0].x - _pos.start[0].x); - var y_distance = Math.abs(_prev_tap_pos[0].y - _pos.start[0].y); - return (_prev_tap_pos && _pos.start && Math.max(x_distance, y_distance) < options.tap_double_distance); - - } - return false; - })(); - - if(is_double_tap) { - _gesture = 'double_tap'; - _prev_tap_end_time = null; - - triggerEvent("doubletap", { - originalEvent : event, - position : _pos.start - }); - cancelEvent(event); - } - - // single tap is single touch - else { - _gesture = 'tap'; - _prev_tap_end_time = now; - _prev_tap_pos = _pos.start; - - if(options.tap) { - triggerEvent("tap", { - originalEvent : event, - position : _pos.start - }); - cancelEvent(event); - } - } - - } - - }; - - - function handleEvents(event) - { - switch(event.type) - { - case 'mousedown': - case 'touchstart': - _pos.start = getXYfromEvent(event); - _touch_start_time = new Date().getTime(); - _fingers = countFingers(event); - _first = true; - _event_start = event; - - // borrowed from jquery offset https://github.com/jquery/jquery/blob/master/src/offset.js - var box = element.getBoundingClientRect(); - var clientTop = element.clientTop || document.body.clientTop || 0; - var clientLeft = element.clientLeft || document.body.clientLeft || 0; - var scrollTop = window.pageYOffset || element.scrollTop || document.body.scrollTop; - var scrollLeft = window.pageXOffset || element.scrollLeft || document.body.scrollLeft; - - _offset = { - top: box.top + scrollTop - clientTop, - left: box.left + scrollLeft - clientLeft - }; - - _mousedown = true; - - // hold gesture - gestures.hold(event); - - if(options.prevent_default) { - cancelEvent(event); - } - break; - - case 'mousemove': - case 'touchmove': - if(!_mousedown) { - return false; - } - _event_move = event; - _pos.move = getXYfromEvent(event); - - if(!gestures.transform(event)) { - gestures.drag(event); - } - break; - - case 'mouseup': - case 'mouseout': - case 'touchcancel': - case 'touchend': - if(!_mousedown || (_gesture != 'transform' && event.touches && event.touches.length > 0)) { - return false; - } - - _mousedown = false; - _event_end = event; - - // drag gesture - // dragstart is triggered, so dragend is possible - if(_gesture == 'drag') { - triggerEvent("dragend", { - originalEvent : event, - direction : _direction, - distance : _distance, - angle : _angle - }); - } - - // transform - // transformstart is triggered, so transformed is possible - else if(_gesture == 'transform') { - triggerEvent("transformend", { - originalEvent : event, - position : _pos.center, - scale : event.scale, - rotation : event.rotation - }); - } - else { - gestures.tap(_event_start); - } - - _prev_gesture = _gesture; - - // reset vars - reset(); - break; - } - } - - - // bind events for touch devices - // except for windows phone 7.5, it doesnt support touch events..! - if('ontouchstart' in window) { - element.addEventListener("touchstart", handleEvents, false); - element.addEventListener("touchmove", handleEvents, false); - element.addEventListener("touchend", handleEvents, false); - element.addEventListener("touchcancel", handleEvents, false); - } - // for non-touch - else { - - if(element.addEventListener){ // prevent old IE errors - element.addEventListener("mouseout", function(event) { - if(!isInsideHammer(element, event.relatedTarget)) { - handleEvents(event); - } - }, false); - element.addEventListener("mouseup", handleEvents, false); - element.addEventListener("mousedown", handleEvents, false); - element.addEventListener("mousemove", handleEvents, false); - - // events for older IE - }else if(document.attachEvent){ - element.attachEvent("onmouseout", function(event) { - if(!isInsideHammer(element, event.relatedTarget)) { - handleEvents(event); - } - }, false); - element.attachEvent("onmouseup", handleEvents); - element.attachEvent("onmousedown", handleEvents); - element.attachEvent("onmousemove", handleEvents); - } - } - - - /** - * find if element is (inside) given parent element - * @param object element - * @param object parent - * @return bool inside - */ - function isInsideHammer(parent, child) { - // get related target for IE - if(!child && window.event && window.event.toElement){ - child = window.event.toElement; - } - - if(parent === child){ - return true; - } - - // loop over parentNodes of child until we find hammer element - if(child){ - var node = child.parentNode; - while(node !== null){ - if(node === parent){ - return true; - }; - node = node.parentNode; - } - } - return false; - } - - - /** - * merge 2 objects into a new object - * @param object obj1 - * @param object obj2 - * @return object merged object - */ - function mergeObject(obj1, obj2) { - var output = {}; - - if(!obj2) { - return obj1; - } - - for (var prop in obj1) { - if (prop in obj2) { - output[prop] = obj2[prop]; - } else { - output[prop] = obj1[prop]; - } - } - return output; - } - - function isFunction( obj ){ - return Object.prototype.toString.call( obj ) == "[object Function]"; - } -} \ No newline at end of file diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/modernizr.custom.45394.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/modernizr.custom.45394.js deleted file mode 100644 index 26f38cdcc52..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/modernizr.custom.45394.js +++ /dev/null @@ -1,4 +0,0 @@ -/* Modernizr 2.5.3 (Custom Build) | MIT & BSD - * Build: http://www.modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexbox_legacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-mq-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load - */ -;window.Modernizr=function(a,b,c){function C(a){i.cssText=a}function D(a,b){return C(m.join(a+";")+(b||""))}function E(a,b){return typeof a===b}function F(a,b){return!!~(""+a).indexOf(b)}function G(a,b){for(var d in a)if(i[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+o.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),H(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d",a,""].join(""),k.id=g,(l?k:m).innerHTML+=h,m.appendChild(k),l||(m.style.background="",f.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},y=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return x("@media "+b+" { #"+g+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},z=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=E(e[d],"function"),E(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=v.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(v.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(v.call(arguments)))};return e});var J=function(c,d){var f=c.join(""),g=d.length;x(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"",i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch||(j.touch&&j.touch.offsetTop)===9,e.csstransforms3d=(j.csstransforms3d&&j.csstransforms3d.offsetLeft)===9&&j.csstransforms3d.offsetHeight===3,e.generatedcontent=(j.generatedcontent&&j.generatedcontent.offsetHeight)>=1,e.fontface=/src/i.test(h)&&h.indexOf(d.split(" ")[0])===0},g,d)}(['@font-face {font-family:"font";src:url("https://")}',["@media (",m.join("touch-enabled),("),g,")","{#touch{top:9px;position:absolute}}"].join(""),["@media (",m.join("transform-3d),("),g,")","{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join(""),['#generatedcontent:after{content:"',k,'";visibility:hidden}'].join("")],["fontface","touch","csstransforms3d","generatedcontent"]);r.flexbox=function(){return I("flexOrder")},r["flexbox-legacy"]=function(){return I("boxDirection")},r.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},r.canvastext=function(){return!!e.canvas&&!!E(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){try{var d=b.createElement("canvas"),e;e=!(!a.WebGLRenderingContext||!d.getContext("experimental-webgl")&&!d.getContext("webgl")),d=c}catch(f){e=!1}return e},r.touch=function(){return e.touch},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){return!!a.openDatabase},r.indexedDB=function(){return!!I("indexedDB",a)},r.hashchange=function(){return z("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return!!a.history&&!!history.pushState},r.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},r.websockets=function(){for(var b=-1,c=o.length;++b0&&g.splice(0,a);setTimeout(function(){b.parentNode.removeChild(b)},15)}}function m(a){var b,c;a.setAttribute("data-orderloaded","loaded");for(a=0;c=h[a];a++)if((b=i[c])&&b.getAttribute("data-orderloaded")==="loaded")delete i[c],require.addScriptToDom(b);else break;a>0&&h.splice(0, -a)}var f=typeof document!=="undefined"&&typeof window!=="undefined"&&document.createElement("script"),n=f&&(f.async||window.opera&&Object.prototype.toString.call(window.opera)==="[object Opera]"||"MozAppearance"in document.documentElement.style),o=f&&f.readyState==="uninitialized",l=/^(complete|loaded)$/,g=[],j={},i={},h=[],f=null;define({version:"1.0.5",load:function(a,b,c,e){var d;b.nameToUrl?(d=b.nameToUrl(a,null),require.s.skipAsync[d]=!0,n||e.isBuild?b([a],c):o?(e=require.s.contexts._,!e.urlFetched[d]&& -!e.loaded[a]&&(e.urlFetched[d]=!0,require.resourcesReady(!1),e.scriptCount+=1,d=require.attach(d,e,a,null,null,m),i[a]=d,h.push(a)),b([a],c)):b.specified(a)?b([a],c):(g.push({name:a,req:b,onLoad:c}),require.attach(d,null,a,k,"script/cache"))):b([a],c)}})})(); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/polyfills/classList.min.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/polyfills/classList.min.js deleted file mode 100644 index 932c7776212..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/polyfills/classList.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/ -"use strict";if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(a){var f="classList",d="prototype",e=(a.HTMLElement||a.Element)[d],g=Object;strTrim=String[d].trim||function(){return this.replace(/^\s+|\s+$/g,"")},arrIndexOf=Array[d].indexOf||function(k){for(var j=0,h=this.length;j")&&c[0]);return a>4?a:!1}();return a},m.isInternetExplorer=function(){var a=m.isInternetExplorer.cached=typeof m.isInternetExplorer.cached!="undefined"?m.isInternetExplorer.cached:Boolean(m.getInternetExplorerMajorVersion());return a},m.emulated={pushState:!Boolean(a.history&&a.history.pushState&&a.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(e.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(e.userAgent)),hashChange:Boolean(!("onhashchange"in a||"onhashchange"in d)||m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8)},m.enabled=!m.emulated.pushState,m.bugs={setHash:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),safariPoll:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),ieDoubleCheck:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<7)},m.isEmptyObject=function(a){for(var b in a)return!1;return!0},m.cloneObject=function(a){var b,c;return a?(b=k.stringify(a),c=k.parse(b)):c={},c},m.getRootUrl=function(){var a=d.location.protocol+"//"+(d.location.hostname||d.location.host);if(d.location.port||!1)a+=":"+d.location.port;return a+="/",a},m.getBaseHref=function(){var a=d.getElementsByTagName("base"),b=null,c="";return a.length===1&&(b=a[0],c=b.href.replace(/[^\/]+$/,"")),c=c.replace(/\/+$/,""),c&&(c+="/"),c},m.getBaseUrl=function(){var a=m.getBaseHref()||m.getBasePageUrl()||m.getRootUrl();return a},m.getPageUrl=function(){var a=m.getState(!1,!1),b=(a||{}).url||d.location.href,c;return c=b.replace(/\/+$/,"").replace(/[^\/]+$/,function(a,b,c){return/\./.test(a)?a:a+"/"}),c},m.getBasePageUrl=function(){var a=d.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(a,b,c){return/[^\/]$/.test(a)?"":a}).replace(/\/+$/,"")+"/";return a},m.getFullUrl=function(a,b){var c=a,d=a.substring(0,1);return b=typeof b=="undefined"?!0:b,/[a-z]+\:\/\//.test(a)||(d==="/"?c=m.getRootUrl()+a.replace(/^\/+/,""):d==="#"?c=m.getPageUrl().replace(/#.*/,"")+a:d==="?"?c=m.getPageUrl().replace(/[\?#].*/,"")+a:b?c=m.getBaseUrl()+a.replace(/^(\.\/)+/,""):c=m.getBasePageUrl()+a.replace(/^(\.\/)+/,"")),c.replace(/\#$/,"")},m.getShortUrl=function(a){var b=a,c=m.getBaseUrl(),d=m.getRootUrl();return m.emulated.pushState&&(b=b.replace(c,"")),b=b.replace(d,"/"),m.isTraditionalAnchor(b)&&(b="./"+b),b=b.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),b},m.store={},m.idToState=m.idToState||{},m.stateToId=m.stateToId||{},m.urlToId=m.urlToId||{},m.storedStates=m.storedStates||[],m.savedStates=m.savedStates||[],m.normalizeStore=function(){m.store.idToState=m.store.idToState||{},m.store.urlToId=m.store.urlToId||{},m.store.stateToId=m.store.stateToId||{}},m.getState=function(a,b){typeof a=="undefined"&&(a=!0),typeof b=="undefined"&&(b=!0);var c=m.getLastSavedState();return!c&&b&&(c=m.createStateObject()),a&&(c=m.cloneObject(c),c.url=c.cleanUrl||c.url),c},m.getIdByState=function(a){var b=m.extractId(a.url),c;if(!b){c=m.getStateString(a);if(typeof m.stateToId[c]!="undefined")b=m.stateToId[c];else if(typeof m.store.stateToId[c]!="undefined")b=m.store.stateToId[c];else{for(;;){b=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof m.idToState[b]=="undefined"&&typeof m.store.idToState[b]=="undefined")break}m.stateToId[c]=b,m.idToState[b]=a}}return b},m.normalizeState=function(a){var b,c;if(!a||typeof a!="object")a={};if(typeof a.normalized!="undefined")return a;if(!a.data||typeof a.data!="object")a.data={};b={},b.normalized=!0,b.title=a.title||"",b.url=m.getFullUrl(m.unescapeString(a.url||d.location.href)),b.hash=m.getShortUrl(b.url),b.data=m.cloneObject(a.data),b.id=m.getIdByState(b),b.cleanUrl=b.url.replace(/\??\&_suid.*/,""),b.url=b.cleanUrl,c=!m.isEmptyObject(b.data);if(b.title||c)b.hash=m.getShortUrl(b.url).replace(/\??\&_suid.*/,""),/\?/.test(b.hash)||(b.hash+="?"),b.hash+="&_suid="+b.id;return b.hashedUrl=m.getFullUrl(b.hash),(m.emulated.pushState||m.bugs.safariPoll)&&m.hasUrlDuplicate(b)&&(b.url=b.hashedUrl),b},m.createStateObject=function(a,b,c){var d={data:a,title:b,url:c};return d=m.normalizeState(d),d},m.getStateById=function(a){a=String(a);var c=m.idToState[a]||m.store.idToState[a]||b;return c},m.getStateString=function(a){var b,c,d;return b=m.normalizeState(a),c={data:b.data,title:a.title,url:a.url},d=k.stringify(c),d},m.getStateId=function(a){var b,c;return b=m.normalizeState(a),c=b.id,c},m.getHashByState=function(a){var b,c;return b=m.normalizeState(a),c=b.hash,c},m.extractId=function(a){var b,c,d;return c=/(.*)\&_suid=([0-9]+)$/.exec(a),d=c?c[1]||a:a,b=c?String(c[2]||""):"",b||!1},m.isTraditionalAnchor=function(a){var b=!/[\/\?\.]/.test(a);return b},m.extractState=function(a,b){var c=null,d,e;return b=b||!1,d=m.extractId(a),d&&(c=m.getStateById(d)),c||(e=m.getFullUrl(a),d=m.getIdByUrl(e)||!1,d&&(c=m.getStateById(d)),!c&&b&&!m.isTraditionalAnchor(a)&&(c=m.createStateObject(null,null,e))),c},m.getIdByUrl=function(a){var c=m.urlToId[a]||m.store.urlToId[a]||b;return c},m.getLastSavedState=function(){return m.savedStates[m.savedStates.length-1]||b},m.getLastStoredState=function(){return m.storedStates[m.storedStates.length-1]||b},m.hasUrlDuplicate=function(a){var b=!1,c;return c=m.extractState(a.url),b=c&&c.id!==a.id,b},m.storeState=function(a){return m.urlToId[a.url]=a.id,m.storedStates.push(m.cloneObject(a)),a},m.isLastSavedState=function(a){var b=!1,c,d,e;return m.savedStates.length&&(c=a.id,d=m.getLastSavedState(),e=d.id,b=c===e),b},m.saveState=function(a){return m.isLastSavedState(a)?!1:(m.savedStates.push(m.cloneObject(a)),!0)},m.getStateByIndex=function(a){var b=null;return typeof a=="undefined"?b=m.savedStates[m.savedStates.length-1]:a<0?b=m.savedStates[m.savedStates.length+a]:b=m.savedStates[a],b},m.getHash=function(){var a=m.unescapeHash(d.location.hash);return a},m.unescapeString=function(b){var c=b,d;for(;;){d=a.unescape(c);if(d===c)break;c=d}return c},m.unescapeHash=function(a){var b=m.normalizeHash(a);return b=m.unescapeString(b),b},m.normalizeHash=function(a){var b=a.replace(/[^#]*#/,"").replace(/#.*/,"");return b},m.setHash=function(a,b){var c,e,f;return b!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.setHash,args:arguments,queue:b}),!1):(c=m.escapeHash(a),m.busy(!0),e=m.extractState(a,!0),e&&!m.emulated.pushState?m.pushState(e.data,e.title,e.url,!1):d.location.hash!==c&&(m.bugs.setHash?(f=m.getPageUrl(),m.pushState(null,null,f+"#"+c,!1)):d.location.hash=c),m)},m.escapeHash=function(b){var c=m.normalizeHash(b);return c=a.escape(c),m.bugs.hashEscape||(c=c.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),c},m.getHashByUrl=function(a){var b=String(a).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return b=m.unescapeHash(b),b},m.setTitle=function(a){var b=a.title,c;b||(c=m.getStateByIndex(0),c&&c.url===a.url&&(b=c.title||m.options.initialTitle));try{d.getElementsByTagName("title")[0].innerHTML=b.replace("<","<").replace(">",">").replace(" & "," & ")}catch(e){}return d.title=b,m},m.queues=[],m.busy=function(a){typeof a!="undefined"?m.busy.flag=a:typeof m.busy.flag=="undefined"&&(m.busy.flag=!1);if(!m.busy.flag){h(m.busy.timeout);var b=function(){var a,c,d;if(m.busy.flag)return;for(a=m.queues.length-1;a>=0;--a){c=m.queues[a];if(c.length===0)continue;d=c.shift(),m.fireQueueItem(d),m.busy.timeout=g(b,m.options.busyDelay)}};m.busy.timeout=g(b,m.options.busyDelay)}return m.busy.flag},m.busy.flag=!1,m.fireQueueItem=function(a){return a.callback.apply(a.scope||m,a.args||[])},m.pushQueue=function(a){return m.queues[a.queue||0]=m.queues[a.queue||0]||[],m.queues[a.queue||0].push(a),m},m.queue=function(a,b){return typeof a=="function"&&(a={callback:a}),typeof b!="undefined"&&(a.queue=b),m.busy()?m.pushQueue(a):m.fireQueueItem(a),m},m.clearQueue=function(){return m.busy.flag=!1,m.queues=[],m},m.stateChanged=!1,m.doubleChecker=!1,m.doubleCheckComplete=function(){return m.stateChanged=!0,m.doubleCheckClear(),m},m.doubleCheckClear=function(){return m.doubleChecker&&(h(m.doubleChecker),m.doubleChecker=!1),m},m.doubleCheck=function(a){return m.stateChanged=!1,m.doubleCheckClear(),m.bugs.ieDoubleCheck&&(m.doubleChecker=g(function(){return m.doubleCheckClear(),m.stateChanged||a(),!0},m.options.doubleCheckInterval)),m},m.safariStatePoll=function(){var b=m.extractState(d.location.href),c;if(!m.isLastSavedState(b))c=b;else return;return c||(c=m.createStateObject()),m.Adapter.trigger(a,"popstate"),m},m.back=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.back,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.back(!1)}),n.go(-1),!0)},m.forward=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.forward,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.forward(!1)}),n.go(1),!0)},m.go=function(a,b){var c;if(a>0)for(c=1;c<=a;++c)m.forward(b);else{if(!(a<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(c=-1;c>=a;--c)m.back(b)}return m};if(m.emulated.pushState){var o=function(){};m.pushState=m.pushState||o,m.replaceState=m.replaceState||o}else m.onPopState=function(b,c){var e=!1,f=!1,g,h;return m.doubleCheckComplete(),g=m.getHash(),g?(h=m.extractState(g||d.location.href,!0),h?m.replaceState(h.data,h.title,h.url,!1):(m.Adapter.trigger(a,"anchorchange"),m.busy(!1)),m.expectedStateId=!1,!1):(e=m.Adapter.extractEventData("state",b,c)||!1,e?f=m.getStateById(e):m.expectedStateId?f=m.getStateById(m.expectedStateId):f=m.extractState(d.location.href),f||(f=m.createStateObject(null,null,d.location.href)),m.expectedStateId=!1,m.isLastSavedState(f)?(m.busy(!1),!1):(m.storeState(f),m.saveState(f),m.setTitle(f),m.Adapter.trigger(a,"statechange"),m.busy(!1),!0))},m.Adapter.bind(a,"popstate",m.onPopState),m.pushState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.pushState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.pushState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0},m.replaceState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.replaceState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.replaceState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0};if(f){try{m.store=k.parse(f.getItem("History.store"))||{}}catch(p){m.store={}}m.normalizeStore()}else m.store={},m.normalizeStore();m.Adapter.bind(a,"beforeunload",m.clearAllIntervals),m.Adapter.bind(a,"unload",m.clearAllIntervals),m.saveState(m.storeState(m.extractState(d.location.href,!0))),f&&(m.onUnload=function(){var a,b;try{a=k.parse(f.getItem("History.store"))||{}}catch(c){a={}}a.idToState=a.idToState||{},a.urlToId=a.urlToId||{},a.stateToId=a.stateToId||{};for(b in m.idToState){if(!m.idToState.hasOwnProperty(b))continue;a.idToState[b]=m.idToState[b]}for(b in m.urlToId){if(!m.urlToId.hasOwnProperty(b))continue;a.urlToId[b]=m.urlToId[b]}for(b in m.stateToId){if(!m.stateToId.hasOwnProperty(b))continue;a.stateToId[b]=m.stateToId[b]}m.store=a,m.normalizeStore(),f.setItem("History.store",k.stringify(a))},m.intervalList.push(i(m.onUnload,m.options.storeInterval)),m.Adapter.bind(a,"beforeunload",m.onUnload),m.Adapter.bind(a,"unload",m.onUnload));if(!m.emulated.pushState){m.bugs.safariPoll&&m.intervalList.push(i(m.safariStatePoll,m.options.safariPollInterval));if(e.vendor==="Apple Computer, Inc."||(e.appCodeName||"")==="Mozilla")m.Adapter.bind(a,"hashchange",function(){m.Adapter.trigger(a,"popstate")}),m.getHash()&&m.Adapter.onDomLoad(function(){m.Adapter.trigger(a,"hashchange")})}},m.init()})(window) \ No newline at end of file diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-apollo.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-apollo.js deleted file mode 100644 index 7098baf4105..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-apollo.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, -null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-clj.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-clj.js deleted file mode 100644 index 542a2205fc7..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-clj.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - Copyright (C) 2011 Google Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -var a=null; -PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], -["typ",/^:[\dA-Za-z-]+/]]),["clj"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-css.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-css.js deleted file mode 100644 index 041e1f59067..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-css.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", -/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-go.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-go.js deleted file mode 100644 index fc18dc07967..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-go.js +++ /dev/null @@ -1 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-hs.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-hs.js deleted file mode 100644 index 9d77b08389b..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-hs.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n \r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, -null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-lisp.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-lisp.js deleted file mode 100644 index 02a30e8d16e..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-lisp.js +++ /dev/null @@ -1,3 +0,0 @@ -var a=null; -PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], -["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","scm"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-lua.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-lua.js deleted file mode 100644 index e83a3c46931..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-lua.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], -["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-ml.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-ml.js deleted file mode 100644 index 6df02d728d1..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-ml.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], -["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-n.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-n.js deleted file mode 100644 index 6c2e85b98f5..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-n.js +++ /dev/null @@ -1,4 +0,0 @@ -var a=null; -PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\xa0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, -a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, -a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-proto.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-proto.js deleted file mode 100644 index f006ad8cfb6..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-proto.js +++ /dev/null @@ -1 +0,0 @@ -PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-scala.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-scala.js deleted file mode 100644 index 60d034de495..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-scala.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], -["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-sql.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-sql.js deleted file mode 100644 index da705b0b678..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-sql.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|merge|national|nocheck|nonclustered|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|percent|plan|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rule|save|schema|select|session_user|set|setuser|shutdown|some|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|union|unique|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|writetext)(?=[^\w-]|$)/i, -null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-tex.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-tex.js deleted file mode 100644 index ce96fbbd1f4..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-tex.js +++ /dev/null @@ -1 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-vb.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-vb.js deleted file mode 100644 index 07506b03cd4..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-vb.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r \xa0

"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"“”'],["com",/^['\u2018\u2019].*/,null,"'‘’"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, -null],["com",/^rem.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-vhdl.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-vhdl.js deleted file mode 100644 index 128b5b6cfc2..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-vhdl.js +++ /dev/null @@ -1,3 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \xa0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, -null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], -["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-wiki.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-wiki.js deleted file mode 100644 index 9b0b44873f0..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-wiki.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t \xa0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]); -PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-xq.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-xq.js deleted file mode 100644 index e323ae32370..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-xq.js +++ /dev/null @@ -1,3 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["var pln",/^\$[\w-]+/,null,"$"]],[["pln",/^[\s=][<>][\s=]/],["lit",/^@[\w-]+/],["tag",/^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["com",/^\(:[\S\s]*?:\)/],["pln",/^[(),/;[\]{}]$/],["str",/^(?:"(?:[^"\\{]|\\[\S\s])*(?:"|$)|'(?:[^'\\{]|\\[\S\s])*(?:'|$))/,null,"\"'"],["kwd",/^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/], -["typ",/^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/,null],["fun pln",/^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/], -["pln",/^[\w:-]+/],["pln",/^[\t\n\r \xa0]+/]]),["xq","xquery"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-yaml.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-yaml.js deleted file mode 100644 index c38729b6cfb..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/lang-yaml.js +++ /dev/null @@ -1,2 +0,0 @@ -var a=null; -PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/prettify.css b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/prettify.css deleted file mode 100644 index d44b3a2282a..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/prettify.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/prettify.js deleted file mode 100644 index eef5ad7e6a0..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/prettify/prettify.js +++ /dev/null @@ -1,28 +0,0 @@ -var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; -(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= -[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), -l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, -q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, -q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, -"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), -a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} -for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], -"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], -H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], -J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ -I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), -["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", -/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), -["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", -hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= -!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p0&&(g.splice(m-1,2),m-=2);m=q.pkgs[g=b[0]];b=b.join("/");m&&b===g+"/"+m.main&&(b=g)}else b.indexOf("./")=== -0&&(b=b.substring(2));return b}function l(b,f){var g=b?b.indexOf("!"):-1,m=null,a=f?f.name:null,h=b,e,d;g!==-1&&(m=b.substring(0,g),b=b.substring(g+1,b.length));m&&(m=c(m,a));b&&(m?e=(g=n[m])&&g.normalize?g.normalize(b,function(b){return c(b,a)}):c(b,a):(e=c(b,a),d=G[e],d||(d=i.nameToUrl(b,null,f),G[e]=d)));return{prefix:m,name:e,parentMap:f,url:d,originalName:h,fullName:m?m+"!"+(e||""):e}}function j(){var b=!0,f=q.priorityWait,g,a;if(f){for(a=0;g=f[a];a++)if(!s[g]){b=!1;break}b&&delete q.priorityWait}return b} -function k(b,f,g){return function(){var a=ha.call(arguments,0),c;if(g&&K(c=a[a.length-1]))c.__requireJsBuild=!0;a.push(f);return b.apply(null,a)}}function t(b,f,g){f=k(g||i.require,b,f);$(f,{nameToUrl:k(i.nameToUrl,b),toUrl:k(i.toUrl,b),defined:k(i.requireDefined,b),specified:k(i.requireSpecified,b),isBrowser:d.isBrowser});return f}function p(b){var f,g,a,c=b.callback,h=b.map,e=h.fullName,ca=b.deps;a=b.listeners;var j=q.requireExecCb||d.execCb;if(c&&K(c)){if(q.catchError.define)try{g=j(e,b.callback, -ca,n[e])}catch(k){f=k}else g=j(e,b.callback,ca,n[e]);if(e)(c=b.cjsModule)&&c.exports!==r&&c.exports!==n[e]?g=n[e]=b.cjsModule.exports:g===r&&b.usingExports?g=n[e]:(n[e]=g,H[e]&&(T[e]=!0))}else e&&(g=n[e]=c,H[e]&&(T[e]=!0));if(x[b.id])delete x[b.id],b.isDone=!0,i.waitCount-=1,i.waitCount===0&&(J=[]);delete M[e];if(d.onResourceLoad&&!b.placeholder)d.onResourceLoad(i,h,b.depArray);if(f)return g=(e?l(e).url:"")||f.fileName||f.sourceURL,a=f.moduleTree,f=P("defineerror",'Error evaluating module "'+e+'" at location "'+ -g+'":\n'+f+"\nfileName:"+g+"\nlineNumber: "+(f.lineNumber||f.line),f),f.moduleName=e,f.moduleTree=a,d.onError(f);for(f=0;c=a[f];f++)c(g);return r}function u(b,f){return function(g){b.depDone[f]||(b.depDone[f]=!0,b.deps[f]=g,b.depCount-=1,b.depCount||p(b))}}function o(b,f){var g=f.map,a=g.fullName,c=g.name,h=N[b]||(N[b]=n[b]),e;if(!f.loading)f.loading=!0,e=function(b){f.callback=function(){return b};p(f);s[f.id]=!0;A()},e.fromText=function(b,f){var g=Q;s[b]=!1;i.scriptCount+=1;i.fake[b]=!0;g&&(Q=!1); -d.exec(f);g&&(Q=!0);i.completeLoad(b)},a in n?e(n[a]):h.load(c,t(g.parentMap,!0,function(b,a){var c=[],e,m;for(e=0;m=b[e];e++)m=l(m,g.parentMap),b[e]=m.fullName,m.prefix||c.push(b[e]);f.moduleDeps=(f.moduleDeps||[]).concat(c);return i.require(b,a)}),e,q)}function y(b){x[b.id]||(x[b.id]=b,J.push(b),i.waitCount+=1)}function D(b){this.listeners.push(b)}function v(b,f){var g=b.fullName,a=b.prefix,c=a?N[a]||(N[a]=n[a]):null,h,e;g&&(h=M[g]);if(!h&&(e=!0,h={id:(a&&!c?O++ +"__p@:":"")+(g||"__r@"+O++),map:b, -depCount:0,depDone:[],depCallbacks:[],deps:[],listeners:[],add:D},B[h.id]=!0,g&&(!a||N[a])))M[g]=h;a&&!c?(g=l(a),a in n&&!n[a]&&(delete n[a],delete R[g.url]),a=v(g,!0),a.add(function(){var f=l(b.originalName,b.parentMap),f=v(f,!0);h.placeholder=!0;f.add(function(b){h.callback=function(){return b};p(h)})})):e&&f&&(s[h.id]=!1,i.paused.push(h),y(h));return h}function C(b,f,a,c){var b=l(b,c),d=b.name,h=b.fullName,e=v(b),j=e.id,k=e.deps,o;if(h){if(h in n||s[j]===!0||h==="jquery"&&q.jQuery&&q.jQuery!== -a().fn.jquery)return;B[j]=!0;s[j]=!0;h==="jquery"&&a&&W(a())}e.depArray=f;e.callback=a;for(a=0;a0)return r;if(q.priorityWait)if(j())A();else return r;for(h in s)if(!(h in L)&&(c=!0,!s[h]))if(b)a+=h+" ";else if(l=!0,h.indexOf("!")===-1){k=[];break}else(e=M[h]&&M[h].moduleDeps)&&k.push.apply(k,e);if(!c&&!i.waitCount)return r;if(b&&a)return b=P("timeout","Load timeout for modules: "+a),b.requireType="timeout",b.requireModules=a,b.contextName=i.contextName,d.onError(b); -if(l&&k.length)for(a=0;h=x[k[a]];a++)if(h=F(h,{})){z(h,{});break}if(!b&&(l||i.scriptCount)){if((I||da)&&!X)X=setTimeout(function(){X=0;E()},50);return r}if(i.waitCount){for(a=0;h=J[a];a++)z(h,{});i.paused.length&&A();Y<5&&(Y+=1,E())}Y=0;d.checkReadyState();return r}var i,A,q={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},catchError:{}},S=[],B={require:!0,exports:!0,module:!0},G={},n={},s={},x={},J=[],R={},O=0,M={},N={},H={},T={},Z=0;W=function(b){if(!i.jQuery&&(b=b||(typeof jQuery!=="undefined"?jQuery: -null))&&!(q.jQuery&&b.fn.jquery!==q.jQuery)&&("holdReady"in b||"readyWait"in b))if(i.jQuery=b,w(["jquery",[],function(){return jQuery}]),i.scriptCount)V(b,!0),i.jQueryIncremented=!0};A=function(){var b,a,c,l,k,h;i.takeGlobalQueue();Z+=1;if(i.scriptCount<=0)i.scriptCount=0;for(;S.length;)if(b=S.shift(),b[0]===null)return d.onError(P("mismatch","Mismatched anonymous define() module: "+b[b.length-1]));else w(b);if(!q.priorityWait||j())for(;i.paused.length;){k=i.paused;i.pausedCount+=k.length;i.paused= -[];for(l=0;b=k[l];l++)a=b.map,c=a.url,h=a.fullName,a.prefix?o(a.prefix,b):!R[c]&&!s[h]&&((q.requireLoad||d.load)(i,h,c),c.indexOf("empty:")!==0&&(R[c]=!0));i.startTime=(new Date).getTime();i.pausedCount-=k.length}Z===1&&E();Z-=1;return r};i={contextName:a,config:q,defQueue:S,waiting:x,waitCount:0,specified:B,loaded:s,urlMap:G,urlFetched:R,scriptCount:0,defined:n,paused:[],pausedCount:0,plugins:N,needFullExec:H,fake:{},fullExec:T,managerCallbacks:M,makeModuleMap:l,normalize:c,configure:function(b){var a, -c,d;b.baseUrl&&b.baseUrl.charAt(b.baseUrl.length-1)!=="/"&&(b.baseUrl+="/");a=q.paths;d=q.pkgs;$(q,b,!0);if(b.paths){for(c in b.paths)c in L||(a[c]=b.paths[c]);q.paths=a}if((a=b.packagePaths)||b.packages){if(a)for(c in a)c in L||aa(d,a[c],c);b.packages&&aa(d,b.packages);q.pkgs=d}if(b.priority)c=i.requireWait,i.requireWait=!1,A(),i.require(b.priority),A(),i.requireWait=c,q.priorityWait=b.priority;if(b.deps||b.callback)i.require(b.deps||[],b.callback)},requireDefined:function(b,a){return l(b,a).fullName in -n},requireSpecified:function(b,a){return l(b,a).fullName in B},require:function(b,c,g){if(typeof b==="string"){if(K(c))return d.onError(P("requireargs","Invalid require call"));if(d.get)return d.get(i,b,c);c=l(b,c);b=c.fullName;return!(b in n)?d.onError(P("notloaded","Module name '"+c.fullName+"' has not been loaded yet for context: "+a)):n[b]}(b&&b.length||c)&&C(null,b,c,g);if(!i.requireWait)for(;!i.scriptCount&&i.paused.length;)A();return i.require},takeGlobalQueue:function(){U.length&&(ja.apply(i.defQueue, -[i.defQueue.length-1,0].concat(U)),U=[])},completeLoad:function(b){var a;for(i.takeGlobalQueue();S.length;)if(a=S.shift(),a[0]===null){a[0]=b;break}else if(a[0]===b)break;else w(a),a=null;a?w(a):w([b,[],b==="jquery"&&typeof jQuery!=="undefined"?function(){return jQuery}:null]);d.isAsync&&(i.scriptCount-=1);A();d.isAsync||(i.scriptCount-=1)},toUrl:function(b,a){var c=b.lastIndexOf("."),d=null;c!==-1&&(d=b.substring(c,b.length),b=b.substring(0,c));return i.nameToUrl(b,d,a)},nameToUrl:function(b,a,g){var l, -k,h,e,j=i.config,b=c(b,g&&g.fullName);if(d.jsExtRegExp.test(b))a=b+(a?a:"");else{l=j.paths;k=j.pkgs;g=b.split("/");for(e=g.length;e>0;e--)if(h=g.slice(0,e).join("/"),l[h]){g.splice(0,e,l[h]);break}else if(h=k[h]){b=b===h.name?h.location+"/"+h.main:h.location;g.splice(0,e,b);break}a=g.join("/")+(a||".js");a=(a.charAt(0)==="/"||a.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+a}return j.urlArgs?a+((a.indexOf("?")===-1?"?":"&")+j.urlArgs):a}};i.jQueryCheck=W;i.resume=A;return i}function ka(){var a,c,d;if(C&&C.readyState=== -"interactive")return C;a=document.getElementsByTagName("script");for(c=a.length-1;c>-1&&(d=a[c]);c--)if(d.readyState==="interactive")return C=d;return null}var la=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ma=/require\(\s*["']([^'"\s]+)["']\s*\)/g,fa=/^\.\//,ba=/\.js$/,O=Object.prototype.toString,u=Array.prototype,ha=u.slice,ja=u.splice,I=!!(typeof window!=="undefined"&&navigator&&document),da=!I&&typeof importScripts!=="undefined",na=I&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/, -ea=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",L={},D={},U=[],C=null,Y=0,Q=!1,ia={require:!0,module:!0,exports:!0},d,u={},J,y,v,E,o,w,F,B,z,W,X;if(typeof define==="undefined"){if(typeof requirejs!=="undefined")if(K(requirejs))return;else u=requirejs,requirejs=r;typeof require!=="undefined"&&!K(require)&&(u=require,require=r);d=requirejs=function(a,c,d){var j="_",k;!G(a)&&typeof a!=="string"&&(k=a,G(c)?(a=c,c=d):a=[]);if(k&&k.context)j=k.context;d=D[j]||(D[j]=ga(j));k&&d.configure(k); -return d.require(a,c)};d.config=function(a){return d(a)};require||(require=d);d.toUrl=function(a){return D._.toUrl(a)};d.version="1.0.8";d.jsExtRegExp=/^\/|:|\?|\.js$/;y=d.s={contexts:D,skipAsync:{}};if(d.isAsync=d.isBrowser=I)if(v=y.head=document.getElementsByTagName("head")[0],E=document.getElementsByTagName("base")[0])v=y.head=E.parentNode;d.onError=function(a){throw a;};d.load=function(a,c,l){d.resourcesReady(!1);a.scriptCount+=1;d.attach(l,a,c);if(a.jQuery&&!a.jQueryIncremented)V(a.jQuery,!0), -a.jQueryIncremented=!0};define=function(a,c,d){var j,k;typeof a!=="string"&&(d=c,c=a,a=null);G(c)||(d=c,c=[]);!c.length&&K(d)&&d.length&&(d.toString().replace(la,"").replace(ma,function(a,d){c.push(d)}),c=(d.length===1?["require"]:["require","exports","module"]).concat(c));if(Q&&(j=J||ka()))a||(a=j.getAttribute("data-requiremodule")),k=D[j.getAttribute("data-requirecontext")];(k?k.defQueue:U).push([a,c,d]);return r};define.amd={multiversion:!0,plugins:!0,jQuery:!0};d.exec=function(a){return eval(a)}; -d.execCb=function(a,c,d,j){return c.apply(j,d)};d.addScriptToDom=function(a){J=a;E?v.insertBefore(a,E):v.appendChild(a);J=null};d.onScriptLoad=function(a){var c=a.currentTarget||a.srcElement,l;if(a.type==="load"||c&&na.test(c.readyState))C=null,a=c.getAttribute("data-requirecontext"),l=c.getAttribute("data-requiremodule"),D[a].completeLoad(l),c.detachEvent&&!ea?c.detachEvent("onreadystatechange",d.onScriptLoad):c.removeEventListener("load",d.onScriptLoad,!1)};d.attach=function(a,c,l,j,k,o){var p; -if(I)return j=j||d.onScriptLoad,p=c&&c.config&&c.config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),p.type=k||c&&c.config.scriptType||"text/javascript",p.charset="utf-8",p.async=!y.skipAsync[a],c&&p.setAttribute("data-requirecontext",c.contextName),p.setAttribute("data-requiremodule",l),p.attachEvent&&!(p.attachEvent.toString&&p.attachEvent.toString().indexOf("[native code]")<0)&&!ea?(Q=!0,o?p.onreadystatechange=function(){if(p.readyState=== -"loaded")p.onreadystatechange=null,p.attachEvent("onreadystatechange",j),o(p)}:p.attachEvent("onreadystatechange",j)):p.addEventListener("load",j,!1),p.src=a,o||d.addScriptToDom(p),p;else da&&(importScripts(a),c.completeLoad(l));return null};if(I){o=document.getElementsByTagName("script");for(B=o.length-1;B>-1&&(w=o[B]);B--){if(!v)v=w.parentNode;if(F=w.getAttribute("data-main")){if(!u.baseUrl)o=F.split("/"),w=o.pop(),o=o.length?o.join("/")+"/":"./",u.baseUrl=o,F=w.replace(ba,"");u.deps=u.deps?u.deps.concat(F): -[F];break}}}d.checkReadyState=function(){var a=y.contexts,c;for(c in a)if(!(c in L)&&a[c].waitCount)return;d.resourcesReady(!0)};d.resourcesReady=function(a){var c,l;d.resourcesDone=a;if(d.resourcesDone)for(l in a=y.contexts,a)if(!(l in L)&&(c=a[l],c.jQueryIncremented))V(c.jQuery,!1),c.jQueryIncremented=!1};d.pageLoaded=function(){if(document.readyState!=="complete")document.readyState="complete"};if(I&&document.addEventListener&&!document.readyState)document.readyState="loading",window.addEventListener("load", -d.pageLoaded,!1);d(u);if(d.isAsync&&typeof setTimeout!=="undefined")z=y.contexts[u.context||"_"],z.requireWait=!0,setTimeout(function(){z.requireWait=!1;z.scriptCount||z.resume();d.checkReadyState()},0)}})(); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-controller.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-controller.js deleted file mode 100644 index 571317b9a04..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-controller.js +++ /dev/null @@ -1,109 +0,0 @@ -(function(window) { - -var ORIGIN_ = location.protocol + '//' + location.host; - -function SlideController() { - this.popup = null; - this.isPopup = window.opener; - - if (this.setupDone()) { - window.addEventListener('message', this.onMessage_.bind(this), false); - - // Close popups if we reload the main window. - window.addEventListener('beforeunload', function(e) { - if (this.popup) { - this.popup.close(); - } - }.bind(this), false); - } -} - -SlideController.PRESENTER_MODE_PARAM = 'presentme'; - -SlideController.prototype.setupDone = function() { - var params = location.search.substring(1).split('&').map(function(el) { - return el.split('='); - }); - - var presentMe = null; - for (var i = 0, param; param = params[i]; ++i) { - if (param[0].toLowerCase() == SlideController.PRESENTER_MODE_PARAM) { - presentMe = param[1] == 'true'; - break; - } - } - - if (presentMe !== null) { - localStorage.ENABLE_PRESENTOR_MODE = presentMe; - // TODO: use window.history.pushState to update URL instead of the redirect. - if (window.history.replaceState) { - window.history.replaceState({}, '', location.pathname); - } else { - location.replace(location.pathname); - return false; - } - } - - var enablePresenterMode = localStorage.getItem('ENABLE_PRESENTOR_MODE'); - if (enablePresenterMode && JSON.parse(enablePresenterMode)) { - // Only open popup from main deck. Don't want recursive popup opening! - if (!this.isPopup) { - var opts = 'menubar=no,location=yes,resizable=yes,scrollbars=no,status=no'; - this.popup = window.open(location.href, 'mywindow', opts); - - // Loading in the popup? Trigger the hotkey for turning presenter mode on. - this.popup.addEventListener('load', function(e) { - var evt = this.popup.document.createEvent('Event'); - evt.initEvent('keydown', true, true); - evt.keyCode = 'P'.charCodeAt(0); - this.popup.document.dispatchEvent(evt); - // this.popup.document.body.classList.add('with-notes'); - // document.body.classList.add('popup'); - }.bind(this), false); - } - } - - return true; -} - -SlideController.prototype.onMessage_ = function(e) { - var data = e.data; - - // Restrict messages to being from this origin. Allow local developmet - // from file:// though. - // TODO: It would be dope if FF implemented location.origin! - if (e.origin != ORIGIN_ && ORIGIN_.indexOf('file://') != 0) { - alert('Someone tried to postMessage from an unknown origin'); - return; - } - - // if (e.source.location.hostname != 'localhost') { - // alert('Someone tried to postMessage from an unknown origin'); - // return; - // } - - if ('keyCode' in data) { - var evt = document.createEvent('Event'); - evt.initEvent('keydown', true, true); - evt.keyCode = data.keyCode; - document.dispatchEvent(evt); - } -}; - -SlideController.prototype.sendMsg = function(msg) { - // // Send message to popup window. - // if (this.popup) { - // this.popup.postMessage(msg, ORIGIN_); - // } - - // Send message to main window. - if (this.isPopup) { - // TODO: It would be dope if FF implemented location.origin. - window.opener.postMessage(msg, '*'); - } -}; - -window.SlideController = SlideController; - -})(window); - diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-deck-instantiate.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-deck-instantiate.js deleted file mode 100644 index 08b2ebdc7fd..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-deck-instantiate.js +++ /dev/null @@ -1,13 +0,0 @@ - -// Polyfill missing APIs (if we need to), then create the slide deck. -// iOS < 5 needs classList, dataset, and window.matchMedia. Modernizr contains -// the last one. -(function() { - Modernizr.load({ - test: !!document.body.classList && !!document.body.dataset, - nope: ['js/polyfills/classList.min.js', 'js/polyfills/dataset.min.js'], - complete: function() { - window.slidedeck = new SlideDeck(); - } - }); -})(); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-deck.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-deck.js deleted file mode 100644 index bc2b3360766..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-deck.js +++ /dev/null @@ -1,897 +0,0 @@ -/** - * @authors Luke Mahe - * @authors Eric Bidelman - * @fileoverview TODO - */ -document.cancelFullScreen = document.webkitCancelFullScreen || - document.mozCancelFullScreen; - -/** - * @constructor - */ -function SlideDeck(el) { - this.curSlide_ = 0; - this.prevSlide_ = 0; - this.config_ = null; - this.container = el || document.querySelector('slides'); - this.slides = []; - this.controller = null; - - this.getCurrentSlideFromHash_(); - - // Call this explicitly. Modernizr.load won't be done until after DOM load. - this.onDomLoaded_.bind(this)(); -} - -/** - * @const - * @private - */ -SlideDeck.prototype.SLIDE_CLASSES_ = [ - 'far-past', 'past', 'current', 'next', 'far-next']; - -/** - * @const - * @private - */ -SlideDeck.prototype.CSS_DIR_ = '_static/theme/css/'; - - -/** - * @private - */ -SlideDeck.prototype.findSlideById = function(title_id) { - // Return the 1-base index of the Slide with id ``title_id`` - // - // The index must be 1-based, as it's passed to code which assumes - // it was specified as the location fragment. - - slideEls = document.querySelectorAll('slides > slide'); - - for (var i = 0; i < slideEls.length; i++) { - if (slideEls.item(i).id == title_id) { - return i + 1; - } - } - - // no match on a slide, perhaps it's an explicit reference? - var - target_link = document.querySelector("span[id='" + title_id + "']"), - // XXX this is pretty strict, may need to be more flexible in the future - slide = (target_link && target_link.parentNode); - - if (slide && slide.tagName == 'SLIDE') { - return this.findSlideById(slide.id); - } - - return false; - -}; - -/** - * @private - */ -SlideDeck.prototype.getCurrentSlideFromHash_ = function() { - var slideNo = parseInt(document.location.hash.substr(1)); - - if (slideNo && isNaN(slideNo)) { - // must be a section title reference - slideNo = this.findSlideById(location.hash.substr(1)); - } - - if (slideNo) { - this.curSlide_ = slideNo - 1; - } else { - this.curSlide_ = 0; - } -}; - -/** - * @param {number} slideNo - */ -SlideDeck.prototype.loadSlide = function(slideNo) { - if (slideNo) { - this.curSlide_ = slideNo - 1; - this.updateSlides_(); - } -}; - -/** - * @private - */ -SlideDeck.prototype.onDomLoaded_ = function(e) { - document.body.classList.add('loaded'); // Add loaded class for templates to use. - - this.slides = this.container.querySelectorAll('slide:not([hidden]):not(.hidden):not(.backdrop)'); - - // If we're on a smartphone, apply special sauce. - if (Modernizr.mq('only screen and (max-device-width: 480px)')) { - // var style = document.createElement('link'); - // style.rel = 'stylesheet'; - // style.type = 'text/css'; - // style.href = this.CSS_DIR_ + 'phone.css'; - // document.querySelector('head').appendChild(style); - - // No need for widescreen layout on a phone. - this.container.classList.remove('layout-widescreen'); - } - - this.loadConfig_(SLIDE_CONFIG); - this.addEventListeners_(); - this.updateSlides_(); - - // Add slide numbers and total slide count metadata to each slide. - var that = this; - for (var i = 0, slide; slide = this.slides[i]; ++i) { - slide.dataset.slideNum = i + 1; - slide.dataset.totalSlides = this.slides.length; - - slide.addEventListener('click', function(e) { - if (document.body.classList.contains('overview')) { - that.loadSlide(this.dataset.slideNum); - e.preventDefault(); - window.setTimeout(function() { - that.toggleOverview(); - }, 500); - } - }, false); - } - - // Note: this needs to come after addEventListeners_(), which adds a - // 'keydown' listener that this controller relies on. - - // Modernizr.touch isn't a sufficient check for devices that support both - // touch and mouse. Create the controller in all cases. - // // Also, no need to set this up if we're on mobile. - // if (!Modernizr.touch) { - this.controller = new SlideController(this); - if (this.controller.isPopup) { - document.body.classList.add('popup'); - } - //} -}; - -/** - * @private - */ -SlideDeck.prototype.addEventListeners_ = function() { - document.addEventListener('keydown', this.onBodyKeyDown_.bind(this), false); - window.addEventListener('popstate', this.onPopState_.bind(this), false); - - // var transEndEventNames = { - // 'WebkitTransition': 'webkitTransitionEnd', - // 'MozTransition': 'transitionend', - // 'OTransition': 'oTransitionEnd', - // 'msTransition': 'MSTransitionEnd', - // 'transition': 'transitionend' - // }; - // - // // Find the correct transitionEnd vendor prefix. - // window.transEndEventName = transEndEventNames[ - // Modernizr.prefixed('transition')]; - // - // // When slides are done transitioning, kickoff loading iframes. - // // Note: we're only looking at a single transition (on the slide). This - // // doesn't include autobuilds the slides may have. Also, if the slide - // // transitions on multiple properties (e.g. not just 'all'), this doesn't - // // handle that case. - // this.container.addEventListener(transEndEventName, function(e) { - // this.enableSlideFrames_(this.curSlide_); - // }.bind(this), false); - - // document.addEventListener('slideenter', function(e) { - // var slide = e.target; - // window.setTimeout(function() { - // this.enableSlideFrames_(e.slideNumber); - // this.enableSlideFrames_(e.slideNumber + 1); - // }.bind(this), 300); - // }.bind(this), false); -}; - -/** - * @private - * @param {Event} e The pop event. - */ -SlideDeck.prototype.onPopState_ = function(e) { - if (e.state != null) { - this.curSlide_ = e.state; - this.updateSlides_(true); - } -}; - -/** - * @param {Event} e - */ -SlideDeck.prototype.onBodyKeyDown_ = function(e) { - if (/^(input|textarea)$/i.test(e.target.nodeName) || - e.target.isContentEditable) { - return; - } - - // Forward keydowns to the main slides if we're the popup. - if (this.controller && this.controller.isPopup) { - this.controller.sendMsg({keyCode: e.keyCode}); - } - - switch (e.keyCode) { - case 13: // Enter - if (document.body.classList.contains('overview')) { - this.toggleOverview(); - } - break; - - case 39: // right arrow - case 32: // space - case 34: // PgDn - this.nextSlide(); - e.preventDefault(); - break; - - case 37: // left arrow - case 8: // Backspace - case 33: // PgUp - this.prevSlide(); - e.preventDefault(); - break; - - case 40: // down arrow - this.nextSlide(); - e.preventDefault(); - break; - - case 38: // up arrow - this.prevSlide(); - e.preventDefault(); - break; - - case 72: // H: Toggle code highlighting - document.body.classList.toggle('highlight-code'); - break; - - case 79: // O: Toggle overview - this.toggleOverview(); - break; - - case 80: // P - if (this.controller && this.controller.isPopup) { - document.body.classList.toggle('with-notes'); - } else if (this.controller && !this.controller.popup) { - document.body.classList.toggle('with-notes'); - } - break; - - case 82: // R - // TODO: implement refresh on main slides when popup is refreshed. - break; - - case 27: // ESC: Hide notes and highlighting - document.body.classList.remove('with-notes'); - document.body.classList.remove('highlight-code'); - - if (document.body.classList.contains('overview')) { - this.toggleOverview(); - } - break; - - case 70: // F: Toggle fullscreen - // Only respect 'f' on body. Don't want to capture keys from an . - // Also, ignore browser's fullscreen shortcut (cmd+shift+f) so we don't - // get trapped in fullscreen! - if (e.target == document.body && !(e.shiftKey && e.metaKey)) { - if (document.mozFullScreen !== undefined && !document.mozFullScreen) { - document.body.mozRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); - } else if (document.webkitIsFullScreen !== undefined && !document.webkitIsFullScreen) { - document.body.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); - } else { - document.cancelFullScreen(); - } - } - break; - - case 87: // W: Toggle widescreen - // Only respect 'w' on body. Don't want to capture keys from an . - if (e.target == document.body && !(e.shiftKey && e.metaKey)) { - this.container.classList.toggle('layout-widescreen'); - } - break; - } -}; - -/** - * - */ -SlideDeck.prototype.focusOverview_ = function() { - var overview = document.body.classList.contains('overview'); - - for (var i = 0, slide; slide = this.slides[i]; i++) { - slide.style[Modernizr.prefixed('transform')] = overview ? - 'translateZ(-2500px) translate(' + (( i - this.curSlide_ ) * 105) + - '%, 0%)' : ''; - } -}; - -/** - */ -SlideDeck.prototype.toggleOverview = function() { - document.body.classList.toggle('overview'); - - this.focusOverview_(); -}; - -/** - * @private - */ -SlideDeck.prototype.loadConfig_ = function(config) { - if (!config) { - return; - } - - this.config_ = config; - - var settings = this.config_.settings; - - this.loadTheme_(settings.theme || []); - - if (settings.favIcon) { - this.addFavIcon_(settings.favIcon); - } - - // Prettyprint. Default to on. - if (!!!('usePrettify' in settings) || settings.usePrettify) { - prettyPrint(); - } - - if (settings.analytics) { - this.loadAnalytics_(); - } - - if (settings.fonts) { - this.addFonts_(settings.fonts); - } - - // Builds. Default to on. - if (!!!('useBuilds' in settings) || settings.useBuilds) { - this.makeBuildLists_(); - } - - if (settings.title) { - document.title = settings.title.replace(//, ' '); - if (settings.eventInfo && settings.eventInfo.title) { - document.title += ' - ' + settings.eventInfo.title; - } - document.querySelector('[data-config-title]').innerHTML = settings.title; - } - - if (settings.subtitle) { - document.querySelector('[data-config-subtitle]').innerHTML = settings.subtitle; - } - - if (this.config_.presenters) { - var presenters = this.config_.presenters; - var dataConfigContact = document.querySelector('[data-config-contact]'); - - var html = []; - if (presenters.length == 1) { - var p = presenters[0]; - - var presenterTitle = [p.name]; - if (p.company) { - presenterTitle.push(p.company); - } - html = presenterTitle.join(' - ') + '
'; - - var gplus = p.gplus ? 'g+' + p.gplus.replace(/https?:\/\//, '') + '' : ''; - - var twitter = p.twitter ? 'twitter' + - '' + - p.twitter + '' : ''; - - var www = p.www ? 'www' + p.www.replace(/https?:\/\//, '') + '' : ''; - - var github = p.github ? 'github' + p.github.replace(/https?:\/\//, '') + '' : ''; - - var html2 = [gplus, twitter, www, github].join('
'); - - if (dataConfigContact) { - dataConfigContact.innerHTML = html2; - } - } else { - for (var i = 0, p; p = presenters[i]; ++i) { - html.push(p.name + ' - ' + p.company); - } - html = html.join('
'); - if (dataConfigContact) { - dataConfigContact.innerHTML = html; - } - } - - var dataConfigPresenter = document.querySelector('[data-config-presenter]'); - if (dataConfigPresenter) { - dataConfigPresenter.innerHTML = html; - if (settings.eventInfo) { - var date = settings.eventInfo.date; - var dateInfo = date ? ' - ' : ''; - dataConfigPresenter.innerHTML += settings.eventInfo.title + dateInfo; - } - } - } - - /* Left/Right tap areas. Default to including. */ - if (!!!('enableSlideAreas' in settings) || settings.enableSlideAreas) { - var el = document.createElement('div'); - el.classList.add('slide-area'); - el.id = 'prev-slide-area'; - el.addEventListener('click', this.prevSlide.bind(this,undefined), false); - this.container.appendChild(el); - - var el = document.createElement('div'); - el.classList.add('slide-area'); - el.id = 'next-slide-area'; - el.addEventListener('click', this.nextSlide.bind(this,undefined), false); - this.container.appendChild(el); - } - - if (Modernizr.touch && (!!!('enableTouch' in settings) || - settings.enableTouch)) { - var self = this; - - // Note: this prevents mobile zoom in/out but prevents iOS from doing - // it's crazy scroll over effect and disaligning the slides. - window.addEventListener('touchstart', function(e) { - e.preventDefault(); - }, false); - - var hammer = new Hammer(this.container); - hammer.ondragend = function(e) { - if (e.direction == 'right' || e.direction == 'down') { - self.prevSlide(); - } else if (e.direction == 'left' || e.direction == 'up') { - self.nextSlide(); - } - }; - } -}; - -/** - * @private - * @param {Array.} fonts - */ -SlideDeck.prototype.addFonts_ = function(fonts) { - var el = document.createElement('link'); - el.rel = 'stylesheet'; - el.href = ('https:' == document.location.protocol ? 'https' : 'http') + - '://fonts.googleapis.com/css?family=' + fonts.join('|') + '&v2'; - document.querySelector('head').appendChild(el); -}; - -/** - * @private - */ -SlideDeck.prototype.buildNextBuildItem_ = function() { - var slide = this.slides[this.curSlide_]; - var toBuild = slide.querySelector('.to-build'); - var built = slide.querySelector('.build-current'); - - if (built) { - built.classList.remove('build-current'); - if (built.classList.contains('fade')) { - built.classList.add('build-fade'); - } - } - - if (!toBuild) { - var items = slide.querySelectorAll('.build-fade'); - for (var j = 0, item; item = items[j]; j++) { - item.classList.remove('build-fade'); - } - return false; - } - - toBuild.classList.remove('to-build'); - toBuild.classList.add('build-current'); - - return true; -}; - -SlideDeck.prototype.buildNextItem_ = function() { - - var slide = this.slides[this.curSlide_]; - var built = slide.querySelectorAll('.build-current'); - - var buildItems = slide.querySelectorAll('[class*="build-item-"]'); - var show_items; - - // Remove the classes from the previously built item - if (built) { - for (var j = 0, built_item; built_item = built[j]; ++j) { - built_item.classList.remove('build-current'); - if (built_item.classList.contains('fade')) { - built_item.classList.add('build-fade'); - } - - if (built_item.getAttribute('data-build-show-only')) { - - if (built_item.getAttribute('data-build-class')) { - built_item.classList.remove( - built_item.getAttribute('data-build-class') - ); - } else { - built_item.classList.add('build-hide'); - } - } - }; - } - - if (slide._buildItems && slide._buildItems.length) { - while ((show_items = slide._buildItems.shift()) === undefined) {}; - if (show_items) { - - // show the next items - show_items.forEach(function(item, index, items) { - item.classList.remove('to-build'); - item.classList.add('build-current'); - - if (item.getAttribute('data-build-class')) { - item.classList.add(item.getAttribute('data-build-class')); - } - }); - - return true; - } - } - - return this.buildNextBuildItem_(); - -}; - -/** - * @param {boolean=} opt_dontPush - */ -SlideDeck.prototype.prevSlide = function(opt_dontPush) { - if (this.curSlide_ > 0) { - var bodyClassList = document.body.classList; - bodyClassList.remove('highlight-code'); - - // Toggle off speaker notes if they're showing when we move backwards on the - // main slides. If we're the speaker notes popup, leave them up. - if (this.controller && !this.controller.isPopup) { - bodyClassList.remove('with-notes'); - } else if (!this.controller) { - bodyClassList.remove('with-notes'); - } - - this.prevSlide_ = this.curSlide_--; - - this.updateSlides_(opt_dontPush); - } -}; - -/** - * @param {boolean=} opt_dontPush - */ -SlideDeck.prototype.nextSlide = function(opt_dontPush) { - if (!document.body.classList.contains('overview') && this.buildNextItem_()) { - return; - } - - if (this.curSlide_ < this.slides.length - 1) { - var bodyClassList = document.body.classList; - bodyClassList.remove('highlight-code'); - - // Toggle off speaker notes if they're showing when we advanced on the main - // slides. If we're the speaker notes popup, leave them up. - if (this.controller && !this.controller.isPopup) { - bodyClassList.remove('with-notes'); - } else if (!this.controller) { - bodyClassList.remove('with-notes'); - } - - this.prevSlide_ = this.curSlide_++; - - this.updateSlides_(opt_dontPush); - } -}; - -/* Slide events */ - -/** - * Triggered when a slide enter/leave event should be dispatched. - * - * @param {string} type The type of event to trigger - * (e.g. 'slideenter', 'slideleave'). - * @param {number} slideNo The index of the slide that is being left. - */ -SlideDeck.prototype.triggerSlideEvent = function(type, slideNo) { - var el = this.getSlideEl_(slideNo); - if (!el) { - return; - } - - // Call onslideenter/onslideleave if the attribute is defined on this slide. - var func = el.getAttribute(type); - if (func) { - new Function(func).call(el); // TODO: Don't use new Function() :( - } - - // Dispatch event to listeners setup using addEventListener. - var evt = document.createEvent('Event'); - evt.initEvent(type, true, true); - evt.slideNumber = slideNo + 1; // Make it readable - evt.slide = el; - - el.dispatchEvent(evt); -}; - -/** - * @private - */ -SlideDeck.prototype.updateSlides_ = function(opt_dontPush) { - var dontPush = opt_dontPush || false; - - var curSlide = this.curSlide_; - for (var i = 0; i < this.slides.length; ++i) { - switch (i) { - case curSlide - 2: - this.updateSlideClass_(i, 'far-past'); - break; - case curSlide - 1: - this.updateSlideClass_(i, 'past'); - break; - case curSlide: - this.updateSlideClass_(i, 'current'); - break; - case curSlide + 1: - this.updateSlideClass_(i, 'next'); - break; - case curSlide + 2: - this.updateSlideClass_(i, 'far-next'); - break; - default: - this.updateSlideClass_(i); - break; - } - }; - - this.triggerSlideEvent('slideleave', this.prevSlide_); - this.triggerSlideEvent('slideenter', curSlide); - -// window.setTimeout(this.disableSlideFrames_.bind(this, curSlide - 2), 301); -// -// this.enableSlideFrames_(curSlide - 1); // Previous slide. -// this.enableSlideFrames_(curSlide + 1); // Current slide. -// this.enableSlideFrames_(curSlide + 2); // Next slide. - - // Enable current slide's iframes (needed for page loat at current slide). - this.enableSlideFrames_(curSlide + 1); - - // No way to tell when all slide transitions + auto builds are done. - // Give ourselves a good buffer to preload the next slide's iframes. - window.setTimeout(this.enableSlideFrames_.bind(this, curSlide + 2), 1000); - - this.updateHash_(dontPush); - - if (document.body.classList.contains('overview')) { - this.focusOverview_(); - return; - } - -}; - -/** - * @private - * @param {number} slideNo - */ -SlideDeck.prototype.enableSlideFrames_ = function(slideNo) { - var el = this.slides[slideNo - 1]; - if (!el) { - return; - } - - var frames = el.querySelectorAll('iframe'); - for (var i = 0, frame; frame = frames[i]; i++) { - this.enableFrame_(frame); - } -}; - -/** - * @private - * @param {number} slideNo - */ -SlideDeck.prototype.enableFrame_ = function(frame) { - var src = frame.dataset.src; - if (src && frame.src != src) { - frame.src = src; - } -}; - -/** - * @private - * @param {number} slideNo - */ -SlideDeck.prototype.disableSlideFrames_ = function(slideNo) { - var el = this.slides[slideNo - 1]; - if (!el) { - return; - } - - var frames = el.querySelectorAll('iframe'); - for (var i = 0, frame; frame = frames[i]; i++) { - this.disableFrame_(frame); - } -}; - -/** - * @private - * @param {Node} frame - */ -SlideDeck.prototype.disableFrame_ = function(frame) { - frame.src = 'about:blank'; -}; - -/** - * @private - * @param {number} slideNo - */ -SlideDeck.prototype.getSlideEl_ = function(no) { - if ((no < 0) || (no >= this.slides.length)) { - return null; - } else { - return this.slides[no]; - } -}; - -/** - * @private - * @param {number} slideNo - * @param {string} className - */ -SlideDeck.prototype.updateSlideClass_ = function(slideNo, className) { - var el = this.getSlideEl_(slideNo); - - if (!el) { - return; - } - - if (className) { - el.classList.add(className); - } - - for (var i = 0, slideClass; slideClass = this.SLIDE_CLASSES_[i]; ++i) { - if (className != slideClass) { - el.classList.remove(slideClass); - } - } -}; - -/** - * @private - */ -SlideDeck.prototype.BUILD_ITEM_RE = /build-item-(\d+)(-class-(\w+))?(-only)?/; - -SlideDeck.prototype.makeBuildLists_ = function () { - for (var i = this.curSlide_, slide; slide = this.slides[i]; ++i) { - var items = slide.querySelectorAll('.build > *'); - - for (var j = 0, item; item = items[j]; ++j) { - if (item.classList) { - item.classList.add('to-build'); - if (item.parentNode.classList.contains('fade')) { - item.classList.add('fade'); - } - } - } - - var items = slide.querySelectorAll('[class*="build-item-"]'); - if (items.length) { - slide._buildItems = []; - }; - for (var j = 0, item; item = items[j]; ++j) { - if (item.classList) { - item.classList.add('to-build'); - if (!item.parentNode.classList.contains('build')) { - item.parentNode.classList.add('build'); - } - if (item.parentNode.classList.contains('fade')) { - item.classList.add('fade'); - } - } - - var build_info = this.BUILD_ITEM_RE.exec(item.classList), - build_index = build_info[1], - build_class = build_info[3], - build_only = build_info[4]; - - if (slide._buildItems[build_index] === undefined) { - slide._buildItems[build_index] = []; - } - slide._buildItems[build_index].push(item); - - if (build_class) { - item.setAttribute('data-build-class', build_class); - } - - if (build_only) { - // add the data-attribute - item.setAttribute('data-build-show-only', build_index); - } - - } - - } -}; - -/** - * @private - * @param {boolean} dontPush - */ -SlideDeck.prototype.updateHash_ = function(dontPush) { - if (!dontPush) { - var slideNo = this.curSlide_ + 1; - var hash = '#' + slideNo; - if (window.history.pushState) { - window.history.pushState(this.curSlide_, 'Slide ' + slideNo, hash); - } else { - window.location.replace(hash); - } - - // Record GA hit on this slide. - window['_gaq'] && window['_gaq'].push(['_trackPageview', - document.location.href]); - } -}; - - -/** - * @private - * @param {string} favIcon - */ -SlideDeck.prototype.addFavIcon_ = function(favIcon) { - var el = document.createElement('link'); - el.rel = 'icon'; - el.type = 'image/png'; - el.href = favIcon; - document.querySelector('head').appendChild(el); -}; - -/** - * @private - * @param {string} theme - */ -SlideDeck.prototype.loadTheme_ = function(theme) { - var styles = []; - if (theme.constructor.name === 'String') { - styles.push(theme); - } else { - styles = theme; - } - - for (var i = 0, style; themeUrl = styles[i]; i++) { - var style = document.createElement('link'); - style.rel = 'stylesheet'; - style.type = 'text/css'; - if (themeUrl.indexOf('http') == -1) { - style.href = this.CSS_DIR_ + themeUrl + '.css'; - } else { - style.href = themeUrl; - } - document.querySelector('head').appendChild(style); - } -}; - -/** - * @private - */ -SlideDeck.prototype.loadAnalytics_ = function() { - var _gaq = window['_gaq'] || []; - _gaq.push(['_setAccount', this.config_.settings.analytics]); - _gaq.push(['_trackPageview']); - - (function() { - var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; - ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); - })(); -}; diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-testing.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-testing.js deleted file mode 100644 index def9cb1b014..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slide-testing.js +++ /dev/null @@ -1,6 +0,0 @@ -require(['order!modernizr.custom.45394', - 'order!prettify/prettify', 'order!hammer', 'order!slide-controller', - 'order!slide-deck', - 'order!slide-deck-instantiate'], function(someModule) { - -}); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slides.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slides.js deleted file mode 100644 index ba5a3699362..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/js/slides.js +++ /dev/null @@ -1,6 +0,0 @@ -require(['order!../slide_config', 'order!modernizr.custom.45394', - 'order!prettify/prettify', 'order!hammer', 'order!slide-controller', - 'order!slide-deck', - 'order!slide-deck-instantiate'], function(someModule) { - -}); diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/slide_config.js b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/slide_config.js deleted file mode 100644 index 0d9b7c6f4d9..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/slide_config.js +++ /dev/null @@ -1,40 +0,0 @@ -var SLIDE_CONFIG = { - // Slide settings - settings: { - title: 'Title Goes Here
Up To Two Lines', - subtitle: 'Subtitle Goes Here', - //eventInfo: { - // title: 'Google I/O', - // date: '6/x/2013' - //}, - useBuilds: true, // Default: true. False will turn off slide animation builds. - usePrettify: true, // Default: true - enableSlideAreas: true, // Default: true. False turns off the click areas on either slide of the slides. - enableTouch: true, // Default: true. If touch support should enabled. Note: the device must support touch. - //analytics: 'UA-XXXXXXXX-1', // TODO: Using this breaks GA for some reason (probably requirejs). Update your tracking code in template.html instead. - favIcon: 'images/google_developers_logo_tiny.png', - fonts: [ - 'Open Sans:regular,semibold,italic,italicsemibold', - 'Source Code Pro' - ], - //theme: ['mytheme'], // Add your own custom themes or styles in /theme/css. Leave off the .css extension. - }, - - // Author information - presenters: [{ - name: 'Firstname Lastname', - company: 'Job Title
Google', - gplus: 'http://plus.google.com/1234567890', - twitter: '@yourhandle', - www: 'http://www.you.com', - github: 'http://github.com/you' - }/*, { - name: 'Second Name', - company: 'Job Title, Google', - gplus: 'http://plus.google.com/1234567890', - twitter: '@yourhandle', - www: 'http://www.you.com', - github: 'http://github.com/you' - }*/] -}; - diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/slide_config.js_t b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/slide_config.js_t deleted file mode 100644 index 62339175d84..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/slide_config.js_t +++ /dev/null @@ -1,27 +0,0 @@ -var SLIDE_CONFIG = { - // Slide settings - settings: { - title: '{{ docstitle|e }}', - subtitle: '{{ theme_subtitle|e }}', - //eventInfo: { - // title: 'Google I/O', - // date: '6/x/2013' - //}, - useBuilds: {{ theme_use_builds }}, // Default: true. False will turn off slide animation builds. - usePrettify: {{ theme_use_prettify }}, // Default: true - enableSlideAreas: {{ theme_enable_slide_areas }}, // Default: true. False turns off the click areas on either slide of the slides. - enableTouch: {{ theme_enable_touch }}, // Default: true. If touch support should enabled. Note: the device must support touch. - //analytics: 'UA-XXXXXXXX-1', // TODO: Using this breaks GA for some reason (probably requirejs). Update your tracking code in template.html instead. - favIcon: {{ theme_favicon }}, - fonts: [ - 'Open Sans:regular,semibold,italic,italicsemibold', - 'Source Code Pro' - ], - //theme: ['mytheme'], // Add your own custom themes or styles in /theme/css. Leave off the .css extension. - }, - - // Author information - presenters: {% if theme_presenters %}{{ theme_presenters|json }} - {% else %}[] - {% endif %} -}; diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/default.css b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/default.css deleted file mode 100644 index dad8b305ed6..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/default.css +++ /dev/null @@ -1,1794 +0,0 @@ -@charset "UTF-8"; -/* line 5, ../../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font: inherit; - vertical-align: baseline; -} - -/* line 22, ../../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ -html { - line-height: 1; -} - -/* line 24, ../../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ -/*ol, ul { - list-style: none; -}*/ - -/* line 26, ../../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ -table { - border-collapse: collapse; - border-spacing: 0; -} - -/* line 28, ../../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ -caption, th, td { - text-align: left; - font-weight: normal; - vertical-align: middle; -} - -/* line 30, ../../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ -q { - quotes: none; - margin-left: 2%; - margin-right:2%; -} -/* line 103, ../../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ -q:before, q:after, blockquote:before, blockquote:after { - content: ""; - content: none; -} - -/* line 32, ../../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ -a img { - border: none; - display: block; - margin-left: auto; - margin-right: auto; -} - -/* line 116, ../../../../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */ -article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { - display: block; -} - -/** - * Base SlideDeck Styles - */ -/* line 52, ../scss/_base.scss */ -html { - height: 100%; - overflow: hidden; -} - -/* line 57, ../scss/_base.scss */ -body { - margin: 0; - padding: 0; - opacity: 0; - height: 100%; - min-height: 740px; - width: 100%; - overflow: hidden; - color: #fff; - -webkit-font-smoothing: antialiased; - -moz-font-smoothing: antialiased; - -ms-font-smoothing: antialiased; - -o-font-smoothing: antialiased; - -moz-transition: opacity 800ms ease-in 100ms; - -o-transition: opacity 800ms ease-in 100ms; - -webkit-transition: opacity 800ms ease-in; - -webkit-transition-delay: 100ms; - transition: opacity 800ms ease-in 100ms; - /*font-size: 2.2vmin;*/ -} -/* line 73, ../scss/_base.scss */ -body.loaded { - opacity: 1 !important; -} - -/* line 78, ../scss/_base.scss */ -input, button { - vertical-align: middle; -} - -/* line 82, ../scss/_base.scss */ -slides > slide[hidden] { - display: none !important; -} - -/* line 86, ../scss/_base.scss */ -slides { - width: 100vw; - height: 56.25vw; - max-height: 100vh; - max-width: 177.78vh; - bottom: auto; - right: auto; - transform: translate(-50%, -50%); - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - margin: auto; - -moz-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - -moz-perspective: 1000; - -webkit-perspective: 1000; - perspective: 1000; - -moz-transform-style: preserve-3d; - -webkit-transform-style: preserve-3d; - transform-style: preserve-3d; - -moz-transition: opacity 800ms ease-in 100ms; - -o-transition: opacity 800ms ease-in 100ms; - -webkit-transition: opacity 800ms ease-in; - -webkit-transition-delay: 100ms; - transition: opacity 800ms ease-in 100ms; - font-size: 14px; -} - -/* line 98, ../scss/_base.scss */ -slides > slide { - display: block; - position: absolute; - overflow: hidden; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -/* Slide styles */ -/*article.fill iframe { - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - - border: 0; - margin: 0; - - @include border-radius(10px); - - z-index: -1; -} - -slide.fill { - background-repeat: no-repeat; - @include background-size(cover); -} - -slide.fill img { - position: absolute; - left: 0; - top: 0; - min-width: 100%; - min-height: 100%; - - z-index: -1; -} -*/ -/** - * Theme Styles - */ -/* line 22, ../scss/default.scss */ -::selection { - color: white; - background-color: #ffd14d; - text-shadow: none; -} - -/* line 28, ../scss/default.scss */ -::-webkit-scrollbar { - height: 16px; - overflow: visible; - width: 16px; -} - -/* line 33, ../scss/default.scss */ -::-webkit-scrollbar-thumb { - background-color: rgba(0, 0, 0, 0.1); - background-clip: padding-box; - border: solid transparent; - min-height: 28px; - padding: 100px 0 0; - -moz-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.07); - -webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.07); - box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.07); - border-width: 1px 1px 1px 6px; -} - -/* line 42, ../scss/default.scss */ -::-webkit-scrollbar-thumb:hover { - background-color: rgba(0, 0, 0, 0.5); -} - -/* line 45, ../scss/default.scss */ -::-webkit-scrollbar-button { - height: 0; - width: 0; -} - -/* line 49, ../scss/default.scss */ -::-webkit-scrollbar-track { - background-clip: padding-box; - border: solid transparent; - border-width: 0 0 0 4px; -} - -/* line 54, ../scss/default.scss */ -::-webkit-scrollbar-corner { - background: transparent; -} - -/* line 58, ../scss/default.scss */ -body { - background: black; -} - -/* line 62, ../scss/default.scss */ -slides > slide { - display: none; - font-family: 'Lato', sans-serif; - font-size: 2em; - color: #797979; - padding: 5%; - -moz-transition: all 0.6s ease-in-out; - -o-transition: all 0.6s ease-in-out; - /*-webkit-transition: all 0.6s ease-in-out; - transition: all 0.6s ease-in-out;*/ - /*overflow: auto;*/ -} -/* line 83, ../scss/default.scss */ -slides > slide.far-past { - display: none; -} -/* line 90, ../scss/default.scss */ -slides > slide.past { - display: block; - opacity: 0; -} -/* line 97, ../scss/default.scss */ -slides > slide.current { - display: block; - opacity: 1; -} -/* line 103, ../scss/default.scss */ -slides > slide.current .auto-fadein { - opacity: 1; -} -/* line 107, ../scss/default.scss */ -slides > slide.current .gdbar { - -moz-background-size: 100% 100%; - -o-background-size: 100% 100%; - -webkit-background-size: 100% 100%; - background-size: 100% 100%; -} -/* line 112, ../scss/default.scss */ -slides > slide.next { - /*display: block;*/ - display: none; - opacity: 0; - pointer-events: none; -} -/* line 120, ../scss/default.scss */ -slides > slide.far-next { - display: none; -} -/* line 127, ../scss/default.scss */ -slides > slide.dark { - background: #515151 !important; -} -/* line 135, ../scss/default.scss */ -slides > slide:not(.nobackground):before { - font-size: 1em; - content: ""; - position: absolute; - bottom: 20px; - left: 60px; - -moz-background-size: 30px 30px; - -o-background-size: 30px 30px; - -webkit-background-size: 30px 30px; - background-size: 30px 30px; - padding-left: 40px; - height: 30px; - line-height: 1.9; -} -/* line 147, ../scss/default.scss */ -slides > slide:not(.nobackground):after { - font-size: 0.5em; - content: attr(data-slide-num) "/" attr(data-total-slides); - position: fixed; - bottom: 20px; - right: 20px; - line-height: 1.9; -} -/* line 158, ../scss/default.scss */ -slides > slide.title-slide:after { - content: ''; - position: absolute; - bottom: 40px; - right: 40px; - width: 100%; - height: 60px; -} -/* line 170, ../scss/default.scss */ -slides > slide.backdrop { - z-index: -10; - display: block !important; - background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iODUlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZTZlNmU2Ii8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmFkKSIgLz48L3N2Zz4g'); - background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(85%, #ffffff), color-stop(100%, #e6e6e6)); - background: -moz-linear-gradient(#ffffff, #ffffff 85%, #e6e6e6); - background: -webkit-linear-gradient(#ffffff, #ffffff 85%, #e6e6e6); - background: linear-gradient(#ffffff, #ffffff 85%, #e6e6e6); - background-color: white; -} -/* line 175, ../scss/default.scss */ -slides > slide.backdrop:after, slides > slide.backdrop:before { - display: none; -} -/* line 180, ../scss/default.scss */ -/*slides > slide > hgroup + article { - margin-top: 45px; -}*/ -/* line 184, ../scss/default.scss */ -slides > slide > hgroup + article.flexbox.vcenter, slides > slide > hgroup + article.flexbox.vleft, slides > slide > hgroup + article.flexbox.vright { - height: 80%; -} -/* line 189, ../scss/default.scss */ -slides > slide > hgroup + article p { - margin-bottom: 0.5em; - line-height: initial; -} -/* line 194, ../scss/default.scss */ -slides > slide > article:only-child { - height: 100%; -} -/* line 197, ../scss/default.scss */ -slides > slide > article:only-child > iframe { - height: 98%; -} - -/* line 203, ../scss/default.scss */ -slides.layout-faux-widescreen > slide { - padding: 40px 160px; -} - -/* line 212, ../scss/default.scss */ -slides.layout-widescreen > slide, -slides.layout-faux-widescreen > slide { - width: 100%; - /*overflow: auto;*/ -} -/* line 217, ../scss/default.scss */ -slides.layout-widescreen > slide.far-past, -slides.layout-faux-widescreen > slide.far-past { - display: block; - display: none; - -moz-transform: translate(-2260px); - -ms-transform: translate(-2260px); - -webkit-transform: translate(-2260px); - transform: translate(-2260px); - -moz-transform: translate3d(-2260px, 0, 0); - -ms-transform: translate3d(-2260px, 0, 0); - -webkit-transform: translate3d(-2260px, 0, 0); - transform: translate3d(-2260px, 0, 0); -} -/* line 224, ../scss/default.scss */ -slides.layout-widescreen > slide.past, -slides.layout-faux-widescreen > slide.past { - display: block; - opacity: 0; -} -/* line 231, ../scss/default.scss */ -slides.layout-widescreen > slide.current, -slides.layout-faux-widescreen > slide.current { - display: block; - opacity: 1; -} -/* line 238, ../scss/default.scss */ -slides.layout-widescreen > slide.next, -slides.layout-faux-widescreen > slide.next { - /*display: block;*/ - opacity: 0; - pointer-events: none; -} -/* line 246, ../scss/default.scss */ -slides.layout-widescreen > slide.far-next, -slides.layout-faux-widescreen > slide.far-next { - display: block; - display: none; - -moz-transform: translate(2260px); - -ms-transform: translate(2260px); - -webkit-transform: translate(2260px); - transform: translate(2260px); - -moz-transform: translate3d(2260px, 0, 0); - -ms-transform: translate3d(2260px, 0, 0); - -webkit-transform: translate3d(2260px, 0, 0); - transform: translate3d(2260px, 0, 0); -} -/* line 253, ../scss/default.scss */ -slides.layout-widescreen #prev-slide-area, -slides.layout-faux-widescreen #prev-slide-area { - margin-left: -650px; -} -/* line 257, ../scss/default.scss */ -slides.layout-widescreen #next-slide-area, -slides.layout-faux-widescreen #next-slide-area { - margin-left: 550px; -} - -/* line 262, ../scss/default.scss */ -b { - font-weight: 600; -} - -/* line 266, ../scss/default.scss */ -a { - color: #5c31ff;; - text-decoration: none; - border-bottom: 1px solid rgba(42, 124, 223, 0.5); -} -/* line 271, ../scss/default.scss */ -a:hover { - color: black !important; -} - -/* line 276, ../scss/default.scss */ -h1, h2, h3 { - font-weight: 600; - color: #5c31ff; -} - -h1, h2 { - font-size: 1.5em; - font-family: 'Work Sans', sans-serif; -} -/* line 280, ../scss/default.scss */ -/*h2 { - font-size: 2em; - line-height: 45px; - letter-spacing: -2px; - color: #515151; -}*/ - -/* line 287, ../scss/default.scss */ -h3 { - font-size: 1.6em; - letter-spacing: -1px; - line-height: 2; - font-weight: inherit; - color: #797979; -} - -/* line 295, ../scss/default.scss */ -ul { - margin-left: 2.2em; - margin-bottom: 1em; - position: relative; - width: 90%; -} -/* line 300, ../scss/default.scss */ -ul li { - margin-bottom: 0.5em; - color: black; - line-height: 1.4em; -} -/* line 303, ../scss/default.scss */ -ul li ul { - margin-left: 2em; - margin-bottom: 0; -} -/* line 307, ../scss/default.scss */ -/*ul li ul li:before { - content: '-'; - font-weight: 600; -}*/ -/* line 314, ../scss/default.scss */ -/*ul > li:before { - content: '\00B7'; - margin-left: -0.5em; - position: absolute; - font-weight: 600; - font-size: 2em; -}*/ -/* line 321, ../scss/default.scss */ -/*ul ul { - margin-top: .5em; -}*/ - -/* line 328, ../scss/default.scss */ -.highlight-code slide.current pre > * { - opacity: 0.25; - -moz-transition: opacity 0.5s ease-in; - -o-transition: opacity 0.5s ease-in; - -webkit-transition: opacity 0.5s ease-in; - transition: opacity 0.5s ease-in; -} -/* line 332, ../scss/default.scss */ -.highlight-code slide.current b { - opacity: 1; -} - -/* line 337, ../scss/default.scss */ -pre { - font-family: 'consolas', 'Courier New', monospace; - font-size: 0.8em; - line-height: 1.2em; - /*padding: 0.8em;*/ - margin-bottom: 0.5em; - /*background-color: #e6e6e6;*/ - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: auto; - white-space: pre-wrap; -} - -/* line 351, ../scss/default.scss */ -pre[data-lang]:after { - content: attr(data-lang); - /*background-color: #a9a9a9;*/ - right: 0; - top: 0; - position: absolute; - font-size: 1em; - color: white; - padding: 2px 25px; - text-transform: uppercase; -} - -/* line 364, ../scss/default.scss */ -pre[data-lang="go"] { - color: #333; -} - -/* line 368, ../scss/default.scss */ -code { - font-size: 95%; - font-family: 'Consolas', 'Courier New', monospace; - color: black; -} - -/* line 374, ../scss/default.scss */ -iframe { - width: 100%; - height: 530px; - background: white; - border: 1px solid #e6e6e6; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -/* line 382, ../scss/default.scss */ -dt { - font-weight: bold; -} - -/* line 386, ../scss/default.scss */ -button { - display: inline-block; - padding: 5px 8px; - outline: none; - white-space: nowrap; - -moz-user-select: -moz-none; - -ms-user-select: none; - -webkit-user-select: none; - user-select: none; - cursor: pointer; - text-shadow: 1px 1px #fff; -} - -/* line 400, ../scss/default.scss */ -button:not(:disabled):hover { - border-color: #515151; -} - -/* line 404, ../scss/default.scss */ -button:not(:disabled):active { - background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSI0MCUiIHN0b3AtY29sb3I9IiNlM2UzZTMiLz48c3RvcCBvZmZzZXQ9IjcwJSIgc3RvcC1jb2xvcj0iI2Y5ZjlmOSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); - background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, #e3e3e3), color-stop(70%, #f9f9f9)); - background: -moz-linear-gradient(#e3e3e3 40%, #f9f9f9 70%); - background: -webkit-linear-gradient(#e3e3e3 40%, #f9f9f9 70%); - background: linear-gradient(#e3e3e3 40%, #f9f9f9 70%); -} - -/* line 408, ../scss/default.scss */ -:disabled { - color: #a9a9a9; -} - -/* line 412, ../scss/default.scss */ -.blue { - color: #4387fd; -} - -/* line 415, ../scss/default.scss */ -.blue2 { - color: #3c8ef3; -} - -/* line 418, ../scss/default.scss */ -.blue3 { - color: #2a7cdf; -} - -/* line 421, ../scss/default.scss */ -.yellow { - color: #ffd14d; -} - -/* line 424, ../scss/default.scss */ -.yellow2 { - color: #f9cc46; -} - -/* line 427, ../scss/default.scss */ -.yellow3 { - color: #f6c000; -} - -/* line 430, ../scss/default.scss */ -.green { - color: #0da861; -} - -/* line 433, ../scss/default.scss */ -.green2 { - color: #00a86d; -} - -/* line 436, ../scss/default.scss */ -.green3 { - color: #009f5d; -} - -/* line 439, ../scss/default.scss */ -.red { - color: #f44a3f; -} - -/* line 442, ../scss/default.scss */ -.red2 { - color: #e0543e; -} - -/* line 445, ../scss/default.scss */ -.red3 { - color: #d94d3a; -} - -/* line 448, ../scss/default.scss */ -.gray { - color: #e6e6e6; -} - -/* line 451, ../scss/default.scss */ -.gray2 { - color: #a9a9a9; -} - -/* line 454, ../scss/default.scss */ -.gray3 { - color: #797979; -} - -/* line 457, ../scss/default.scss */ -.gray4 { - color: #515151; -} - -/* line 461, ../scss/default.scss */ -.white { - color: white !important; -} - -/* line 464, ../scss/default.scss */ -.black { - color: black !important; -} - -/* line 468, ../scss/default.scss */ -.columns-2 { - -moz-column-count: 2; - -webkit-column-count: 2; - column-count: 2; -} - -/* line 472, ../scss/default.scss */ -table { - width: 100%; - border-collapse: -moz-initial; - border-collapse: initial; - border-spacing: 2px; - border-bottom: 1px solid #797979; -} -/* line 479, ../scss/default.scss */ -table tr > td:first-child, table th { - font-weight: 600; - color: #515151; -} -/* line 484, ../scss/default.scss */ -table tr:nth-child(odd) { - background-color: #e6e6e6; -} -/* line 488, ../scss/default.scss */ -table th { - color: white; - font-size: 1em; - background: grey; -} -/* line 494, ../scss/default.scss */ -table td, table th { - font-size: 1em; - padding: 1em 0.5em; -} -/* line 499, ../scss/default.scss */ -table td.highlight { - color: #515151; - background: grey; -} -/* line 504, ../scss/default.scss */ -table.rows { - border-bottom: none; - border-right: 1px solid #797979; -} -table td { - background: white; -} - -/* line 510, ../scss/default.scss */ -q { - font-size: 2em; - line-height: 72px; -} -/* line 514, ../scss/default.scss */ -q:before { - content: '“'; - position: absolute; - margin-left: -0.5em; -} -/* line 519, ../scss/default.scss */ -q:after { - content: '”'; - position: absolute; - margin-left: 0.1em; -} - -/* line 526, ../scss/default.scss */ -slide.fill { - background-repeat: no-repeat; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - -moz-background-size: cover; - -o-background-size: cover; - -webkit-background-size: cover; - background-size: cover; -} - -/* Size variants */ -/* line 535, ../scss/default.scss */ -article.smaller p, article.smaller ul { - font-size: 20px; - line-height: 24px; - letter-spacing: 0; -} -/* line 541, ../scss/default.scss */ -article.smaller table td, article.smaller table th { - font-size: 14px; -} -/* line 545, ../scss/default.scss */ -article.smaller pre { - font-size: 15px; - line-height: 20px; - letter-spacing: 0; -} -/* line 550, ../scss/default.scss */ -article.smaller q { - font-size: 40px; - line-height: 48px; -} -/* line 554, ../scss/default.scss */ -article.smaller q:before, article.smaller q:after { - font-size: 60px; -} - -/* Builds */ -/* line 563, ../scss/default.scss */ -.build > * { - -moz-transition: opacity 0.5s ease-in-out 0.2s; - -o-transition: opacity 0.5s ease-in-out 0.2s; - -webkit-transition: opacity 0.5s ease-in-out; - -webkit-transition-delay: 0.2s; - transition: opacity 0.5s ease-in-out 0.2s; -} -/* line 567, ../scss/default.scss */ -.build .to-build { - opacity: 0; -} -/* line 571, ../scss/default.scss */ -.build .build-fade { - opacity: 0.3; -} -/* line 574, ../scss/default.scss */ -.build .build-fade:hover { - opacity: 1.0; -} - -/* line 581, ../scss/default.scss */ -.popup .next .build .to-build { - opacity: 1; -} -/* line 585, ../scss/default.scss */ -.popup .next .build .build-fade { - opacity: 1; -} - -/* Pretty print */ -/* line 592, ../scss/default.scss */ -.prettyprint .str, -.prettyprint .atv { - /* a markup attribute value */ - color: #009f5d; -} - -/* line 596, ../scss/default.scss */ -.prettyprint .kwd, -.prettyprint .tag { - /* a markup tag name */ - color: #0066cc; -} - -/* line 600, ../scss/default.scss */ -.prettyprint .com { - /* a comment */ - color: #797979; - font-style: italic; -} - -/* line 604, ../scss/default.scss */ -.prettyprint .lit { - /* a literal value */ - color: #7f0000; -} - -/* line 607, ../scss/default.scss */ -.prettyprint .pun, -.prettyprint .opn, -.prettyprint .clo { - color: #515151; -} - -/* line 612, ../scss/default.scss */ -.prettyprint .typ, -.prettyprint .atn, -.prettyprint .dec, -.prettyprint .var { - /* a declaration; a variable name */ - color: #d94d3a; -} - -/* line 618, ../scss/default.scss */ -.prettyprint .pln { - color: #515151; -} - -/* line 622, ../scss/default.scss */ -.note { - position: fixed; - z-index: 100; - width: 100%; - height: 100%; - top: 0; - left: 0; - padding: 1em; - background: white; - line-height: 1.5em; - opacity: 0; - pointer-events: none; - display: -webkit-box !important; - display: -moz-box !important; - display: -ms-box !important; - display: -o-box !important; - display: box !important; - -webkit-box-orient: vertical; - -moz-box-orient: vertical; - -ms-box-orient: vertical; - box-orient: vertical; - -webkit-box-align: center; - -moz-box-align: center; - -ms-box-align: center; - box-align: center; - -webkit-box-pack: center; - -moz-box-pack: center; - -ms-box-pack: center; - box-pack: center; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -moz-transform: translateY(350px); - -ms-transform: translateY(350px); - -webkit-transform: translateY(350px); - transform: translateY(350px); - -moz-transition: all 0.4s ease-in-out; - -o-transition: all 0.4s ease-in-out; - -webkit-transition: all 0.4s ease-in-out; - transition: all 0.4s ease-in-out; -} -/* line 640, ../scss/default.scss */ -.note > section { - background: #fff; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - -moz-box-shadow: 0 0 10px #797979; - -webkit-box-shadow: 0 0 10px #797979; - box-shadow: 0 0 10px #797979; - width: 60%; - padding: 2em; -} - -/* line 657, ../scss/default.scss */ -.with-notes.popup slides.layout-widescreen slide.next, -.with-notes.popup slides.layout-faux-widescreen slide.next { - -moz-transform: translate3d(690px, 80px, 0) scale(0.35); - -ms-transform: translate3d(690px, 80px, 0) scale(0.35); - -webkit-transform: translate3d(690px, 80px, 0) scale(0.35); - transform: translate3d(690px, 80px, 0) scale(0.35); -} -/* line 660, ../scss/default.scss */ -.with-notes.popup slides.layout-widescreen slide .note, -.with-notes.popup slides.layout-faux-widescreen slide .note { - -moz-transform: translate3d(300px, 800px, 0) scale(1.5); - -ms-transform: translate3d(300px, 800px, 0) scale(1.5); - -webkit-transform: translate3d(300px, 800px, 0) scale(1.5); - transform: translate3d(300px, 800px, 0) scale(1.5); -} -/* line 666, ../scss/default.scss */ -.with-notes.popup slide { - overflow: visible; - background: white; - -moz-transition: none; - -o-transition: none; - -webkit-transition: none; - transition: none; - pointer-events: none; - -moz-transform-origin: 0 0; - -ms-transform-origin: 0 0; - -webkit-transform-origin: 0 0; - transform-origin: 0 0; -} -/* line 673, ../scss/default.scss */ -.with-notes.popup slide:not(.backdrop) { - -moz-transform: scale(0.6) translate3d(0.5em, 0.5em, 0); - -ms-transform: scale(0.6) translate3d(0.5em, 0.5em, 0); - -webkit-transform: scale(0.6) translate3d(0.5em, 0.5em, 0); - transform: scale(0.6) translate3d(0.5em, 0.5em, 0); - -moz-box-shadow: 0 0 10px #797979; - -webkit-box-shadow: 0 0 10px #797979; - box-shadow: 0 0 10px #797979; -} -/* line 678, ../scss/default.scss */ -.with-notes.popup slide.backdrop { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHJhZGlhbEdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNjAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2IxZGZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzQzODdmZCIvPjwvcmFkaWFsR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); - background-size: 100%; - background-image: -moz-radial-gradient(50% 50%, #b1dfff 0%, #4387fd 600px); - background-image: -webkit-radial-gradient(50% 50%, #b1dfff 0%, #4387fd 600px); - background-image: radial-gradient(50% 50%, #b1dfff 0%, #4387fd 600px); -} - -/* the popup class is used to display the speaker notes when 'presenter' view - is enabled. This view is not currently optimal, so certain selectors have been commented-out, - with a view to improving the styles at a later date */ - - -/* line 684, ../scss/default.scss */ -/*.with-notes.popup slide.next { - -moz-transform: translate3d(570px, 80px, 0) scale(0.35); - -ms-transform: translate3d(570px, 80px, 0) scale(0.35); - -webkit-transform: translate3d(570px, 80px, 0) scale(0.35); - transform: translate3d(570px, 80px, 0) scale(0.35); - opacity: 1 !important; -}*/ -/* line 688, ../scss/default.scss */ -/*.with-notes.popup slide.next .note { - display: none !important; -}*/ -/* line 694, ../scss/default.scss */ -.with-notes.popup .note { - width: 109%; - height: 260px; - background: #e6e6e6; - padding: 0; - -moz-box-shadow: 0 0 10px #797979; - -webkit-box-shadow: 0 0 10px #797979; - box-shadow: 0 0 10px #797979; - -moz-transform: translate3d(250px, 800px, 0) scale(1.5); - -ms-transform: translate3d(250px, 800px, 0) scale(1.5); - -webkit-transform: translate3d(250px, 800px, 0) scale(1.5); - transform: translate3d(250px, 800px, 0) scale(1.5); - -moz-transition: opacity 400ms ease-in-out; - -o-transition: opacity 400ms ease-in-out; - -webkit-transition: opacity 400ms ease-in-out; - transition: opacity 400ms ease-in-out; -} -/* line 705, ../scss/default.scss */ -.with-notes.popup .note > section { - background: #fff; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - height: 100%; - width: 100%; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; - overflow: auto; - padding: 1em; -} -/* line 718, ../scss/default.scss */ -.with-notes .note { - opacity: 1; - -moz-transform: translateY(0); - -ms-transform: translateY(0); - -webkit-transform: translateY(0); - transform: translateY(0); - pointer-events: auto; -} - -/* line 725, ../scss/default.scss */ -.source { - font-size: 14px; - color: #a9a9a9; - position: absolute; - bottom: 70px; - left: 60px; -} - -/* line 733, ../scss/default.scss */ -.centered { - text-align: center; -} - -/* line 737, ../scss/default.scss */ -.reflect { - -webkit-box-reflect: below 3px -webkit-linear-gradient(rgba(255, 255, 255, 0) 85%, white 150%); - -moz-box-reflect: below 3px -moz-linear-gradient(rgba(255, 255, 255, 0) 85%, white 150%); - -o-box-reflect: below 3px -o-linear-gradient(rgba(255, 255, 255, 0) 85%, white 150%); - -ms-box-reflect: below 3px -ms-linear-gradient(rgba(255, 255, 255, 0) 85%, white 150%); - box-reflect: below 3px linear-gradient(rgba(255, 255, 255, 0) 85%, #ffffff 150%); -} - -/* line 745, ../scss/default.scss */ -.flexbox { - display: -webkit-box !important; - display: -moz-box !important; - display: -ms-box !important; - display: -o-box !important; - display: box !important; -} - -/* line 749, ../scss/default.scss */ -.flexbox.vcenter { - -webkit-box-orient: vertical; - -moz-box-orient: vertical; - -ms-box-orient: vertical; - box-orient: vertical; - -webkit-box-align: center; - -moz-box-align: center; - -ms-box-align: center; - box-align: center; - -webkit-box-pack: center; - -moz-box-pack: center; - -ms-box-pack: center; - box-pack: center; - height: 100%; - width: 100%; -} - -/* line 755, ../scss/default.scss */ -.flexbox.vleft { - -webkit-box-orient: vertical; - -moz-box-orient: vertical; - -ms-box-orient: vertical; - box-orient: vertical; - -webkit-box-align: left; - -moz-box-align: left; - -ms-box-align: left; - box-align: left; - -webkit-box-pack: center; - -moz-box-pack: center; - -ms-box-pack: center; - box-pack: center; - height: 100%; - width: 100%; -} - -/* line 761, ../scss/default.scss */ -.flexbox.vright { - -webkit-box-orient: vertical; - -moz-box-orient: vertical; - -ms-box-orient: vertical; - box-orient: vertical; - -webkit-box-align: end; - -moz-box-align: end; - -ms-box-align: end; - box-align: end; - -webkit-box-pack: center; - -moz-box-pack: center; - -ms-box-pack: center; - box-pack: center; - height: 100%; - width: 100%; -} - -/* line 767, ../scss/default.scss */ -.auto-fadein { - -moz-transition: opacity 0.6s ease-in 1s; - -o-transition: opacity 0.6s ease-in 1s; - -webkit-transition: opacity 0.6s ease-in; - -webkit-transition-delay: 1s; - transition: opacity 0.6s ease-in 1s; - opacity: 0; -} - -/* Clickable/tappable areas */ -/* line 773, ../scss/default.scss */ -/*.slide-area { - z-index: 1000; - position: absolute; - left: 0; - top: 0; - width: 100px; - height: 700px; - left: 50%; - top: 50%; - cursor: pointer; - margin-top: -350px; -}*/ - -/* line 790, ../scss/default.scss */ -#prev-slide-area { - margin-left: -550px; -} - -/* line 795, ../scss/default.scss */ -#next-slide-area { - margin-left: 450px; -} - -/* ===== SLIDE CONTENT ===== */ -/* line 803, ../scss/default.scss */ -.logoslide img { - width: 383px; - height: 92px; -} - -/* line 809, ../scss/default.scss */ -.segue { - padding: 5%; -} -/* line 812, ../scss/default.scss */ -.segue h2 { - color: #e6e6e6; - font-size: 60px; -} -/* line 816, ../scss/default.scss */ -.segue h3 { - color: #e6e6e6; - line-height: 2.8; -} -/* line 820, ../scss/default.scss */ -.segue hgroup { - display: block; -} - -/* line 826, ../scss/default.scss */ -.thank-you-slide { - background: #4387fd !important; - color: white; -} -/* line 830, ../scss/default.scss */ -.thank-you-slide h2 { - font-size: 60px; - color: inherit; -} -/* line 835, ../scss/default.scss */ -.thank-you-slide article > p { - margin-top: 2em; - font-size: 20pt; -} -/* line 840, ../scss/default.scss */ -.thank-you-slide > p { - position: absolute; - bottom: 80px; - font-size: 24pt; - line-height: 1.3; -} - -/* line 848, ../scss/default.scss */ -aside.gdbar { - height: 97px; - width: 215px; - position: absolute; - left: -1px; - top: 125px; - -moz-border-radius: 0 10px 10px 0; - -webkit-border-radius: 0; - border-radius: 0 10px 10px 0; - background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuMCIgeTE9IjAuNSIgeDI9IjEuMCIgeTI9IjAuNSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2U2ZTZlNiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2U2ZTZlNiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==') no-repeat; - background: -webkit-gradient(linear, 0% 50%, 100% 50%, color-stop(0%, #e6e6e6), color-stop(100%, #e6e6e6)) no-repeat; - background: -moz-linear-gradient(left, #e6e6e6, #e6e6e6) no-repeat; - background: -webkit-linear-gradient(left, #e6e6e6, #e6e6e6) no-repeat; - background: linear-gradient(to right, #e6e6e6, #e6e6e6) no-repeat; - -moz-background-size: 0% 100%; - -o-background-size: 0% 100%; - -webkit-background-size: 0% 100%; - background-size: 0% 100%; - -moz-transition: all 0.5s ease-out 0.5s; - -o-transition: all 0.5s ease-out 0.5s; - -webkit-transition: all 0.5s ease-out; - -webkit-transition-delay: 0.5s; - transition: all 0.5s ease-out 0.5s; - /* Better to transition only on background-size, but not sure how to do that with the mixin. */ -} -/* line 859, ../scss/default.scss */ -aside.gdbar.right { - right: 0; - left: -moz-initial; - left: initial; - top: 254px; - /* 96 is height of gray icon bar */ - -moz-transform: rotateZ(180deg); - -ms-transform: rotateZ(180deg); - -webkit-transform: rotateZ(180deg); - transform: rotateZ(180deg); -} -/* line 866, ../scss/default.scss */ -aside.gdbar.right img { - -moz-transform: rotateZ(180deg); - -ms-transform: rotateZ(180deg); - -webkit-transform: rotateZ(180deg); - transform: rotateZ(180deg); -} -/* line 871, ../scss/default.scss */ -aside.gdbar.bottom { - top: -moz-initial; - top: initial; - bottom: 60px; -} -/* line 877, ../scss/default.scss */ -aside.gdbar img { - width: 85px; - height: 85px; - position: absolute; - right: 0; - margin: 8px 15px; -} - -/* line 888, ../scss/default.scss */ -.title-slide hgroup { - margin-top: 20%; -} -/* line 891, ../scss/default.scss */ -.title-slide hgroup h1 { - font-size: 2em; - line-height: 1.4; - color: white; - margin: auto; - display: block; - position: absolute; - top: 0; - bottom: 10%; - left: 1.25em; - height: 0; -} -/* line 898, ../scss/default.scss */ -.title-slide hgroup h2 { - font-size: 2em; - color: #a9a9a9; - font-weight: inherit; -} -/* line 904, ../scss/default.scss */ -.title-slide hgroup p { - font-size: 1.5em; - color: #797979; - line-height: 1.3; - margin-top: 2em; -} - -/* line 913, ../scss/default.scss */ -.quote { - color: black; - font-style: italic; - font-size: 1em; - padding: 0.5em; -} -/* line 916, ../scss/default.scss */ -.quote .author { - font-size: 24px; - position: absolute; - bottom: 80px; - line-height: 1.4; -} - -/* line 925, ../scss/default.scss */ -[data-config-contact] a { - color: white; - border-bottom: none; -} -/* line 929, ../scss/default.scss */ -[data-config-contact] span { - width: 115px; - display: inline-block; -} - -/* line 938, ../scss/default.scss */ -.overview.popup .note { - display: none !important; -} -/* line 944, ../scss/default.scss */ -.overview slides slide { - display: block; - cursor: pointer; - opacity: 0.5; - pointer-events: auto !important; - background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iODUlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZTZlNmU2Ii8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmFkKSIgLz48L3N2Zz4g'); - background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(85%, #ffffff), color-stop(100%, #e6e6e6)); - background: -moz-linear-gradient(#ffffff, #ffffff 85%, #e6e6e6); - background: -webkit-linear-gradient(#ffffff, #ffffff 85%, #e6e6e6); - background: linear-gradient(#ffffff, #ffffff 85%, #e6e6e6); - background-color: white; -} -/* line 945, ../scss/default.scss */ -.overview slides slide.backdrop { - display: none !important; -} -/* line 956, ../scss/default.scss */ -.overview slides slide.far-past, .overview slides slide.past, .overview slides slide.next, .overview slides slide.far-next, .overview slides slide.far-past { - opacity: 0.5; - display: block; -} -/* line 965, ../scss/default.scss */ -.overview slides slide.current { - opacity: 1; -} -/* line 971, ../scss/default.scss */ -.overview .slide-area { - display: none; -} - -/****** Semmle-specific styles *********/ - -/* rst markup */ -strong { - font-weight: bold; -} - -em { - font-style: italic; -} - -sup { - vertical-align: super; - font-size: 0.5em; -} - -/*custom slide styles */ -/* general */ -slide { - background-image: url("../../normal-slide.svg"); - background-size: cover; - width: 100%; - height: 100%; - overflow: auto; - transform: scale(1); -} - -.highlight { - width: auto; - background: transparent !important; - margin-bottom: 2%; -} - -p { - color: black; - font-size: 1em; -} - -article { - margin-top: 3%; -} - -hgroup .pre { - color: #5c31ff; -} - -/* title slide (deck title, subtitle)*/ - -.title-slide { - background-image: url("../../title-slide.svg"); - background-size: cover; -} - -.title-slide p { - color: white; - font-size: 1em; - position: absolute; - bottom: 30%; - left: 2.6em; -} - -.title-slide hgroup .pre { - color: white; -} - -.subheading { - position: absolute; - top: 62.5%; - left: 0; -} - -.subheading p { - position: relative; -} - -/* purple background slides (new section)*/ - -.background2 { - background-image: url("../../alternative-slide.svg"); - background-size: cover; -} - -.background2 h2 { - color: white; -} - -.background2 p { - color: #5c31ff; - font-size: 1.5em; -} - -/* setup and agenda slides */ - -.setup, .agenda { - background-image: url("../../setup-slide.svg"); - background-size: cover; -} - -.setup article, .agenda article { - margin-top: 3%; - border-left: 1px solid #5c31ff; - top: 0; - bottom: 0; - right: 0; - left: 0; - margin: auto; - width: 50%; - height: fit-content; - padding: 2%; -} - -.setup li { - line-height: 1.5em; - margin-top: 1.5em; -} - -.agenda li { - margin:0; -} - -.setup ul, .agenda ul { - padding: 0; -} - -.setup hgroup, .agenda hgroup { - position: relative; - margin: 7% 0 0 17%; -} - -/* end slide */ - -.end-slide { - background-image: url("../../end-slide.svg"); - background-size: 100% 100%; - background-color: #5c31ff; -} - -/* styles for side by side columns */ - -.column-left { - float: left; -} - -.column-right { - float: right; -} - -.column-left, .column-right { - padding: 0px; - width: 45%; - line-height: 1.2em; - color: black; -} - -.column-right img, .column-left img { - display: block; - margin-left: auto; - margin-right: auto; -} - -.column-right .highlight, .column-left .highlight { - max-width: 100%; -} - -/* admonition (speaker notes) styles */ - -p.first.admonition-title { - display: none; -} - -.admonition.note { - text-align: left; - font-size: 0.8em; - width: 100%; - overflow: auto; - border: 1px solid black; -} - -.admonition.note pre { - font-family: 'consolas', 'Courier New', monospace; - background-color: white; - padding: 0; - margin-bottom: 10px; -} - -.admonition.note .notranslate { - width: 100%; -} - -.admonition.note > p { - width: inherit; - font-size: 1em; -} - -.admonition.note ul li { - width: inherit; -} - - -/* styles for information buttons on slides that have notes */ - -#extra-notes { - display: block; - position: fixed; - top: 0; - right: 1%; - font-size: 1em; -} - -#close-notes { - display: block; - position: fixed; - top: 0; - right: 0; - font-size: 1.2em; -} - -button { - border: none; - background: none; -} - -button:hover { - text-decoration: underline; -} - -/********* images ************/ -/* general styles to scale and centre images*/ - -.image-box { - display: grid; - height: 100%; -} - -img { - width: 50%; - margin: auto; -} - -/********* deck-specific styles for individual images *********/ -/* intro to ql */ -img.analysis { - width: 90%; -} - -/* program representation*/ -.ast-graph { - width: 66%; - position: absolute; - right: -10%; -} - -.java-expression-ast { - background-image: url("../../java-expression-ast.svg"); - background-size: cover; -} - -/* java data flow code example */ - -.java-data-flow-code-example { - background-image: url("../../java-data-flow-code-example.svg"); - background-size: cover; -} - -/* extra global data flow slies*/ - -.mismatched-calls-and-returns { - background-image: url("../../mismatched-calls-and-returns.svg"); - background-size: cover; -} - -/******* Other custom styles *******/ -/* custom styles for lists*/ - -ol { - color: black; -} - -li > ul > li { - margin-bottom: 0; -} - -.admonition.note ol { - width: 90%; - margin-left: 2.2em; -} - -.admonition.note ol > li { - margin-top: 0.5em; -} - -/* - * extra styles for more appropriate for syntax highlighting - * - */ - - span.n, span.p, span.o { - color: black !important; - } - - .highlight { color: #333 !important} /* default */ - .highlight .s { color: #06994a !important} /* strings */ - .highlight .m { color: #333 } /* numbers (no special highlighting) */ - .highlight .c1 { color: #007020 !important; font-style: italic !important} /* one-line comments */ - .highlight .cm { color: #007020 !important; font-style: italic !important} /* multiline comments */ - .highlight .cp { color: #2F1695 !important; font-style: italic !important} /* QLDoc comments */ - .highlight .k { color: #7a65cd !important; font-weight: bold !important} /* keywords */ - .highlight .kt { color: #7a65cd !important; font-weight: bold !important} /* built-in type keywords */ - .highlight .kr { color: #333 !important; font-style: italic !important} /* annotations */ - - -@media print { - /* line 978, ../scss/default.scss */ - slides slide { - display: block !important; - position: relative; - /*background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iODUlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZTZlNmU2Ii8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmFkKSIgLz48L3N2Zz4g'); - background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(85%, #ffffff), color-stop(100%, #e6e6e6)); - background: -moz-linear-gradient(#ffffff, #ffffff 85%, #e6e6e6); - background: -webkit-linear-gradient(#ffffff, #ffffff 85%, #e6e6e6); - background: linear-gradient(#ffffff, #ffffff 85%, #e6e6e6); - background-color: white;*/ - -moz-transform: none !important; - -ms-transform: none !important; - -webkit-transform: none !important; - transform: none !important; - width: 100%; - height: 100%; - page-break-after: always !important; - top: auto !important; - left: auto !important; - bottom: unset; - margin-top: 0 !important; - margin-left: 0 !important; - opacity: 1 !important; - color: #555; - font-size: 100%; - } - /* line 993, ../scss/default.scss */ - slides slide.far-past, slides slide.past, slides slide.next, slides slide.far-next, slides slide.far-past, slides slide.current { - opacity: 1 !important; - display: block !important; - } - /* line 1004, ../scss/default.scss */ - slides slide .build > * { - -moz-transition: none; - -o-transition: none; - -webkit-transition: none; - transition: none; - } - /* line 1008, ../scss/default.scss */ - slides slide .build .to-build, - slides slide .build .build-fade { - opacity: 1; - } - /* line 1014, ../scss/default.scss */ - slides slide .auto-fadein { - opacity: 1 !important; - } - /* line 1018, ../scss/default.scss */ - slides slide.backdrop { - display: none !important; - } - /* line 1022, ../scss/default.scss */ - slides slide table.rows { - border-right: 0; - } - /* line 1027, ../scss/default.scss */ - slides slide[hidden] { - display: none !important; - } - - /* line 1032, ../scss/default.scss */ - .slide-area { - display: none; - } - - /* line 1036, ../scss/default.scss */ - .reflect { - -webkit-box-reflect: none; - -moz-box-reflect: none; - -o-box-reflect: none; - -ms-box-reflect: none; - box-reflect: none; - } - - /* line 1044, ../scss/default.scss */ - pre, code { - font-family: monospace !important; - } - - /* make notes appear on slides for print view*/ - - .note { - position: unset; - } - - /* don't display slide number */ - slides > slide:not(.nobackground):after { - display: none; - } - - slides { - width: 90%; - height: 100%; - } -} diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/hieroglyph.css b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/hieroglyph.css deleted file mode 100644 index a919b034114..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/hieroglyph.css +++ /dev/null @@ -1,84 +0,0 @@ -/* line 5, ../scss/hieroglyph.scss */ -ol { - margin-left: 1.2em; - margin-bottom: 1em; - position: relative; - list-style: decimal; -} -/* line 11, ../scss/hieroglyph.scss */ -ol li { - margin-bottom: 0.5em; -} -/* line 14, ../scss/hieroglyph.scss */ -ol li ol { - margin-left: 2em; - margin-bottom: 0; - list-style: decimal; -} -/* line 19, ../scss/hieroglyph.scss */ -ol li ol li:before { - font-weight: 600; -} -/* line 25, ../scss/hieroglyph.scss */ -ol ol { - margin-top: .5em; - list-style: decimal; -} - -/* line 32, ../scss/hieroglyph.scss */ -slide.title-image { - padding-right: 0px; -} -/* line 36, ../scss/hieroglyph.scss */ -slide.title-image hgroup { - position: static !important; - margin-top: 35%; - padding-left: 30px; - background: rgba(255, 255, 255, 0.7); - border-top-left-radius: 5px; - -webkit-border-top-left-radius: 5px; - -moz-border-top-left-radius: 5px; - -o-border-top-left-radius: 5px; -} -/* line 50, ../scss/hieroglyph.scss */ -slide.title-image hgroup + article { - background: rgba(255, 255, 255, 0.7); - margin-top: 0px; - padding-left: 30px; - border-bottom-left-radius: 5px; - -webkit-border-bottom-left-radius: 5px; - -moz-border-bottom-left-radius: 5px; - -o-border-bottom-left-radius: 5px; -} -/* line 62, ../scss/hieroglyph.scss */ -slide.title-image h1 { - color: #222; - font-size: 3.2em; - line-height: 1.5em; - font-weight: 500; -} -/* line 72, ../scss/hieroglyph.scss */ -slide.title-image div.figure img { - position: absolute; - left: 0; - top: 0; - min-width: 100%; - min-height: 100%; - border-radius: 5px; - -o-border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - z-index: -1; -} -/* line 87, ../scss/hieroglyph.scss */ -slide.title-image div.figure .caption { - color: black; - background: rgba(255, 255, 255, 0.25); - padding: 0 5px; - border-bottom-left-radius: 5px; - border-top-right-radius: 5px; - position: absolute; - left: 0; - bottom: 0; - margin-bottom: 0; -} diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/io2013.css b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/io2013.css deleted file mode 100644 index b42982b21c9..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/io2013.css +++ /dev/null @@ -1,55 +0,0 @@ -/* line 5, ../scss/io2013.scss */ -* { - line-height: 1.3; -} - -/* line 9, ../scss/io2013.scss */ -h2 { - font-weight: bold; -} - -/* line 12, ../scss/io2013.scss */ -h2, h3 { - color: #515151; -} - -/* line 16, ../scss/io2013.scss */ -q, blockquote { - font-weight: bold; -} - -/* line 20, ../scss/io2013.scss */ -slides > slide { - color: #515151; -} -/* line 24, ../scss/io2013.scss */ -slides > slide.title-slide:after { - content: ''; - background: url(../../images/io2013/google-io-lockup-1.png) no-repeat 100% 50%; - -moz-background-size: contain; - -o-background-size: contain; - -webkit-background-size: contain; - background-size: contain; - position: absolute; - bottom: 80px; - right: 40px; - width: 100%; - height: 90px; -} -/* line 36, ../scss/io2013.scss */ -slides > slide.title-slide hgroup h1 { - font-weight: bold; - line-height: 1.1; -} -/* line 40, ../scss/io2013.scss */ -slides > slide.title-slide hgroup h2, slides > slide.title-slide hgroup p { - color: #515151; -} -/* line 43, ../scss/io2013.scss */ -slides > slide.title-slide hgroup h2 { - margin-top: 0.25em; -} -/* line 46, ../scss/io2013.scss */ -slides > slide.title-slide hgroup p { - margin-top: 3em; -} diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/phone.css b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/phone.css deleted file mode 100644 index 017c7bbf60d..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/css/phone.css +++ /dev/null @@ -1,26 +0,0 @@ -/*Smartphones (portrait and landscape) ----------- */ -/*@media only screen -and (min-width : 320px) -and (max-width : 480px) { - -}*/ -/* Smartphones (portrait) ----------- */ -/* Styles */ -/* line 17, ../scss/phone.scss */ -slides > slide { - /* width: $slide-width !important; - height: $slide-height !important; - margin-left: -$slide-width / 2 !important; - margin-top: -$slide-height / 2 !important; - */ - -webkit-transition: none !important; - -moz-transition: none !important; - -o-transition: none !important; - -webkit-transition: none !important; - transition: none !important; -} - -/* iPhone 4 ----------- */ -@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { - /* Styles */ -} diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/_base.scss b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/_base.scss deleted file mode 100644 index 50504db99b7..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/_base.scss +++ /dev/null @@ -1,139 +0,0 @@ -@charset "UTF-8"; - -@import "compass/reset"; -@import "compass/css3/border-radius"; -@import "compass/css3/box"; -@import "compass/css3/box-shadow"; -@import "compass/css3/box-sizing"; -@import "compass/css3/images"; -@import "compass/css3/text-shadow"; -@import "compass/css3/background-size"; -@import "compass/css3/transform"; -@import "compass/css3/transition"; - -@import "variables"; - -@mixin font-smoothing($val: antialiased) { - -webkit-font-smoothing: $val; - -moz-font-smoothing: $val; - -ms-font-smoothing: $val; - -o-font-smoothing: $val; -} - -@mixin flexbox { - display: -webkit-box !important; - display: -moz-box !important; - display: -ms-box !important; - display: -o-box !important; - display: box !important; -} - -@mixin flex-center-center { - @include box-orient(vertical); - @include box-align(center); - @include box-pack(center); -} - -@mixin flex-left-center { - @include box-orient(vertical); - @include box-align(left); - @include box-pack(center); -} - -@mixin flex-right-center { - @include box-orient(vertical); - @include box-align(end); - @include box-pack(center); -} - -/** - * Base SlideDeck Styles - */ -html { - height: 100%; - overflow: hidden; -} - -body { - margin: 0; - padding: 0; - - opacity: 0; - - height: 100%; - min-height: 740px; - width: 100%; - - overflow: hidden; - - color: #fff; - @include font-smoothing(antialiased); - @include transition(opacity 800ms ease-in 100ms); // Add small delay to prevent jank. - - &.loaded { - opacity: 1 !important; - } -} - -input, button { - vertical-align: middle; -} - -slides > slide[hidden] { - display: none !important; -} - -slides { - width: 100%; - height: 100%; - position: absolute; - left: 0; - top: 0; - @include transform(translate3d(0, 0, 0)); - @include perspective(1000); - @include transform-style(preserve-3d); - @include transition(opacity 800ms ease-in 100ms); // Add small delay to prevent jank. -} - -slides > slide { - display: block; - position: absolute; - overflow: hidden; - left: 50%; - top: 50%; - @include box-sizing(border-box); -} - -/* Slide styles */ - - -/*article.fill iframe { - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - - border: 0; - margin: 0; - - @include border-radius(10px); - - z-index: -1; -} - -slide.fill { - background-repeat: no-repeat; - @include background-size(cover); -} - -slide.fill img { - position: absolute; - left: 0; - top: 0; - min-width: 100%; - min-height: 100%; - - z-index: -1; -} -*/ diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/_variables.scss b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/_variables.scss deleted file mode 100644 index d07f9072070..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/_variables.scss +++ /dev/null @@ -1,34 +0,0 @@ -$social-tags: ''; -$brand-small-icon-size: 30px; - -$gray-1: #e6e6e6; -$gray-2: #a9a9a9; -$gray-3: #797979; -$gray-4: #515151; - -$brand-blue: rgb(67, 135, 253); -$brand-blue-secondary: #3c8ef3; -$brand-blue-secondary2: #2a7cdf; - -$brand-red: rgb(244, 74, 63); -$brand-red-secondary: #e0543e; -$brand-red-secondary2: #d94d3a; - -$brand-yellow: rgb(255, 209, 77); -$brand-yellow-secondary: #f9cc46; -$brand-yellow-secondary2: #f6c000; - -$brand-green: rgb(13, 168, 97); -$brand-green-secondary: #00a86d; -$brand-green-secondary2: #009f5d; - -$slide-width: 900px; -$slide-height: 700px; -$slide-width-widescreen: 1100px; -$slide-top-bottom-padding: 40px; -$slide-left-right-padding: 60px; -$slide-border-radius: 5px; - -$slide-tap-area-width: 100px; - -$article-content-top-padding: 45px; diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/default.scss b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/default.scss deleted file mode 100644 index b8c83b424ff..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/default.scss +++ /dev/null @@ -1,1047 +0,0 @@ -@import "base"; -@import "compass/css3/columns"; -@import "compass/css3/user-interface"; - -@mixin highlight-color($color: $brand-yellow) { - -webkit-tap-highlight-color: $color; - -moz-tap-highlight-color: $color; - -ms-tap-highlight-color: $color; - -o-tap-highlight-color: $color; - tap-highlight-color: $color; -} - -@mixin backdrop { - @include background(linear-gradient(white, white 85%, $gray-1)); - background-color: white; -} - - -/** - * Theme Styles - */ -::selection { - color: white; - background-color: $brand-yellow; - @include text-shadow(none); -} - -::-webkit-scrollbar { - height: 16px; - overflow: visible; - width: 16px; -} -::-webkit-scrollbar-thumb { - background-color: rgba(0, 0, 0, .1); - background-clip: padding-box; - border: solid transparent; - min-height: 28px; - padding: 100px 0 0; - @include box-shadow(inset 1px 1px 0 rgba(0,0,0,.1),inset 0 -1px 0 rgba(0,0,0,.07)); - border-width: 1px 1px 1px 6px; -} -::-webkit-scrollbar-thumb:hover { - background-color: rgba(0, 0, 0, 0.5); -} -::-webkit-scrollbar-button { - height: 0; - width: 0; -} -::-webkit-scrollbar-track { - background-clip: padding-box; - border: solid transparent; - border-width: 0 0 0 4px; -} -::-webkit-scrollbar-corner { - background: transparent; -} - -body { - background: black; -} - -slides > slide { - display: none; - font-family: 'Open Sans', Arial, sans-serif; - font-size: 26px; - color: $gray-3; - //@include background(linear-gradient(white, white 85%, $gray-1)); - //background-color: white; - width: $slide-width; - height: $slide-height; - margin-left: -$slide-width / 2; - margin-top: -$slide-height / 2; - padding: $slide-top-bottom-padding $slide-left-right-padding; - - @include border-radius($slide-border-radius); - //@include box-shadow(5px 5px 20px $gray-4); - @include transition(all 0.6s ease-in-out); - - //$translateX: 1020px; - //$rotateY: 30deg; - //$rotateX: 45deg; - - &.far-past { - //display: block; - display: none; - //@include transform(translate(-$translateX * 2)); - //@include transform(translate3d(-$translateX * 2, 0, 0)); - } - - &.past { - display: block; - //@include transform(translate(-$translateX) rotateY($rotateY) rotateX($rotateX)); - //@include transform(translate3d(-$translateX, 0, 0) rotateY($rotateY) rotateX($rotateX)); - opacity: 0; - } - - &.current { - display: block; - //@include transform(translate(0)); - //@include transform(translate3d(0, 0, 0)); - opacity: 1; - - .auto-fadein { - opacity: 1; - } - - .gdbar { - @include background-size(100% 100%); - } - } - - &.next { - display: block; - //@include transform(translate($translateX) rotateY(-$rotateY) rotateX($rotateX)); - //@include transform(translate3d($translateX, 0, 0) rotateY(-$rotateY) rotateX($rotateX)); - opacity: 0; - pointer-events: none; - } - - &.far-next { - //display: block; - display: none; - //@include transform(translate($translateX * 2)); - //@include transform(translate3d($translateX * 2, 0, 0)); - } - - &.dark { - background: $gray-4 !important; - } - - &:not(.nobackground) { - //background: white url(../../images/google_developers_icon_128.png) ($brand-small-icon-size * 2) 98% no-repeat; - //@include background-size($brand-small-icon-size $brand-small-icon-size); - - &:before { - font-size: 12pt; - content: $social-tags; - position: absolute; - bottom: $slide-top-bottom-padding / 2; - left: $slide-left-right-padding; - // background: url(../../images/google_developers_icon_128.png) no-repeat 0 50%; - @include background-size($brand-small-icon-size $brand-small-icon-size); - padding-left: $brand-small-icon-size + 10; - height: $brand-small-icon-size; - line-height: 1.9; - } - &:after { - font-size: 12pt; - content: attr(data-slide-num) '/' attr(data-total-slides); - position: absolute; - bottom: $slide-top-bottom-padding / 2; - right: $slide-left-right-padding; - line-height: 1.9; - } - } - - &.title-slide { - &:after { - content: ''; - //background: url(../../images/io2012_logo.png) no-repeat 100% 50%; - //@include background-size(contain); - position: absolute; - bottom: $slide-top-bottom-padding; - right: $slide-top-bottom-padding; - width: 100%; - height: 60px; - } - } - - &.backdrop { - z-index: -10; - display: block !important; - @include backdrop; - - &:after, &:before { - display: none; // Prevent double set of slide nums and footer icons. - } - } - - > hgroup + article { - margin-top: $article-content-top-padding; - - &.flexbox { - &.vcenter, &.vleft, &.vright { - height: 80%; - } - } - - p { - margin-bottom: 1em; - } - } - - > article:only-child { - height: 100%; - - > iframe { - height: 98%; - } - } -} - -slides.layout-faux-widescreen > slide { - padding: $slide-top-bottom-padding 160px; -} - -slides.layout-widescreen, -slides.layout-faux-widescreen { - - $translateX: 1130px; - - > slide { - margin-left: -$slide-width-widescreen / 2; - width: $slide-width-widescreen; - } - - > slide.far-past { - display: block; - display: none; - @include transform(translate(-$translateX * 2)); - @include transform(translate3d(-$translateX * 2, 0, 0)); - } - - > slide.past { - display: block; - //@include transform(translate(-$translateX)); - //@include transform(translate3d(-$translateX, 0, 0)); - opacity: 0; - } - - > slide.current { - display: block; - //@include transform(translate(0)); - //@include transform(translate3d(0, 0, 0)); - opacity: 1; - } - - > slide.next { - display: block; - //@include transform(translate($translateX)); - //@include transform(translate3d($translateX, 0, 0)); - opacity: 0; - pointer-events: none; - } - - > slide.far-next { - display: block; - display: none; - @include transform(translate($translateX * 2)); - @include transform(translate3d($translateX * 2, 0, 0)); - } - - #prev-slide-area { - margin-left: -$slide-width-widescreen / 2 - $slide-tap-area-width; - } - - #next-slide-area { - margin-left: $slide-width-widescreen / 2; - } -} - -b { - font-weight: 600; -} - -a { - color: $brand-blue-secondary2; - text-decoration: none; - border-bottom: 1px solid rgba(42, 124, 223, 0.5); - - &:hover { - color: black !important; - } -} - -h1, h2, h3 { - font-weight: 600; -} - -h2 { - font-size: 45px; - line-height: 45px; - letter-spacing: -2px; - color: $gray-4; -} - -h3 { - font-size: 30px; - letter-spacing: -1px; - line-height: 2; - font-weight: inherit; - color: $gray-3; -} - -ul { - margin-left: 1.2em; - margin-bottom: 1em; - position: relative; - - li { - margin-bottom: 0.5em; - - ul { - margin-left: 2em; - margin-bottom: 0; - - li:before { - content: '-'; - font-weight: 600; - } - } - } - - > li:before { - content: '\00B7'; - margin-left: -1em; - position: absolute; - font-weight: 600; - } - - ul { - margin-top: .5em; - } -} - -// Code highlighting only effects the current slide. -.highlight-code slide.current { - pre > * { - opacity: 0.25; - @include transition(opacity 0.5s ease-in); - } - b { - opacity: 1; - } -} - -pre { - font-family: 'Source Code Pro', 'Courier New', monospace; - font-size: 20px; - line-height: 28px; - padding: 10px 0 10px $slide-left-right-padding; - letter-spacing: -1px; - margin-bottom: 20px; - width: 106%; - background-color: $gray-1; - left: -$slide-left-right-padding; - position: relative; - @include box-sizing(border-box); - /*overflow: hidden;*/ - - &[data-lang]:after { - content: attr(data-lang); - background-color: $gray-2; - right: 0; - top: 0; - position: absolute; - font-size: 16pt; - color: white; - padding: 2px 25px; - text-transform: uppercase; - } -} - -pre[data-lang="go"] { - color: #333; -} - -code { - font-size: 95%; - font-family: 'Source Code Pro', 'Courier New', monospace; - color: black; -} - -iframe { - width: 100%; - height: $slide-height - ($slide-top-bottom-padding * 2) - ($article-content-top-padding * 2); - background: white; - border: 1px solid $gray-1; - @include box-sizing(border-box); -} - -dt { - font-weight: bold; -} - -button { - display: inline-block; - @include background(linear-gradient(#F9F9F9 40%, #E3E3E3 70%)); - border: 1px solid $gray-2; - @include border-radius(3px); - padding: 5px 8px; - outline: none; - white-space: nowrap; - @include user-select(none); - cursor: pointer; - @include text-shadow(1px 1px #fff); - font-size: 10pt; -} - -button:not(:disabled):hover { - border-color: $gray-4; -} - -button:not(:disabled):active { - @include background(linear-gradient(#E3E3E3 40%, #F9F9F9 70%)); -} - -:disabled { - color: $gray-2; -} - -.blue { - color: $brand-blue; -} -.blue2 { - color: $brand-blue-secondary; -} -.blue3 { - color: $brand-blue-secondary2; -} -.yellow { - color: $brand-yellow; -} -.yellow2 { - color: $brand-yellow-secondary; -} -.yellow3 { - color: $brand-yellow-secondary2; -} -.green { - color: $brand-green; -} -.green2 { - color: $brand-green-secondary; -} -.green3 { - color: $brand-green-secondary2; -} -.red { - color: $brand-red; -} -.red2 { - color: $brand-red-secondary; -} -.red3 { - color: $brand-red-secondary2; -} -.gray { - color: $gray-1; -} -.gray2 { - color: $gray-2; -} -.gray3 { - color: $gray-3; -} -.gray4 { - color: $gray-4; -} - -.white { - color: white !important; -} -.black { - color: black !important; -} - -.columns-2 { - @include column-count(2); -} - -table { - width: 100%; - border-collapse: -moz-initial; - border-collapse: initial; - border-spacing: 2px; - border-bottom: 1px solid $gray-3; - - tr > td:first-child, th { - font-weight: 600; - color: $gray-4; - } - - tr:nth-child(odd) { - background-color: $gray-1; - } - - th { - color: white; - font-size: 18px; - @include background(linear-gradient(top, $brand-blue 40%, $brand-blue-secondary2 80%) no-repeat); - } - - td, th { - font-size: 18px; - padding: 1em 0.5em; - } - - td.highlight { - color: $gray-4; - @include background(linear-gradient(top, $brand-yellow 40%, $brand-yellow-secondary2 80%) no-repeat); - } - - &.rows { - border-bottom: none; - border-right: 1px solid $gray-3; - } -} - -q { - font-size: 45px; - line-height: 72px; - - &:before { - content: '“'; - position: absolute; - margin-left: -0.5em; - } - &:after { - content: '”'; - position: absolute; - margin-left: 0.1em; - } -} - -slide.fill { - background-repeat: no-repeat; - @include border-radius($slide-border-radius); - @include background-size(cover); -} - -/* Size variants */ - -article.smaller { - p, ul { - font-size: 20px; - line-height: 24px; - letter-spacing: 0; - } - table { - td, th { - font-size: 14px; - } - } - pre { - font-size: 15px; - line-height: 20px; - letter-spacing: 0; - } - q { - font-size: 40px; - line-height: 48px; - - &:before, &:after { - font-size: 60px; - } - } -} - -/* Builds */ - -.build { - > * { - @include transition(opacity 0.5s ease-in-out 0.2s); - } - - .to-build { - opacity: 0; - } - - .build-fade { - opacity: 0.3; - - &:hover { - opacity: 1.0; - } - } -} - -.popup .next .build { - .to-build { - opacity: 1; - } - - .build-fade { - opacity: 1; - } -} - -/* Pretty print */ - -.prettyprint .str, /* string content */ -.prettyprint .atv { /* a markup attribute value */ - color: $brand-green-secondary2; //rgb(0, 138, 53); -} -.prettyprint .kwd, /* a keyword */ -.prettyprint .tag { /* a markup tag name */ - color: rgb(0, 102, 204); -} -.prettyprint .com { /* a comment */ - color: $gray-3; //rgb(127, 127, 127); - font-style: italic; -} -.prettyprint .lit { /* a literal value */ - color: rgb(127, 0, 0); -} -.prettyprint .pun, /* punctuation, lisp open bracket, lisp close bracket */ -.prettyprint .opn, -.prettyprint .clo { - color: $gray-4; //rgb(127, 127, 127); -} -.prettyprint .typ, /* a type name */ -.prettyprint .atn, /* a markup attribute name */ -.prettyprint .dec, -.prettyprint .var { /* a declaration; a variable name */ - color: $brand-red-secondary2; //rgb(127, 0, 127); -} -.prettyprint .pln { - color: $gray-4; -} - -.note { - position: absolute; - z-index: 100; - width: 100%; - height: 100%; - top: 0; - left: 0; - padding: 1em; - background: rgba(0, 0, 0, 0.3); - opacity: 0; - pointer-events: none; - @include flexbox; - @include flex-center-center; - @include border-radius($slide-border-radius); - - @include box-sizing(border-box); - @include transform(translateY($slide-height / 2));@include transition(all 0.4s ease-in-out); - - > section { - background: #fff; - @include border-radius($slide-border-radius); - @include box-shadow(0 0 10px $gray-3); - width: 60%; - padding: 2em; - } -} - -// Speaker notes only show the current slide. -.with-notes { - - &.popup { - - slides.layout-widescreen, - slides.layout-faux-widescreen { - slide { - &.next { - @include transform(translate3d($slide-width-widescreen / 2 + 140, 80px, 0) scale(0.35)); - } - .note { - @include transform(translate3d(300px, $slide-height + 100, 0) scale(1.5)); - } - } - } - - slide { - overflow: visible; - background: white; - @include transition(none); // No slide transition goodies when in presenter mode. - pointer-events: none; - @include transform-origin(0, 0); // For speaker note transition. - - &:not(.backdrop) { - @include transform(scale(0.6) translate3d(0.5em, 0.5em, 0)); - @include box-shadow(0 0 10px $gray-3); - } - - &.backdrop { - //@include background(linear-gradient($gray-1, white 30%, white 60%, $gray-1)); - @include background-image(radial-gradient(50% 50%, #b1dfff 0%, - $brand-blue 600px)); - } - - &.next { - @include transform(translate3d($slide-width / 2 + 120, 80px, 0) scale(0.35)); - opacity: 1 !important; - - .note { - display: none !important; // Prevents seeing notes if we go to previous slide. - } - } - } - - .note { - width: 109%; - height: $slide-height / 2 - 90; - background: $gray-1; - padding: 0; - - @include box-shadow(0 0 10px $gray-3); - - @include transform(translate3d(250px, $slide-height + 100, 0) scale(1.5)); - @include transition(opacity 400ms ease-in-out); - - > section { - background: #fff; - @include border-radius($slide-border-radius); - height: 100%; - width: 100%; - @include box-sizing(border-box); - @include box-shadow(none); - overflow: auto; - padding: 1em; - } - } - } - - .note { - opacity: 1; - @include transform(translateY(0)); - pointer-events: auto; // Allow people to do things like open links embedded in the speaker notes. - } -} - -.source { - font-size: 14px; - color: $gray-2; - position: absolute; - bottom: $slide-top-bottom-padding + 30px; - left: $slide-left-right-padding; -} - -.centered { - text-align: center; -} - -.reflect { - -webkit-box-reflect: below 3px -webkit-linear-gradient(rgba(255,255,255,0) 85%, white 150%); - -moz-box-reflect: below 3px -moz-linear-gradient(rgba(255,255,255,0) 85%, white 150%); - -o-box-reflect: below 3px -o-linear-gradient(rgba(255,255,255,0) 85%, white 150%); - -ms-box-reflect: below 3px -ms-linear-gradient(rgba(255,255,255,0) 85%, white 150%); - box-reflect: below 3px linear-gradient(rgba(255,255,255,0) 85%, white 150%); -} - -.flexbox { - @include flexbox; -} - -.flexbox.vcenter { - @include flex-center-center; - height: 100%; - width: 100%; -} - -.flexbox.vleft { - @include flex-left-center; - height: 100%; - width: 100%; -} - -.flexbox.vright { - @include flex-right-center; - height: 100%; - width: 100%; -} - -.auto-fadein { - @include transition(opacity 0.6s ease-in 1s); - opacity: 0; -} - -/* Clickable/tappable areas */ -.slide-area { - z-index: 1000; - - position: absolute; - left: 0; - top: 0; - width: $slide-tap-area-width; - height: $slide-height; - - left: 50%; - top: 50%; - - cursor: pointer; - margin-top: -$slide-height / 2; - - //@include highlight-color(rgba(51, 51, 51, 0.5)); -} -#prev-slide-area { - margin-left: -$slide-width-widescreen / 2; - //@include border-radius(10px 0 0 10px); - //@include box-shadow(-5px 0 10px #222 inset); -} -#next-slide-area { - margin-left: $slide-width / 2; - //@include border-radius(0 10px 10px 0); - //@include box-shadow(5px 0 10px #222 inset); -} - -/* ===== SLIDE CONTENT ===== */ -.logoslide { - img { - width: 383px; - height: 92px; - } -} - -.segue { - padding: $slide-left-right-padding $slide-left-right-padding * 2; - - h2 { - color: $gray-1; - font-size: 60px; - } - h3 { - color: $gray-1; - line-height: 2.8; - } - hgroup { - position: absolute; - bottom: 225px; - } -} - -.thank-you-slide { - background: $brand-blue !important; - color: white; - - h2 { - font-size: 60px; - color: inherit; - } - - article > p { - margin-top: 2em; - font-size: 20pt; - } - - > p { - position: absolute; - bottom: $slide-top-bottom-padding * 2; - font-size: 24pt; - line-height: 1.3; - } -} - -aside.gdbar { - height: 97px; - width: 215px; - position: absolute; - left: -1px; - top: 125px; - @include border-radius(0 10px 10px 0); - @include background(linear-gradient(left, $gray-1, $gray-1) no-repeat); - @include background-size(0% 100%); - @include transition(all 0.5s ease-out 0.5s); /* Better to transition only on background-size, but not sure how to do that with the mixin. */ - - &.right { - right: 0; - left: -moz-initial; - left: initial; - top: ($slide-height / 2) - 96; /* 96 is height of gray icon bar */ - @include transform(rotateZ(180deg)); - - img { - @include transform(rotateZ(180deg)); - } - } - - &.bottom { - top: -moz-initial; - top: initial; - bottom: $slide-left-right-padding; - } - - img { - width: 85px; - height: 85px; - position: absolute; - right: 0; - margin: 8px 15px; - } -} - -.title-slide { - - hgroup { - bottom: 100px; - - h1 { - font-size: 65px; - line-height: 1.4; - letter-spacing: -3px; - color: $gray-4; - } - - h2 { - font-size: 34px; - color: $gray-2; - font-weight: inherit; - } - - p { - font-size: 20px; - color: $gray-3; - line-height: 1.3; - margin-top: 2em; - } - } -} - -.quote { - color: $gray-1; - - .author { - font-size: 24px; - position: absolute; - bottom: 80px; - line-height: 1.4; - } -} - -[data-config-contact] { - a { - color: rgb(255, 255, 255); - border-bottom: none; - } - span { - width: 115px; - display: inline-block; - } -} - -.overview { - - &.popup { - .note { - display: none !important; - } - } - - slides { - slide { - &.backdrop { - display: none !important; - } - - display: block; - cursor: pointer; - opacity: 0.5; - pointer-events: auto !important; - - @include backdrop(); - - &.far-past, - &.past, - &.next, - &.far-next, - &.far-past { - opacity: 0.5; - display: block; - } - - &.current { - opacity: 1; - } - } - } - - .slide-area { - display: none; - } -} - -@media print { - slides { - slide { - display: block !important; - position: relative; - @include backdrop(); - @include transform(none !important); - width: 100%; - height: 100%; - page-break-after:always; - top: auto !important; - left: auto !important; - margin-top: 0 !important; - margin-left: 0 !important; - opacity: 1 !important; - color: #555; - - &.far-past, - &.past, - &.next, - &.far-next, - &.far-past, - &.current { - opacity: 1 !important; - display: block !important; - } - - .build { - > * { - @include transition(none); - } - - .to-build, - .build-fade { - opacity: 1; - } - } - - .auto-fadein { - opacity: 1 !important; - } - - &.backdrop { - display: none !important; - } - - table.rows { - border-right: 0; - } - } - - slide[hidden] { - display: none !important; - } - } - - .slide-area { - display: none; - } - - .reflect { - -webkit-box-reflect: none; - -moz-box-reflect: none; - -o-box-reflect: none; - -ms-box-reflect: none; - box-reflect: none; - } - - pre, code { - font-family: monospace !important; - } -} diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/hieroglyph.scss b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/hieroglyph.scss deleted file mode 100644 index e406085227b..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/hieroglyph.scss +++ /dev/null @@ -1,100 +0,0 @@ -@import "compass/css3/background-size"; - -@import "variables"; - -ol { - margin-left: 1.2em; - margin-bottom: 1em; - position: relative; - list-style: decimal; - - li { - margin-bottom: 0.5em; - - ol { - margin-left: 2em; - margin-bottom: 0; - list-style: decimal; - - li:before { - font-weight: 600; - } - } - } - - ol { - margin-top: .5em; - list-style: decimal; - - } -} - -slide.title-image { - - padding-right: 0px; - - hgroup { - position: static !important; - - margin-top: 35%; - padding-left: 30px; - - background: rgba(255, 255, 255, 0.7); - - border-top-left-radius: $slide-border-radius; - -webkit-border-top-left-radius: $slide-border-radius; - -moz-border-top-left-radius: $slide-border-radius; - -o-border-top-left-radius: $slide-border-radius; - } - - hgroup + article { - background: rgba(255, 255, 255, 0.7); - - margin-top: 0px; - padding-left: 30px; - - border-bottom-left-radius: $slide-border-radius; - -webkit-border-bottom-left-radius: $slide-border-radius; - -moz-border-bottom-left-radius: $slide-border-radius; - -o-border-bottom-left-radius: $slide-border-radius; - } - - h1 { - color: #222; - font-size: 3.2em; - - line-height: 1.5em; - font-weight: 500; - } - - div.figure { - - img { - position: absolute; - left: 0; - top: 0; - min-width: 100%; - min-height: 100%; - - border-radius: $slide-border-radius; - -o-border-radius: $slide-border-radius; - -moz-border-radius: $slide-border-radius; - -webkit-border-radius: $slide-border-radius; - - z-index: -1; - } - - .caption { - color: black; - background: rgba(255, 255, 255, 0.25); - padding: 0 5px; - border-bottom-left-radius: $slide-border-radius; - border-top-right-radius: $slide-border-radius; - - position: absolute; - left: 0; - bottom: 0; - margin-bottom: 0; - } - } -} diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/io2013.scss b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/io2013.scss deleted file mode 100644 index c728cfbf56d..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/io2013.scss +++ /dev/null @@ -1,51 +0,0 @@ -@import "compass/css3/background-size"; - -@import "variables"; - -* { - line-height: 1.3; -} - -h2 { - font-weight: bold; -} -h2, h3 { - color: $gray-4; -} - -q, blockquote { - font-weight: bold; -} - -slides > slide { - color: $gray-4; - - &.title-slide { - &:after { - content: ''; - background: url(../../images/io2013/google-io-lockup-1.png) no-repeat 100% 50%; - @include background-size(contain); - position: absolute; - bottom: $slide-top-bottom-padding + 40; - right: $slide-top-bottom-padding; - width: 100%; - height: 90px; - } - - hgroup { - h1 { - font-weight: bold; - line-height: 1.1; - } - h2, p { - color: $gray-4; - } - h2 { - margin-top: 0.25em; - } - p { - margin-top: 3em; - } - } - } -} \ No newline at end of file diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/phone.scss b/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/phone.scss deleted file mode 100644 index c6a40432470..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/static/theme/scss/phone.scss +++ /dev/null @@ -1,35 +0,0 @@ -@import "compass/css3/transition"; - - -/*Smartphones (portrait and landscape) ----------- */ -/*@media only screen -and (min-width : 320px) -and (max-width : 480px) { - -}*/ - -/* Smartphones (portrait) ----------- */ -//@media only screen and (max-device-width: 480px) { -/* Styles */ -//$slide-width: 350px; -//$slide-height: 500px; - -slides > slide { -/* width: $slide-width !important; - height: $slide-height !important; - margin-left: -$slide-width / 2 !important; - margin-top: -$slide-height / 2 !important; -*/ - // Don't do full slide transitions on mobile. - -webkit-transition: none !important; // Bug in compass? Not sure why the below is not working - @include transition(none !important); -} - -//} - -/* iPhone 4 ----------- */ -@media -only screen and (-webkit-min-device-pixel-ratio : 1.5), -only screen and (min-device-pixel-ratio : 1.5) { -/* Styles */ -} \ No newline at end of file diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/theme.conf b/docs/codeql/ql-training/_static-training/slides-semmle-2/theme.conf deleted file mode 100644 index fa2b35a18ca..00000000000 --- a/docs/codeql/ql-training/_static-training/slides-semmle-2/theme.conf +++ /dev/null @@ -1,15 +0,0 @@ -[theme] -inherit = basic -stylesheet = slides.css - -[options] -custom_css = -custom_js = - -subtitle = -use_builds = true -use_prettify = true -enable_slide_areas = true -enable_touch = true -favicon = '' -presenters = \ No newline at end of file diff --git a/docs/codeql/ql-training/_static-training/slides-semmle-2/title_slide.html b/docs/codeql/ql-training/_static-training/slides-semmle-2/title_slide.html deleted file mode 100644 index e69de29bb2d..00000000000